]> _ Git - cubeextranet.git/commitdiff
wip #5220 @0.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 7 Apr 2022 20:04:24 +0000 (20:04 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 7 Apr 2022 20:04:24 +0000 (20:04 +0000)
inc/ws/Controlleur/class.ws.maintenance.php
inc/ws/Metier/class.ws.document.php

index c238fdbd093957ac5857b38681e5782949913702..29796cde4aef77a79c43d2f1bd9a04eded334188 100644 (file)
@@ -1816,6 +1816,19 @@ class wsMaintenance
 
     }
 
+    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);
+
+    }
+
 }
 
 
index 5117d6073a1e6c1fe135dd9706366f19322c6a0f..77ccfc5a3f8aad069d0723f35dcef26d7c9e67fd 100644 (file)
@@ -440,8 +440,28 @@ class wsDocument extends cubeMetier
         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';