From: vincent@cubedesigners.com Date: Fri, 15 Jun 2018 14:57:03 +0000 (+0000) Subject: wip #1998 @0:01 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=6ffdff307c9f8901d0b8829499e7a5420b666567;p=cubeextranet.git wip #1998 @0:01 --- diff --git a/inc/ws/Controlleur/class.ws.services.php b/inc/ws/Controlleur/class.ws.services.php index 543c9b9e9..728b06a1e 100644 --- a/inc/ws/Controlleur/class.ws.services.php +++ b/inc/ws/Controlleur/class.ws.services.php @@ -1205,11 +1205,11 @@ class wsServices extends cubeFlashGateway file_put_contents('/tmp/bourbonSuggestion', print_r($e, true)); } - $body = "Hello,\r\nThis automatic message confirm that your suggestion has been received.\r\nPlease do not reply to this e-mail,\r\nThank you"; + $body = "Hello,\r\nThis automatic message confirms that your suggestion has been received.\r\nPlease do not reply to this e-mail,\r\nThank you"; $ack = new Zend_Mail(); $ack->setFrom('no-reply@bourbonoffshore.com'); - $ack->setSubject('Suggestion ackknowledge'); + $ack->setSubject('Suggestion acknowledge'); $ack->setBodyText($body); $ack->addTo($from); diff --git a/inc/ws/Util/packager/class.ws.packager.php b/inc/ws/Util/packager/class.ws.packager.php index d164c8231..c2d0d74ea 100644 --- a/inc/ws/Util/packager/class.ws.packager.php +++ b/inc/ws/Util/packager/class.ws.packager.php @@ -1,6 +1,7 @@ makePackage($zip); } - public function __construct($book_id, $vdir = null, $whole = true) { + public function __construct($book_id, $vdir = null, $whole = true) + { $this->_clean = (null === $vdir); global $core; @@ -81,19 +84,23 @@ class wsPackager { $this->compile(); } - protected function compile() { + protected function compile() + { $this->daoBook->compile($this->book_id, '2', false, $this->book->parametres->forceCompileOnDownload); } - protected function preparePackage() { + protected function preparePackage() + { $this->initTempDir(); } - public function makePackage($zip) { + public function makePackage($zip) + { $this->preparePackage(); } - protected function replaceContents($str, $toReplace) { + protected function replaceContents($str, $toReplace) + { $res = $str; foreach ($toReplace as $k => $v) { if (is_null($v)) { @@ -104,7 +111,8 @@ class wsPackager { return $res; } - protected function copyFluidbookFiles() { + protected function copyFluidbookFiles() + { // Copie du FB vers un répertoire temporaire $cp = new cubeCommandLine('cp'); $cp->setArg('R'); @@ -114,7 +122,8 @@ class wsPackager { $cp->execute(); } - protected function copyOtherFiles($files) { + protected function copyOtherFiles($files) + { foreach ($files as $source => $dest) { if (is_int($source)) { $source = $dest; @@ -139,15 +148,18 @@ class wsPackager { } } - protected function getBaseFile() { + protected function getBaseFile() + { return $this->version . '-' . date('Ymdhis', TIME) . '-' . cubeText::str2URL($this->book->parametres->title); } - protected function getRelativeBase() { + protected function getRelativeBase() + { return '/packager/download/' . $this->getBaseFile(); } - protected function getURLBase($ext = '') { + protected function getURLBase($ext = '') + { $res = '/fluidbook' . $this->getRelativeBase(); if ($ext != '') { $res .= '.' . $ext; @@ -155,7 +167,8 @@ class wsPackager { return $res; } - protected function getPathBase($ext = '') { + protected function getPathBase($ext = '') + { $res = WS_FILES . $this->getRelativeBase(); if ($ext != '') { $res .= '.' . $ext; @@ -164,7 +177,8 @@ class wsPackager { return $res; } - protected function zip($zipfile = null) { + protected function zip($zipfile = null) + { if (!$this->whole) { return; } @@ -177,18 +191,19 @@ class wsPackager { $rename = true; } - $dir=$this->getFinalPackageDir(); - if(file_exists($dir)) { - $zip = new cubeCommandLine('zip'); - $zip->cd($dir); - $zip->setArg(null, $zipfile); - $zip->setArg('symlinks'); - $zip->setArg('0'); - $zip->setArg('r'); - $zip->setArg('u'); - $zip->setArg(null, '.'); - $zip->execute(); - } + $dir = $this->getFinalPackageDir(); + if (file_exists($dir)) { + $zip = new CubeIT_CommandLine('zip'); + $zip->cd($dir); + $zip->setArg(null, $zipfile); + $zip->setArg('symlinks'); + $zip->setArg('0'); + $zip->setArg('r'); + $zip->setArg('u'); + $zip->setArg(null, '.'); + $zip->setManualArg('-x "*/\.*"'); + $zip->execute(); + } if (!file_exists(WS_FILES . '/packager/download')) { mkdir(WS_FILES . '/packager/download', 0777, true); @@ -200,7 +215,8 @@ class wsPackager { return $url; } - public function getFinalPackageDir() { + public function getFinalPackageDir() + { $dir = $this->vdir; if ($this->book->parametres->alwaysHTML5) { $dir .= '/m/'; @@ -208,7 +224,8 @@ class wsPackager { return $dir; } - protected function initTempDir() { + protected function initTempDir() + { if (is_null($this->vdir)) { $this->vdir = $this->dir . $this->version . '/'; } @@ -218,7 +235,8 @@ class wsPackager { } } - protected function cleanVdir() { + protected function cleanVdir() + { if (!$this->_clean) { return; } @@ -232,7 +250,8 @@ class wsPackager { } } - protected function moveDatasSWF() { + protected function moveDatasSWF() + { if (file_exists($this->vdir . '/FluidbookDatas.swf')) { rename($this->vdir . '/FluidbookDatas.swf', $this->vdir . '/data/FluidbookDatas.swf'); } @@ -241,17 +260,20 @@ class wsPackager { } } - protected function postPackage() { + protected function postPackage() + { } - public function __destruct() { + public function __destruct() + { if ($this->whole && $this->cleanOnDestruct) { $this->cleanVdir(); } } - public function copy($source, $dest) { + public function copy($source, $dest) + { if (!file_exists($source)) { return; }