Great help, thanks!
Seems there a couple of issues. I have some trouble knowing what’s important from all this debugging output.
I think these are the main errors:
ERROR : DataStream::pipeline(): File_Module::endow_upload(): file `Divi.zipn049Kr' is not an uploaded file
WARNING: Undefined variable: hostname
[/usr/local/apnscp/config/custom/wp-inst-divi-flips.php:13]
Seems the file is downloaded correctly (inside /home/virtual/my.domain.test/tmp
):
#
file Divi.zipn049Kr
Divi.zipn049Kr: Zip archive data, at least v2.0 to extract
#
du -sh Divi.zipn049Kr
9.7M Divi.zipn049Kr
The hook/code:
1 <?php
2 \a23r::registerCallback('wordpress', 'valid', function ($ret, $args) {
3 if (!$ret) {
4 return;
5 }
6
7 $tempFile = tempnam($this->domain_fs_path("/tmp"), 'Divi.zip');
8 $localFile = "/tmp/" . basename($tempFile);
9
10 \Util_HTTP::download("https://my.own.server/Divi.zip", $tempFile);
11 $this->file_endow_upload(basename($localFile));
12
13 $this->file_extract('/tmp/' . $localFile, $this->getAppRoot($hostname, $path ?? '') . '/wp-content/themes') && $this->file_delete($localFile);
14
15 });
Debug output:
DEBUG : Callback fn install overwritten in wordpress - call cleanDynamicCompositions()
DEBUG : Callback fn valid overwritten in wordpress - call cleanDynamicCompositions()
ERROR : DataStream::pipeline(): File_Module::endow_upload(): file `Divi.zipn049Kr' is not an uploaded file
0. Error_Reporter::merge_buffer([[message:"File_Module::endow_upload(): file `Divi.zipn049Kr' is not an uploaded file", severity:16, caller:"File_Module::endow_upload", bt:" 0B. Error_Reporter::add_error("file `Divi.zipn049Kr' is not an uploaded file", )[/usr/local/apnscp/lib/log_wrapper.php:62] 1B. error("file `Divi.zipn049Kr' is not an uploaded file")[/usr/local/apnscp/lib/modules/file.php:3009] 2B. File_Module->endow_upload(["Divi.zipn049Kr"])[/usr/local/apnscp/lib/Module/Skeleton/Standard.php:142] 3B. Module\Skeleton\Standard->_invoke("endow_upload", ["Divi.zipn049Kr"])[/usr/local/apnscp/lib/apnscpfunction.php:929] 4B. apnscpFunctionInterceptor->call("file_endow_upload", [..."]])
[/usr/local/apnscp/lib/datastream.php:301]
1. DataStream->unpack("")
[/usr/local/apnscp/lib/datastream.php:394]
2. DataStream->pipeline("")
[/usr/local/apnscp/lib/datastream.php:383]
3. DataStream->query("file_endow_upload", "Divi.zipn049Kr")
[/usr/local/apnscp/lib/Module/Skeleton/Standard.php:197]
4. Module\Skeleton\Standard->query("file_endow_upload", "Divi.zipn049Kr")
[/usr/local/apnscp/lib/modules/file.php:2979]
5. File_Module->endow_upload("Divi.zipn049Kr")
[/usr/local/apnscp/lib/Module/Skeleton/Standard.php:142]
6. Module\Skeleton\Standard->_invoke("endow_upload", ["Divi.zipn049Kr"])
[/usr/local/apnscp/lib/apnscpfunction.php:929]
7. apnscpFunctionInterceptor->call("file_endow_upload", ["Divi.zipn049Kr"])
[/usr/local/apnscp/lib/apnscpFunctionInterceptorTrait.php:34]
8. Module\Skeleton\Standard->__call("file_endow_upload", ["Divi.zipn049Kr"])
[/usr/local/apnscp/config/custom/wp-inst-divi-flips.php:11]
9. class@anonymous/usr/local/apnscp/lib/apnscpfunction.php(604) : eval()'d code:1$34e->{closure}(true, ["my.domain.test"])
[/usr/local/apnscp/lib/apnscpfunction.php(604) : eval()'d code:17]
10. class@anonymous/usr/local/apnscp/lib/apnscpfunction.php(604) : eval()'d code:1$34e->_invoke("valid", ["my.domain.test"])
[/usr/local/apnscp/lib/apnscpfunction.php:929]
11. apnscpFunctionInterceptor->call("wordpress_valid", ["my.domain.test"])
[/usr/local/apnscp/lib/CLI/cmd.php:62]
12. cli\__call("wordpress_valid", ["my.domain.test"])
[/usr/local/apnscp/lib/CLI/cmd.php:575]
13. cli\main()
[/usr/local/apnscp/bin/cmd:7]
WARNING: Undefined variable: hostname
[/usr/local/apnscp/config/custom/wp-inst-divi-flips.php:13]
WARNING: Undefined variable: hostname
[/usr/local/apnscp/config/custom/wp-inst-divi-flips.php:13]
0. Error_Reporter::handle_error(8, "Undefined variable: hostname", "/usr/local/apnscp/config/custom/wp-inst-divi-flips.php", 13, [ret:true, [["my.domain.test"], tempFile:"/home/virtual/site1/fst/tmp/Divi.zipn049Kr", localFile:"/tmp/Divi.zipn049Kr"]])
[/usr/local/apnscp/config/custom/wp-inst-divi-flips.php:13]
1. class@anonymous/usr/local/apnscp/lib/apnscpfunction.php(604) : eval()'d code:1$34e->{closure}(true, ["my.domain.test"])
[/usr/local/apnscp/lib/apnscpfunction.php(604) : eval()'d code:17]
2. class@anonymous/usr/local/apnscp/lib/apnscpfunction.php(604) : eval()'d code:1$34e->_invoke("valid", ["my.domain.test"])
[/usr/local/apnscp/lib/apnscpfunction.php:929]
3. apnscpFunctionInterceptor->call("wordpress_valid", ["my.domain.test"])
[/usr/local/apnscp/lib/CLI/cmd.php:62]
4. cli\__call("wordpress_valid", ["my.domain.test"])
[/usr/local/apnscp/lib/CLI/cmd.php:575]
5. cli\main()
[/usr/local/apnscp/bin/cmd:7]
EXCEPTION: TypeError Argument 1 passed to Module\Support\Webapps::getAppRoot() must be of the type string, null given, called in /usr/local/apnscp/config/custom/wp-inst-divi-flips.php on line 13
0. class@anonymous/usr/local/apnscp/lib/apnscpfunction.php(604) : eval()'d code:1$34e->{closure}(true, ["my.domain.test"])
[/usr/local/apnscp/lib/apnscpfunction.php(604) : eval()'d code:17]
1. class@anonymous/usr/local/apnscp/lib/apnscpfunction.php(604) : eval()'d code:1$34e->_invoke("valid", ["my.domain.test"])
[/usr/local/apnscp/lib/apnscpfunction.php:929]
2. apnscpFunctionInterceptor->call("wordpress_valid", ["my.domain.test"])
[/usr/local/apnscp/lib/CLI/cmd.php:62]
3. cli\__call("wordpress_valid", ["my.domain.test"])
[/usr/local/apnscp/lib/CLI/cmd.php:575]
4. cli\main()
[/usr/local/apnscp/bin/cmd:7]
(TypeError) EXCEPTION: Argument 1 passed to Module\Support\Webapps::getAppRoot() must be of the type string, null given, called in /usr/local/apnscp/config/custom/wp-inst-divi-flips.php on line 13
[/usr/local/apnscp/lib/Module/Support/Webapps.php:346]
EXCEPTION: Argument 1 passed to Module\Support\Webapps::getAppRoot() must be of the type string, null given, called in /usr/local/apnscp/config/custom/wp-inst-divi-flips.php on line 13
[/usr/local/apnscp/lib/Module/Support/Webapps.php:346]
0. Module\Support\Webapps->getAppRoot(null, "")
[/usr/local/apnscp/config/custom/wp-inst-divi-flips.php:13]
1. class@anonymous/usr/local/apnscp/lib/apnscpfunction.php(604) : eval()'d code:1$34e->{closure}(true, ["my.domain.test"])
[/usr/local/apnscp/lib/apnscpfunction.php(604) : eval()'d code:17]
2. class@anonymous/usr/local/apnscp/lib/apnscpfunction.php(604) : eval()'d code:1$34e->_invoke("valid", ["my.domain.test"])
[/usr/local/apnscp/lib/apnscpfunction.php:929]
3. apnscpFunctionInterceptor->call("wordpress_valid", ["my.domain.test"])
[/usr/local/apnscp/lib/CLI/cmd.php:62]
4. cli\__call("wordpress_valid", ["my.domain.test"])
[/usr/local/apnscp/lib/CLI/cmd.php:575]
5. cli\main()
[/usr/local/apnscp/bin/cmd:7]