Page MenuHomestyx hydra

PhabricatorConfigManagementDeleteWorkflow.php
No OneTemporary

PhabricatorConfigManagementDeleteWorkflow.php

<?php
final class PhabricatorConfigManagementDeleteWorkflow
extends PhabricatorConfigManagementWorkflow {
protected function didConstruct() {
$this
->setName('delete')
->setExamples('**delete** __key__')
->setSynopsis('Delete a local configuration value.')
->setArguments(
array(
array(
'name' => 'args',
'wildcard' => true,
),
));
}
public function execute(PhutilArgumentParser $args) {
$console = PhutilConsole::getConsole();
$argv = $args->getArg('args');
if (count($argv) == 0) {
throw new PhutilArgumentUsageException(
'Specify a configuration key to delete.');
}
$key = $argv[0];
if (count($argv) > 1) {
throw new PhutilArgumentUsageException(
'Too many arguments: expected one key.');
}
$config = new PhabricatorConfigLocalSource();
$values = $config->getKeys(array($key));
if (!$values) {
throw new PhutilArgumentUsageException(
"Configuration key '{$key}' is not set in local configuration!");
}
$config->deleteKeys(array($key));
$console->writeOut(
pht("Deleted '%s' from local configuration.", $key)."\n");
}
}

File Metadata

Mime Type
text/x-php
Expires
Mon, Nov 24, 2:18 PM (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
360125
Default Alt Text
PhabricatorConfigManagementDeleteWorkflow.php (1 KB)

Event Timeline