]> _ Git - fluidbook_processfarm.git/commitdiff
wip #5220
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 7 Apr 2022 19:54:22 +0000 (21:54 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 7 Apr 2022 19:54:22 +0000 (21:54 +0200)
src/Process.php

index 95399af800404d2e1c725427cc9b547f5227b52a..1c5979e73516107e273ec147d4769b7be3a97521 100644 (file)
@@ -6,14 +6,20 @@ use Fluidbook\Tools\Jobs\ProcessFile;
 
 class Process extends ProcessFile
 {
+    protected const DISTANT_ROOT = '/data1/extranet/www/fluidbook/docs/';
+    protected const LOCAL_ROOT = '/usr/local/fluidbook_processfarm/files/';
+
     protected $page;
     protected $out;
     protected $force = false;
     protected $mobileRatio = 1;
     protected $resolutionRatio = 1;
+    protected $filespath;
 
     public function __construct($out, $page, $resolutionRatio, $mobileRatio, $format = 'jpg', $resolution = 150, $withGraphics = true, $withTexts = true, $version = 'html', $force = false)
     {
+
+        $this->filespath = realpath(__DIR__ . '/../files/');
         $this->setOut($out);
         $this->setPage($page);
         $this->setForce(!!$force);
@@ -90,7 +96,7 @@ class Process extends ProcessFile
 
     public function getOut()
     {
-        return str_replace('/data1/extranet/www/fluidbook/docs/', realpath(__DIR__ . '/../files/') . '/', $this->getDistantOut());
+        return str_replace(self::DISTANT_ROOT, self::LOCAL_ROOT, $this->getDistantOut());
     }
 
     /**
@@ -103,7 +109,7 @@ class Process extends ProcessFile
 
     public function process()
     {
-        return $this->getPath($this->isForce());
+        return str_replace(self::LOCAL_ROOT, self::DISTANT_ROOT, $this->getPath($this->isForce()));
     }
 
 }
\ No newline at end of file