From: Vincent Vanwaelscappel Date: Thu, 20 Jul 2023 06:52:05 +0000 (+0200) Subject: wip #6149 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=0d76a5189de1492ef1a97358a294d68e5f5c8ee4;p=fluidbook_processfarm.git wip #6149 --- diff --git a/app/bin/mount b/app/bin/mount index 0cd7a09..aa7e9bc 100755 --- a/app/bin/mount +++ b/app/bin/mount @@ -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 diff --git a/app/src/ProcessFile.php b/app/src/ProcessFile.php index 272e478..1c55cfb 100644 --- a/app/src/ProcessFile.php +++ b/app/src/ProcessFile.php @@ -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;