1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-24 15:52:41 +01:00
phorge-phorge/src/applications/feed/management/PhabricatorFeedManagementRepublishWorkflow.php
Joshua Spence 0a62f13464 Change double quotes to single quotes.
Summary: Ran `arc lint --apply-patches --everything` over rP, mainly to change double quotes to single quotes where appropriate. These changes also validate that the `ArcanistXHPASTLinter::LINT_DOUBLE_QUOTE` rule is working as expected.

Test Plan: Eyeballed it.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin, hach-que

Differential Revision: https://secure.phabricator.com/D9431
2014-06-09 11:36:50 -07:00

61 lines
1.5 KiB
PHP

<?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;
}
}