From: Vincent Vanwaelscappel Date: Wed, 24 Jan 2024 09:24:32 +0000 (+0100) Subject: wait #6652 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=2520d4e592b0e2feb170514f7e0d1cd3f5776dc0;p=fluidbook-toolbox.git wait #6652 @0.5 --- diff --git a/app/Jobs/FluidbookCollectionDownload.php b/app/Jobs/FluidbookCollectionDownload.php index 13c4f6d4e..a370c72ae 100644 --- a/app/Jobs/FluidbookCollectionDownload.php +++ b/app/Jobs/FluidbookCollectionDownload.php @@ -8,6 +8,7 @@ use App\Models\FluidbookExternalInstallServer; use App\Models\FluidbookPublication; use Cubist\Backpack\Magic\PageData; use Cubist\Net\Transfer\Driver; +use Cubist\Util\CommandLine; use Cubist\Util\CommandLine\Rsync; use Cubist\Util\Files\Files; use Cubist\Util\PHP; @@ -41,8 +42,8 @@ class FluidbookCollectionDownload extends DownloadBase if (!$server) { throw new \Exception('No valid server defined for external installation'); } - if (!$dest) { - throw new \Exception('No path defined for external server installation'); + if (!$dest && !$server->allows_root) { + throw new \Exception('No path defined for external server installation : this server does not allow installing on root'); } $translateVariables['server'] = $server->name; @@ -69,7 +70,10 @@ class FluidbookCollectionDownload extends DownloadBase { $path = $this->_compile(); $driver = $server->getTransferDriver(); - $driver->copy($path, $dest, false, false); + $res = $driver->copy($path, $dest, false, false); + if ($res instanceof CommandLine) { + $res->debug(); + } return $server->makeURL($dest); } @@ -196,7 +200,7 @@ class FluidbookCollectionDownload extends DownloadBase $fbOptions += $optionsFluidbooks[$fbid]; } - $jobs[] = $this->_jobDownloadFluidbook($fbid, $version, $basePath . $this->dirs[$fbid], $fbOptions, false); + $jobs[] = $this->_jobDownloadFluidbook($fbid, $version, $basePath . $this->dirs[$fbid], $fbOptions, true); } $this->_waitJobs($jobs);