]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Sun, 18 Mar 2012 02:55:30 +0000 (02:55 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Sun, 18 Mar 2012 02:55:30 +0000 (02:55 +0000)
.htaccess
inc/ws/Controlleur/class.ws.ajax.php
inc/ws/Controlleur/class.ws.url.php
inc/ws/DAO/class.ws.dao.book.php
inc/ws/Util/html5/class.ws.html5.compiler.php
inc/ws/Util/packager/class.ws.packager.php
inc/ws/Util/packager/class.ws.packager.v1.php

index 004b8e3c1434e9953d89b022f8cefe2afac0e683..6efd2ec643eb596c7ec916cd3c0b73abf7f53b3c 100644 (file)
--- a/.htaccess
+++ b/.htaccess
@@ -6,8 +6,8 @@ AddCharset UTF-8 log
 \r
 # Static\r
 <IfModule mod_expires.c>\r
-       ExpiresActive On\r
-       ExpiresDefault "modification plus 1 month"\r
+#      ExpiresActive On\r
+#      ExpiresDefault "modification plus 1 month"\r
 </IfModule>\r
 \r
 <IfModule mod_rewrite.c>\r
index 95a9842d59953f12035ea0e6a17ed06f0c41d4b7..56aba9b67e5b6cc68e4911f53f71bbf134500de9 100644 (file)
@@ -281,6 +281,8 @@ class wsAjax extends cubeAjax {
                $cp = new cubeCommandLine('cp');\r
                $cp->setPath(CONVERTER_PATH);\r
                $cp->setArg('r');\r
+               $cp->setArg('u');\r
+               $cp->setArg('preserve','timestamps');\r
                $cp->setArg(null, $package . '*');\r
                $cp->setArg(null, $finalDir);\r
                $cp->execute();\r
index 5ad564c335341f0ddad77acc734fc2f4cef4ec72..d0fbd18bb08f6f25519e9d8af1bb7b4b814e209b 100644 (file)
@@ -321,7 +321,7 @@ class wsUrl {
                $res .= commonPage::bf();\r
 \r
                $res .= commonPage::bh();\r
-               $res .= cubeLang::translationForm(array(PLAYER_SOURCES, WS_COMPILE_ASSETS . '/_html5/js/libs'), $lang_id, null, 'liste', array(), '<a href="#" class="submit">' . $core->typo->Ajouter(__('Enregistrer')) . '</a>', $lang->traductions);\r
+               $res .= cubeLang::translationForm(array(PLAYER_SOURCES, WS_COMPILE_ASSETS . '/_html5/js'), $lang_id, null, 'liste', array(), '<a href="#" class="submit">' . $core->typo->Ajouter(__('Enregistrer')) . '</a>', $lang->traductions);\r
                $res .= commonPage::bf();\r
                $res .= '</form>';\r
                return $res;\r
index 228ef89dd9353c397fe49529c51e9813d94100f3..b6d3fa1a53d4c1452bf79ce833a854ceacd313d7 100644 (file)
@@ -558,15 +558,23 @@ class wsDAOBook extends commonDAO {
        }\r
 \r
        public function isUpToDate($book_id, $html = false) {\r
+               // V2\r
+               if (!file_exists(WS_BOOKS . '/final/' . $book_id)) {\r
+                       return false;\r
+               }\r
                $r = $this->con->select('SELECT changedate,compiledate FROM books WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
                if ($r->compiledate < $r->changedate) {\r
                        return false;\r
                }\r
 \r
+\r
+               // V1\r
                if (!file_exists(WS_BOOKS . '/finalv1/' . $book_id . '/index.swf')) {\r
                        return false;\r
                }\r
 \r
+\r
+               // HTML5\r
                $checks = array($r->changedate, cubeFiles::filemtimeRecursive(WS_COMPILE_ASSETS . '/_html5'), cubeFiles::filemtimeRecursive(ROOT . '/inc/ws/Util/html5'));\r
                $reffile = WS_BOOKS . '/html5/' . $book_id;\r
 \r
@@ -715,9 +723,12 @@ class wsDAOBook extends commonDAO {
        }\r
 \r
        public function compile($book_id, $version = 3, $complete = false) {\r
-               $res=$this->compile3($book_id, $complete);\r
-               $this->compile1($book_id);\r
+               if (is_null($book_id) || !$book_id) {\r
+                       return;\r
+               }\r
 \r
+               $res = $this->compile3($book_id, $complete);\r
+               $this->compile1($book_id);\r
                $this->touchCompile($book_id);\r
                return $res;\r
        }\r
@@ -726,8 +737,6 @@ class wsDAOBook extends commonDAO {
                $finalDir = WS_BOOKS . '/finalv1/' . $book_id . '/';\r
                $packager = new wsPackagerV1($book_id, $finalDir, false);\r
                $packager->makePackage(false);\r
-\r
-               mkdir($finalDir, 0777, true);\r
        }\r
 \r
        public function compile3($book_id, $complete) {\r
index 951f1596d4cc75ed4634b458439b222c7dc8085e..c075969478b03e7483f7330a8359427b61d2acc5 100644 (file)
@@ -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;
                                                }
                                        }
index 9cccaa660dead386b27bd38f68f44d5cd3a2579d..21ade59813041f678aaa8958a1e1f5aea3786eac 100644 (file)
@@ -58,6 +58,14 @@ class wsPackager {
                $this->themeRoot = WS_THEMES . '/' . $this->theme->theme_id . '/';\r
 \r
                $this->workingDir = WS_BOOKS . '/working/' . $book_id . '/';\r
+\r
+               $this->compile();\r
+       }\r
+\r
+       protected function compile() {\r
+               if (!$this->daoBook->isUpToDate($this->book_id)) {\r
+                       $this->daoBook->compile($this->book_id);\r
+               }\r
        }\r
 \r
        protected function preparePackage() {\r
index 3016b885756f8663e223bd978b7321e61bdfd473..9678af22ed168eaad37a26dfc04a43ef9094e542 100644 (file)
@@ -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']--;