Differential D20788 Diff 49566 src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php
| Show First 20 Lines • Show All 139 Lines • ▼ Show 20 Lines | if ($use_database) { | ||||
| 'Wrote configuration key "%s" to database storage.', | 'Wrote configuration key "%s" to database storage.', | ||||
| $key); | $key); | ||||
| } else { | } else { | ||||
| $config_source = new PhabricatorConfigLocalSource(); | $config_source = new PhabricatorConfigLocalSource(); | ||||
| $local_path = $config_source->getReadablePath(); | $local_path = $config_source->getReadablePath(); | ||||
| try { | try { | ||||
| Filesystem::assertWritable($local_path); | $config_source->setKeys(array($key => $value)); | ||||
| } catch (FilesystemException $ex) { | } catch (FilesystemException $ex) { | ||||
| throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
| pht( | pht( | ||||
| 'Local path "%s" is not writable. This file must be writable '. | 'Local path "%s" is not writable. This file must be writable '. | ||||
| 'so that "bin/config" can store configuration.', | 'so that "bin/config" can store configuration.', | ||||
| Filesystem::readablePath($local_path))); | Filesystem::readablePath($local_path))); | ||||
| } | } | ||||
| $config_source->setKeys(array($key => $value)); | |||||
| $write_message = pht( | $write_message = pht( | ||||
| 'Wrote configuration key "%s" to local storage (in file "%s").', | 'Wrote configuration key "%s" to local storage (in file "%s").', | ||||
| $key, | $key, | ||||
| $local_path); | $local_path); | ||||
| } | } | ||||
| echo tsprintf( | echo tsprintf( | ||||
| "<bg:green>** %s **</bg> %s\n", | "<bg:green>** %s **</bg> %s\n", | ||||
| pht('DONE'), | pht('DONE'), | ||||
| $write_message); | $write_message); | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| } | } | ||||