From: vincent@cubedesigners.com Date: Sat, 9 Apr 2011 11:50:41 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=1005e030dfffb71f9967c980875a0b3068941103;p=cubeextranet.git --- diff --git a/inc/ws/Controlleur/packager/_common.php b/inc/ws/Controlleur/packager/_common.php deleted file mode 100644 index e5bca614a..000000000 --- a/inc/ws/Controlleur/packager/_common.php +++ /dev/null @@ -1,9 +0,0 @@ - \ No newline at end of file diff --git a/inc/ws/Controlleur/packager/class.ws.packager.html.php b/inc/ws/Controlleur/packager/class.ws.packager.html.php deleted file mode 100644 index 290dd16ba..000000000 --- a/inc/ws/Controlleur/packager/class.ws.packager.html.php +++ /dev/null @@ -1,169 +0,0 @@ -version = 'html'; - } - - protected function preparePackage() - { - parent::preparePackage(); - - $this->copyFluidbookFiles(); - $this->mergeJavascript(); - - $this->copyOtherFiles(array('fluidbook.js', 'getflash.gif', 'index.html', 'index.swf', 'player.swf', 'style.css')); - - mkdir($this->vdir . '/pages/', 0777, true); - - $ga = ''; - if ($this->book->parametres->googleAnalytics != '') { - $variables = array('Language' => array('value' => 'getLang()', 'valueAsJS' => true, 'scope' => 2)); - $ga = cubePage::googleAnalytics(explode(',', $this->book->parametres->googleAnalytics), true, $variables); - } - - $facebook = ''; - if ($this->book->parametres->facebook) { - if ($this->book->parametres->facebook_title != '') { - $facebook .= ''; - } else { - $facebook .= ''; - } - if ($this->book->parametres->facebook_description != '') { - $facebook .= ''; - } - $facebook .= ''; - } - // Stuffs to replace in html - $toReplace = array('lang' => strtolower($this->book->lang), 'title' => self::escape($this->book->parametres->title), 'ga' => $ga, 'facebook' => $facebook, 'bgcolor' => $this->theme->parametres->loadingBackColor); - - $this->origHTML = file_get_contents($this->vdir . '/index.html'); - $this->origHTML = $this->replaceHTML($toReplace); - - $nav1 = $this->makeHTMLNav(true); - $nav = $this->makeHTMLNav(false); - $footer = $this->makeHTMLFooter(); - - foreach($this->pages as $page => $infos) { - $pathToIndex = 'index.swf'; - $pathToGetflash = 'getflash.gif'; - $redirectScript = ''; - if ($page == 1) { - $dest = 'index.html'; - } else { - $dest = 'pages/page' . $page . '.html'; - $pathToIndex = '../index.swf'; - $pathToGetflash = '../getflash.gif'; - $redirectScript = ''; - } - $alt = ''; - - $htmlfile = WS_DOCS . '/' . $infos['document_id'] . '/h' . $infos['document_page'] . '.txt'; - - if (file_exists($htmlfile)) { - $html = file_get_contents($htmlfile); - $alt .= "\n" . $html . "\n"; - } - - if ($page == 1) { - $alt .= $nav1; - } else { - $alt .= $nav; - } - $alt .= $footer; - - $data = str_replace('$alt', $alt , $this->origHTML); - $data = str_replace('$pathToIndex', $pathToIndex, $data); - $data = str_replace('$pathToGetflash', $pathToGetflash, $data); - $data = str_replace('$redirectScript', $redirectScript, $data); - - file_put_contents($this->vdir . $dest, $data); - } - } - - public function makePackage() - { - parent::makePackage(); - return $this->zip(); - } - - protected function makeHTMLNav($root) - { - $res = ''; - return $res; - } - - protected function escape($txt) - { - return htmlentities($txt, ENT_COMPAT, 'UTF-8'); - } - - protected function makeHTMLFooter() - { - $res = ''; - return $res; - } - - protected function replaceHTML($toReplace) - { - return $this->replaceContents($this->origHTML, $toReplace); - } - - protected function mergeJavascript() - { - $dest = WS_COMPILE_ASSETS . '/fluidbook.js'; - $orig = WS_COMPILE_ASSETS . '/_js/'; - $files = array('swfobject.js' => false, 'swfaddress.js' => false, 'fluidbook.js' => true); - - $refresh = false; - if (file_exists($dest)) { - $mtime = filemtime($dest); - foreach($files as $file => $min) { - if (filemtime($orig . $file) > $mtime) { - $refresh = true; - break; - } - } - } else { - $refresh = true; - } - if (!$refresh) { - return; - } - - $minjs = "\n\n"; - foreach($files as $file => $min) { - $c = file_get_contents($orig . $file); - if ($min) { - $c = JSMin::minify($c); - } - - $minjs .= $c . "\n\n"; - } - file_put_contents($dest, $minjs); - } -} - -?> \ No newline at end of file diff --git a/inc/ws/Controlleur/packager/class.ws.packager.mac.exe.php b/inc/ws/Controlleur/packager/class.ws.packager.mac.exe.php deleted file mode 100644 index d93ec19ff..000000000 --- a/inc/ws/Controlleur/packager/class.ws.packager.mac.exe.php +++ /dev/null @@ -1,28 +0,0 @@ -version = 'mac-exe'; - - $this->exeName = cubeText::str2URL(mb_substr($this->book->parametres->title, 0, 16)); - } - - protected function preparePackage() - { - parent::preparePackage(); - - $this->copyFluidbookFiles(); - $this->copyOtherFiles(array('Fluidbook.app.zip')); - } - - public function makePackage() - { - parent::makePackage(); - return $this->zip($this->vdir . 'Fluidbook.app.zip'); - } -} - -?> \ No newline at end of file diff --git a/inc/ws/Controlleur/packager/class.ws.packager.php b/inc/ws/Controlleur/packager/class.ws.packager.php deleted file mode 100644 index 7bcd01c90..000000000 --- a/inc/ws/Controlleur/packager/class.ws.packager.php +++ /dev/null @@ -1,169 +0,0 @@ -makePackage(); - } - - public function __construct($book_id) - { - global $core; - - $this->dir = WS_FILES . '/packager/' . $book_id . '/'; - - if (!file_exists($this->dir)) { - mkdir($this->dir, 0777, true); - } - - $daoBook = new wsDAOBook($core->con); - $this->book = $daoBook->selectById($book_id); - $this->pages = $daoBook->getPagesOfBook($book_id); - - $daoTheme = new wsDAOTheme($core->con); - $this->theme = $daoTheme->getThemeOfBook($book_id, true); - } - - protected function preparePackage() - { - $this->initTempDir(); - } - - public function makePackage() - { - $this->preparePackage(); - } - - protected function replaceContents($str, $toReplace) - { - $res = $str; - foreach($toReplace as $k => $v) { - if (is_null($v)) { - return; - } - $res = str_replace('$' . $k, $v, $res); - } - return $res; - } - - protected function copyFluidbookFiles() - { - // Copie du FB vers un répertoire temporaire - $cp = new cubeCommandLine('cp'); - $cp->setArg('R'); - $cp->setArg(null, WS_BOOKS . '/final/' . $this->book->book_id . '/*'); - $cp->setArg(null, $this->vdir); - $cp->execute(); - } - - protected function copyOtherFiles($files) - { - foreach($files as $source => $dest) { - if (is_int($source)) { - $source = $dest; - } - - copy(WS_COMPILE_ASSETS . '/' . $source, $this->vdir . $dest); - } - } - - protected function getBaseFile() - { - return $this->version . '-' . date('Ymdhis', TIME) . '-' . cubeText::str2URL($this->book->parametres->title); - } - - protected function getRelativeBase() - { - return '/packager/download/' . $this->getBaseFile(); - } - - protected function getURLBase($ext = '') - { - $res = '/fluidbook' . $this->getRelativeBase() ; - if ($ext != '') { - $res .= '.' . $ext; - } - return $res; - } - - protected function getPathBase($ext = '') - { - $res = WS_FILES . $this->getRelativeBase(); - if ($ext != '') { - $res .= '.' . $ext; - } - - return $res; - } - - protected function zip($zipfile = null) - { - $url = $this->getURLBase('zip'); - $final = $this->getPathBase('zip'); - $rename = false; - if (is_null($zipfile)) { - $zipfile = $final; - } else { - $rename = true; - } - - $zip = new cubeCommandLine('zip'); - $zip->cd($this->vdir); - $zip->setArg(null, $zipfile); - $zip->setArg('0'); - $zip->setArg('u'); - $zip->setArg('r'); - $zip->setArg('X'); - $zip->setArg(null, '.'); - $zip->execute(); - - if ($rename) { - rename($zipfile, $final); - } - return $url; - } - - protected function initTempDir() - { - $this->vdir = $this->dir . $this->version . '/'; - $this->cleanVdir(); - mkdir($this->vdir, 0777, true); - } - - protected function cleanVdir() - { - if (file_exists($this->vdir)) { - // Suppression du répertoire si il existe - $rm = new cubeCommandLine('rm'); - $rm->setArg('r'); - $rm->setArg('f'); - $rm->setArg(null, $this->vdir); - $rm->execute(); - } - } - - public function __destruct() - { - $this->cleanVdir(); - } -} - -?> \ No newline at end of file diff --git a/inc/ws/Controlleur/packager/class.ws.packager.win.cd.php b/inc/ws/Controlleur/packager/class.ws.packager.win.cd.php deleted file mode 100644 index d70a06b91..000000000 --- a/inc/ws/Controlleur/packager/class.ws.packager.win.cd.php +++ /dev/null @@ -1,26 +0,0 @@ -version = 'win-cd'; - } - - protected function preparePackage() - { - parent::preparePackage(); - - $this->copyOtherFiles(array('fluidbook.ico', 'autorun.inf')); - $this->replaceAutorun(); - } - - public function replaceAutorun() - { - $inf = file_get_contents($this->vdir . 'autorun.inf'); - $toReplace = array('title' => $this->book->parametres->title, 'exe' => $this->exeName); - $inf = $this->replaceContents($inf, $toReplace); - file_put_contents($this->vdir . 'autorun.inf', $inf); - } -} - -?> \ No newline at end of file diff --git a/inc/ws/Controlleur/packager/class.ws.packager.win.exe.php b/inc/ws/Controlleur/packager/class.ws.packager.win.exe.php deleted file mode 100644 index 2ebd4e4fe..000000000 --- a/inc/ws/Controlleur/packager/class.ws.packager.win.exe.php +++ /dev/null @@ -1,28 +0,0 @@ -version = 'win-exe'; - - $this->exeName = cubeText::str2URL(mb_substr($this->book->parametres->title, 0, 16)).'.exe'; - } - - protected function preparePackage() - { - parent::preparePackage(); - - $this->copyFluidbookFiles(); - $this->copyOtherFiles(array('Fluidbook.exe' => $this->exeName)); - } - - public function makePackage() - { - parent::makePackage(); - return $this->zip(); - } -} - -?> \ No newline at end of file diff --git a/inc/ws/Controlleur/packager/class.ws.packager.win.inst.php b/inc/ws/Controlleur/packager/class.ws.packager.win.inst.php deleted file mode 100644 index d5f9b8720..000000000 --- a/inc/ws/Controlleur/packager/class.ws.packager.win.inst.php +++ /dev/null @@ -1,59 +0,0 @@ -version = 'win-ins'; - } - - protected function preparePackage() - { - parent::preparePackage(); - - $this->copyFluidbookFiles(); - $this->copyOtherFiles(array('Fluidbook.exe' => $this->exeName)); - - $this->makeNSI(); - } - - protected function makeNSI() - { - global $core; - - $winvdir = trim($this->vdir, '/'); - $winvdir = str_replace('/', '\\' , $winvdir); - $winvdir = "\\" . $winvdir; - - $daoLang = new wsDAOLang($core->con); - $lang = $daoLang->selectById($this->book->lang); - - $nsi = file_get_contents(WS_COMPILE_ASSETS . '/script.nsi'); - $nsi = str_replace('$name', utf8_decode($this->book->parametres->title), $nsi); - $nsi = str_replace('$htmldir', utf8_decode(WS_COMPILE_ASSETS), $nsi); - $nsi = str_replace('$fname', str_replace('.exe', '', $this->exeName), $nsi); - $nsi = str_replace('$fdir', $winvdir, $nsi); - $nsi = str_replace('$titre', utf8_decode($this->book->parametres->title), $nsi); - $nsi = str_replace('$lang', utf8_decode($lang->nsis), $nsi); - $nsi = str_replace('$nsisdir', '/usr/local/nsis/nsis-2.46/share/nsis', $nsi); - $nsi = str_replace('$output', $this->getPathBase('exe'), $nsi); - - $this->nsi = $nsi; - } - public function makePackage() - { - $this->preparePackage(); - $url = 'http://installer.fluidbook.com/make.php?nsi=' . base64_encode($this->nsi) ; - fb($url); - - file_get_contents('http://installer.fluidbook.com/make.php?nsi=' . base64_encode($this->nsi) . '&junk=' . TIME); - return $this->getURLBase('exe'); - } - - public function __destruct() - { - } -} - -?> \ No newline at end of file diff --git a/inc/ws/Util/packager/_common.php b/inc/ws/Util/packager/_common.php new file mode 100644 index 000000000..e5bca614a --- /dev/null +++ b/inc/ws/Util/packager/_common.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/inc/ws/Util/packager/class.ws.packager.html.php b/inc/ws/Util/packager/class.ws.packager.html.php new file mode 100644 index 000000000..290dd16ba --- /dev/null +++ b/inc/ws/Util/packager/class.ws.packager.html.php @@ -0,0 +1,169 @@ +version = 'html'; + } + + protected function preparePackage() + { + parent::preparePackage(); + + $this->copyFluidbookFiles(); + $this->mergeJavascript(); + + $this->copyOtherFiles(array('fluidbook.js', 'getflash.gif', 'index.html', 'index.swf', 'player.swf', 'style.css')); + + mkdir($this->vdir . '/pages/', 0777, true); + + $ga = ''; + if ($this->book->parametres->googleAnalytics != '') { + $variables = array('Language' => array('value' => 'getLang()', 'valueAsJS' => true, 'scope' => 2)); + $ga = cubePage::googleAnalytics(explode(',', $this->book->parametres->googleAnalytics), true, $variables); + } + + $facebook = ''; + if ($this->book->parametres->facebook) { + if ($this->book->parametres->facebook_title != '') { + $facebook .= ''; + } else { + $facebook .= ''; + } + if ($this->book->parametres->facebook_description != '') { + $facebook .= ''; + } + $facebook .= ''; + } + // Stuffs to replace in html + $toReplace = array('lang' => strtolower($this->book->lang), 'title' => self::escape($this->book->parametres->title), 'ga' => $ga, 'facebook' => $facebook, 'bgcolor' => $this->theme->parametres->loadingBackColor); + + $this->origHTML = file_get_contents($this->vdir . '/index.html'); + $this->origHTML = $this->replaceHTML($toReplace); + + $nav1 = $this->makeHTMLNav(true); + $nav = $this->makeHTMLNav(false); + $footer = $this->makeHTMLFooter(); + + foreach($this->pages as $page => $infos) { + $pathToIndex = 'index.swf'; + $pathToGetflash = 'getflash.gif'; + $redirectScript = ''; + if ($page == 1) { + $dest = 'index.html'; + } else { + $dest = 'pages/page' . $page . '.html'; + $pathToIndex = '../index.swf'; + $pathToGetflash = '../getflash.gif'; + $redirectScript = ''; + } + $alt = ''; + + $htmlfile = WS_DOCS . '/' . $infos['document_id'] . '/h' . $infos['document_page'] . '.txt'; + + if (file_exists($htmlfile)) { + $html = file_get_contents($htmlfile); + $alt .= "\n" . $html . "\n"; + } + + if ($page == 1) { + $alt .= $nav1; + } else { + $alt .= $nav; + } + $alt .= $footer; + + $data = str_replace('$alt', $alt , $this->origHTML); + $data = str_replace('$pathToIndex', $pathToIndex, $data); + $data = str_replace('$pathToGetflash', $pathToGetflash, $data); + $data = str_replace('$redirectScript', $redirectScript, $data); + + file_put_contents($this->vdir . $dest, $data); + } + } + + public function makePackage() + { + parent::makePackage(); + return $this->zip(); + } + + protected function makeHTMLNav($root) + { + $res = ''; + return $res; + } + + protected function escape($txt) + { + return htmlentities($txt, ENT_COMPAT, 'UTF-8'); + } + + protected function makeHTMLFooter() + { + $res = ''; + return $res; + } + + protected function replaceHTML($toReplace) + { + return $this->replaceContents($this->origHTML, $toReplace); + } + + protected function mergeJavascript() + { + $dest = WS_COMPILE_ASSETS . '/fluidbook.js'; + $orig = WS_COMPILE_ASSETS . '/_js/'; + $files = array('swfobject.js' => false, 'swfaddress.js' => false, 'fluidbook.js' => true); + + $refresh = false; + if (file_exists($dest)) { + $mtime = filemtime($dest); + foreach($files as $file => $min) { + if (filemtime($orig . $file) > $mtime) { + $refresh = true; + break; + } + } + } else { + $refresh = true; + } + if (!$refresh) { + return; + } + + $minjs = "\n\n"; + foreach($files as $file => $min) { + $c = file_get_contents($orig . $file); + if ($min) { + $c = JSMin::minify($c); + } + + $minjs .= $c . "\n\n"; + } + file_put_contents($dest, $minjs); + } +} + +?> \ No newline at end of file diff --git a/inc/ws/Util/packager/class.ws.packager.mac.exe.php b/inc/ws/Util/packager/class.ws.packager.mac.exe.php new file mode 100644 index 000000000..d93ec19ff --- /dev/null +++ b/inc/ws/Util/packager/class.ws.packager.mac.exe.php @@ -0,0 +1,28 @@ +version = 'mac-exe'; + + $this->exeName = cubeText::str2URL(mb_substr($this->book->parametres->title, 0, 16)); + } + + protected function preparePackage() + { + parent::preparePackage(); + + $this->copyFluidbookFiles(); + $this->copyOtherFiles(array('Fluidbook.app.zip')); + } + + public function makePackage() + { + parent::makePackage(); + return $this->zip($this->vdir . 'Fluidbook.app.zip'); + } +} + +?> \ No newline at end of file diff --git a/inc/ws/Util/packager/class.ws.packager.php b/inc/ws/Util/packager/class.ws.packager.php new file mode 100644 index 000000000..7bcd01c90 --- /dev/null +++ b/inc/ws/Util/packager/class.ws.packager.php @@ -0,0 +1,169 @@ +makePackage(); + } + + public function __construct($book_id) + { + global $core; + + $this->dir = WS_FILES . '/packager/' . $book_id . '/'; + + if (!file_exists($this->dir)) { + mkdir($this->dir, 0777, true); + } + + $daoBook = new wsDAOBook($core->con); + $this->book = $daoBook->selectById($book_id); + $this->pages = $daoBook->getPagesOfBook($book_id); + + $daoTheme = new wsDAOTheme($core->con); + $this->theme = $daoTheme->getThemeOfBook($book_id, true); + } + + protected function preparePackage() + { + $this->initTempDir(); + } + + public function makePackage() + { + $this->preparePackage(); + } + + protected function replaceContents($str, $toReplace) + { + $res = $str; + foreach($toReplace as $k => $v) { + if (is_null($v)) { + return; + } + $res = str_replace('$' . $k, $v, $res); + } + return $res; + } + + protected function copyFluidbookFiles() + { + // Copie du FB vers un répertoire temporaire + $cp = new cubeCommandLine('cp'); + $cp->setArg('R'); + $cp->setArg(null, WS_BOOKS . '/final/' . $this->book->book_id . '/*'); + $cp->setArg(null, $this->vdir); + $cp->execute(); + } + + protected function copyOtherFiles($files) + { + foreach($files as $source => $dest) { + if (is_int($source)) { + $source = $dest; + } + + copy(WS_COMPILE_ASSETS . '/' . $source, $this->vdir . $dest); + } + } + + protected function getBaseFile() + { + return $this->version . '-' . date('Ymdhis', TIME) . '-' . cubeText::str2URL($this->book->parametres->title); + } + + protected function getRelativeBase() + { + return '/packager/download/' . $this->getBaseFile(); + } + + protected function getURLBase($ext = '') + { + $res = '/fluidbook' . $this->getRelativeBase() ; + if ($ext != '') { + $res .= '.' . $ext; + } + return $res; + } + + protected function getPathBase($ext = '') + { + $res = WS_FILES . $this->getRelativeBase(); + if ($ext != '') { + $res .= '.' . $ext; + } + + return $res; + } + + protected function zip($zipfile = null) + { + $url = $this->getURLBase('zip'); + $final = $this->getPathBase('zip'); + $rename = false; + if (is_null($zipfile)) { + $zipfile = $final; + } else { + $rename = true; + } + + $zip = new cubeCommandLine('zip'); + $zip->cd($this->vdir); + $zip->setArg(null, $zipfile); + $zip->setArg('0'); + $zip->setArg('u'); + $zip->setArg('r'); + $zip->setArg('X'); + $zip->setArg(null, '.'); + $zip->execute(); + + if ($rename) { + rename($zipfile, $final); + } + return $url; + } + + protected function initTempDir() + { + $this->vdir = $this->dir . $this->version . '/'; + $this->cleanVdir(); + mkdir($this->vdir, 0777, true); + } + + protected function cleanVdir() + { + if (file_exists($this->vdir)) { + // Suppression du répertoire si il existe + $rm = new cubeCommandLine('rm'); + $rm->setArg('r'); + $rm->setArg('f'); + $rm->setArg(null, $this->vdir); + $rm->execute(); + } + } + + public function __destruct() + { + $this->cleanVdir(); + } +} + +?> \ No newline at end of file diff --git a/inc/ws/Util/packager/class.ws.packager.win.cd.php b/inc/ws/Util/packager/class.ws.packager.win.cd.php new file mode 100644 index 000000000..d70a06b91 --- /dev/null +++ b/inc/ws/Util/packager/class.ws.packager.win.cd.php @@ -0,0 +1,26 @@ +version = 'win-cd'; + } + + protected function preparePackage() + { + parent::preparePackage(); + + $this->copyOtherFiles(array('fluidbook.ico', 'autorun.inf')); + $this->replaceAutorun(); + } + + public function replaceAutorun() + { + $inf = file_get_contents($this->vdir . 'autorun.inf'); + $toReplace = array('title' => $this->book->parametres->title, 'exe' => $this->exeName); + $inf = $this->replaceContents($inf, $toReplace); + file_put_contents($this->vdir . 'autorun.inf', $inf); + } +} + +?> \ No newline at end of file diff --git a/inc/ws/Util/packager/class.ws.packager.win.exe.php b/inc/ws/Util/packager/class.ws.packager.win.exe.php new file mode 100644 index 000000000..2ebd4e4fe --- /dev/null +++ b/inc/ws/Util/packager/class.ws.packager.win.exe.php @@ -0,0 +1,28 @@ +version = 'win-exe'; + + $this->exeName = cubeText::str2URL(mb_substr($this->book->parametres->title, 0, 16)).'.exe'; + } + + protected function preparePackage() + { + parent::preparePackage(); + + $this->copyFluidbookFiles(); + $this->copyOtherFiles(array('Fluidbook.exe' => $this->exeName)); + } + + public function makePackage() + { + parent::makePackage(); + return $this->zip(); + } +} + +?> \ No newline at end of file diff --git a/inc/ws/Util/packager/class.ws.packager.win.inst.php b/inc/ws/Util/packager/class.ws.packager.win.inst.php new file mode 100644 index 000000000..d5f9b8720 --- /dev/null +++ b/inc/ws/Util/packager/class.ws.packager.win.inst.php @@ -0,0 +1,59 @@ +version = 'win-ins'; + } + + protected function preparePackage() + { + parent::preparePackage(); + + $this->copyFluidbookFiles(); + $this->copyOtherFiles(array('Fluidbook.exe' => $this->exeName)); + + $this->makeNSI(); + } + + protected function makeNSI() + { + global $core; + + $winvdir = trim($this->vdir, '/'); + $winvdir = str_replace('/', '\\' , $winvdir); + $winvdir = "\\" . $winvdir; + + $daoLang = new wsDAOLang($core->con); + $lang = $daoLang->selectById($this->book->lang); + + $nsi = file_get_contents(WS_COMPILE_ASSETS . '/script.nsi'); + $nsi = str_replace('$name', utf8_decode($this->book->parametres->title), $nsi); + $nsi = str_replace('$htmldir', utf8_decode(WS_COMPILE_ASSETS), $nsi); + $nsi = str_replace('$fname', str_replace('.exe', '', $this->exeName), $nsi); + $nsi = str_replace('$fdir', $winvdir, $nsi); + $nsi = str_replace('$titre', utf8_decode($this->book->parametres->title), $nsi); + $nsi = str_replace('$lang', utf8_decode($lang->nsis), $nsi); + $nsi = str_replace('$nsisdir', '/usr/local/nsis/nsis-2.46/share/nsis', $nsi); + $nsi = str_replace('$output', $this->getPathBase('exe'), $nsi); + + $this->nsi = $nsi; + } + public function makePackage() + { + $this->preparePackage(); + $url = 'http://installer.fluidbook.com/make.php?nsi=' . base64_encode($this->nsi) ; + fb($url); + + file_get_contents('http://installer.fluidbook.com/make.php?nsi=' . base64_encode($this->nsi) . '&junk=' . TIME); + return $this->getURLBase('exe'); + } + + public function __destruct() + { + } +} + +?> \ No newline at end of file