]> _ Git - cubeextranet.git/commitdiff
wip #1077 @1
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 18 Jan 2017 12:03:46 +0000 (12:03 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 18 Jan 2017 12:03:46 +0000 (12:03 +0000)
inc/ws/Util/class.ws.exporter.php
inc/ws/Util/packager/class.ws.packager.php

index 1fcfc68297ebf1b0ec945135d75c58622fdafd15..5008d2e40490bc43edb2350f217478bea5db693e 100644 (file)
@@ -318,10 +318,10 @@ class wsExporter {
        }
 
        protected function _install() {
-               $package = wsPackager::package($this->book_id, $this->version, $this->_haveToZip());
+               $p = wsPackager::package($this->book_id, $this->version, $this->_haveToZip(),false);
 
-               if (strpos($package, '/fluidbook') == 0) {
-                       $package = ROOT . $package;
+               if (strpos($p, '/fluidbook') == 0) {
+                       $p = ROOT . $p;
                }
 
 
@@ -330,7 +330,6 @@ class wsExporter {
                        $root = '/mnt/sshfs/fluidbook/www/references/';
                        $rootURL = 'https://www.fluidbook.com/references/';
                } else if ($this->action == 'hosting') {
-                       //$root = 'fluidbook@hosting.fluidbook.com:/home/fluidbook/hosting/';
                        $root = '/mnt/sshfs/fluidbook/hosting/';
                        $rootURL = 'http://hosting.fluidbook.com/';
                } else if ($this->action == 'ftp') {
@@ -346,9 +345,9 @@ class wsExporter {
                }
 
                if (stristr($path, 'ftp://')) {
-                       $this->_lftp($package, $path, false);
+                       $this->_lftp($p, $path, false);
                } else {
-                       $this->_rsync($package, $path);
+                       $this->_rsync($p, $path);
                }
 
                if (!is_null($rootURL)) {
@@ -425,7 +424,7 @@ class wsExporter {
        }
 
        protected function _rsync($src, $dest, $erase = false, $chown = null) {
-               if (is_file($src)) {
+               /*if (is_file($src)) {
                        $dir = dirname($dest);
                        if (!file_exists($dir)) {
                                mkdir($dir, 0777, true);
@@ -435,7 +434,7 @@ class wsExporter {
                                `chown $chown $dest`;
                        }
                        return;
-               }
+               }*/
 
                $cl = new CubeIT_CommandLine_Rsync($src, $dest, $erase);
                $cl->setProg('/usr/bin/rsync');
index c5d680bd6cb2d0aff75fae99c7d7446e31b54670..35d093c6a54b113a77d91ebf059a2fcc001562e6 100644 (file)
@@ -17,7 +17,7 @@ class wsPackager {
        protected $_clean = true;
        public $cleanOnDestruct = true;
 
-       public static function package($book_id, $version, $zip = true) {
+       public static function package($book_id, $version, $zip = true, $cleanOnDestruct = true) {
                global $packager;
 
                cubePHP::neverStop();
@@ -38,6 +38,7 @@ class wsPackager {
                } else if ($version == 'phonegap') {
                        $packager = new wsPackagerPhonegap($book_id);
                }
+               $packager->cleanOnDestruct = $packager->cleanOnDestruct && $cleanOnDestruct;
 
                return $packager->makePackage($zip);
        }