mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-07 05:11:05 +01:00
601aaa5a86
Summary: Ref T10537. For Nuance, I want to introduce new sources (like "GitHub" or "GitHub via Nuance" or something) but this needs to modularize eventually. Split ContentSource apart so applications can add new content sources. Test Plan: This change has huge surface area, so I'll hold it until post-release. I think it's fairly safe (and if it does break anything, the breaks should be fatals, not anything subtle or difficult to fix), there's just no reason not to hold it for a few hours. - Viewed new module page. - Grepped for all removed functions/constants. - Viewed some transactions. - Hovered over timestamps to get content source details. - Added a comment via Conduit. - Added a comment via web. - Ran `bin/storage upgrade --namespace XXXXX --no-quickstart -f` to re-run all historic migrations. - Generated some objects with `bin/lipsum`. - Ran a bulk job on some tasks. - Ran unit tests. {F1190182} Reviewers: chad Reviewed By: chad Maniphest Tasks: T10537 Differential Revision: https://secure.phabricator.com/D15521
34 lines
835 B
PHP
34 lines
835 B
PHP
<?php
|
|
|
|
abstract class PhabricatorManagementWorkflow extends PhutilArgumentWorkflow {
|
|
|
|
public function isExecutable() {
|
|
return true;
|
|
}
|
|
|
|
public function getViewer() {
|
|
// Some day, we might provide a more general viewer mechanism to scripts.
|
|
// For now, workflows can call this method for convenience and future
|
|
// flexibility.
|
|
return PhabricatorUser::getOmnipotentUser();
|
|
}
|
|
|
|
protected function parseTimeArgument($time) {
|
|
if (!strlen($time)) {
|
|
return null;
|
|
}
|
|
|
|
$epoch = strtotime($time);
|
|
if ($epoch <= 0) {
|
|
throw new PhutilArgumentUsageException(
|
|
pht('Unable to parse time "%s".', $time));
|
|
}
|
|
return $epoch;
|
|
}
|
|
|
|
protected function newContentSource() {
|
|
return PhabricatorContentSource::newForSource(
|
|
PhabricatorConsoleContentSource::SOURCECONST);
|
|
}
|
|
|
|
}
|