From: Vincent Vanwaelscappel Date: Thu, 7 Apr 2022 19:36:46 +0000 (+0200) Subject: wip #5220 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=8d016c189fb0f6e383a55c314220844439b599c9;p=fluidbook_processfarm.git wip #5220 --- diff --git a/src/Process.php b/src/Process.php index 55a6b6c..55b6685 100644 --- a/src/Process.php +++ b/src/Process.php @@ -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()); }