]> _ Git - cubeextranet.git/commitdiff
wip #819 @1:10
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 6 Mar 2018 17:48:36 +0000 (17:48 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 6 Mar 2018 17:48:36 +0000 (17:48 +0000)
inc/ws/Controlleur/class.ws.ajax.php
inc/ws/Util/packager/class.ws.packager.mac.exe.html.php [new file with mode: 0644]
inc/ws/Util/packager/class.ws.packager.php
inc/ws/Util/packager/class.ws.packager.win.exe.html.php

index 50f3d0e450c74487ce5842e134d26dd27a91ee27..bb9ba2e7f716d19385de9f8e62cb22eff8f4f723 100644 (file)
@@ -969,7 +969,11 @@ class wsAjax extends cubeAjax {
                                       'win-html' => 'zip',
                                       'mac-exe' => 'zip',
                                       'win-cd' => 'zip',
-                                      'phonegap' => 'zip');
+                                      'phonegap' => 'zip',
+                                      'mac-exe-html' => 'zip',
+                                      'win-exe-html' => 'zip',
+                                      'win-inst-html' => 'zip',
+                                      'win-cd-html' => 'zip');
 
                $defaultVersion = isset($_POST['version']) ? $_POST['version'] : 'online';
                $version = '<tr><td class="right">' . __('Version') . '</td><td>' . form::combo('version', wsUrl::getFluidbookVersions(true), $defaultVersion) . '</td></tr>';
diff --git a/inc/ws/Util/packager/class.ws.packager.mac.exe.html.php b/inc/ws/Util/packager/class.ws.packager.mac.exe.html.php
new file mode 100644 (file)
index 0000000..e1e0ede
--- /dev/null
@@ -0,0 +1,25 @@
+<?php\r
+\r
+class wsPackagerMacEXEHTML extends wsPackagerWinEXEHTML {\r
+       protected $nwplatform = 'osx64';\r
+\r
+       public function __construct($book_id) {\r
+               parent::__construct($book_id);\r
+               $this->version = 'mac-exe-inst';\r
+               $this->book->parametres->alwaysHTML5 = true;\r
+\r
+               $this->exeName = cubeText::str2URL(mb_substr($this->book->parametres->title, 0, 30));\r
+       }\r
+\r
+       public function makePackage($zip) {\r
+               $this->preparePackage();\r
+               $toDelete = ['chromedriver', 'credits.html', 'minidump_stackwalk', 'nwjc', 'payload'];\r
+               foreach ($toDelete as $item) {\r
+                       $p = $this->getFinalPackageDir() . '/' . $item;\r
+                       `rm -rf "$p"`;\r
+               }\r
+               $res = $this->zip(null);\r
+               $this->postPackage();\r
+               return $res;\r
+       }\r
+}\r
index dfbddbd07e190d23b807283e92bf38825e4efc32..d7634ea488abf06746196f39caaed447dd3aed3e 100644 (file)
@@ -179,6 +179,7 @@ class wsPackager {
                $zip = new cubeCommandLine('zip');
                $zip->cd($this->getFinalPackageDir());
                $zip->setArg(null, $zipfile);
+               $zip->setArg('symlinks');
                $zip->setArg('0');
                $zip->setArg('r');
                $zip->setArg('u');
index 200e543d2337ce86f3e0c670238b86d6bd6fc2c9..abe424dba0d2540bd018130c4c439db3dc284968 100644 (file)
@@ -5,6 +5,7 @@ class wsPackagerWinEXEHTML extends wsPackager {
        protected $exeName;\r
        protected $appName;\r
        protected $buildPath;\r
+       protected $nwplatform = 'win32';\r
 \r
        public function __construct($book_id) {\r
                parent::__construct($book_id, null, true, true);\r
@@ -36,7 +37,7 @@ class wsPackagerWinEXEHTML extends wsPackager {
 \r
                $cl = new CubeIT_CommandLine('/data/extranet/node_modules/nw-builder/bin/nwbuild');\r
                $cl->setPath(CONVERTER_PATH);\r
-               $cl->setArg('p', 'win32');\r
+               $cl->setArg('p', $this->nwplatform);\r
                $cl->setArg('o', $this->buildPath);\r
                $cl->setArg(null, $this->vdir);\r
                $cl->execute();\r
@@ -58,7 +59,7 @@ class wsPackagerWinEXEHTML extends wsPackager {
        }\r
 \r
        public function getFinalPackageDir() {\r
-               return $this->buildPath . '/' . $this->exeName . '/win32';\r
+               return $this->buildPath . '/' . $this->exeName . '/' . $this->nwplatform;\r
        }\r
 \r
        protected function compile() {\r