Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F94128173
AlmanacManagementUnlockWorkflow.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Dec 4, 03:22
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Dec 6, 03:22 (2 d)
Engine
blob
Format
Raw Data
Handle
22719423
Attached To
rPH Phabricator
AlmanacManagementUnlockWorkflow.php
View Options
<?php
final
class
AlmanacManagementUnlockWorkflow
extends
AlmanacManagementWorkflow
{
public
function
didConstruct
()
{
$this
->
setName
(
'unlock'
)
->
setSynopsis
(
pht
(
'Unlock a service to allow it to be edited.'
))
->
setArguments
(
array
(
array
(
'name'
=>
'services'
,
'wildcard'
=>
true
,
),
));
}
public
function
execute
(
PhutilArgumentParser
$args
)
{
$console
=
PhutilConsole
::
getConsole
();
$services
=
$this
->
loadServices
(
$args
->
getArg
(
'services'
));
if
(!
$services
)
{
throw
new
PhutilArgumentUsageException
(
pht
(
'Specify at least one service to unlock.'
));
}
foreach
(
$services
as
$service
)
{
if
(!
$service
->
getIsLocked
())
{
throw
new
PhutilArgumentUsageException
(
pht
(
'Service "%s" is not locked!'
,
$service
->
getName
()));
}
}
foreach
(
$services
as
$service
)
{
$this
->
updateServiceLock
(
$service
,
false
);
$console
->
writeOut
(
"**<bg:green> %s </bg>** %s
\n
"
,
pht
(
'UNLOCKED'
),
pht
(
'Service "%s" was unlocked.'
,
$service
->
getName
()));
}
return
0
;
}
}
Event Timeline
Log In to Comment