Changeset View
Changeset View
Standalone View
Standalone View
src/config/source/ArcanistUserConfigurationSource.php
<?php | <?php | ||||
final class ArcanistUserConfigurationSource | final class ArcanistUserConfigurationSource | ||||
extends ArcanistFilesystemConfigurationSource { | extends ArcanistFilesystemConfigurationSource { | ||||
public function getFileKindDisplayName() { | public function getFileKindDisplayName() { | ||||
return pht('User Config File'); | return pht('User Config File'); | ||||
} | } | ||||
public function isWritableConfigurationSource() { | |||||
return true; | |||||
} | |||||
public function getConfigurationSourceScope() { | |||||
return ArcanistConfigurationSource::SCOPE_USER; | |||||
} | |||||
public function didReadFilesystemValues(array $values) { | public function didReadFilesystemValues(array $values) { | ||||
// Before toolsets, the "~/.arcrc" file had separate top-level keys for | // Before toolsets, the "~/.arcrc" file had separate top-level keys for | ||||
// "config", "hosts", and "aliases". Transform this older file format into | // "config", "hosts", and "aliases". Transform this older file format into | ||||
// a more modern format. | // a more modern format. | ||||
if (!isset($values['config'])) { | if (!isset($values['config'])) { | ||||
// This isn't an older file, so just return the values unmodified. | // This isn't an older file, so just return the values unmodified. | ||||
return $values; | return $values; | ||||
Show All 23 Lines | public function didReadFilesystemValues(array $values) { | ||||
$result = $values['config']; | $result = $values['config']; | ||||
unset($values['config']); | unset($values['config']); | ||||
$result += $values; | $result += $values; | ||||
return $result; | return $result; | ||||
} | } | ||||
} | } | ||||
No newline at end of file | No newline at end of file |