// specific libraries to load regardless of the state of the world. if ($load) { // Load the flag libraries. These must load, since the user specified them // explicitly. arcanist_load_libraries($load, $must_load = true, $lib_source = 'a "--load-phutil-library" flag', $working_copy, $config_trace_mode); } else { // Load libraries in system 'load' config. In contrast to global config, we // fail hard here because this file is edited manually, so if 'arc' breaks // that doesn't make it any more difficult to correct. arcanist_load_libraries(idx($system_config, 'load', array()), $must_load = true, $lib_source = 'the "load" setting in system config', $working_copy, $config_trace_mode); // Load libraries in global 'load' config, as per "arc set-config load". We // need to fail softly if these break because errors would prevent the user // from running "arc set-config" to correct them. arcanist_load_libraries(idx($global_config, 'load', array()), $must_load = false, $lib_source = 'the "load" setting in global config', $working_copy, $config_trace_mode); // Load libraries in ".arcconfig". Libraries here must load. arcanist_load_libraries($working_copy->getConfig('phutil_libraries'), $must_load = true, $lib_source = 'the "phutil_libraries" setting in ".arcconfig"', $working_copy, $config_trace_mode); } $user_config = ArcanistBaseWorkflow::readUserConfigurationFile(); $config = $working_copy->getConfig('arcanist_configuration'); if ($config) { $config = new $config(); } else { $config = new ArcanistConfiguration(); } $command = strtolower($args[0]); $args = array_slice($args, 1); $workflow = $config->buildWorkflow($command); if (!$workflow) { // If the user has an alias, like 'arc alias dhelp diff help', look it up // and substitute it. We do this only after trying to resolve the workflow // normally to prevent you from doing silly things like aliasing 'alias'
// Load the flag libraries. These must load, since the user specified them // explicitly. arcanist_load_libraries($load, $must_load = true, $lib_source = 'a "--load-phutil-library" flag', $working_copy); } else { // Load libraries in system 'load' config. In contrast to global config, we // fail hard here because this file is edited manually, so if 'arc' breaks // that doesn't make it any more difficult to correct. arcanist_load_libraries(idx($system_config, 'load', array()), $must_load = true, $lib_source = 'the "load" setting in system config', $working_copy); // Load libraries in global 'load' config, as per "arc set-config load". We // need to fail softly if these break because errors would prevent the user // from running "arc set-config" to correct them. arcanist_load_libraries(idx($global_config, 'load', array()), $must_load = false, $lib_source = 'the "load" setting in global config', $working_copy); // Load libraries in ".arcconfig". Libraries here must load. arcanist_load_libraries($working_copy->getProjectConfig('load'), $must_load = true, $lib_source = 'the "load" setting in ".arcconfig"', $working_copy); // Load libraries in ".arcconfig". Libraries here must load. arcanist_load_libraries(idx($runtime_config, 'load', array()), $must_load = true, $lib_source = 'the --config "load=[...]" argument', $working_copy); } $user_config = $configuration_manager->readUserConfigurationFile(); $config_class = $working_copy->getProjectConfig('arcanist_configuration'); if ($config_class) { $config = new $config_class(); } else { $config = new ArcanistConfiguration(); } $command = strtolower($args[0]); $args = array_slice($args, 1); $workflow = $config->selectWorkflow($command, $args, $configuration_manager, $console); $workflow->setConfigurationManager($configuration_manager); $workflow->setArcanistConfiguration($config); $workflow->setCommand($command); $workflow->setWorkingDirectory($working_directory);
// specific libraries to load regardless of the state of the world. if ($load) { // Load the flag libraries. These must load, since the user specified them // explicitly. arcanist_load_libraries($load, $must_load = true, $lib_source = 'a "--load-phutil-library" flag', $working_copy); } else { // Load libraries in system 'load' config. In contrast to global config, we // fail hard here because this file is edited manually, so if 'arc' breaks // that doesn't make it any more difficult to correct. arcanist_load_libraries(idx($system_config, 'load', array()), $must_load = true, $lib_source = 'the "load" setting in system config', $working_copy); // Load libraries in global 'load' config, as per "arc set-config load". We // need to fail softly if these break because errors would prevent the user // from running "arc set-config" to correct them. arcanist_load_libraries(idx($global_config, 'load', array()), $must_load = false, $lib_source = 'the "load" setting in global config', $working_copy); // Load libraries in ".arcconfig". Libraries here must load. arcanist_load_libraries($working_copy->getConfig('load'), $must_load = true, $lib_source = 'the "load" setting in ".arcconfig"', $working_copy); } $user_config = ArcanistBaseWorkflow::readUserConfigurationFile(); $config_class = $working_copy->getConfig('arcanist_configuration'); if ($config_class) { $config = new $config_class(); } else { $config = new ArcanistConfiguration(); } $command = strtolower($args[0]); $args = array_slice($args, 1); $workflow = $config->selectWorkflow($command, $args, $working_copy, $console); $workflow->setArcanistConfiguration($config); $workflow->setCommand($command); $workflow->setWorkingDirectory($working_directory); $workflow->parseArguments($args);