2013-12-27 13:15:40 -08:00
|
|
|
<?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();
|
|
|
|
}
|
|
|
|
|
2015-01-30 11:29:05 -08:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2016-03-25 05:56:16 -07:00
|
|
|
protected function newContentSource() {
|
|
|
|
return PhabricatorContentSource::newForSource(
|
|
|
|
PhabricatorConsoleContentSource::SOURCECONST);
|
|
|
|
}
|
|
|
|
|
2013-12-27 13:15:40 -08:00
|
|
|
}
|