From cb7468a155ac98ca8310abfbb9530ad42c567b91 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Wed, 15 Feb 2017 15:24:30 +0000 Subject: [PATCH] wip #1111 @2 --- fluidbook/tools/fwstk.sh | 2 +- inc/commons/class.common.url.php | 4 ++-- inc/ws/Controlleur/class.ws.ajax.php | 4 ++-- inc/ws/Controlleur/class.ws.maintenance.php | 11 +++++++---- inc/ws/DAO/class.ws.dao.book.php | 2 +- inc/ws/Metier/class.ws.document.php | 8 ++++---- 6 files changed, 17 insertions(+), 14 deletions(-) diff --git a/fluidbook/tools/fwstk.sh b/fluidbook/tools/fwstk.sh index f168f3ab3..30d3c16c6 100644 --- a/fluidbook/tools/fwstk.sh +++ b/fluidbook/tools/fwstk.sh @@ -1,2 +1,2 @@ #!/bin/sh -java -jar fwstk.jar $* \ No newline at end of file +/usr/lib/jvm/java-8-openjdk-amd64/bin/java -jar /home/extranet/www/fluidbook/tools/fwstk/out/artifacts/fwstk_jar/fwstk.jar $* \ No newline at end of file diff --git a/inc/commons/class.common.url.php b/inc/commons/class.common.url.php index 8d009afc8..8affa7c0f 100644 --- a/inc/commons/class.common.url.php +++ b/inc/commons/class.common.url.php @@ -8,7 +8,7 @@ class commonUrl { // Si l'utilisateur n'est pas connecté, on affiche le formulaire // de login - $bypass = array('stats', 'telecharger', 'telechargerr'); + $bypass = array('stats', 'telecharger', 'telechargerr', 'orpiref'); if ((!isset($args[0]) || !in_array($args[0], $bypass)) && (is_null($core->user) || !$core->user)) { $args = array('login'); @@ -585,7 +585,7 @@ class commonUrl { print_r($_FILES); - foreach ($_FILES['files']['name'] as $k=>$ffname) { + foreach ($_FILES['files']['name'] as $k => $ffname) { if ($_FILES['files']['error'][$k]) { continue; } diff --git a/inc/ws/Controlleur/class.ws.ajax.php b/inc/ws/Controlleur/class.ws.ajax.php index 70bd7e680..2018b41f4 100644 --- a/inc/ws/Controlleur/class.ws.ajax.php +++ b/inc/ws/Controlleur/class.ws.ajax.php @@ -578,7 +578,7 @@ class wsAjax extends cubeAjax { } public static function valideDemandeDevis(&$x) { - $d64 = base64_decode($_GET['devis_form']); + $d64 = base64_decode(str_replace(' ', '+', $_GET['devis_form'])); $d = json_decode($d64); if (!$d) { @@ -589,7 +589,6 @@ class wsAjax extends cubeAjax { return false; } - $d = cubeArray::array_flatten($d); foreach ($d as $k => $v) { $_POST[$k] = trim($v); @@ -1114,6 +1113,7 @@ class wsAjax extends cubeAjax { public static function collectionVersionCreate($args, &$x) { global $core; + $id = $args[1]; $compiler = new wsHTML5AppCompiler($id); diff --git a/inc/ws/Controlleur/class.ws.maintenance.php b/inc/ws/Controlleur/class.ws.maintenance.php index 4ef6204ca..90b94df42 100644 --- a/inc/ws/Controlleur/class.ws.maintenance.php +++ b/inc/ws/Controlleur/class.ws.maintenance.php @@ -997,17 +997,18 @@ class wsMaintenance { foreach ($docs as $doc) { $out = WS_DOCS . '/' . $doc . '/'; - $fwstk = new cubeCommandLine('fwstk'); + $fwstk = new cubeCommandLine('fwstk.sh'); $fwstk->setPath(CONVERTER_PATH); $fwstk->setArg('--input ' . $out . '/crop.pdf'); $fwstk->setArg('--extractTexts ' . $out . '%s%d.txt'); if ($book->parametres->ignoreSearchSeparators != '') { $fwstk->setArg('--ignoreSeparators ' . $book->parametres->ignoreSearchSeparators); } - $fwstk->setArg('--threads 1'); + $fwstk->setArg('--threads 4'); $fwstk->execute(); - fb($fwstk->commande); - fb($fwstk->output); + + $res = $fwstk->commande . "\n\n"; + $res .= $fwstk->output; } $dir = WS_BOOKS . '/index/' . $book->book_id; @@ -1029,6 +1030,8 @@ class wsMaintenance { $i = WS_BOOKS . '/index/' . $book_id . '/*'; `rm -rf $i`; + ob_end_clean(); + die('
' . $res . '
'); } public static function _reencodeVideos($book_id, $format) { diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index e7d72cc04..87d1c186b 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -876,7 +876,7 @@ class wsDAOBook extends commonDAO { foreach ($docs as $doc) { $out = wsDocument::getDir($doc); - $fwstk = new cubeCommandLine('fwstk'); + $fwstk = new cubeCommandLine('fwstk.sh'); $fwstk->setPath(CONVERTER_PATH); $fwstk->setArg('--input ' . $out . '/crop.pdf'); $fwstk->setArg('--extractTexts ' . $out . '%s%d.txt'); diff --git a/inc/ws/Metier/class.ws.document.php b/inc/ws/Metier/class.ws.document.php index 2a764c5fc..d9735aa5f 100644 --- a/inc/ws/Metier/class.ws.document.php +++ b/inc/ws/Metier/class.ws.document.php @@ -101,7 +101,7 @@ class wsDocument extends cubeMetier { $in = $this->in; } - $fwstk = new cubeCommandLine('fwstk'); + $fwstk = new cubeCommandLine('fwstk.sh'); $fwstk->setPath(CONVERTER_PATH); $fwstk->setArg('--input ' . $in); $fwstk->setArg('--infos'); @@ -302,7 +302,7 @@ class wsDocument extends cubeMetier { } public function cutDocument($mode) { - $fwstk = new cubeCommandLine('fwstk'); + $fwstk = new cubeCommandLine('fwstk.sh'); $fwstk->setPath(CONVERTER_PATH); $fwstk->setArg('--input ' . $this->in); $fwstk->setArg('--cut ' . $mode); @@ -312,7 +312,7 @@ class wsDocument extends cubeMetier { } public function trimDocument() { - $fwstk = new cubeCommandLine('fwstk'); + $fwstk = new cubeCommandLine('fwstk.sh'); $fwstk->setPath(CONVERTER_PATH); $fwstk->setArg('--input ' . $this->in); $fwstk->setArg('--trim'); @@ -353,7 +353,7 @@ class wsDocument extends cubeMetier { } public function getLinksAndTexts() { - $fwstk = new cubeCommandLine('fwstk'); + $fwstk = new cubeCommandLine('fwstk.sh'); $fwstk->setPath(CONVERTER_PATH); $fwstk->setArg('--input ' . $this->cropped); $fwstk->setArg('--extractTexts ' . $this->out . '%s%d.txt'); -- 2.39.5