]> _ Git - cubeextranet.git/commitdiff
fix #2038 @1.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 22 Oct 2018 14:39:28 +0000 (14:39 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 22 Oct 2018 14:39:28 +0000 (14:39 +0000)
fluidbook/compile/fluidbook.png [new file with mode: 0644]
inc/commons/class.common.tools.php
inc/ws/Util/packager/class.ws.packager.mac.exe.html.php
inc/ws/Util/packager/class.ws.packager.win.exe.html.php

diff --git a/fluidbook/compile/fluidbook.png b/fluidbook/compile/fluidbook.png
new file mode 100644 (file)
index 0000000..983708a
Binary files /dev/null and b/fluidbook/compile/fluidbook.png differ
index 4826833167749482ed564a80a315d3dccd0e2186..126adb80c93193587daf1171829699d6f938eeae 100644 (file)
@@ -557,11 +557,12 @@ class commonTools
        public static function pngToIcns($file, $res)
        {
                if (!file_exists($file)) {
+                       die('!!!!');
                        return;
                }
                $icns = array(128, 256, 512);
 
-               $png2icns = new cubeCommandLine('png2icns');
+               $png2icns = new CubeIT_CommandLine('png2icns');
                $png2icns->setArg(null, $res);
 
                $tmp = array();
@@ -579,6 +580,7 @@ class commonTools
                }
 
                $png2icns->execute();
+               $png2icns->debug();
                foreach ($tmp as $item) {
                        unlink($tmp);
                }
@@ -1196,13 +1198,13 @@ class commonTools
                $url = $_GET['url'];
                $dir = '/data/extranet/www/cache/youtubedl';
                `cd $dir;youtube-dl $url`;
-               $fname=trim(`youtube-dl --get-filename $url`);
+               $fname = trim(`youtube-dl --get-filename $url`);
                $path = $dir . '/' . $fname;
 
 
                header('Content-Type: application/octet-stream');
-               header('Content-Disposition: attachment; filename="'.$fname.'"');
-               header('X-SendFile: '.$path);
+               header('Content-Disposition: attachment; filename="' . $fname . '"');
+               header('X-SendFile: ' . $path);
                ob_end_clean();
                exit;
        }
index db67c40fe830f20163d877d9ec2caec7bd014e2b..f6afc24535a92f089346c9e3691f2169d8d81f4c 100644 (file)
@@ -1,18 +1,23 @@
 <?php\r
 \r
-class wsPackagerMacEXEHTML extends wsPackagerWinEXEHTML {\r
+class wsPackagerMacEXEHTML extends wsPackagerWinEXEHTML\r
+{\r
        protected $nwplatform = 'osx64';\r
        protected $nwversion = '0.29.0';\r
-       protected $node_platform='mac';\r
+       protected $node_platform = 'mac';\r
+       protected $exenameMaxlength = 28;\r
 \r
-       public function __construct($book_id) {\r
+       public function __construct($book_id)\r
+       {\r
                parent::__construct($book_id);\r
                $this->version = 'mac-exe-html';\r
+\r
        }\r
 \r
-       public function makePackage($zip) {\r
+       public function makePackage($zip)\r
+       {\r
                $this->preparePackage();\r
-               $toDelete = ['chromedriver', 'credits.html', 'minidump_stackwalk', 'nwjc', 'payload'];\r
+               $toDelete = ['chromedriver', 'credits.html', 'minidump_stackwalk', 'nwjc', 'payload', 'v8_context_snapshot.bin', 'natives_blob.bin'];\r
                foreach ($toDelete as $item) {\r
                        $p = $this->getFinalPackageDir() . '/' . $item;\r
                        `rm -rf "$p"`;\r
@@ -26,11 +31,14 @@ class wsPackagerMacEXEHTML extends wsPackagerWinEXEHTML {
                return $res;\r
        }\r
 \r
-       public function getFinalPackageDir() {\r
-               return parent::getFinalPackageDir()  . $this->nwplatform . '/';\r
+       public function getFinalPackageDir()\r
+       {\r
+               $res = parent::getFinalPackageDir();\r
+               return $res;\r
        }\r
 \r
-       protected function preparePackage() {\r
+       protected function preparePackage()\r
+       {\r
                $this->initTempDir();\r
                $this->copyFluidbookFiles();\r
                $this->makeJSON();\r
@@ -44,6 +52,7 @@ class wsPackagerMacEXEHTML extends wsPackagerWinEXEHTML {
                $cl->setPath(CONVERTER_PATH);\r
                $cl->setArg('p', $this->nwplatform);\r
                $cl->setArg('o', $this->buildPath);\r
+               $cl->setArg('v', $this->nwversion);\r
                $cl->setArg('winIco', $this->vdir . '/icon.ico');\r
                $cl->setArg('macIcns', $this->vdir . '/icon.icns');\r
                $cl->setArg(null, $this->vdir);\r
index f4894e18cb897acc061edb2c6693c735a552e4ec..f33c43c56ab91895ca3936b8e866e8a7931d50f4 100644 (file)
@@ -2,14 +2,14 @@
 \r
 class wsPackagerWinEXEHTML extends wsPackager\r
 {\r
-\r
        protected $exeName;\r
        protected $appName;\r
        protected $buildPath;\r
        protected $nwplatform = 'windows-x32';\r
-       protected $nwversion = '0.29.2';\r
+       protected $nwversion = '0.34.0';\r
        protected $appversion = '';\r
        protected $node_platform = 'win';\r
+       protected $exenameMaxlength = 30;\r
 \r
        public function __construct($book_id)\r
        {\r
@@ -20,10 +20,10 @@ class wsPackagerWinEXEHTML extends wsPackager
                $this->_clean = false;\r
 \r
                if ($this->book->parametres->offlineTitle == "") {\r
-                       $this->exeName = cubeText::str2URL(mb_substr($this->book->parametres->title, 0, 30));\r
+                       $this->exeName = cubeText::str2URL(mb_substr($this->book->parametres->title, 0, $this->exenameMaxlength));\r
                        $this->appName = $this->book->parametres->title;\r
                } else {\r
-                       $this->exeName = cubeText::str2URL($this->book->parametres->offlineTitle);\r
+                       $this->exeName = cubeText::str2URL(mb_substr($this->book->parametres->offlineTitle, 0, $this->exenameMaxlength));\r
                        $this->appName = $this->book->parametres->offlineTitle;\r
                }\r
        }\r
@@ -75,18 +75,25 @@ class wsPackagerWinEXEHTML extends wsPackager
                ];\r
                $pngIcon = $this->vdir . '/icon.png';\r
                $winIcon = $this->vdir . '/icon.ico';\r
-               if ($this->theme->parametres->favicon == '') {\r
-                       $png = WS_COMPILE_ASSETS . '/fluidbook.png';\r
-                       $ico = WS_COMPILE_ASSETS . '/fluidbook.ico';\r
-               } else {\r
-                       $png = $this->vdir . '/data/favicon.png';\r
-                       $ico = $this->vdir . '/data/favicon.ico';\r
+\r
+               $png = WS_COMPILE_ASSETS . '/fluidbook.png';\r
+               $ico = WS_COMPILE_ASSETS . '/fluidbook.ico';\r
+\r
+               if ($this->theme->parametres->favicon != '') {\r
+                       if (file_exists($this->vdir . '/data/favicon.png')) {\r
+                               $png = $this->vdir . '/data/favicon.png';\r
+                       }\r
+                       if (file_exists($this->vdir . '/data/favicon.ico')) {\r
+                               $ico = $this->vdir . '/data/favicon.ico';\r
+                       }\r
                }\r
 \r
                $icns = $this->vdir . '/icon.icns';\r
                $this->copy($png, $pngIcon);\r
                $this->copy($ico, $winIcon);\r
+\r
                commonTools::pngToIcns($png, $icns);\r
+\r
                file_put_contents($this->vdir . '/package.json', json_encode($data));\r
        }\r
 \r
@@ -127,10 +134,8 @@ class wsPackagerWinEXEHTML extends wsPackager
                $cp->setArg(null, $this->vdir);\r
                $cp->execute();\r
 \r
-\r
                $this->copyExtras();\r
                $this->copyNodeModules();\r
-\r
        }\r
 \r
        protected function copyExtras()\r