}
+ public static function fluidbookFarm($args)
+ {
+ global $core;
+
+ $doc_id = $args[0] ?? 127174;
+ $page = $args[1] ?? 1;
+
+ $dao = new wsDAODocument($core->con);
+ $doc = $dao->selectById($doc_id);
+ $doc->_getFileFarm($page, 'jpg', 150, true, true, 'html', true);
+
+ }
+
}
return $this->filesdata[$cacheKey];
}
+
+ public function _getFileFarm($page, $format = 'jpg', $resolution = 150, $withText = true, $withGraphics = true, $version = 'html', $force = false)
+ {
+ $farm = [['host' => 'elephantman.cubedesigners.com', 'port' => 22822]];
+ shuffle($farm);
+ $farmer = array_pop($farm);
+
+ $params = ['page' => $page, 'format' => $format, 'resolution' => $resolution, 'withText' => $withText, 'withGraphics' => $withGraphics, 'version' => $version, 'force' => $force, 'out' => $this->out,'resolutionRatio'=>$this->getResolutionRatio(),'mobileRatio'=>$this->getMobileFirstRatio()];
+ $cl = new CubeIT_CommandLine('/usr/local/fluidbook_processfarm/bin/process');
+ $cl->setSSH($farmer['host'], 'fluidbookfarmer', '', $farmer['port'], '/home/extranet/.ssh/id_rsa');
+ $cl->setManualArg(base64_encode(json_encode($params)));
+ $cl->execute();
+ die($cl->output);
+ }
+
public function _getFile($page, $format = 'jpg', $resolution = 150, $withText = true, $withGraphics = true, $version = 'html', $force = false)
{
+ global $core;
+// if ($core->user->utilisateur_id == 5) {
+// return $this->_getFileFarm($page, $format, $resolution, $withText, $withGraphics, $version, $force);
+// }
+
if ($format === 'jpeg') {
$format = 'jpg';