From ad1c35222a71c55acb6c7843c371a363ab04a426 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Thu, 12 Jan 2017 18:08:30 +0000 Subject: [PATCH] wip #1077 @3 --- inc/postconfig.inc.php | 3 +++ inc/prepend.php | 6 ++++++ inc/ws/Controlleur/class.ws.flash.php | 10 +++++++--- inc/ws/DAO/class.ws.dao.book.php | 1 + 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/inc/postconfig.inc.php b/inc/postconfig.inc.php index 55b9318d4..b44927717 100644 --- a/inc/postconfig.inc.php +++ b/inc/postconfig.inc.php @@ -17,11 +17,14 @@ define('DEV', $dev); // Définition des variables dans l'environnement de production //define('DB_HOST', ':/var/run/mysqld/mysqld.sock'); +$amacord = false; if ($_SERVER['SERVER_ADDR'] == '91.121.74.76') { + $amacord = true; define('DB_HOST', '127.0.0.1'); } else { define('DB_HOST', 'amarcord.cubedesigners.com'); } +define('AMARCORD', $amacord); define('SERVER', 'avanger'); define('DB_NAME', 'extranet'); diff --git a/inc/prepend.php b/inc/prepend.php index 1c546832d..e73503121 100644 --- a/inc/prepend.php +++ b/inc/prepend.php @@ -1,5 +1,11 @@ con); foreach ($_FILES as $varname => $infos) { + if ($infos['error']) { continue; } @@ -104,7 +105,11 @@ class wsFlash extends cubeFlashGateway { unset($_SESSION['conversionSessionReload']); $session->serialize(); - $php = new cubeCommandLine('php'); + $executable='php'; + if(AMARCORD){ + $executable='/usr/bin/php5.6'; + } + $php = new cubeCommandLine($executable); $php->setPath(CONVERTER_PATH); $php->setArg('f', ROOT . '/index.php'); $php->setManualArg('--'); @@ -116,8 +121,7 @@ class wsFlash extends cubeFlashGateway { $php->setNohup(true); $php->execute('exec'); - fb($php->commande); - fb($php->output); + file_put_contents(ROOT . '/../log/processConversionSession.txt', $php->commande . "\n" . $php->output); $this->xml->addChild('command', html::escapeHTML($php->command)); exit; diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index b568d4bc3..e7d72cc04 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -800,6 +800,7 @@ class wsDAOBook extends commonDAO { $r = $this->con->select('SELECT * FROM book_pages WHERE book_id=\'' . $this->con->escape($book_id) . '\''); $tab = array(); $now = array(); + $ref = array(); while ($r->fetch()) { $ref[$r->book_page] = array((int)$r->document_id, (int)$r->document_page); } -- 2.39.5