Changeset View
Changeset View
Standalone View
Standalone View
src/configuration/ArcanistSettings.php
<?php | <?php | ||||
final class ArcanistSettings extends Phobject { | final class ArcanistSettings extends Phobject { | ||||
private function getOptions() { | private function getOptions() { | ||||
return array( | $legacy_builtins = array( | ||||
'default' => array( | 'default' => array( | ||||
'type' => 'string', | 'type' => 'string', | ||||
'help' => pht( | 'help' => pht( | ||||
'The URI of a Phabricator install to connect to by default, if '. | 'The URI of a Phabricator install to connect to by default, if '. | ||||
'%s is run in a project without a Phabricator URI or run outside '. | '%s is run in a project without a Phabricator URI or run outside '. | ||||
'of a project.', | 'of a project.', | ||||
'arc'), | 'arc'), | ||||
'example' => '"http://phabricator.example.com/"', | 'example' => '"http://phabricator.example.com/"', | ||||
▲ Show 20 Lines • Show All 155 Lines • ▼ Show 20 Lines | $legacy_builtins = array( | ||||
'example' => 'false', | 'example' => 'false', | ||||
), | ), | ||||
'aliases' => array( | 'aliases' => array( | ||||
'type' => 'aliases', | 'type' => 'aliases', | ||||
'help' => pht( | 'help' => pht( | ||||
'Configured command aliases. Use "arc alias" to define aliases.'), | 'Configured command aliases. Use "arc alias" to define aliases.'), | ||||
), | ), | ||||
); | ); | ||||
$settings = ArcanistSetting::getAllSettings(); | |||||
foreach ($settings as $key => $setting) { | |||||
$settings[$key] = $setting->getLegacyDictionary(); | |||||
} | |||||
$results = $settings + $legacy_builtins; | |||||
ksort($results); | |||||
return $results; | |||||
} | } | ||||
private function getOption($key) { | private function getOption($key) { | ||||
return idx($this->getOptions(), $key, array()); | return idx($this->getOptions(), $key, array()); | ||||
} | } | ||||
public function getAllKeys() { | public function getAllKeys() { | ||||
return array_keys($this->getOptions()); | return array_keys($this->getOptions()); | ||||
▲ Show 20 Lines • Show All 165 Lines • Show Last 20 Lines |