Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F94425
D7838.diff
All Users
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
35 KB
Referenced Files
None
Subscribers
None
D7838.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -1560,6 +1560,7 @@
'PhabricatorMainMenuIconView' => 'view/page/menu/PhabricatorMainMenuIconView.php',
'PhabricatorMainMenuSearchView' => 'view/page/menu/PhabricatorMainMenuSearchView.php',
'PhabricatorMainMenuView' => 'view/page/menu/PhabricatorMainMenuView.php',
+ 'PhabricatorManagementWorkflow' => 'infrastructure/management/PhabricatorManagementWorkflow.php',
'PhabricatorManiphestConfigOptions' => 'applications/maniphest/config/PhabricatorManiphestConfigOptions.php',
'PhabricatorManiphestTaskTestDataGenerator' => 'applications/maniphest/lipsum/PhabricatorManiphestTaskTestDataGenerator.php',
'PhabricatorMarkupCache' => 'applications/cache/storage/PhabricatorMarkupCache.php',
@@ -3020,7 +3021,7 @@
'DivinerReturnTableView' => 'AphrontTagView',
'DivinerSectionView' => 'AphrontTagView',
'DivinerStaticPublisher' => 'DivinerPublisher',
- 'DivinerWorkflow' => 'PhutilArgumentWorkflow',
+ 'DivinerWorkflow' => 'PhabricatorManagementWorkflow',
'DoorkeeperBridge' => 'Phobject',
'DoorkeeperBridgeAsana' => 'DoorkeeperBridge',
'DoorkeeperBridgeJIRA' => 'DoorkeeperBridge',
@@ -3099,7 +3100,7 @@
'DrydockManagementCreateResourceWorkflow' => 'DrydockManagementWorkflow',
'DrydockManagementLeaseWorkflow' => 'DrydockManagementWorkflow',
'DrydockManagementReleaseWorkflow' => 'DrydockManagementWorkflow',
- 'DrydockManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'DrydockManagementWorkflow' => 'PhabricatorManagementWorkflow',
'DrydockPHIDTypeBlueprint' => 'PhabricatorPHIDType',
'DrydockPHIDTypeLease' => 'PhabricatorPHIDType',
'DrydockPHIDTypeResource' => 'PhabricatorPHIDType',
@@ -3197,7 +3198,7 @@
'HarbormasterDAO' => 'PhabricatorLiskDAO',
'HarbormasterHTTPRequestBuildStepImplementation' => 'VariableBuildStepImplementation',
'HarbormasterManagementBuildWorkflow' => 'HarbormasterManagementWorkflow',
- 'HarbormasterManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'HarbormasterManagementWorkflow' => 'PhabricatorManagementWorkflow',
'HarbormasterObject' => 'HarbormasterDAO',
'HarbormasterPHIDTypeBuild' => 'PhabricatorPHIDType',
'HarbormasterPHIDTypeBuildItem' => 'PhabricatorPHIDType',
@@ -3672,7 +3673,7 @@
'PhabricatorAuditListView' => 'AphrontView',
'PhabricatorAuditMailReceiver' => 'PhabricatorObjectMailReceiver',
'PhabricatorAuditManagementDeleteWorkflow' => 'PhabricatorAuditManagementWorkflow',
- 'PhabricatorAuditManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorAuditManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorAuditPreviewController' => 'PhabricatorAuditController',
'PhabricatorAuditReplyHandler' => 'PhabricatorMailReplyHandler',
'PhabricatorAuthAccountView' => 'AphrontView',
@@ -3687,7 +3688,7 @@
'PhabricatorAuthManagementLDAPWorkflow' => 'PhabricatorAuthManagementWorkflow',
'PhabricatorAuthManagementRecoverWorkflow' => 'PhabricatorAuthManagementWorkflow',
'PhabricatorAuthManagementRefreshWorkflow' => 'PhabricatorAuthManagementWorkflow',
- 'PhabricatorAuthManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorAuthManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorAuthNeedsApprovalController' => 'PhabricatorAuthController',
'PhabricatorAuthNewController' => 'PhabricatorAuthProviderConfigController',
'PhabricatorAuthOldOAuthRedirectController' => 'PhabricatorAuthController',
@@ -3740,7 +3741,7 @@
'PhabricatorBusyExample' => 'PhabricatorUIExample',
'PhabricatorCacheDAO' => 'PhabricatorLiskDAO',
'PhabricatorCacheManagementPurgeWorkflow' => 'PhabricatorSearchManagementWorkflow',
- 'PhabricatorCacheManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorCacheManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorCalendarBrowseController' => 'PhabricatorCalendarController',
'PhabricatorCalendarController' => 'PhabricatorController',
'PhabricatorCalendarDAO' => 'PhabricatorLiskDAO',
@@ -3815,7 +3816,7 @@
'PhabricatorConfigManagementGetWorkflow' => 'PhabricatorConfigManagementWorkflow',
'PhabricatorConfigManagementListWorkflow' => 'PhabricatorConfigManagementWorkflow',
'PhabricatorConfigManagementSetWorkflow' => 'PhabricatorConfigManagementWorkflow',
- 'PhabricatorConfigManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorConfigManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorConfigOption' =>
array(
0 => 'Phobject',
@@ -3892,7 +3893,7 @@
'PhabricatorDaemonManagementStartWorkflow' => 'PhabricatorDaemonManagementWorkflow',
'PhabricatorDaemonManagementStatusWorkflow' => 'PhabricatorDaemonManagementWorkflow',
'PhabricatorDaemonManagementStopWorkflow' => 'PhabricatorDaemonManagementWorkflow',
- 'PhabricatorDaemonManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorDaemonManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorDataNotAttachedException' => 'Exception',
'PhabricatorDebugController' => 'PhabricatorController',
'PhabricatorDefaultFileStorageEngineSelector' => 'PhabricatorFileStorageEngineSelector',
@@ -3946,7 +3947,7 @@
'PhabricatorFactManagementDestroyWorkflow' => 'PhabricatorFactManagementWorkflow',
'PhabricatorFactManagementListWorkflow' => 'PhabricatorFactManagementWorkflow',
'PhabricatorFactManagementStatusWorkflow' => 'PhabricatorFactManagementWorkflow',
- 'PhabricatorFactManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorFactManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorFactRaw' => 'PhabricatorFactDAO',
'PhabricatorFactSimpleSpec' => 'PhabricatorFactSpec',
'PhabricatorFactUpdateIterator' => 'PhutilBufferedIterator',
@@ -3960,7 +3961,7 @@
1 => 'PhabricatorApplicationSearchResultsControllerInterface',
),
'PhabricatorFeedManagementRepublishWorkflow' => 'PhabricatorFeedManagementWorkflow',
- 'PhabricatorFeedManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorFeedManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorFeedPublicStreamController' => 'PhabricatorFeedController',
'PhabricatorFeedQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorFeedSearchEngine' => 'PhabricatorApplicationSearchEngine',
@@ -4029,7 +4030,7 @@
'PhabricatorFilesManagementMigrateWorkflow' => 'PhabricatorFilesManagementWorkflow',
'PhabricatorFilesManagementPurgeWorkflow' => 'PhabricatorFilesManagementWorkflow',
'PhabricatorFilesManagementRebuildWorkflow' => 'PhabricatorFilesManagementWorkflow',
- 'PhabricatorFilesManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorFilesManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorFlag' =>
array(
0 => 'PhabricatorFlagDAO',
@@ -4077,7 +4078,7 @@
'PhabricatorLegalpadPHIDTypeDocument' => 'PhabricatorPHIDType',
'PhabricatorLintEngine' => 'PhutilLintEngine',
'PhabricatorLipsumGenerateWorkflow' => 'PhabricatorLipsumManagementWorkflow',
- 'PhabricatorLipsumManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorLipsumManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorLipsumMondrianArtist' => 'PhabricatorLipsumArtist',
'PhabricatorLiskDAO' => 'LiskDAO',
'PhabricatorLocalDiskFileStorageEngine' => 'PhabricatorFileStorageEngine',
@@ -4119,7 +4120,7 @@
'PhabricatorMailManagementSendTestWorkflow' => 'PhabricatorSearchManagementWorkflow',
'PhabricatorMailManagementShowInboundWorkflow' => 'PhabricatorSearchManagementWorkflow',
'PhabricatorMailManagementShowOutboundWorkflow' => 'PhabricatorSearchManagementWorkflow',
- 'PhabricatorMailManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorMailManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorMailReceiverTestCase' => 'PhabricatorTestCase',
'PhabricatorMailingListPHIDTypeList' => 'PhabricatorPHIDType',
'PhabricatorMailingListQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
@@ -4135,6 +4136,7 @@
'PhabricatorMainMenuIconView' => 'AphrontView',
'PhabricatorMainMenuSearchView' => 'AphrontView',
'PhabricatorMainMenuView' => 'AphrontView',
+ 'PhabricatorManagementWorkflow' => 'PhutilArgumentWorkflow',
'PhabricatorManiphestConfigOptions' => 'PhabricatorApplicationConfigOptions',
'PhabricatorManiphestTaskTestDataGenerator' => 'PhabricatorTestDataGenerator',
'PhabricatorMarkupCache' => 'PhabricatorCacheDAO',
@@ -4305,7 +4307,7 @@
'PhabricatorPolicyInterface' => 'PhabricatorPHIDInterface',
'PhabricatorPolicyManagementShowWorkflow' => 'PhabricatorPolicyManagementWorkflow',
'PhabricatorPolicyManagementUnlockWorkflow' => 'PhabricatorPolicyManagementWorkflow',
- 'PhabricatorPolicyManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorPolicyManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorPolicyPHIDTypePolicy' => 'PhabricatorPHIDType',
'PhabricatorPolicyQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorPolicyRuleAdministrators' => 'PhabricatorPolicyRule',
@@ -4421,7 +4423,7 @@
'PhabricatorRepositoryManagementLookupUsersWorkflow' => 'PhabricatorRepositoryManagementWorkflow',
'PhabricatorRepositoryManagementMarkImportedWorkflow' => 'PhabricatorRepositoryManagementWorkflow',
'PhabricatorRepositoryManagementPullWorkflow' => 'PhabricatorRepositoryManagementWorkflow',
- 'PhabricatorRepositoryManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorRepositoryManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorRepositoryMercurialCommitChangeParserWorker' => 'PhabricatorRepositoryCommitChangeParserWorker',
'PhabricatorRepositoryMercurialCommitMessageParserWorker' => 'PhabricatorRepositoryCommitMessageParserWorker',
'PhabricatorRepositoryMirror' =>
@@ -4459,7 +4461,7 @@
'PhabricatorS3FileStorageEngine' => 'PhabricatorFileStorageEngine',
'PhabricatorSSHLog' => 'Phobject',
'PhabricatorSSHPassthruCommand' => 'Phobject',
- 'PhabricatorSSHWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorSSHWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorSavedQuery' =>
array(
0 => 'PhabricatorSearchDAO',
@@ -4480,7 +4482,7 @@
'PhabricatorSearchEngineMySQL' => 'PhabricatorSearchEngine',
'PhabricatorSearchHovercardController' => 'PhabricatorSearchBaseController',
'PhabricatorSearchManagementIndexWorkflow' => 'PhabricatorSearchManagementWorkflow',
- 'PhabricatorSearchManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorSearchManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorSearchOrderController' => 'PhabricatorSearchBaseController',
'PhabricatorSearchQuery' => 'PhabricatorSearchDAO',
'PhabricatorSearchResultView' => 'AphrontView',
@@ -4574,7 +4576,7 @@
'PhabricatorStorageManagementProbeWorkflow' => 'PhabricatorStorageManagementWorkflow',
'PhabricatorStorageManagementStatusWorkflow' => 'PhabricatorStorageManagementWorkflow',
'PhabricatorStorageManagementUpgradeWorkflow' => 'PhabricatorStorageManagementWorkflow',
- 'PhabricatorStorageManagementWorkflow' => 'PhutilArgumentWorkflow',
+ 'PhabricatorStorageManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorSubscribersQuery' => 'PhabricatorQuery',
'PhabricatorSubscriptionsEditController' => 'PhabricatorController',
'PhabricatorSubscriptionsEditor' => 'PhabricatorEditor',
diff --git a/src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php b/src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php
--- a/src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php
+++ b/src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php
@@ -178,10 +178,6 @@
return 0;
}
- private function getViewer() {
- return PhabricatorUser::getOmnipotentUser();
- }
-
private function loadUsers($users) {
$users = $this->parseList($users);
if (!$users) {
diff --git a/src/applications/audit/management/PhabricatorAuditManagementWorkflow.php b/src/applications/audit/management/PhabricatorAuditManagementWorkflow.php
--- a/src/applications/audit/management/PhabricatorAuditManagementWorkflow.php
+++ b/src/applications/audit/management/PhabricatorAuditManagementWorkflow.php
@@ -1,10 +1,6 @@
<?php
abstract class PhabricatorAuditManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
}
diff --git a/src/applications/auth/management/PhabricatorAuthManagementRecoverWorkflow.php b/src/applications/auth/management/PhabricatorAuthManagementRecoverWorkflow.php
--- a/src/applications/auth/management/PhabricatorAuthManagementRecoverWorkflow.php
+++ b/src/applications/auth/management/PhabricatorAuthManagementRecoverWorkflow.php
@@ -22,7 +22,7 @@
public function execute(PhutilArgumentParser $args) {
$can_recover = id(new PhabricatorPeopleQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($this->getViewer())
->withIsAdmin(true)
->execute();
if (!$can_recover) {
@@ -48,7 +48,7 @@
$username = head($usernames);
$user = id(new PhabricatorPeopleQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($this->getViewer())
->withUsernames(array($username))
->executeOne();
diff --git a/src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php b/src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php
--- a/src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php
+++ b/src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php
@@ -33,7 +33,7 @@
public function execute(PhutilArgumentParser $args) {
$console = PhutilConsole::getConsole();
- $viewer = PhabricatorUser::getOmnipotentUser();
+ $viewer = $this->getViewer();
$query = id(new PhabricatorExternalAccountQuery())
->setViewer($viewer);
diff --git a/src/applications/auth/management/PhabricatorAuthManagementWorkflow.php b/src/applications/auth/management/PhabricatorAuthManagementWorkflow.php
--- a/src/applications/auth/management/PhabricatorAuthManagementWorkflow.php
+++ b/src/applications/auth/management/PhabricatorAuthManagementWorkflow.php
@@ -1,10 +1,6 @@
<?php
abstract class PhabricatorAuthManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- final public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
}
diff --git a/src/applications/cache/management/PhabricatorCacheManagementWorkflow.php b/src/applications/cache/management/PhabricatorCacheManagementWorkflow.php
--- a/src/applications/cache/management/PhabricatorCacheManagementWorkflow.php
+++ b/src/applications/cache/management/PhabricatorCacheManagementWorkflow.php
@@ -1,10 +1,6 @@
<?php
abstract class PhabricatorCacheManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- final public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
}
diff --git a/src/applications/config/management/PhabricatorConfigManagementWorkflow.php b/src/applications/config/management/PhabricatorConfigManagementWorkflow.php
--- a/src/applications/config/management/PhabricatorConfigManagementWorkflow.php
+++ b/src/applications/config/management/PhabricatorConfigManagementWorkflow.php
@@ -1,10 +1,6 @@
<?php
abstract class PhabricatorConfigManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- final public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
}
diff --git a/src/applications/daemon/management/PhabricatorDaemonManagementLogWorkflow.php b/src/applications/daemon/management/PhabricatorDaemonManagementLogWorkflow.php
--- a/src/applications/daemon/management/PhabricatorDaemonManagementLogWorkflow.php
+++ b/src/applications/daemon/management/PhabricatorDaemonManagementLogWorkflow.php
@@ -32,7 +32,7 @@
$id = head($id);
$daemon = id(new PhabricatorDaemonLogQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($this->getViewer())
->withIDs(array($id))
->executeOne();
diff --git a/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php b/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php
--- a/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php
+++ b/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php
@@ -1,11 +1,7 @@
<?php
abstract class PhabricatorDaemonManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
protected function loadAvailableDaemonClasses() {
$loader = new PhutilSymbolLoader();
diff --git a/src/applications/diviner/workflow/DivinerWorkflow.php b/src/applications/diviner/workflow/DivinerWorkflow.php
--- a/src/applications/diviner/workflow/DivinerWorkflow.php
+++ b/src/applications/diviner/workflow/DivinerWorkflow.php
@@ -1,18 +1,14 @@
<?php
-abstract class DivinerWorkflow extends PhutilArgumentWorkflow {
+abstract class DivinerWorkflow extends PhabricatorManagementWorkflow {
private $config;
private $bookConfigPath;
public function getBookConfigPath() {
return $this->bookConfigPath;
}
- public function isExecutable() {
- return true;
- }
-
protected function getConfig($key, $default = null) {
return idx($this->config, $key, $default);
}
diff --git a/src/applications/drydock/management/DrydockManagementCloseWorkflow.php b/src/applications/drydock/management/DrydockManagementCloseWorkflow.php
--- a/src/applications/drydock/management/DrydockManagementCloseWorkflow.php
+++ b/src/applications/drydock/management/DrydockManagementCloseWorkflow.php
@@ -25,7 +25,7 @@
"Specify one or more resource IDs to close.");
}
- $viewer = PhabricatorUser::getOmnipotentUser();
+ $viewer = $this->getViewer();
$resources = id(new DrydockResourceQuery())
->setViewer($viewer)
diff --git a/src/applications/drydock/management/DrydockManagementCreateResourceWorkflow.php b/src/applications/drydock/management/DrydockManagementCreateResourceWorkflow.php
--- a/src/applications/drydock/management/DrydockManagementCreateResourceWorkflow.php
+++ b/src/applications/drydock/management/DrydockManagementCreateResourceWorkflow.php
@@ -49,7 +49,7 @@
$attributes = $options->parse($attributes);
}
- $viewer = PhabricatorUser::getOmnipotentUser();
+ $viewer = $this->getViewer();
$blueprint = id(new DrydockBlueprintQuery())
->setViewer($viewer)
diff --git a/src/applications/drydock/management/DrydockManagementReleaseWorkflow.php b/src/applications/drydock/management/DrydockManagementReleaseWorkflow.php
--- a/src/applications/drydock/management/DrydockManagementReleaseWorkflow.php
+++ b/src/applications/drydock/management/DrydockManagementReleaseWorkflow.php
@@ -25,7 +25,7 @@
"Specify one or more lease IDs to release.");
}
- $viewer = PhabricatorUser::getOmnipotentUser();
+ $viewer = $this->getViewer();
$leases = id(new DrydockLeaseQuery())
->setViewer($viewer)
diff --git a/src/applications/drydock/management/DrydockManagementWorkflow.php b/src/applications/drydock/management/DrydockManagementWorkflow.php
--- a/src/applications/drydock/management/DrydockManagementWorkflow.php
+++ b/src/applications/drydock/management/DrydockManagementWorkflow.php
@@ -1,10 +1,6 @@
<?php
abstract class DrydockManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
}
diff --git a/src/applications/fact/management/PhabricatorFactManagementWorkflow.php b/src/applications/fact/management/PhabricatorFactManagementWorkflow.php
--- a/src/applications/fact/management/PhabricatorFactManagementWorkflow.php
+++ b/src/applications/fact/management/PhabricatorFactManagementWorkflow.php
@@ -1,10 +1,6 @@
<?php
abstract class PhabricatorFactManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
}
diff --git a/src/applications/feed/management/PhabricatorFeedManagementRepublishWorkflow.php b/src/applications/feed/management/PhabricatorFeedManagementRepublishWorkflow.php
--- a/src/applications/feed/management/PhabricatorFeedManagementRepublishWorkflow.php
+++ b/src/applications/feed/management/PhabricatorFeedManagementRepublishWorkflow.php
@@ -21,7 +21,7 @@
public function execute(PhutilArgumentParser $args) {
$console = PhutilConsole::getConsole();
- $viewer = PhabricatorUser::getOmnipotentUser();
+ $viewer = $this->getViewer();
$key = $args->getArg('key');
if (count($key) < 1) {
diff --git a/src/applications/feed/management/PhabricatorFeedManagementWorkflow.php b/src/applications/feed/management/PhabricatorFeedManagementWorkflow.php
--- a/src/applications/feed/management/PhabricatorFeedManagementWorkflow.php
+++ b/src/applications/feed/management/PhabricatorFeedManagementWorkflow.php
@@ -1,10 +1,6 @@
<?php
abstract class PhabricatorFeedManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- final public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
}
diff --git a/src/applications/files/management/PhabricatorFilesManagementWorkflow.php b/src/applications/files/management/PhabricatorFilesManagementWorkflow.php
--- a/src/applications/files/management/PhabricatorFilesManagementWorkflow.php
+++ b/src/applications/files/management/PhabricatorFilesManagementWorkflow.php
@@ -1,11 +1,7 @@
<?php
abstract class PhabricatorFilesManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
protected function buildIterator(PhutilArgumentParser $args) {
$names = $args->getArg('names');
@@ -20,7 +16,7 @@
if ($names) {
$query = id(new PhabricatorObjectQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($this->getViewer())
->withNames($names)
->withTypes(array(PhabricatorFilePHIDTypeFile::TYPECONST));
diff --git a/src/applications/harbormaster/management/HarbormasterManagementBuildWorkflow.php b/src/applications/harbormaster/management/HarbormasterManagementBuildWorkflow.php
--- a/src/applications/harbormaster/management/HarbormasterManagementBuildWorkflow.php
+++ b/src/applications/harbormaster/management/HarbormasterManagementBuildWorkflow.php
@@ -23,7 +23,7 @@
}
public function execute(PhutilArgumentParser $args) {
- $viewer = PhabricatorUser::getOmnipotentUser();
+ $viewer = $this->getViewer();
$names = $args->getArg('buildable');
if (count($names) != 1) {
diff --git a/src/applications/harbormaster/management/HarbormasterManagementWorkflow.php b/src/applications/harbormaster/management/HarbormasterManagementWorkflow.php
--- a/src/applications/harbormaster/management/HarbormasterManagementWorkflow.php
+++ b/src/applications/harbormaster/management/HarbormasterManagementWorkflow.php
@@ -1,10 +1,6 @@
<?php
abstract class HarbormasterManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
}
diff --git a/src/applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php b/src/applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php
--- a/src/applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php
+++ b/src/applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php
@@ -61,7 +61,7 @@
echo "\n";
while (true) {
$type = $supported_types[array_rand($supported_types)];
- $admin = PhabricatorUser::getOmnipotentUser();
+ $admin = $this->getViewer();
try {
$taskgen = newv($type, array());
$object = $taskgen->generate();
diff --git a/src/applications/lipsum/management/PhabricatorLipsumManagementWorkflow.php b/src/applications/lipsum/management/PhabricatorLipsumManagementWorkflow.php
--- a/src/applications/lipsum/management/PhabricatorLipsumManagementWorkflow.php
+++ b/src/applications/lipsum/management/PhabricatorLipsumManagementWorkflow.php
@@ -1,10 +1,6 @@
<?php
abstract class PhabricatorLipsumManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- final public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
}
diff --git a/src/applications/metamta/management/PhabricatorMailManagementListInboundWorkflow.php b/src/applications/metamta/management/PhabricatorMailManagementListInboundWorkflow.php
--- a/src/applications/metamta/management/PhabricatorMailManagementListInboundWorkflow.php
+++ b/src/applications/metamta/management/PhabricatorMailManagementListInboundWorkflow.php
@@ -22,7 +22,7 @@
public function execute(PhutilArgumentParser $args) {
$console = PhutilConsole::getConsole();
- $viewer = PhabricatorUser::getOmnipotentUser();
+ $viewer = $this->getViewer();
$mails = id(new PhabricatorMetaMTAReceivedMail())->loadAllWhere(
'1 = 1 ORDER BY id DESC LIMIT %d',
diff --git a/src/applications/metamta/management/PhabricatorMailManagementListOutboundWorkflow.php b/src/applications/metamta/management/PhabricatorMailManagementListOutboundWorkflow.php
--- a/src/applications/metamta/management/PhabricatorMailManagementListOutboundWorkflow.php
+++ b/src/applications/metamta/management/PhabricatorMailManagementListOutboundWorkflow.php
@@ -22,7 +22,7 @@
public function execute(PhutilArgumentParser $args) {
$console = PhutilConsole::getConsole();
- $viewer = PhabricatorUser::getOmnipotentUser();
+ $viewer = $this->getViewer();
$mails = id(new PhabricatorMetaMTAMail())->loadAllWhere(
'1 = 1 ORDER BY id DESC LIMIT %d',
diff --git a/src/applications/metamta/management/PhabricatorMailManagementReceiveTestWorkflow.php b/src/applications/metamta/management/PhabricatorMailManagementReceiveTestWorkflow.php
--- a/src/applications/metamta/management/PhabricatorMailManagementReceiveTestWorkflow.php
+++ b/src/applications/metamta/management/PhabricatorMailManagementReceiveTestWorkflow.php
@@ -42,7 +42,7 @@
}
$user = id(new PhabricatorPeopleQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($this->getViewer())
->withUsernames(array($as))
->executeOne();
if (!$user) {
diff --git a/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php b/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php
--- a/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php
+++ b/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php
@@ -61,7 +61,7 @@
public function execute(PhutilArgumentParser $args) {
$console = PhutilConsole::getConsole();
- $viewer = PhabricatorUser::getOmnipotentUser();
+ $viewer = $this->getViewer();
$from = $args->getArg('from');
if ($from) {
diff --git a/src/applications/metamta/management/PhabricatorMailManagementWorkflow.php b/src/applications/metamta/management/PhabricatorMailManagementWorkflow.php
--- a/src/applications/metamta/management/PhabricatorMailManagementWorkflow.php
+++ b/src/applications/metamta/management/PhabricatorMailManagementWorkflow.php
@@ -1,10 +1,6 @@
<?php
abstract class PhabricatorMailManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- final public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
}
diff --git a/src/applications/policy/management/PhabricatorPolicyManagementShowWorkflow.php b/src/applications/policy/management/PhabricatorPolicyManagementShowWorkflow.php
--- a/src/applications/policy/management/PhabricatorPolicyManagementShowWorkflow.php
+++ b/src/applications/policy/management/PhabricatorPolicyManagementShowWorkflow.php
@@ -20,7 +20,7 @@
public function execute(PhutilArgumentParser $args) {
$console = PhutilConsole::getConsole();
- $viewer = PhabricatorUser::getOmnipotentUser();
+ $viewer = $this->getViewer();
$obj_names = $args->getArg('objects');
if (!$obj_names) {
diff --git a/src/applications/policy/management/PhabricatorPolicyManagementUnlockWorkflow.php b/src/applications/policy/management/PhabricatorPolicyManagementUnlockWorkflow.php
--- a/src/applications/policy/management/PhabricatorPolicyManagementUnlockWorkflow.php
+++ b/src/applications/policy/management/PhabricatorPolicyManagementUnlockWorkflow.php
@@ -22,7 +22,7 @@
public function execute(PhutilArgumentParser $args) {
$console = PhutilConsole::getConsole();
- $viewer = PhabricatorUser::getOmnipotentUser();
+ $viewer = $this->getViewer();
$obj_names = $args->getArg('objects');
if (!$obj_names) {
diff --git a/src/applications/policy/management/PhabricatorPolicyManagementWorkflow.php b/src/applications/policy/management/PhabricatorPolicyManagementWorkflow.php
--- a/src/applications/policy/management/PhabricatorPolicyManagementWorkflow.php
+++ b/src/applications/policy/management/PhabricatorPolicyManagementWorkflow.php
@@ -1,10 +1,6 @@
<?php
abstract class PhabricatorPolicyManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- final public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
}
diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementEditWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementEditWorkflow.php
--- a/src/applications/repository/management/PhabricatorRepositoryManagementEditWorkflow.php
+++ b/src/applications/repository/management/PhabricatorRepositoryManagementEditWorkflow.php
@@ -51,7 +51,7 @@
}
$actor = id(new PhabricatorPeopleQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($this->getViewer())
->withUsernames(array($username))
->executeOne();
diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementListWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementListWorkflow.php
--- a/src/applications/repository/management/PhabricatorRepositoryManagementListWorkflow.php
+++ b/src/applications/repository/management/PhabricatorRepositoryManagementListWorkflow.php
@@ -14,7 +14,7 @@
$console = PhutilConsole::getConsole();
$repos = id(new PhabricatorRepositoryQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($this->getViewer())
->execute();
if ($repos) {
foreach ($repos as $repo) {
diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementLookupUsersWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementLookupUsersWorkflow.php
--- a/src/applications/repository/management/PhabricatorRepositoryManagementLookupUsersWorkflow.php
+++ b/src/applications/repository/management/PhabricatorRepositoryManagementLookupUsersWorkflow.php
@@ -89,7 +89,7 @@
}
return id(new PhabricatorHandleQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($this->getViewer())
->withPHIDs(array($phid))
->executeOne();
}
diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementWorkflow.php
--- a/src/applications/repository/management/PhabricatorRepositoryManagementWorkflow.php
+++ b/src/applications/repository/management/PhabricatorRepositoryManagementWorkflow.php
@@ -1,11 +1,7 @@
<?php
abstract class PhabricatorRepositoryManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
protected function loadRepositories(PhutilArgumentParser $args, $param) {
$callsigns = $args->getArg($param);
@@ -15,7 +11,7 @@
}
$repos = id(new PhabricatorRepositoryQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($this->getViewer())
->withCallsigns($callsigns)
->execute();
@@ -37,7 +33,7 @@
}
$query = id(new DiffusionCommitQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($this->getViewer())
->withIdentifiers($names);
$query->execute();
diff --git a/src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php b/src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php
--- a/src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php
+++ b/src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php
@@ -92,7 +92,7 @@
private function loadPHIDsByNames(array $names) {
$query = id(new PhabricatorObjectQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->setViewer($this->getViewer())
->withNames($names);
$query->execute();
$objects = $query->getNamedResults();
diff --git a/src/applications/search/management/PhabricatorSearchManagementWorkflow.php b/src/applications/search/management/PhabricatorSearchManagementWorkflow.php
--- a/src/applications/search/management/PhabricatorSearchManagementWorkflow.php
+++ b/src/applications/search/management/PhabricatorSearchManagementWorkflow.php
@@ -1,13 +1,6 @@
<?php
-/**
- * @group search
- */
abstract class PhabricatorSearchManagementWorkflow
- extends PhutilArgumentWorkflow {
-
- final public function isExecutable() {
- return true;
- }
+ extends PhabricatorManagementWorkflow {
}
diff --git a/src/infrastructure/management/PhabricatorManagementWorkflow.php b/src/infrastructure/management/PhabricatorManagementWorkflow.php
new file mode 100644
--- /dev/null
+++ b/src/infrastructure/management/PhabricatorManagementWorkflow.php
@@ -0,0 +1,16 @@
+<?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();
+ }
+
+}
diff --git a/src/infrastructure/ssh/PhabricatorSSHWorkflow.php b/src/infrastructure/ssh/PhabricatorSSHWorkflow.php
--- a/src/infrastructure/ssh/PhabricatorSSHWorkflow.php
+++ b/src/infrastructure/ssh/PhabricatorSSHWorkflow.php
@@ -1,6 +1,6 @@
<?php
-abstract class PhabricatorSSHWorkflow extends PhutilArgumentWorkflow {
+abstract class PhabricatorSSHWorkflow extends PhabricatorManagementWorkflow {
private $user;
private $iochannel;
@@ -24,10 +24,6 @@
return $this->user;
}
- final public function isExecutable() {
- return false;
- }
-
public function setIOChannel(PhutilChannel $channel) {
$this->iochannel = $channel;
return $this;
diff --git a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php
--- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php
+++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php
@@ -1,7 +1,7 @@
<?php
abstract class PhabricatorStorageManagementWorkflow
- extends PhutilArgumentWorkflow {
+ extends PhabricatorManagementWorkflow {
private $patches;
private $api;
@@ -25,8 +25,4 @@
return $this->api;
}
- public function isExecutable() {
- return true;
- }
-
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/zd/fl/nu6odyzmh2nmjm7z
Default Alt Text
D7838.diff (35 KB)
Attached To
Mode
D7838: Extend all "ManagementWorkflow" classes from a base class
Attached
Detach File
Event Timeline
Log In to Comment