Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93651205
DrydockManagementUpdateLeaseWorkflow.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
Sat, Nov 30, 11:01
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Dec 2, 11:01 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22683565
Attached To
rPH Phabricator
DrydockManagementUpdateLeaseWorkflow.php
View Options
<?php
final
class
DrydockManagementUpdateLeaseWorkflow
extends
DrydockManagementWorkflow
{
protected
function
didConstruct
()
{
$this
->
setName
(
'update-lease'
)
->
setSynopsis
(
pht
(
'Update a lease.'
))
->
setArguments
(
array
(
array
(
'name'
=>
'id'
,
'param'
=>
'id'
,
'repeat'
=>
true
,
'help'
=>
pht
(
'Lease ID to update.'
),
),
));
}
public
function
execute
(
PhutilArgumentParser
$args
)
{
$viewer
=
$this
->
getViewer
();
$ids
=
$args
->
getArg
(
'id'
);
if
(!
$ids
)
{
throw
new
PhutilArgumentUsageException
(
pht
(
'Specify one or more lease IDs to update with "%s".'
,
'--id'
));
}
$leases
=
id
(
new
DrydockLeaseQuery
())
->
setViewer
(
$viewer
)
->
withIDs
(
$ids
)
->
execute
();
PhabricatorWorker
::
setRunAllTasksInProcess
(
true
);
foreach
(
$ids
as
$id
)
{
$lease
=
idx
(
$leases
,
$id
);
if
(!
$lease
)
{
echo
tsprintf
(
"%s
\n
"
,
pht
(
'Lease "%s" does not exist.'
,
$id
));
continue
;
}
echo
tsprintf
(
"%s
\n
"
,
pht
(
'Updating lease "%s".'
,
$id
));
$lease
->
scheduleUpdate
();
}
}
}
Event Timeline
Log In to Comment