]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Sun, 11 Nov 2012 17:13:06 +0000 (17:13 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Sun, 11 Nov 2012 17:13:06 +0000 (17:13 +0000)
inc/commons/class.common.core.php
inc/ws/Controlleur/class.ws.ajax.php
inc/ws/Controlleur/class.ws.url.php
inc/ws/DAO/class.ws.dao.book.php
inc/ws/Util/html5/class.ws.html5.compiler.php
inc/ws/Util/packager/class.ws.packager.phonegap.php

index 28617c445f7a607d116a05d1f8130d3fbd2b944d..f2e973f18853ef757883dbfcf8d0c73c55b79700 100644 (file)
@@ -380,6 +380,7 @@ class commonCore extends cubeCore {
                $db->books->dir_references('varchar', 256, false);\r
                $db->books->dir_hosting('varchar', 256, false);\r
                $db->books->dir_macbook_phonegap_ios('varchar', 256, false);\r
+               $db->books->dir_phonegap_android('varchar', 256, false);\r
                $db->books->dir_external('varchar', 256, false);\r
                $db->books->lucene_time('integer', 0, false);\r
                // Clés\r
index 485363fc2fe285041aac0c9cbbfbaf18b7dae7a7..5c7d6522927e09154b468b33a3b2aebd5be334dc 100644 (file)
@@ -255,8 +255,12 @@ class wsAjax extends cubeAjax {
                        $version = 'v1';\r
                }\r
                if (stristr($server, 'phonegap')) {\r
-                       $version = 'phonegap';\r
-                       $packager = new wsPackagerPhonegap($book_id, null, true, false);\r
+                       if (stristr($server, 'ios')) {\r
+                               $os = 'ios';\r
+                       } elseif (stristr($server, 'android')) {\r
+                               $os = 'android';\r
+                       }\r
+                       $packager = new wsPackagerPhonegap($book_id, null, true, false, $os);\r
                        $package = $packager->makePackage(false);\r
                } else {\r
                        $package = wsPackager::package($book_id, $version, false);\r
@@ -277,6 +281,13 @@ class wsAjax extends cubeAjax {
                        $protocol = 'rsync';\r
                } else if ($server == 'external') {\r
                        $protocol = 'ftp';\r
+                       $root = 'ftp://';\r
+                       $passive = 'on';\r
+                       $url = null;\r
+               } else if ($server == 'phonegap_android') {\r
+                       $protocol = 'ftp';\r
+                       $root = 'ftp://android:DlSa1LGw@paris.cubedesigners.com:22122/';\r
+                       $passive = 'off';\r
                        $url = null;\r
                }\r
 \r
@@ -321,19 +332,24 @@ class wsAjax extends cubeAjax {
                        fb(time(), 'end transfert');\r
                } elseif ($protocol == 'ftp') {\r
 \r
-                       $u = parse_url('ftp://' . $dir);\r
+                       $u = parse_url($root . ltrim($dir, '/'));\r
+                       if (!isset($u['port'])) {\r
+                               $u['port'] = '21';\r
+                       }\r
 \r
                        $commandes = array(\r
+                               'set ftp:passive-mode ' . $passive,\r
                                'mkdir -p ' . $u['path'],\r
                                'cd ' . $u['path'],\r
                                'lcd ' . $package,\r
-                               'mirror -Rve'\r
+                               'mirror -Rve --parallel=5'\r
                        );\r
 \r
                        //$lftp->setManualArg( . '> mirror -Rv ' . $package);\r
 \r
                        $lftp = new cubeCommandLine('lftp');\r
                        $lftp->setArg('u', $u['user'] . ',' . $u['pass']);\r
+                       $lftp->setArg('p', $u['port']);\r
                        $lftp->setArg('e', implode(';', $commandes));\r
                        $lftp->setArg(null, $u['host']);\r
                        $lftp->execute();\r
index 44e1c2d0f818272fb019f552a2a97ad0c68a7e5d..515cd1655f9d3ef47bb834dfdae7af0dbd383c88 100644 (file)
@@ -1019,6 +1019,9 @@ html{height:100%}' . "\n";
                } elseif ($server == 'macbook_phonegap_ios') {\r
                        $s = __("Projet Phonegap iOS");\r
                        $dir = $book->dir_macbook_phonegap_ios;\r
+               } elseif ($server == 'phonegap_android') {\r
+                       $s = __("Projet Phonegap Android");\r
+                       $dir = $book->dir_phonegap_android;\r
                } elseif ($server == 'external') {\r
                        $s = __('Serveur FTP externe') . ' : ftp://';\r
                        $dir = $book->dir_external;\r
index 42dcf44232f0cf6fd9f0d947d8db993068d6a322..117fd70c36946b7d8f86feade9c6df9cc29fc8f2 100644 (file)
@@ -45,7 +45,7 @@ class wsDAOBook extends commonDAO {
                $book->dir_references = $r->dir_references;\r
                $book->dir_hosting = $r->dir_hosting;\r
                $book->dir_macbook_phonegap_ios = $r->dir_macbook_phonegap_ios;\r
-               $book->dir_phonegap_android = $r->dir_macbook_phonegap_android;\r
+               $book->dir_phonegap_android = $r->dir_phonegap_android;\r
                $book->dir_external = $r->dir_external;\r
 \r
                return $book;\r
index 36d8cb5b8248e2f318da20d0d3d1c33bd1bc85fc..4953f50ec11a3c417bef7937e75f42275ba832ce 100644 (file)
@@ -667,7 +667,7 @@ class wsHTML5Compiler {
                        $this->config->$k = $v;
                }
                if ($this->phonegap) {
-                       $this->config->twitter = $this->config->facebook = false;
+                       $this->config->friend = $this->config->twitter = $this->config->facebook = false;
                }
                $this->config->standalone = $this->phonegap;
                return 'var DATAS=' . json_encode($this->config) . ';' . "\n";
index b7a5b2293ac962535afa28555e6de3be5f286657..665688f3ccfd8a835d2a2d2bdf615f67a30d862a 100644 (file)
@@ -4,9 +4,11 @@ class wsPackagerPhonegap extends wsPackager {
 
        protected $resources = '';
        protected $makeResources = true;
+       protected $os = 'ios';
 
-       public function __construct($book_id, $vdir = null, $whole = true, $makeResources = true) {
+       public function __construct($book_id, $vdir = null, $whole = true, $makeResources = true, $os = 'ios') {
                $this->makeResources = $makeResources;
+               $this->os = $os;
                parent::__construct($book_id, $vdir, $whole);
                $this->version = 'phonegap';
        }
@@ -14,7 +16,7 @@ class wsPackagerPhonegap extends wsPackager {
        protected function preparePackage() {
                parent::preparePackage();
 
-               $compiler = wsHTML5Compiler::factory($this->book_id, null, 'ios', $this->vdir);
+               $compiler = wsHTML5Compiler::factory($this->book_id, null, $this->os, $this->vdir);
                $compiler->compile();
 
                unlink($this->vdir . '/indext.html');