From: vincent@cubedesigners.com Date: Thu, 26 Jan 2017 11:09:41 +0000 (+0000) Subject: fix #1108 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=1ecb9f1b20e7d1cb2c97c167d901329c76a89964;p=cubeextranet.git fix #1108 @1 --- diff --git a/inc/postconfig.inc.php b/inc/postconfig.inc.php index b44927717..73ff303f2 100644 --- a/inc/postconfig.inc.php +++ b/inc/postconfig.inc.php @@ -17,16 +17,10 @@ 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('AMARCORD', true); +define('SERVER', 'avanger'); +define('DB_HOST', 'localhost'); define('DB_NAME', 'extranet'); define('DB_USER', 'extranet'); define('DB_PASSWORD', 'WvcAeYBDnrB93RXa'); diff --git a/inc/ws/Util/class.ws.exporter.php b/inc/ws/Util/class.ws.exporter.php index 5008d2e40..e28618f6a 100644 --- a/inc/ws/Util/class.ws.exporter.php +++ b/inc/ws/Util/class.ws.exporter.php @@ -20,7 +20,6 @@ class wsExporter { global $core; - $ctrl = isset($_GET['ctrl']) && $_GET['ctrl'] == 'true'; $alt = isset($_GET['alt']) && $_GET['alt'] == 'true'; @@ -261,6 +260,7 @@ class wsExporter { public function export($book_id, &$x, $action = 'download', $version = 'online', $destinationDir = null, $destinationFile = null) { global $core; + set_time_limit(0); if (is_null($destinationDir)) { $destinationDir = ''; @@ -318,7 +318,7 @@ class wsExporter { } protected function _install() { - $p = wsPackager::package($this->book_id, $this->version, $this->_haveToZip(),false); + $p = wsPackager::package($this->book_id, $this->version, $this->_haveToZip(), false); if (strpos($p, '/fluidbook') == 0) { $p = ROOT . $p; @@ -381,6 +381,7 @@ class wsExporter { } protected function _lftp($src, $dest, $passive = false, $erase = false) { + set_time_limit(0); $u = parse_url($dest); $file = is_file($src); @@ -424,6 +425,7 @@ class wsExporter { } protected function _rsync($src, $dest, $erase = false, $chown = null) { + set_time_limit(0); /*if (is_file($src)) { $dir = dirname($dest); if (!file_exists($dir)) { diff --git a/inc/ws/Util/class.ws.tools.php b/inc/ws/Util/class.ws.tools.php index 3e0f47e60..da540dc65 100644 --- a/inc/ws/Util/class.ws.tools.php +++ b/inc/ws/Util/class.ws.tools.php @@ -50,7 +50,7 @@ class wsTools { $webvideo->execute(); } - public static function colorizeAndRasterizeIcon($iconSet, $icon, $colors, $dest, $scale, &$w, &$h, $makepng = true) { + public static function colorizeAndRasterizeIcon($iconSet, $icon, $colors, $dest, &$w, &$h) { // Init directory if (is_string($colors)) { $colors = array('colorize' => $colors); @@ -88,14 +88,14 @@ class wsTools { foreach ($colors as $k => $v) { $replace = "#" . $v['hex']; if ($v['opacity'] < 1) { - $replace.='" stroke-opacity="' . $v['opacity']; + $replace .= '" stroke-opacity="' . $v['opacity']; } $svg = str_replace('$s' . $k, $replace, $svg); $replace = "#" . $v['hex']; if ($v['opacity'] < 1) { - $replace.='" fill-opacity="' . $v['opacity']; + $replace .= '" fill-opacity="' . $v['opacity']; } $svg = str_replace('$' . $k, $replace, $svg); } @@ -103,33 +103,11 @@ class wsTools { } self::copy($svgColorized, $dest . '/' . $icon . '.svg'); - // PNG - $png = $dirColorized . '/' . $icon . '.png'; - if (!file_exists($png) || filemtime($png) <= filemtime($svgColorized)) { - $svg = simplexml_load_file($svgColorized); - $w = (string) $svg['width']; - $h = (string) $svg['height']; - $w = rtrim($w, 'px'); - $h = rtrim($h, 'px'); - // Finally rasterize it - $batik = new cubeCommandLine('batik-rasterizer'); - $batik->setArg('d', $dirColorized); - $batik->setArg('m', 'image/png'); - if ($scale != 1) { - $batik->setArg('w', $w * $scale); - $batik->setArg('h', $h * $scale); - } - $batik->setManualArg($svgColorized); - $batik->execute(); - } - - $dim = getimagesize($png); - $w = $dim[0] / $scale; - $h = $dim[1] / $scale; - - if ($makepng) { - self::copy($png, $dest . '/' . $icon . '.png'); - } + $svg = simplexml_load_file($svgColorized); + $w = (string)$svg['width']; + $h = (string)$svg['height']; + $w = rtrim($w, 'px'); + $h = rtrim($h, 'px'); } public static function copy($source, $dest) { @@ -141,7 +119,7 @@ class wsTools { } public function chiffres() { - + } } diff --git a/inc/ws/Util/html5/app/class.ws.html5.app.compiler.php b/inc/ws/Util/html5/app/class.ws.html5.app.compiler.php index 01a6f88bf..3cabf6fe4 100644 --- a/inc/ws/Util/html5/app/class.ws.html5.app.compiler.php +++ b/inc/ws/Util/html5/app/class.ws.html5.app.compiler.php @@ -21,7 +21,7 @@ class wsHTML5AppCompiler { foreach ($this->collection->datas as $group) { foreach ($group['publications'] as $p) { - if($p['id']) { + if ($p['id']) { $this->books[] = $p['id']; } } @@ -223,7 +223,7 @@ class wsHTML5AppCompiler { $svg = array('interface-back-arrow'); foreach ($svg as $icon) { - wsTools::colorizeAndRasterizeIcon(1, $icon, $text, $this->vdir . '/images/', 4, $w, $h, true); + wsTools::colorizeAndRasterizeIcon(1, $icon, $text, $this->vdir . '/images/', $w, $h); } diff --git a/inc/ws/Util/packager/class.ws.packager.html5.php b/inc/ws/Util/packager/class.ws.packager.html5.php index da05fa44e..a2d62d711 100644 --- a/inc/ws/Util/packager/class.ws.packager.html5.php +++ b/inc/ws/Util/packager/class.ws.packager.html5.php @@ -112,7 +112,7 @@ class wsPackagerHTML5 extends wsPackager { 'next' => $arrowsColor, 'previous' => $arrowsColor, 'search' => $couleurI); foreach ($icons as $icon => $color) { - wsTools::colorizeAndRasterizeIcon($this->theme->parametres->iconSet, $icon, $color, $this->vdir . '/data/images/', 4, $w, $h); + wsTools::colorizeAndRasterizeIcon($this->theme->parametres->iconSet, $icon, $color, $this->vdir . '/data/images/', $w, $h); $res[] = '#icon-' . $icon . '{width:' . $w . 'px;height:' . $h . 'px;background-image:url(data/images/' . $icon . '.svg), url(data/images/' . $icon . '.png);background-repeat:no-repeat;background-size:' . $w . 'px ' . $h . 'px}'; } return $res; diff --git a/inc/ws/Util/packager/html5/class.ws.packager.html5.php b/inc/ws/Util/packager/html5/class.ws.packager.html5.php index 3666dc46c..c0de0aafe 100644 --- a/inc/ws/Util/packager/html5/class.ws.packager.html5.php +++ b/inc/ws/Util/packager/html5/class.ws.packager.html5.php @@ -281,7 +281,7 @@ class wsPackagerHTML5 extends wsPackager { 'help-fingers' => $couleurI, 'help-mouse' => $couleurI); foreach ($icons as $icon => $color) { - wsTools::colorizeAndRasterizeIcon($this->theme->parametres->iconSet, $icon, $color, $this->vdir . '/data/images/', 4, $w, $h); + wsTools::colorizeAndRasterizeIcon($this->theme->parametres->iconSet, $icon, $color, $this->vdir . '/data/images/', $w, $h); } return $res; }