Changeset View
Changeset View
Standalone View
Standalone View
support/ArcanistRuntime.php
- This file was copied from scripts/init/init-arcanist.php.
| Show All 11 Lines | public function execute(array $argv) { | ||||
| if ($err) { | if ($err) { | ||||
| return $err; | return $err; | ||||
| } | } | ||||
| PhutilTranslator::getInstance() | PhutilTranslator::getInstance() | ||||
| ->setLocale(PhutilLocale::loadLocale('en_US')) | ->setLocale(PhutilLocale::loadLocale('en_US')) | ||||
| ->setTranslations(PhutilTranslation::getTranslationMapForLocale('en_US')); | ->setTranslations(PhutilTranslation::getTranslationMapForLocale('en_US')); | ||||
| ini_set('memory_limit', -1); | |||||
| try { | try { | ||||
| return $this->executeCore($argv); | return $this->executeCore($argv); | ||||
| } catch (PhutilArgumentUsageException $ex) { | } catch (PhutilArgumentUsageException $ex) { | ||||
| fwrite( | fwrite( | ||||
| STDERR, | STDERR, | ||||
| tsprintf( | tsprintf( | ||||
| "**%s:** %s\n", | "**%s:** %s\n", | ||||
| pht('Usage Exception'), | pht('Usage Exception'), | ||||
| ▲ Show 20 Lines • Show All 185 Lines • ▼ Show 20 Lines | private function includeCoreLibraries() { | ||||
| // | // | ||||
| // - Next to 'arcanist/'. | // - Next to 'arcanist/'. | ||||
| // - Anywhere in the normal PHP 'include_path'. | // - Anywhere in the normal PHP 'include_path'. | ||||
| // - Inside 'arcanist/externals/includes/'. | // - Inside 'arcanist/externals/includes/'. | ||||
| // | // | ||||
| // When looking in these places, we expect to find a 'libphutil/' directory. | // When looking in these places, we expect to find a 'libphutil/' directory. | ||||
| // The 'arcanist/' directory. | // The 'arcanist/' directory. | ||||
| $arcanist_dir = dirname(dirname(dirname(__FILE__))); | $arcanist_dir = dirname(dirname(__FILE__)); | ||||
| // The parent directory of 'arcanist/'. | // The parent directory of 'arcanist/'. | ||||
| $parent_dir = dirname($arcanist_dir); | $parent_dir = dirname($arcanist_dir); | ||||
| // The 'arcanist/externals/includes/' directory. | // The 'arcanist/externals/includes/' directory. | ||||
| $include_dir = implode( | $include_dir = implode( | ||||
| DIRECTORY_SEPARATOR, | DIRECTORY_SEPARATOR, | ||||
| array( | array( | ||||
| $arcanist_dir, | $arcanist_dir, | ||||
| 'externals', | 'externals', | ||||
| 'includes', | 'includes', | ||||
| )); | )); | ||||
| $php_include_path = ini_get('include_path'); | $php_include_path = ini_get('include_path'); | ||||
| $php_include_path = implode( | $php_include_path = implode( | ||||
| PATH_SEPARATOR, | PATH_SEPARATOR, | ||||
| array( | array( | ||||
| $parent_dir, | $parent_dir, | ||||
| $php_include_path, | $php_include_path, | ||||
| $include_dir, | $include_dir, | ||||
| )); | )); | ||||
| ini_set('include_path', $php_include_path); | ini_set('include_path', $php_include_path); | ||||
| // Load libphutil. | // Load libphutil. Note that this has some side effects, including | ||||
| // adjusting some PHP configuration values. | |||||
| @include_once 'libphutil/scripts/__init_script__.php'; | @include_once 'libphutil/scripts/__init_script__.php'; | ||||
| if (!@constant('__LIBPHUTIL__')) { | if (!@constant('__LIBPHUTIL__')) { | ||||
| return $this->fatalError( | return $this->fatalError( | ||||
| 'Unable to load libphutil. Put "libphutil/" next to "arcanist/"; '. | 'Unable to load libphutil. Put "libphutil/" next to "arcanist/"; '. | ||||
| 'or update your PHP "include_path" to include the parent directory '. | 'or update your PHP "include_path" to include the parent directory '. | ||||
| 'of "libphutil/"; or symlink "libphutil" into '. | 'of "libphutil/"; or symlink "libphutil" into '. | ||||
| '"arcanist/externals/includes/".'); | '"arcanist/externals/includes/".'); | ||||
| ▲ Show 20 Lines • Show All 333 Lines • Show Last 20 Lines | |||||