Skip to content

Commit 97bb13d

Browse files
committed
Discover workflows automatically.
Summary: Most scripts detect the relevant workflows automatically. Some scripts, however, use a hardcoded list of workflows. Test Plan: Ran `./bin/aphlict`, `./bin/cache` and `./bin/phd`. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D9564
1 parent a3c8b1e commit 97bb13d

File tree

3 files changed

+13
-25
lines changed

3 files changed

+13
-25
lines changed

scripts/cache/manage_cache.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
);
1515
$args->parseStandardArguments();
1616

17-
$workflows = array(
18-
new PhabricatorCacheManagementPurgeWorkflow(),
19-
new PhutilHelpArgumentWorkflow(),
20-
);
21-
17+
$workflows = id(new PhutilSymbolLoader())
18+
->setAncestorClass('PhabricatorCacheManagementWorkflow')
19+
->loadObjects();
20+
$workflows[] = new PhutilHelpArgumentWorkflow();
2221
$args->parseWorkflows($workflows);

scripts/daemon/manage_daemons.php

+4-11
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,9 @@
1515
EOSYNOPSIS
1616
);
1717
$args->parseStandardArguments();
18-
$workflows = array(
19-
new PhabricatorDaemonManagementListWorkflow(),
20-
new PhabricatorDaemonManagementStatusWorkflow(),
21-
new PhabricatorDaemonManagementStartWorkflow(),
22-
new PhabricatorDaemonManagementStopWorkflow(),
23-
new PhabricatorDaemonManagementRestartWorkflow(),
24-
new PhabricatorDaemonManagementLaunchWorkflow(),
25-
new PhabricatorDaemonManagementDebugWorkflow(),
26-
new PhabricatorDaemonManagementLogWorkflow(),
27-
new PhutilHelpArgumentWorkflow(),
28-
);
2918

19+
$workflows = id(new PhutilSymbolLoader())
20+
->setAncestorClass('PhabricatorDaemonManagementWorkflow')
21+
->loadObjects();
22+
$workflows[] = new PhutilHelpArgumentWorkflow();
3023
$args->parseWorkflows($workflows);

support/aphlict/server/aphlict_launcher.php

+5-9
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,8 @@
1616
);
1717
$args->parseStandardArguments();
1818

19-
$args->parseWorkflows(array(
20-
new PhabricatorAphlictManagementStatusWorkflow(),
21-
new PhabricatorAphlictManagementStartWorkflow(),
22-
new PhabricatorAphlictManagementStopWorkflow(),
23-
new PhabricatorAphlictManagementRestartWorkflow(),
24-
new PhabricatorAphlictManagementDebugWorkflow(),
25-
new PhabricatorAphlictManagementBuildWorkflow(),
26-
new PhutilHelpArgumentWorkflow(),
27-
));
19+
$workflows = id(new PhutilSymbolLoader())
20+
->setAncestorClass('PhabricatorAphlictManagementWorkflow')
21+
->loadObjects();
22+
$workflows[] = new PhutilHelpArgumentWorkflow();
23+
$args->parseWorkflows($workflows);

0 commit comments

Comments
 (0)