Exemple #1
0
     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);
 $workflow->parseArguments($args);
 // Write the command into the environment so that scripts (for example, local
 // Git commit hooks) can detect that they're being run via `arc` and change
 // their behaviors.
 putenv('ARCANIST=' . $command);
 if ($force_conduit_version) {
     $workflow->forceConduitVersion($force_conduit_version);
 }
 if ($conduit_timeout) {
     $workflow->setConduitTimeout($conduit_timeout);
 }
     // 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);
 if ($force_conduit_version) {
     $workflow->forceConduitVersion($force_conduit_version);
 }
 if ($conduit_timeout) {
     $workflow->setConduitTimeout($conduit_timeout);
 }
 $need_working_copy = $workflow->requiresWorkingCopy();
 $need_conduit = $workflow->requiresConduit();
 $need_auth = $workflow->requiresAuthentication();
 $need_repository_api = $workflow->requiresRepositoryAPI();
 $want_repository_api = $workflow->desiresRepositoryAPI();