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

index 66e38469226fe8fae3eb7a88ff1eedb1bfb23a20..92602fd1284a91d178c22a21855a49328b01854b 100644 (file)
@@ -1,8 +1,10 @@
 <?php
 
-require_once __DIR__."/../vendor/autoload.php";
+use Fluidbook\Farmer\Process;
+
+require_once __DIR__ . "/../vendor/autoload.php";
 $params = json_decode(base64_decode($argv[1]));
 print_r($params);
-exit;
 
-$p = new \Fluidbook\Farmer\Process($params['out'],$params['page'],$params['format'],$params['resolution'],$params['withText'],$params['withGraphics'],$params['version'],$params['force']);
\ No newline at end of file
+$p = new Process($params['out'], $params['page'], $params['format'], $params['resolution'], $params['withText'], $params['withGraphics'], $params['version'], $params['force']);
+echo $p->getLocalOut();
\ No newline at end of file
index 5de1a1d114d1b4f7c32806318137468a79d2a080..0f9af179b2ae00ed251a157b44cc887103507e83 100644 (file)
@@ -7,11 +7,11 @@ use Fluidbook\Tools\Jobs\ProcessFile;
 class Process extends ProcessFile
 {
     protected $page;
-    protected $file;
+    protected $out;
 
-    public function __construct($file, $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')
     {
-        $this->setFile($file);
+        $this->setOut($out);
         $this->setPage($page);
         parent::__construct($format, $resolution, $withGraphics, $withTexts, $version);
     }
@@ -31,23 +31,25 @@ class Process extends ProcessFile
 
     public function getOut()
     {
-        $f = $this->getFile();
+        return $this->out;
     }
 
-    /**
-     * @return mixed
-     */
-    public function getFile()
+    public function getLocalOut()
     {
-        return $this->file;
+        return str_replace('/data1/extranet/wwww/fluidbook/docs/', __DIR__ . '/../files/',$this->getOut());
     }
 
     /**
-     * @param mixed $file
+     * @param mixed $out
      */
-    public function setFile($file): void
+    public function setOut($out): void
+    {
+        $this->out = $out;
+    }
+
+    public function process()
     {
-        $this->file = $file;
+
     }