mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-12-23 05:50:54 +01:00
Restore old expanded include path rules for workflows which fall through
Summary: Ref T13490. Historically, "arc" was eager to load external libraries from many locations. I plan to make this significantly more structured/safer in the future (see T5055), but this rule got dropped as the "experimental" and "wilds" branches collapsed to "master". Restore "next to arcanist" and "inside externals/includes" as valid search locations for classic workflows. Test Plan: Ran "arc" commands in a working copy with a "load" library configured. Maniphest Tasks: T13490 Differential Revision: https://secure.phabricator.com/D21004
This commit is contained in:
parent
d3b77af8a5
commit
eb6edb2739
1 changed files with 38 additions and 1 deletions
|
@ -5,6 +5,43 @@ sanity_check_environment();
|
|||
|
||||
require_once dirname(__FILE__).'/__init_script__.php';
|
||||
|
||||
/**
|
||||
* Adjust 'include_path' to add locations where we'll search for libraries.
|
||||
* We look in these places:
|
||||
*
|
||||
* - Next to 'arcanist/'.
|
||||
* - Anywhere in the normal PHP 'include_path'.
|
||||
* - Inside 'arcanist/externals/includes/'.
|
||||
*/
|
||||
function arcanist_adjust_php_include_path() {
|
||||
// The 'arcanist/' directory.
|
||||
$arcanist_dir = dirname(dirname(__FILE__));
|
||||
|
||||
// The parent directory of 'arcanist/'.
|
||||
$parent_dir = dirname($arcanist_dir);
|
||||
|
||||
// The 'arcanist/externals/includes/' directory.
|
||||
$include_dir = implode(
|
||||
DIRECTORY_SEPARATOR,
|
||||
array(
|
||||
$arcanist_dir,
|
||||
'externals',
|
||||
'includes',
|
||||
));
|
||||
|
||||
$php_include_path = ini_get('include_path');
|
||||
$php_include_path = implode(
|
||||
PATH_SEPARATOR,
|
||||
array(
|
||||
$parent_dir,
|
||||
$php_include_path,
|
||||
$include_dir,
|
||||
));
|
||||
|
||||
ini_set('include_path', $php_include_path);
|
||||
}
|
||||
arcanist_adjust_php_include_path();
|
||||
|
||||
ini_set('memory_limit', -1);
|
||||
|
||||
$original_argv = $argv;
|
||||
|
@ -646,7 +683,7 @@ function arcanist_load_libraries(
|
|||
|
||||
$error = null;
|
||||
try {
|
||||
require_once $location.'/__phutil_library_init__.php';
|
||||
phutil_load_library($location);
|
||||
} catch (PhutilBootloaderException $ex) {
|
||||
$error = pht(
|
||||
"Failed to load phutil library at location '%s'. This library ".
|
||||
|
|
Loading…
Reference in a new issue