From 327e8a086e3e845c6e67416b505fc5cb43fa23e7 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Tue, 15 Jan 2013 14:55:34 +0000 Subject: [PATCH] --- fluidbook/tools/webvideo | 26 ++++++++++++++----- inc/commons/class.common.tools.php | 4 +++ inc/postconfig.inc.php | 5 +++- inc/ws/Controlleur/class.ws.ajax.php | 6 ++--- .../class.ws.conversion.session.php | 7 +++-- inc/ws/Controlleur/class.ws.stats.php | 12 ++++----- inc/ws/Metier/class.ws.book.parametres.php | 2 +- .../packager/class.ws.packager.win.inst.php | 14 ++++++++-- 8 files changed, 55 insertions(+), 21 deletions(-) diff --git a/fluidbook/tools/webvideo b/fluidbook/tools/webvideo index 5b98aab5b..23f522acc 100644 --- a/fluidbook/tools/webvideo +++ b/fluidbook/tools/webvideo @@ -20,9 +20,9 @@ echo /usr/bin/ffmpeg -i $1 \ -y \ -acodec aac \ --ab 64k \ -vcodec libx264 \ -b 384k \ +-ab 64k \ -mbd 2 \ -cmp 256 \ -subcmp 2 \ @@ -43,15 +43,29 @@ echo -i_qfactor 0.71 \ -qmin 10 -qmax 51 \ -qdiff 4 \ --ac 1 \ +-ac 2 \ +-ar 44100 \ -r 13 \ $2/$filename.mp4 fi -echo 'making ogv' +echo 'making webm' echo echo -/usr/local/bin/ffmpeg2theora $1 -o $2/$filename.ogv -echo 'making webm' +/usr/local/bin/ffmpeg -i $1 \ +-keyint_min 0 \ +-g 250 \ +-skip_threshold 0 \ +-qmin 1 \ +-qmax 51 \ +-vcodec libvpx \ +-b 614400 \ +-acodec libvorbis \ +-ar 44100 \ +-ac 2 \ +-ab 64k \ +-y $2/$filename.webm + +echo 'making ogv' echo echo -/usr/local/bin/ffmpeg -i $1 -keyint_min 0 -g 250 -skip_threshold 0 -qmin 1 -qmax 51 -vcodec libvpx -b 614400 -acodec libvorbis -y $2/$filename.webm \ No newline at end of file +/usr/local/bin/ffmpeg2theora $1 -o $2/$filename.ogv diff --git a/inc/commons/class.common.tools.php b/inc/commons/class.common.tools.php index f7082beb9..0e784b13a 100644 --- a/inc/commons/class.common.tools.php +++ b/inc/commons/class.common.tools.php @@ -62,6 +62,9 @@ class commonTools { if (!file_exists($dir)) { mkdir($dir, 0777, true); $ext = files::getExtension($url); + if (preg_match('#^(\w+)(.*)$#', $ext, $matches)) { + $ext = $matches[1]; + } $original = $dir . 'video.' . $ext; copy($url, $original); @@ -869,4 +872,5 @@ class commonTools { } } + ?> diff --git a/inc/postconfig.inc.php b/inc/postconfig.inc.php index 85ec7aef7..8117456d9 100644 --- a/inc/postconfig.inc.php +++ b/inc/postconfig.inc.php @@ -8,10 +8,13 @@ define('DEV', $dev); // Définition des variables dans l'environnement de production //define('DB_HOST', ':/var/run/mysqld/mysqld.sock'); -if ($_SERVER['SERVER_ADDR'] == '37.59.53.196') { + +if (getenv('HOSTNAME') != 'ks308520.kimsufi.com') { define('DB_HOST', 'localhost'); + define('SERVER','avanger'); } else { define('DB_HOST', 'avanger.fluidbook.com'); + define('SERVER','dictator'); } define('DB_NAME', 'extranet'); diff --git a/inc/ws/Controlleur/class.ws.ajax.php b/inc/ws/Controlleur/class.ws.ajax.php index 4b60bf244..5ef01b2fe 100644 --- a/inc/ws/Controlleur/class.ws.ajax.php +++ b/inc/ws/Controlleur/class.ws.ajax.php @@ -317,7 +317,7 @@ class wsAjax extends cubeAjax { /** --del -r -z -v * */ $cp = new cubeCommandLine('rsync'); $cp->setPath(CONVERTER_PATH); - $cp->setArg('del'); + //$cp->setArg('del'); $cp->setArg('t'); $cp->setArg('r'); $cp->setArg('z'); @@ -342,10 +342,10 @@ class wsAjax extends cubeAjax { 'mkdir -p ' . $u['path'], 'cd ' . $u['path'], 'lcd ' . $package, - 'mirror -Rve --parallel=5' + //'mirror -Rve --parallel=5' + 'mirror -Rv --parallel=5' ); - $lftp = new cubeCommandLine('lftp'); $lftp->setArg('u', $u['user'] . ',' . $u['pass']); $lftp->setArg('p', $u['port']); diff --git a/inc/ws/Controlleur/class.ws.conversion.session.php b/inc/ws/Controlleur/class.ws.conversion.session.php index e7a79b5b7..43603f22c 100644 --- a/inc/ws/Controlleur/class.ws.conversion.session.php +++ b/inc/ws/Controlleur/class.ws.conversion.session.php @@ -168,14 +168,17 @@ class wsConversionSession { } public function getProgress() { - return array("progress" => $this->progress, - 'currentDoc' => $this->currentDoc->file, + $res = array("progress" => $this->progress, 'totalDoc' => $this->totalDoc, 'currentDocPage' => $this->currentDocPage, 'totalDocPage' => $this->totalDocPage, 'totalPages' => $this->totalPages, 'processedPages' => $this->processedPages, 'processedDoc' => max($this->processedDoc + 1, $this->totalDoc)); + if ($this->currentDoc) { + $res['currentDoc'] = $this->currentDoc->file; + } + return $res; } public function setProgress($i) { diff --git a/inc/ws/Controlleur/class.ws.stats.php b/inc/ws/Controlleur/class.ws.stats.php index e2c86a52b..c4bfc05df 100644 --- a/inc/ws/Controlleur/class.ws.stats.php +++ b/inc/ws/Controlleur/class.ws.stats.php @@ -808,10 +808,10 @@ class wsStats { @unlink($img); if (!file_exists($img) || filemtime($img) < cubeDate::round(null, 'H')) { $im = imagecreatetruecolor(944, 306); - imagelayereffect($im, IMG_EFFECT_REPLACE); + //imagelayereffect($im, IMG_EFFECT_REPLACE); $trans = imagecolorallocatealpha($im, 255, 255, 255, 0); imagefill($im, 0, 0, $trans); - imagelayereffect($im, IMG_EFFECT_ALPHABLEND); + //imagelayereffect($im, IMG_EFFECT_ALPHABLEND); $i = 1; $x0 = 0; $y0 = 305; @@ -911,10 +911,10 @@ class wsStats { } if (!file_exists($img) || filemtime($img) < cubeDate::round(null, 'H')) { $im = imagecreatetruecolor(944, 306); - imagelayereffect($im, IMG_EFFECT_REPLACE); + //imagelayereffect($im, IMG_EFFECT_REPLACE); $trans = imagecolorallocatealpha($im, 255, 255, 255, 0); imagefill($im, 0, 0, $trans); - imagelayereffect($im, IMG_EFFECT_ALPHABLEND); + //imagelayereffect($im, IMG_EFFECT_ALPHABLEND); $i = 1; $x0 = 900; $y0 = 305; @@ -1011,10 +1011,10 @@ class wsStats { if (!file_exists($img) || filemtime($img) < cubeDate::round(null, 'H')) { // Création de l'image $im = imagecreatetruecolor(944, 306); - imagelayereffect($im, IMG_EFFECT_REPLACE); + //imagelayereffect($im, IMG_EFFECT_REPLACE); $trans = imagecolorallocatealpha($im, 255, 255, 255, 0); imagefill($im, 0, 0, $trans); - imagelayereffect($im, IMG_EFFECT_ALPHABLEND); + //imagelayereffect($im, IMG_EFFECT_ALPHABLEND); $i = 1; $x0 = 0; $y0 = 305; diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index 241e09df4..451cd8ed8 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -269,7 +269,7 @@ class wsBookParametres extends wsParametres { $this->fields['mobileTransitionDuration'] = array('type' => 'float', 'default' => '1.0', 'editable' => true, 'label' => __('Durée de la transition')); $this->fields['mobileIconVector'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Utiliser les icônes vectorielles')); - $this->fields['mobileServerConfig'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Inclure les fichiers de configuration serveur'), 'grade' => 5); + $this->fields['mobileServerConfig'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Inclure les fichiers de configuration serveur'), 'grade' => 3); $this->fields['mobilePlugins'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('Plugin'), 'grade' => 5); diff --git a/inc/ws/Util/packager/class.ws.packager.win.inst.php b/inc/ws/Util/packager/class.ws.packager.win.inst.php index 475d16a05..b909d74a8 100644 --- a/inc/ws/Util/packager/class.ws.packager.win.inst.php +++ b/inc/ws/Util/packager/class.ws.packager.win.inst.php @@ -51,9 +51,19 @@ class wsPackagerWinINST extends wsPackagerWinEXE { public function makePackage($zip) { $this->preparePackage(); - $url = 'http://installer.fluidbook.com/make.php?nsi=' . base64_encode($this->nsi) . '&junk=' . TIME; + if (SERVER == 'dictator') { + $url = 'http://installer.fluidbook.com/make.php?nsi=' . base64_encode($this->nsi) . '&junk=' . TIME; + file_get_contents($url); + } else { + $tmp=cubeFiles::tempnam(); + file_put_contents($tmp, $this->nsi); + $makensis=new cubeCommandLine('makensis'); + $makensis->setArg(null,$tmp); + $makensis->execute(); + unlink($tmp); + } + - file_get_contents($url); return $this->getURLBase('exe'); } -- 2.39.5