Changeset View
Changeset View
Standalone View
Standalone View
src/parser/xhpast/bin/xhpast_parse.php
| <?php | <?php | ||||
| /** | /** | ||||
| * @group xhpast | * @group xhpast | ||||
| */ | */ | ||||
| function xhpast_is_available() { | function xhpast_is_available() { | ||||
| static $available; | static $available; | ||||
| if ($available === null) { | if ($available === null) { | ||||
| $available = false; | $available = false; | ||||
| $bin = xhpast_get_binary_path(); | $bin = xhpast_get_binary_path(); | ||||
| if (Filesystem::pathExists($bin)) { | if (Filesystem::pathExists($bin)) { | ||||
| list($err, $stdout) = exec_manual('%s --version', $bin); | list($err, $stdout) = exec_manual('%s --version', $bin); | ||||
| if (!$err) { | if (!$err) { | ||||
| $version = trim($stdout); | $version = trim($stdout); | ||||
| if ($version === "xhpast version 0.62") { | if ($version === "xhpast version 5.5.8/1a") { | ||||
| $available = true; | $available = true; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| return $available; | return $available; | ||||
| } | } | ||||
| Show All 40 Lines | |||||