Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96979606
AlmanacManagementLockWorkflow.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, Jan 1, 07:11
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Jan 3, 07:11 (2 d)
Engine
blob
Format
Raw Data
Handle
23304946
Attached To
rPH Phabricator
AlmanacManagementLockWorkflow.php
View Options
<?php
final
class
AlmanacManagementLockWorkflow
extends
AlmanacManagementWorkflow
{
protected
function
didConstruct
()
{
$this
->
setName
(
'lock'
)
->
setSynopsis
(
pht
(
'Lock a service to prevent it from being 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 lock.'
));
}
foreach
(
$services
as
$service
)
{
if
(
$service
->
getIsLocked
())
{
throw
new
PhutilArgumentUsageException
(
pht
(
'Service "%s" is already locked!'
,
$service
->
getName
()));
}
}
foreach
(
$services
as
$service
)
{
$this
->
updateServiceLock
(
$service
,
true
);
$console
->
writeOut
(
"**<bg:green> %s </bg>** %s
\n
"
,
pht
(
'LOCKED'
),
pht
(
'Service "%s" was locked.'
,
$service
->
getName
()));
}
return
0
;
}
}
Event Timeline
Log In to Comment