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

index 55a6b6c7ab4f8ddf51baecc236233ab7d3ed344a..55b66857e53045b6387e0ffdd71e6050d3a94108 100644 (file)
@@ -8,14 +8,32 @@ class Process extends ProcessFile
 {
     protected $page;
     protected $out;
+    protected $force = false;
 
-    public function __construct($out, $page, $format = 'jpg', $resolution = 150, $withGraphics = true, $withTexts = true, $version = 'html')
+    public function __construct($out, $page, $format = 'jpg', $resolution = 150, $withGraphics = true, $withTexts = true, $version = 'html', $force = false)
     {
         $this->setOut($out);
         $this->setPage($page);
+        $this->setForce(!!$force);
         parent::__construct($format, $resolution, $withGraphics, $withTexts, $version);
     }
 
+    /**
+     * @return bool
+     */
+    public function isForce(): bool
+    {
+        return $this->force;
+    }
+
+    /**
+     * @param bool $force
+     */
+    public function setForce(bool $force): void
+    {
+        $this->force = $force;
+    }
+
     /**
      * @param mixed $page
      */
@@ -29,14 +47,19 @@ class Process extends ProcessFile
         return $this->page;
     }
 
-    public function getOut()
+    public function getDistantOut()
     {
         return $this->out;
     }
 
     public function getLocalOut()
     {
-        return str_replace('/data1/extranet/www/fluidbook/docs/', realpath(__DIR__ . '/../files/').'/',$this->getOut());
+        return $this->getOut();
+    }
+
+    public function getOut()
+    {
+        return str_replace('/data1/extranet/www/fluidbook/docs/', realpath(__DIR__ . '/../files/') . '/', $this->getDistantOut());
     }
 
     /**
@@ -49,7 +72,7 @@ class Process extends ProcessFile
 
     public function process()
     {
-
+        return $this->getPath($this->isForce());
     }