]> _ Git - fluidbook_processfarm.git/commitdiff
wip #6149
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 20 Jul 2023 06:52:05 +0000 (08:52 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 20 Jul 2023 06:52:05 +0000 (08:52 +0200)
app/bin/mount
app/src/ProcessFile.php

index 0cd7a09a33070c54dec5e10271d94f207f600e20..aa7e9bc8d02b1f9df2fa09bc8bedd599118c7d05 100755 (executable)
@@ -13,11 +13,11 @@ else
     sshfs -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3 -o uid=33 -o gid=33 -o allow_other fluidbook@kingkong.cubedesigners.com:/home/fluidbook/data/docs /usfiles
 fi
 
-mkdir -p /application/protected/fluidbookpublication
-if mountpoint -q "/application/protected/fluidbookpublication"; then
+mkdir -p /application/protected/fluidbookpublication/docs
+if mountpoint -q "/application/protected/fluidbookpublication/docs"; then
     :
 else
-    sshfs -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3 -p 58745 -o uid=33 -o gid=33 -o allow_other toolbox@toolbox.fluidbook.com:/application/protected/fluidbookpublication /application/protected/fluidbookpublication
+    sshfs -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3 -o uid=33 -o gid=33 -o allow_other root@godzilla.cubedesigners.com:/application/protected/fluidbookpublication/docs /application/protected/fluidbookpublication/docs
 fi
 
 mkdir -p /application/usstorage
index 272e4780212c2fe3ddfd2e42efd09ddce8d2bc32..1c55cfbb003e267d2c898cde98996f9205c03e7f 100644 (file)
@@ -6,10 +6,10 @@ use Cubist\PDF\PDFTools;
 use Cubist\Util\Files\Files;
 
 class ProcessFile extends \Fluidbook\Tools\Jobs\ProcessFile {
-       protected const DISTANT_ROOTS = ['/application/fluidbook/docs/', '/application/protected/fluidbookpublication/docs/'];
+       protected const DISTANT_ROOT = '/application/fluidbook/docs/';
        protected const LOCAL_ROOT = '/files/';
 
-       protected const US_DISTANT_ROOTS = ['/application/usstorage/docs/'];
+       protected const US_DISTANT_ROOT = '/application/usstorage/docs/';
        protected const US_LOCAL_ROOT = '/usfiles/';
 
        /**
@@ -99,14 +99,9 @@ class ProcessFile extends \Fluidbook\Tools\Jobs\ProcessFile {
 
        public function getOut() {
                if ($this->getRegion() === 'UE') {
-                       foreach (self::DISTANT_ROOTS as $dr) {
-                               return str_replace($dr, self::LOCAL_ROOT, $this->getDistantOut());
-                       }
+                       return str_replace(self::DISTANT_ROOT, self::LOCAL_ROOT, $this->getDistantOut());
                } else {
-                       foreach (self::US_DISTANT_ROOTS as $dr) {
-                               return str_replace($dr, self::US_LOCAL_ROOT, $this->getDistantOut());
-                       }
-
+                       return str_replace(self::US_DISTANT_ROOT, self::US_LOCAL_ROOT, $this->getDistantOut());
                }
        }
 
@@ -133,15 +128,15 @@ class ProcessFile extends \Fluidbook\Tools\Jobs\ProcessFile {
 
        public function process() {
                if ($this->getRegion() === 'UE') {
-                       return str_replace(self::LOCAL_ROOT, self::DISTANT_ROOTS[0], $this->getPath($this->isForce()));
+                       return str_replace(self::LOCAL_ROOT, self::DISTANT_ROOT, $this->getPath($this->isForce()));
                } else {
-                       return str_replace(self::US_LOCAL_ROOT, self::US_DISTANT_ROOTS[0], $this->getPath($this->isForce()));
+                       return str_replace(self::US_LOCAL_ROOT, self::US_DISTANT_ROOT, $this->getPath($this->isForce()));
                }
        }
 
        public function getPdf(): string|null {
                $res = Files::firstThatExists($this->getOut() . '/crop.pdf', $this->getOut() . '/fixed.pdf', $this->getOut() . '/original.pdf');
-               if (null === $res) {
+               if(null===$res) {
                        echo 'no pdf in ' . $this->getOut();
                }
                return $res;