From 56e7c3cd78640c8a351bc3993ee0d74675719dc5 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Wed, 12 Apr 2017 16:08:29 +0000 Subject: [PATCH] done #1343 @4 --- inc/ws/Controlleur/class.ws.maintenance.php | 38 +++++++++++++++++-- inc/ws/Metier/class.ws.book.parametres.php | 14 +++++-- inc/ws/Util/html5/class.ws.html5.compiler.php | 6 +-- 3 files changed, 49 insertions(+), 9 deletions(-) diff --git a/inc/ws/Controlleur/class.ws.maintenance.php b/inc/ws/Controlleur/class.ws.maintenance.php index a16fa44cc..b758b543d 100644 --- a/inc/ws/Controlleur/class.ws.maintenance.php +++ b/inc/ws/Controlleur/class.ws.maintenance.php @@ -858,9 +858,41 @@ class wsMaintenance { } public static function updateHTML5Sources($args = array(), $externals = true) { - $svn = new cubeCommandLine('updatewshtml5prod'); - $svn->setPath(CONVERTER_PATH); - $svn->execute(); + $branchesDir = WS_COMPILE_ASSETS . '/player/branches/'; + $git = new CubeIT_CommandLine_Git($branchesDir . 'fluidbook-html5'); + echo '
';
+		echo $git->executeCmd('pull --all');
+		$git = new CubeIT_CommandLine_Git($branchesDir . 'fluidbook-html5');
+		$b = $git->executeCmd('branch -r');
+		echo $b;
+		$bb = explode("\n", $b);
+		$branches = array();
+		foreach ($bb as $item) {
+			$item = trim($item);
+			if ($item == '') {
+				continue;
+			}
+			$e = explode('->', $item);
+			if (count($e) == 2) {
+				$item = $e[1];
+			} else {
+				$item = $e[0];
+			}
+			$e = explode("/", $item);
+			$branches[trim($e[1])] = true;
+		}
+		$branches = array_keys($branches);
+		foreach ($branches as $b) {
+			echo '' . $b . '' . "\n";
+			if (!file_exists($branchesDir . $b)) {
+				$git = new CubeIT_CommandLine_Git($branchesDir);
+				echo $git->executeCmd('clone -b ' . $b . ' --single-branch git@git.cubedesigners.com:fluidbook-html5.git ' . $b);
+			}
+			$git = new CubeIT_CommandLine_Git($branchesDir . $b);
+			echo $git->executeCmd('pull');
+		}
+		echo '
'; + file_put_contents(WS_CACHE . '/activebranches', json_encode($branches)); } public static function cleanDownload($args) { diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index 40bbdecbf..2026f118c 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -321,9 +321,17 @@ class wsBookParametres extends wsParametres { $this->fields['navOrderH'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('Ordre des icônes dans la nav') . ' (' . __('Si différente') . ')', 'grade' => 3); - $this->fields['mobileLVersion'] = array('type' => 'combo', 'default' => 'stable', 'editable' => true, 'label' => __('Version logicielle'), 'grade' =>1, - 'datas' => array(__('Stable') => 'stable', - __('En cours de développement') => 'dev') + + $branches = array(__('Stable') => 'stable', + __('En cours de développement') => 'dev'); + $gitbranches = json_decode(file_get_contents(WS_CACHE . '/activebranches')); + foreach ($gitbranches as $b) { + $branches['Branch ' . $b] = 'branch:' . $b; + } + + $this->fields['mobileLVersion'] = array('type' => 'combo', 'default' => 'stable', 'editable' => true, + 'label' => __('Version logicielle'), 'grade' => 1, + 'datas' => $branches ); $this->fields['mobileTransitions'] = array('type' => 'combo', 'default' => 'flip', 'editable' => true, 'label' => __('Transitions entre les pages'), 'grade' => 3, diff --git a/inc/ws/Util/html5/class.ws.html5.compiler.php b/inc/ws/Util/html5/class.ws.html5.compiler.php index 5d72f815f..ead2b1353 100644 --- a/inc/ws/Util/html5/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/class.ws.html5.compiler.php @@ -11,10 +11,11 @@ class wsHTML5Compiler { } if ($version == 'stable') { - return new wsHTML5Compiler($book_id, 'stable', $phonegap, $phonegapVersion, $dir, $standalone, $appcache, $home); + $class = 'wsHTML5Compiler'; } else { - return new wsHTML5CompilerDev($book_id, 'dev', $phonegap, $phonegapVersion, $dir, $standalone, $appcache, $home); + $class = 'wsHTML5CompilerDev'; } + return new $class($book_id, $version, $phonegap, $phonegapVersion, $dir, $standalone, $appcache, $home); } protected static $resolutions = array(150, 300); @@ -523,7 +524,6 @@ class wsHTML5Compiler { $script .= '' . "\n"; } $script .= $iscript; - $description = ''; -- 2.39.5