Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F106439466
PhabricatorConfigManagementDoneWorkflow.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
Tue, Mar 25, 18:00
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Mar 27, 18:00 (2 d)
Engine
blob
Format
Raw Data
Handle
25147507
Attached To
rPH Phabricator
PhabricatorConfigManagementDoneWorkflow.php
View Options
<?php
final
class
PhabricatorConfigManagementDoneWorkflow
extends
PhabricatorConfigManagementWorkflow
{
protected
function
didConstruct
()
{
$this
->
setName
(
'done'
)
->
setExamples
(
'**done** __activity__'
)
->
setSynopsis
(
pht
(
'Mark a manual upgrade activity as complete.'
))
->
setArguments
(
array
(
array
(
'name'
=>
'activities'
,
'wildcard'
=>
true
,
),
));
}
public
function
execute
(
PhutilArgumentParser
$args
)
{
$activities
=
$args
->
getArg
(
'activities'
);
if
(!
$activities
)
{
throw
new
PhutilArgumentUsageException
(
pht
(
'Specify an activity to mark as completed.'
));
}
foreach
(
$activities
as
$type
)
{
$activity
=
id
(
new
PhabricatorConfigManualActivity
())->
loadOneWhere
(
'activityType = %s'
,
$type
);
if
(!
$activity
)
{
throw
new
PhutilArgumentUsageException
(
pht
(
'Activity "%s" is not currently marked as required, so there '
.
'is no need to complete it.'
,
$type
));
}
else
{
$activity
->
delete
();
echo
tsprintf
(
"%s
\n
"
,
pht
(
'Marked activity "%s" as completed.'
,
$type
));
}
}
echo
tsprintf
(
"%s
\n
"
,
pht
(
'Done.'
));
return
0
;
}
}
Event Timeline
Log In to Comment