]> _ Git - fluidbook-toolbox.git/commitdiff
wait #6652 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 24 Jan 2024 09:24:32 +0000 (10:24 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 24 Jan 2024 09:24:32 +0000 (10:24 +0100)
app/Jobs/FluidbookCollectionDownload.php

index 13c4f6d4efd5b5a0deebfdab3a11f6f11fde0008..a370c72aed17d5d7c7ee32f71060979c046302e7 100644 (file)
@@ -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);