Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F547960
PhabricatorFeedManagementRepublishWorkflow.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
PhabricatorFeedManagementRepublishWorkflow.php
View Options
<?php
final
class
PhabricatorFeedManagementRepublishWorkflow
extends
PhabricatorFeedManagementWorkflow
{
protected
function
didConstruct
()
{
$this
->
setName
(
'republish'
)
->
setExamples
(
'**republish** __story_key__'
)
->
setSynopsis
(
pht
(
'Republish a feed event to all consumers.'
))
->
setArguments
(
array
(
array
(
'name'
=>
'key'
,
'wildcard'
=>
true
,
),
));
}
public
function
execute
(
PhutilArgumentParser
$args
)
{
$console
=
PhutilConsole
::
getConsole
();
$viewer
=
$this
->
getViewer
();
$key
=
$args
->
getArg
(
'key'
);
if
(
count
(
$key
)
<
1
)
{
throw
new
PhutilArgumentUsageException
(
pht
(
'Specify a story key to republish.'
));
}
else
if
(
count
(
$key
)
>
1
)
{
throw
new
PhutilArgumentUsageException
(
pht
(
'Specify exactly one story key to republish.'
));
}
$key
=
head
(
$key
);
$story
=
id
(
new
PhabricatorFeedQuery
())
->
setViewer
(
$viewer
)
->
withChronologicalKeys
(
array
(
$key
))
->
executeOne
();
if
(!
$story
)
{
throw
new
PhutilArgumentUsageException
(
pht
(
'No story exists with key "%s"!'
,
$key
));
}
$console
->
writeOut
(
"%s
\n
"
,
pht
(
'Republishing story...'
));
PhabricatorWorker
::
setRunAllTasksInProcess
(
true
);
PhabricatorWorker
::
scheduleTask
(
'FeedPublisherWorker'
,
array
(
'key'
=>
$key
,
));
$console
->
writeOut
(
"%s
\n
"
,
pht
(
'Done.'
));
return
0
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 1:41 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
121784
Default Alt Text
PhabricatorFeedManagementRepublishWorkflow.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment