\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
$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
$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
}\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
}\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
$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
$p = str_replace($dest . '/', '', $path);
foreach ($ignore as $i) {
if (preg_match('|' . $i . '|i', $p, $matches)) {
- $network[] = $p;
continue 2;
}
}
$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
return array('_v1/index.swf' => 'index.swf');
}
+ protected function compile() {
+
+ }
+
protected function copyFluidbookFiles() {
parent::copyFluidbookFiles();
unlink($this->vdir . '/data/fd.swf');
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']--;