Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F971666
PhabricatorConfigManagementSetWorkflow.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorConfigManagementSetWorkflow.php
View Options
<?php
final
class
PhabricatorConfigManagementSetWorkflow
extends
PhabricatorConfigManagementWorkflow
{
protected
function
didConstruct
()
{
$this
->
setName
(
'set'
)
->
setExamples
(
'**set** __key__ __value__'
)
->
setSynopsis
(
'Set 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 and a value to set it to."
);
}
$key
=
$argv
[
0
];
if
(
count
(
$argv
)
==
1
)
{
throw
new
PhutilArgumentUsageException
(
"Specify a value to set the key '{$key}' to."
);
}
$value
=
$argv
[
1
];
if
(
count
(
$argv
)
>
2
)
{
throw
new
PhutilArgumentUsageException
(
"Too many arguments: expected one key and one value."
);
}
$config
=
new
PhabricatorConfigLocalSource
();
$config
->
setKeys
(
array
(
$key
=>
$value
));
$console
->
writeOut
(
pht
(
"Set '%s' to '%s' in local configuration."
,
$key
,
$value
).
"
\n
"
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, Jun 18, 5:53 AM (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
229226
Default Alt Text
PhabricatorConfigManagementSetWorkflow.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment