From: vincent@cubedesigners.com Date: Sun, 11 Nov 2012 17:13:06 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=2bbd18f91061a1dfd8aad2abf51ac340a0addbbc;p=cubeextranet.git --- diff --git a/inc/commons/class.common.core.php b/inc/commons/class.common.core.php index 28617c445..f2e973f18 100644 --- a/inc/commons/class.common.core.php +++ b/inc/commons/class.common.core.php @@ -380,6 +380,7 @@ class commonCore extends cubeCore { $db->books->dir_references('varchar', 256, false); $db->books->dir_hosting('varchar', 256, false); $db->books->dir_macbook_phonegap_ios('varchar', 256, false); + $db->books->dir_phonegap_android('varchar', 256, false); $db->books->dir_external('varchar', 256, false); $db->books->lucene_time('integer', 0, false); // Clés diff --git a/inc/ws/Controlleur/class.ws.ajax.php b/inc/ws/Controlleur/class.ws.ajax.php index 485363fc2..5c7d65229 100644 --- a/inc/ws/Controlleur/class.ws.ajax.php +++ b/inc/ws/Controlleur/class.ws.ajax.php @@ -255,8 +255,12 @@ class wsAjax extends cubeAjax { $version = 'v1'; } if (stristr($server, 'phonegap')) { - $version = 'phonegap'; - $packager = new wsPackagerPhonegap($book_id, null, true, false); + if (stristr($server, 'ios')) { + $os = 'ios'; + } elseif (stristr($server, 'android')) { + $os = 'android'; + } + $packager = new wsPackagerPhonegap($book_id, null, true, false, $os); $package = $packager->makePackage(false); } else { $package = wsPackager::package($book_id, $version, false); @@ -277,6 +281,13 @@ class wsAjax extends cubeAjax { $protocol = 'rsync'; } else if ($server == 'external') { $protocol = 'ftp'; + $root = 'ftp://'; + $passive = 'on'; + $url = null; + } else if ($server == 'phonegap_android') { + $protocol = 'ftp'; + $root = 'ftp://android:DlSa1LGw@paris.cubedesigners.com:22122/'; + $passive = 'off'; $url = null; } @@ -321,19 +332,24 @@ class wsAjax extends cubeAjax { fb(time(), 'end transfert'); } elseif ($protocol == 'ftp') { - $u = parse_url('ftp://' . $dir); + $u = parse_url($root . ltrim($dir, '/')); + if (!isset($u['port'])) { + $u['port'] = '21'; + } $commandes = array( + 'set ftp:passive-mode ' . $passive, 'mkdir -p ' . $u['path'], 'cd ' . $u['path'], 'lcd ' . $package, - 'mirror -Rve' + 'mirror -Rve --parallel=5' ); //$lftp->setManualArg( . '> mirror -Rv ' . $package); $lftp = new cubeCommandLine('lftp'); $lftp->setArg('u', $u['user'] . ',' . $u['pass']); + $lftp->setArg('p', $u['port']); $lftp->setArg('e', implode(';', $commandes)); $lftp->setArg(null, $u['host']); $lftp->execute(); diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index 44e1c2d0f..515cd1655 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -1019,6 +1019,9 @@ html{height:100%}' . "\n"; } elseif ($server == 'macbook_phonegap_ios') { $s = __("Projet Phonegap iOS"); $dir = $book->dir_macbook_phonegap_ios; + } elseif ($server == 'phonegap_android') { + $s = __("Projet Phonegap Android"); + $dir = $book->dir_phonegap_android; } elseif ($server == 'external') { $s = __('Serveur FTP externe') . ' : ftp://'; $dir = $book->dir_external; diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index 42dcf4423..117fd70c3 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -45,7 +45,7 @@ class wsDAOBook extends commonDAO { $book->dir_references = $r->dir_references; $book->dir_hosting = $r->dir_hosting; $book->dir_macbook_phonegap_ios = $r->dir_macbook_phonegap_ios; - $book->dir_phonegap_android = $r->dir_macbook_phonegap_android; + $book->dir_phonegap_android = $r->dir_phonegap_android; $book->dir_external = $r->dir_external; return $book; diff --git a/inc/ws/Util/html5/class.ws.html5.compiler.php b/inc/ws/Util/html5/class.ws.html5.compiler.php index 36d8cb5b8..4953f50ec 100644 --- a/inc/ws/Util/html5/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/class.ws.html5.compiler.php @@ -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"; diff --git a/inc/ws/Util/packager/class.ws.packager.phonegap.php b/inc/ws/Util/packager/class.ws.packager.phonegap.php index b7a5b2293..665688f3c 100644 --- a/inc/ws/Util/packager/class.ws.packager.phonegap.php +++ b/inc/ws/Util/packager/class.ws.packager.phonegap.php @@ -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');