From: vincent@cubedesigners.com Date: Sun, 18 Mar 2012 02:55:30 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=06a6835655db5b0505b1bee699d7428be1508ecc;p=cubeextranet.git --- diff --git a/.htaccess b/.htaccess index 004b8e3c1..6efd2ec64 100644 --- a/.htaccess +++ b/.htaccess @@ -6,8 +6,8 @@ AddCharset UTF-8 log # Static - ExpiresActive On - ExpiresDefault "modification plus 1 month" +# ExpiresActive On +# ExpiresDefault "modification plus 1 month" diff --git a/inc/ws/Controlleur/class.ws.ajax.php b/inc/ws/Controlleur/class.ws.ajax.php index 95a9842d5..56aba9b67 100644 --- a/inc/ws/Controlleur/class.ws.ajax.php +++ b/inc/ws/Controlleur/class.ws.ajax.php @@ -281,6 +281,8 @@ class wsAjax extends cubeAjax { $cp = new cubeCommandLine('cp'); $cp->setPath(CONVERTER_PATH); $cp->setArg('r'); + $cp->setArg('u'); + $cp->setArg('preserve','timestamps'); $cp->setArg(null, $package . '*'); $cp->setArg(null, $finalDir); $cp->execute(); diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index 5ad564c33..d0fbd18bb 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -321,7 +321,7 @@ class wsUrl { $res .= commonPage::bf(); $res .= commonPage::bh(); - $res .= cubeLang::translationForm(array(PLAYER_SOURCES, WS_COMPILE_ASSETS . '/_html5/js/libs'), $lang_id, null, 'liste', array(), '' . $core->typo->Ajouter(__('Enregistrer')) . '', $lang->traductions); + $res .= cubeLang::translationForm(array(PLAYER_SOURCES, WS_COMPILE_ASSETS . '/_html5/js'), $lang_id, null, 'liste', array(), '' . $core->typo->Ajouter(__('Enregistrer')) . '', $lang->traductions); $res .= commonPage::bf(); $res .= ''; return $res; diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index 228ef89dd..b6d3fa1a5 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -558,15 +558,23 @@ class wsDAOBook extends commonDAO { } public function isUpToDate($book_id, $html = false) { + // V2 + if (!file_exists(WS_BOOKS . '/final/' . $book_id)) { + return false; + } $r = $this->con->select('SELECT changedate,compiledate FROM books WHERE book_id=\'' . $this->con->escape($book_id) . '\''); if ($r->compiledate < $r->changedate) { return false; } + + // V1 if (!file_exists(WS_BOOKS . '/finalv1/' . $book_id . '/index.swf')) { return false; } + + // HTML5 $checks = array($r->changedate, cubeFiles::filemtimeRecursive(WS_COMPILE_ASSETS . '/_html5'), cubeFiles::filemtimeRecursive(ROOT . '/inc/ws/Util/html5')); $reffile = WS_BOOKS . '/html5/' . $book_id; @@ -715,9 +723,12 @@ class wsDAOBook extends commonDAO { } public function compile($book_id, $version = 3, $complete = false) { - $res=$this->compile3($book_id, $complete); - $this->compile1($book_id); + if (is_null($book_id) || !$book_id) { + return; + } + $res = $this->compile3($book_id, $complete); + $this->compile1($book_id); $this->touchCompile($book_id); return $res; } @@ -726,8 +737,6 @@ class wsDAOBook extends commonDAO { $finalDir = WS_BOOKS . '/finalv1/' . $book_id . '/'; $packager = new wsPackagerV1($book_id, $finalDir, false); $packager->makePackage(false); - - mkdir($finalDir, 0777, true); } public function compile3($book_id, $complete) { diff --git a/inc/ws/Util/html5/class.ws.html5.compiler.php b/inc/ws/Util/html5/class.ws.html5.compiler.php index 951f1596d..c07596947 100644 --- a/inc/ws/Util/html5/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/class.ws.html5.compiler.php @@ -221,7 +221,6 @@ class wsHTML5Compiler { $p = str_replace($dest . '/', '', $path); foreach ($ignore as $i) { if (preg_match('|' . $i . '|i', $p, $matches)) { - $network[] = $p; continue 2; } } diff --git a/inc/ws/Util/packager/class.ws.packager.php b/inc/ws/Util/packager/class.ws.packager.php index 9cccaa660..21ade5981 100644 --- a/inc/ws/Util/packager/class.ws.packager.php +++ b/inc/ws/Util/packager/class.ws.packager.php @@ -58,6 +58,14 @@ class wsPackager { $this->themeRoot = WS_THEMES . '/' . $this->theme->theme_id . '/'; $this->workingDir = WS_BOOKS . '/working/' . $book_id . '/'; + + $this->compile(); + } + + protected function compile() { + if (!$this->daoBook->isUpToDate($this->book_id)) { + $this->daoBook->compile($this->book_id); + } } protected function preparePackage() { diff --git a/inc/ws/Util/packager/class.ws.packager.v1.php b/inc/ws/Util/packager/class.ws.packager.v1.php index 3016b8857..9678af22e 100644 --- a/inc/ws/Util/packager/class.ws.packager.v1.php +++ b/inc/ws/Util/packager/class.ws.packager.v1.php @@ -23,6 +23,10 @@ class wsPackagerV1 extends wsPackagerHTML { return array('_v1/index.swf' => 'index.swf'); } + protected function compile() { + + } + protected function copyFluidbookFiles() { parent::copyFluidbookFiles(); unlink($this->vdir . '/data/fd.swf'); @@ -83,7 +87,7 @@ class wsPackagerV1 extends wsPackagerHTML { foreach ($links as $link) { $one = $xml->addChild('oneLink'); - $link['type']=intval($link['type']); + $link['type'] = intval($link['type']); if ($link['page'] % 2 == 1) { $link['page']--;