From e2fcd24130123b2ed3d2de1ff2595f533c9ee096 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Fri, 29 Sep 2017 12:38:59 +0000 Subject: [PATCH] wip #1704 @1.5 --- .../Util/html5/bookedges/class.ws.html5.compiler.php | 12 ++++++++---- inc/ws/Util/html5/bookedges/class.ws.html5.links.php | 9 +++------ inc/ws/Util/html5/master/class.ws.html5.compiler.php | 4 +++- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/inc/ws/Util/html5/bookedges/class.ws.html5.compiler.php b/inc/ws/Util/html5/bookedges/class.ws.html5.compiler.php index 171ed99df..96cadae48 100644 --- a/inc/ws/Util/html5/bookedges/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/bookedges/class.ws.html5.compiler.php @@ -227,6 +227,8 @@ class wsHTML5Compiler { $firstDoc = $daoDoc->selectById($this->pages[1]['document_id']); $size = $firstDoc->generalInfos['size']; + $this->log('Got data from database'); + $this->width = round($size[0], 3); $this->height = round($size[1], 3); @@ -253,6 +255,8 @@ class wsHTML5Compiler { $this->numerotation = explode(',', $this->book->numerotation); $this->config = cubeObject::merge($this->book->parametres->toStandardObject(), $this->theme->parametres->toStandardObject()); + + $this->log('Defined dimensions'); } public function log($step) { @@ -335,8 +339,8 @@ class wsHTML5Compiler { $this->log('Extras written'); $this->writeJs(); $this->log('Js written'); - $this->vdir->sync(true); + $this->log('Files Synced'); } protected function loadPlugins() { @@ -511,7 +515,7 @@ class wsHTML5Compiler { $favicon = ''; if ($this->theme->parametres->favicon != '') { - copy($this->themeRoot . '/' . $this->theme->parametres->favicon, $this->vdir . '/data/favicon.png'); + $this->vdir->copy($this->themeRoot . '/' . $this->theme->parametres->favicon, 'data/favicon.png'); $favicon = ''; } @@ -1278,7 +1282,7 @@ class wsHTML5Compiler { $logo = '#logo{'; if ($this->theme->parametres->logo) { $this->vdir->copy($this->themeRoot . '/' . $this->theme->parametres->logo, '/data/images/' . $this->theme->parametres->logo); - $dim = getimagesize($this->vdir . '/data/images/' . $this->theme->parametres->logo); + $dim = getimagesize($this->themeRoot . '/' . $this->theme->parametres->logo); $logo .= 'background-image:url(../images/' . $this->theme->parametres->logo . ');width:' . $dim[0] . 'px;height:' . $dim[1] . 'px;'; } $logo .= '}'; @@ -1499,7 +1503,7 @@ class wsHTML5Compiler { public function simpleCopyLinkFile($source, $dest, $addVdir = true) { if ($addVdir) { - $dest = $this->vdir . '/' . $dest; + $dest = $dest; } $this->vdir->copy($source, $dest); diff --git a/inc/ws/Util/html5/bookedges/class.ws.html5.links.php b/inc/ws/Util/html5/bookedges/class.ws.html5.links.php index 38778093c..97b7eb451 100644 --- a/inc/ws/Util/html5/bookedges/class.ws.html5.links.php +++ b/inc/ws/Util/html5/bookedges/class.ws.html5.links.php @@ -829,14 +829,11 @@ class htmlMultimediaLink extends wsHTML5Link { $this->copyExternalDir($d['dir']); } elseif ($ext == 'html') { $fdir = 'data/links'; - $dir = $this->compiler->vdir . '/' . $fdir; + $dir = $fdir; $d = array('fdir' => $fdir, 'dir' => $dir); - if (!file_exists($d['dir'])) { - fb($d['dir']); - mkdir($d['dir'], 0777, true); - } - copy($this->compiler->wdir . '/' . $this->alternative, $d['dir'] . '/' . $this->alternative); + + $this->compiler->vdir->copy($this->compiler->wdir . '/' . $this->alternative, $d['dir'] . '/' . $this->alternative); $this->_config = $this->getConfigHTML($d['dir'], $this->alternative); $this->copyExternalFile($d['dir'] . '/' . $this->alternative); } diff --git a/inc/ws/Util/html5/master/class.ws.html5.compiler.php b/inc/ws/Util/html5/master/class.ws.html5.compiler.php index 295a639ae..c7c9d6194 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -274,6 +274,7 @@ class wsHTML5Compiler { $time = $currenttime - $this->logtime; $log = $step . ' | ' . round($time, 3) . 's' . "\n"; fwrite($this->logfp, $log); + fflush($this->logfp); $this->logtime = $currenttime; } @@ -1051,9 +1052,10 @@ class wsHTML5Compiler { if ($ext == 'xlsx') { $this->config->basketReferences = wsUtil::excelToArray($referencesFile); if ($this->book->parametres->customLinkClass == 'AtlanticDownloadLink') { - $this->config->basketReferences = wsUtil::atlanticReferences($this->config->basketReferences,$this->vdir.'/local/'); + $this->config->basketReferences = wsUtil::atlanticReferences($this->config->basketReferences, $this->vdir . '/local/', array($this, 'log')); } } + $this->log("Done cart references"); } } $this->config->rasterizePages = cubeArray::parseRange($this->config->rasterizePages); -- 2.39.5