]> _ Git - cubeextranet.git/commitdiff
wip #1704 @1.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 29 Sep 2017 12:38:59 +0000 (12:38 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 29 Sep 2017 12:38:59 +0000 (12:38 +0000)
inc/ws/Util/html5/bookedges/class.ws.html5.compiler.php
inc/ws/Util/html5/bookedges/class.ws.html5.links.php
inc/ws/Util/html5/master/class.ws.html5.compiler.php

index 171ed99dfff4af186d9646f8372cdae1c3d38ea9..96cadae48d89be278b6a5b49da1ef2dd0d885208 100644 (file)
@@ -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 = '<link rel="apple-touch-icon" href="data/favicon.png" />';
                }
 
@@ -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);
index 38778093c9e75b874f050ea61f96ae2a8fd2704e..97b7eb451992b498b4e20427e315b2e1329f2d24 100644 (file)
@@ -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);
                        }
index 295a639aedbcc49d3314bb4795f5ed0ec2ead591..c7c9d6194364886337fd7cfc1889bedf80f705a4 100644 (file)
@@ -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);