Changeset View
Changeset View
Standalone View
Standalone View
src/runtime/ArcanistRuntime.php
| Show First 20 Lines • Show All 162 Lines • ▼ Show 20 Lines | final class ArcanistRuntime { | ||||
| * Perform some sanity checks against the possible diversity of PHP builds in | * Perform some sanity checks against the possible diversity of PHP builds in | ||||
| * the wild, like very old versions and builds that were compiled with flags | * the wild, like very old versions and builds that were compiled with flags | ||||
| * that exclude core functionality. | * that exclude core functionality. | ||||
| */ | */ | ||||
| private function checkEnvironment() { | private function checkEnvironment() { | ||||
| // NOTE: We don't have phutil_is_windows() yet here. | // NOTE: We don't have phutil_is_windows() yet here. | ||||
| $is_windows = (DIRECTORY_SEPARATOR != '/'); | $is_windows = (DIRECTORY_SEPARATOR != '/'); | ||||
| // We use stream_socket_pair() which is not available on Windows earlier. | // NOTE: There's a hard PHP version check earlier, in "init-script.php". | ||||
| $min_version = ($is_windows ? '5.3.0' : '5.2.3'); | |||||
| $cur_version = phpversion(); | |||||
| if (version_compare($cur_version, $min_version, '<')) { | |||||
| $message = sprintf( | |||||
| 'You are running a version of PHP ("%s"), which is older than the '. | |||||
| 'minimum supported version ("%s"). Update PHP to continue.', | |||||
| $cur_version, | |||||
| $min_version); | |||||
| throw new Exception($message); | |||||
| } | |||||
| if ($is_windows) { | if ($is_windows) { | ||||
| $need_functions = array( | $need_functions = array( | ||||
| 'curl_init' => array('builtin-dll', 'php_curl.dll'), | 'curl_init' => array('builtin-dll', 'php_curl.dll'), | ||||
| ); | ); | ||||
| } else { | } else { | ||||
| $need_functions = array( | $need_functions = array( | ||||
| 'curl_init' => array( | 'curl_init' => array( | ||||
| 'text', | 'text', | ||||
| "You need to install the cURL PHP extension, maybe with ". | "You need to install the cURL PHP extension, maybe with ". | ||||
| "'apt-get install php5-curl' or 'yum install php53-curl' or ". | "'apt-get install php5-curl' or 'yum install php53-curl' or ". | ||||
| "something similar.", | "something similar.", | ||||
| ), | ), | ||||
| 'json_decode' => array('flag', '--without-json'), | 'json_decode' => array('flag', '--without-json'), | ||||
| ); | ); | ||||
| } | } | ||||
| $problems = array(); | $problems = array(); | ||||
| $config = null; | $config = null; | ||||
| $show_config = false; | $show_config = false; | ||||
| foreach ($need_functions as $fname => $resolution) { | foreach ($need_functions as $fname => $resolution) { | ||||
| ▲ Show 20 Lines • Show All 273 Lines • ▼ Show 20 Lines | private function newToolset(array $argv) { | ||||
| } | } | ||||
| return $toolsets[$binary]; | return $toolsets[$binary]; | ||||
| } | } | ||||
| private function newWorkflows(ArcanistToolset $toolset) { | private function newWorkflows(ArcanistToolset $toolset) { | ||||
| $workflows = id(new PhutilClassMapQuery()) | $workflows = id(new PhutilClassMapQuery()) | ||||
| ->setAncestorClass('ArcanistWorkflow') | ->setAncestorClass('ArcanistWorkflow') | ||||
| ->setContinueOnFailure(true) | |||||
| ->execute(); | ->execute(); | ||||
| foreach ($workflows as $key => $workflow) { | foreach ($workflows as $key => $workflow) { | ||||
| if (!$workflow->supportsToolset($toolset)) { | if (!$workflow->supportsToolset($toolset)) { | ||||
| unset($workflows[$key]); | unset($workflows[$key]); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 160 Lines • Show Last 20 Lines | |||||