From 5709e3dcb4f592a0edeb23264bffd47f59ef704f Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 7 Apr 2022 21:54:22 +0200 Subject: [PATCH] wip #5220 --- src/Process.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Process.php b/src/Process.php index 95399af..1c5979e 100644 --- a/src/Process.php +++ b/src/Process.php @@ -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 -- 2.39.5