Sfoglia il codice sorgente

[TravisCI] detect php version

Andy Li 9 anni fa
parent
commit
7f99b04da9
1 ha cambiato i file con 7 aggiunte e 1 eliminazioni
  1. 7 1
      tests/RunCi.hx

+ 7 - 1
tests/RunCi.hx

@@ -368,7 +368,13 @@ class RunCi {
 	static function getPhpDependencies() {
 		switch (systemName) {
 			case "Linux":
-				if (commandSucceed("php", ["-v"])) {
+				var phpCmd = commandResult("php", ["-v"]);
+				var phpVerReg = ~/PHP ([0-9]+\.[0-9]+)/i;
+				var phpVer = if (phpVerReg.match(phpCmd.stdout))
+					Std.parseFloat(phpVerReg.matched(1));
+				else
+					null;
+				if (phpCmd.exitCode == 0 && phpVer != null && phpVer >= 5.5) {
 					infoMsg('php has already been installed.');
 				} else {
 					requireAptPackages(["php5-cli", "php5-mysql", "php5-sqlite"]);