<?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
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);
}
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;
+
}