Page MenuHomePhabricator

D13589.id32842.diff
No OneTemporary

D13589.id32842.diff

diff --git a/scripts/almanac/manage_almanac.php b/scripts/almanac/manage_almanac.php
--- a/scripts/almanac/manage_almanac.php
+++ b/scripts/almanac/manage_almanac.php
@@ -14,8 +14,8 @@
);
$args->parseStandardArguments();
-$workflows = id(new PhutilSymbolLoader())
+$workflows = id(new PhutilClassMapQuery())
->setAncestorClass('AlmanacManagementWorkflow')
- ->loadObjects();
+ ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows);
diff --git a/scripts/cache/manage_cache.php b/scripts/cache/manage_cache.php
--- a/scripts/cache/manage_cache.php
+++ b/scripts/cache/manage_cache.php
@@ -14,8 +14,8 @@
);
$args->parseStandardArguments();
-$workflows = id(new PhutilSymbolLoader())
+$workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorCacheManagementWorkflow')
- ->loadObjects();
+ ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows);
diff --git a/scripts/daemon/manage_daemons.php b/scripts/daemon/manage_daemons.php
--- a/scripts/daemon/manage_daemons.php
+++ b/scripts/daemon/manage_daemons.php
@@ -16,8 +16,8 @@
);
$args->parseStandardArguments();
-$workflows = id(new PhutilSymbolLoader())
+$workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorDaemonManagementWorkflow')
- ->loadObjects();
+ ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows);
diff --git a/scripts/diviner/diviner.php b/scripts/diviner/diviner.php
--- a/scripts/diviner/diviner.php
+++ b/scripts/diviner/diviner.php
@@ -14,8 +14,8 @@
);
$args->parseStandardArguments();
-$workflows = id(new PhutilSymbolLoader())
+$workflows = id(new PhutilClassMapQuery())
->setAncestorClass('DivinerWorkflow')
- ->loadObjects();
+ ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows);
diff --git a/scripts/drydock/drydock_control.php b/scripts/drydock/drydock_control.php
--- a/scripts/drydock/drydock_control.php
+++ b/scripts/drydock/drydock_control.php
@@ -14,8 +14,8 @@
);
$args->parseStandardArguments();
-$workflows = id(new PhutilSymbolLoader())
+$workflows = id(new PhutilClassMapQuery())
->setAncestorClass('DrydockManagementWorkflow')
- ->loadObjects();
+ ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows);
diff --git a/scripts/fact/manage_facts.php b/scripts/fact/manage_facts.php
--- a/scripts/fact/manage_facts.php
+++ b/scripts/fact/manage_facts.php
@@ -15,8 +15,8 @@
);
$args->parseStandardArguments();
-$workflows = id(new PhutilSymbolLoader())
+$workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorFactManagementWorkflow')
- ->loadObjects();
+ ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows);
diff --git a/scripts/files/manage_files.php b/scripts/files/manage_files.php
--- a/scripts/files/manage_files.php
+++ b/scripts/files/manage_files.php
@@ -14,8 +14,8 @@
);
$args->parseStandardArguments();
-$workflows = id(new PhutilSymbolLoader())
+$workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorFilesManagementWorkflow')
- ->loadObjects();
+ ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows);
diff --git a/scripts/lipsum/manage_lipsum.php b/scripts/lipsum/manage_lipsum.php
--- a/scripts/lipsum/manage_lipsum.php
+++ b/scripts/lipsum/manage_lipsum.php
@@ -14,8 +14,8 @@
);
$args->parseStandardArguments();
-$workflows = id(new PhutilSymbolLoader())
+$workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorLipsumManagementWorkflow')
- ->loadObjects();
+ ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows);
diff --git a/scripts/mail/manage_mail.php b/scripts/mail/manage_mail.php
--- a/scripts/mail/manage_mail.php
+++ b/scripts/mail/manage_mail.php
@@ -14,8 +14,8 @@
);
$args->parseStandardArguments();
-$workflows = id(new PhutilSymbolLoader())
+$workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorMailManagementWorkflow')
- ->loadObjects();
+ ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows);
diff --git a/scripts/repository/manage_repositories.php b/scripts/repository/manage_repositories.php
--- a/scripts/repository/manage_repositories.php
+++ b/scripts/repository/manage_repositories.php
@@ -15,8 +15,8 @@
);
$args->parseStandardArguments();
-$workflows = id(new PhutilSymbolLoader())
+$workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorRepositoryManagementWorkflow')
- ->loadObjects();
+ ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows);
diff --git a/scripts/search/manage_search.php b/scripts/search/manage_search.php
--- a/scripts/search/manage_search.php
+++ b/scripts/search/manage_search.php
@@ -14,8 +14,8 @@
);
$args->parseStandardArguments();
-$workflows = id(new PhutilSymbolLoader())
+$workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorSearchManagementWorkflow')
- ->loadObjects();
+ ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows);
diff --git a/scripts/setup/manage_audit.php b/scripts/setup/manage_audit.php
--- a/scripts/setup/manage_audit.php
+++ b/scripts/setup/manage_audit.php
@@ -14,8 +14,8 @@
);
$args->parseStandardArguments();
-$workflows = id(new PhutilSymbolLoader())
+$workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorAuditManagementWorkflow')
- ->loadObjects();
+ ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows);
diff --git a/scripts/setup/manage_auth.php b/scripts/setup/manage_auth.php
--- a/scripts/setup/manage_auth.php
+++ b/scripts/setup/manage_auth.php
@@ -14,8 +14,8 @@
);
$args->parseStandardArguments();
-$workflows = id(new PhutilSymbolLoader())
+$workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorAuthManagementWorkflow')
- ->loadObjects();
+ ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows);
diff --git a/scripts/setup/manage_celerity.php b/scripts/setup/manage_celerity.php
--- a/scripts/setup/manage_celerity.php
+++ b/scripts/setup/manage_celerity.php
@@ -14,8 +14,8 @@
);
$args->parseStandardArguments();
-$workflows = id(new PhutilSymbolLoader())
+$workflows = id(new PhutilClassMapQuery())
->setAncestorClass('CelerityManagementWorkflow')
- ->loadObjects();
+ ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows);
diff --git a/scripts/setup/manage_config.php b/scripts/setup/manage_config.php
--- a/scripts/setup/manage_config.php
+++ b/scripts/setup/manage_config.php
@@ -14,8 +14,8 @@
);
$args->parseStandardArguments();
-$workflows = id(new PhutilSymbolLoader())
+$workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorConfigManagementWorkflow')
- ->loadObjects();
+ ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows);
diff --git a/scripts/setup/manage_feed.php b/scripts/setup/manage_feed.php
--- a/scripts/setup/manage_feed.php
+++ b/scripts/setup/manage_feed.php
@@ -14,8 +14,8 @@
);
$args->parseStandardArguments();
-$workflows = id(new PhutilSymbolLoader())
+$workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorFeedManagementWorkflow')
- ->loadObjects();
+ ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows);
diff --git a/scripts/setup/manage_harbormaster.php b/scripts/setup/manage_harbormaster.php
--- a/scripts/setup/manage_harbormaster.php
+++ b/scripts/setup/manage_harbormaster.php
@@ -14,8 +14,8 @@
);
$args->parseStandardArguments();
-$workflows = id(new PhutilSymbolLoader())
+$workflows = id(new PhutilClassMapQuery())
->setAncestorClass('HarbormasterManagementWorkflow')
- ->loadObjects();
+ ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows);
diff --git a/scripts/setup/manage_hunks.php b/scripts/setup/manage_hunks.php
--- a/scripts/setup/manage_hunks.php
+++ b/scripts/setup/manage_hunks.php
@@ -14,8 +14,8 @@
);
$args->parseStandardArguments();
-$workflows = id(new PhutilSymbolLoader())
+$workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorHunksManagementWorkflow')
- ->loadObjects();
+ ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows);
diff --git a/scripts/setup/manage_i18n.php b/scripts/setup/manage_i18n.php
--- a/scripts/setup/manage_i18n.php
+++ b/scripts/setup/manage_i18n.php
@@ -14,8 +14,8 @@
);
$args->parseStandardArguments();
-$workflows = id(new PhutilSymbolLoader())
+$workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorInternationalizationManagementWorkflow')
- ->loadObjects();
+ ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows);
diff --git a/scripts/setup/manage_phortune.php b/scripts/setup/manage_phortune.php
--- a/scripts/setup/manage_phortune.php
+++ b/scripts/setup/manage_phortune.php
@@ -14,8 +14,8 @@
);
$args->parseStandardArguments();
-$workflows = id(new PhutilSymbolLoader())
+$workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorPhortuneManagementWorkflow')
- ->loadObjects();
+ ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows);
diff --git a/scripts/setup/manage_policy.php b/scripts/setup/manage_policy.php
--- a/scripts/setup/manage_policy.php
+++ b/scripts/setup/manage_policy.php
@@ -14,8 +14,8 @@
);
$args->parseStandardArguments();
-$workflows = id(new PhutilSymbolLoader())
+$workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorPolicyManagementWorkflow')
- ->loadObjects();
+ ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows);
diff --git a/scripts/setup/manage_remove.php b/scripts/setup/manage_remove.php
--- a/scripts/setup/manage_remove.php
+++ b/scripts/setup/manage_remove.php
@@ -14,8 +14,8 @@
);
$args->parseStandardArguments();
-$workflows = id(new PhutilSymbolLoader())
+$workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorSystemRemoveWorkflow')
- ->loadObjects();
+ ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows);
diff --git a/scripts/setup/manage_trigger.php b/scripts/setup/manage_trigger.php
--- a/scripts/setup/manage_trigger.php
+++ b/scripts/setup/manage_trigger.php
@@ -14,8 +14,8 @@
);
$args->parseStandardArguments();
-$workflows = id(new PhutilSymbolLoader())
+$workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorWorkerTriggerManagementWorkflow')
- ->loadObjects();
+ ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows);
diff --git a/scripts/setup/manage_worker.php b/scripts/setup/manage_worker.php
--- a/scripts/setup/manage_worker.php
+++ b/scripts/setup/manage_worker.php
@@ -14,8 +14,8 @@
);
$args->parseStandardArguments();
-$workflows = id(new PhutilSymbolLoader())
+$workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorWorkerManagementWorkflow')
- ->loadObjects();
+ ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows);
diff --git a/scripts/sms/manage_sms.php b/scripts/sms/manage_sms.php
--- a/scripts/sms/manage_sms.php
+++ b/scripts/sms/manage_sms.php
@@ -14,8 +14,8 @@
);
$args->parseStandardArguments();
-$workflows = id(new PhutilSymbolLoader())
+$workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorSMSManagementWorkflow')
- ->loadObjects();
+ ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows);
diff --git a/scripts/sql/manage_storage.php b/scripts/sql/manage_storage.php
--- a/scripts/sql/manage_storage.php
+++ b/scripts/sql/manage_storage.php
@@ -160,9 +160,9 @@
exit(1);
}
-$workflows = id(new PhutilSymbolLoader())
+$workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorStorageManagementWorkflow')
- ->loadObjects();
+ ->execute();
$patches = PhabricatorSQLPatchList::buildAllPatches();
diff --git a/scripts/ssh/ssh-exec.php b/scripts/ssh/ssh-exec.php
--- a/scripts/ssh/ssh-exec.php
+++ b/scripts/ssh/ssh-exec.php
@@ -190,11 +190,10 @@
$user->getUsername()));
}
- $workflows = id(new PhutilSymbolLoader())
+ $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorSSHWorkflow')
- ->loadObjects();
-
- $workflow_names = mpull($workflows, 'getName', 'getName');
+ ->setUniqueMethod('getName')
+ ->execute();
if (!$original_argv) {
throw new Exception(
diff --git a/src/__tests__/PhabricatorConduitTestCase.php b/src/__tests__/PhabricatorConduitTestCase.php
--- a/src/__tests__/PhabricatorConduitTestCase.php
+++ b/src/__tests__/PhabricatorConduitTestCase.php
@@ -3,9 +3,9 @@
final class PhabricatorConduitTestCase extends PhabricatorTestCase {
public function testConduitMethods() {
- $methods = id(new PhutilSymbolLoader())
+ $methods = id(new PhutilClassMapQuery())
->setAncestorClass('ConduitAPIMethod')
- ->loadObjects();
+ ->execute();
// We're just looking for a side effect of ConduitCall construction
// here: it will throw if any methods define reserved parameter names.
diff --git a/src/applications/conduit/method/ConduitAPIMethod.php b/src/applications/conduit/method/ConduitAPIMethod.php
--- a/src/applications/conduit/method/ConduitAPIMethod.php
+++ b/src/applications/conduit/method/ConduitAPIMethod.php
@@ -116,34 +116,10 @@
}
public static function loadAllConduitMethods() {
- static $method_map = null;
-
- if ($method_map === null) {
- $methods = id(new PhutilSymbolLoader())
- ->setAncestorClass(__CLASS__)
- ->loadObjects();
-
- foreach ($methods as $method) {
- $name = $method->getAPIMethodName();
-
- if (empty($method_map[$name])) {
- $method_map[$name] = $method;
- continue;
- }
-
- $orig_class = get_class($method_map[$name]);
- $this_class = get_class($method);
- throw new Exception(
- pht(
- 'Two Conduit API method classes (%s, %s) both have the same '.
- 'method name (%s). API methods must have unique method names.',
- $orig_class,
- $this_class,
- $name));
- }
- }
-
- return $method_map;
+ return id(new PhutilClassMapQuery())
+ ->setAncestorClass(__CLASS__)
+ ->setUniqueMethod('getAPIMethodName')
+ ->execute();
}
public static function getConduitMethod($method_name) {
diff --git a/src/applications/conduit/method/ConduitQueryConduitAPIMethod.php b/src/applications/conduit/method/ConduitQueryConduitAPIMethod.php
--- a/src/applications/conduit/method/ConduitQueryConduitAPIMethod.php
+++ b/src/applications/conduit/method/ConduitQueryConduitAPIMethod.php
@@ -19,10 +19,9 @@
}
protected function execute(ConduitAPIRequest $request) {
- $classes = id(new PhutilSymbolLoader())
+ $classes = id(new PhutilClassMapQuery())
->setAncestorClass('ConduitAPIMethod')
- ->setType('class')
- ->loadObjects();
+ ->execute();
$names_to_params = array();
foreach ($classes as $class) {
diff --git a/src/applications/conduit/query/PhabricatorConduitMethodQuery.php b/src/applications/conduit/query/PhabricatorConduitMethodQuery.php
--- a/src/applications/conduit/query/PhabricatorConduitMethodQuery.php
+++ b/src/applications/conduit/query/PhabricatorConduitMethodQuery.php
@@ -47,14 +47,10 @@
}
private function getAllMethods() {
- static $methods;
- if ($methods === null) {
- $methods = id(new PhutilSymbolLoader())
- ->setAncestorClass('ConduitAPIMethod')
- ->loadObjects();
- $methods = msort($methods, 'getSortOrder');
- }
- return $methods;
+ return id(new PhutilClassMapQuery())
+ ->setAncestorClass('ConduitAPIMethod')
+ ->setSortMethod('getSortOrder')
+ ->execute();
}
private function filterMethods(array $methods) {
diff --git a/src/applications/config/schema/PhabricatorConfigCoreSchemaSpec.php b/src/applications/config/schema/PhabricatorConfigCoreSchemaSpec.php
--- a/src/applications/config/schema/PhabricatorConfigCoreSchemaSpec.php
+++ b/src/applications/config/schema/PhabricatorConfigCoreSchemaSpec.php
@@ -9,9 +9,9 @@
public function buildSchemata() {
// Build all Lisk table schemata.
- $lisk_objects = id(new PhutilSymbolLoader())
+ $lisk_objects = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorLiskDAO')
- ->loadObjects();
+ ->execute();
$counters = array();
foreach ($lisk_objects as $object) {
diff --git a/src/applications/config/schema/PhabricatorConfigSchemaQuery.php b/src/applications/config/schema/PhabricatorConfigSchemaQuery.php
--- a/src/applications/config/schema/PhabricatorConfigSchemaQuery.php
+++ b/src/applications/config/schema/PhabricatorConfigSchemaQuery.php
@@ -155,9 +155,9 @@
$databases = $this->getDatabaseNames();
$info = $this->getAPI()->getCharsetInfo();
- $specs = id(new PhutilSymbolLoader())
+ $specs = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorConfigSchemaSpec')
- ->loadObjects();
+ ->execute();
$server_schema = new PhabricatorConfigServerSchema();
foreach ($specs as $spec) {
diff --git a/src/applications/console/core/DarkConsoleCore.php b/src/applications/console/core/DarkConsoleCore.php
--- a/src/applications/console/core/DarkConsoleCore.php
+++ b/src/applications/console/core/DarkConsoleCore.php
@@ -6,19 +6,17 @@
const STORAGE_VERSION = 1;
public function __construct() {
- $symbols = id(new PhutilSymbolLoader())
- ->setType('class')
+ $plugins = id(new PhutilClassMapQuery())
->setAncestorClass('DarkConsolePlugin')
- ->selectAndLoadSymbols();
+ ->execute();
- foreach ($symbols as $symbol) {
- $plugin = newv($symbol['name'], array());
+ foreach ($plugins as $plugin) {
if (!$plugin->shouldStartup()) {
continue;
}
$plugin->setConsoleCore($this);
$plugin->didStartup();
- $this->plugins[$symbol['name']] = $plugin;
+ $this->plugins[get_class($plugin)] = $plugin;
}
}
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
@@ -6,11 +6,9 @@
private $runDaemonsAsUser = null;
final protected function loadAvailableDaemonClasses() {
- $loader = new PhutilSymbolLoader();
- return $loader
+ return id(new PhutilClassMapQuery())
->setAncestorClass('PhutilDaemon')
- ->setConcreteOnly(true)
- ->selectSymbolsWithoutLoading();
+ ->execute();
}
final protected function getPIDDirectory() {
diff --git a/src/applications/dashboard/customfield/PhabricatorDashboardPanelSearchApplicationCustomField.php b/src/applications/dashboard/customfield/PhabricatorDashboardPanelSearchApplicationCustomField.php
--- a/src/applications/dashboard/customfield/PhabricatorDashboardPanelSearchApplicationCustomField.php
+++ b/src/applications/dashboard/customfield/PhabricatorDashboardPanelSearchApplicationCustomField.php
@@ -12,11 +12,11 @@
}
public function renderEditControl(array $handles) {
-
- $engines = id(new PhutilSymbolLoader())
+ $engines = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorApplicationSearchEngine')
- ->loadObjects();
- $engines = mfilter($engines, 'canUseInPanelContext');
+ ->setFilterMethod('canUseInPanelContext')
+ ->execute();
+
$all_apps = id(new PhabricatorApplicationQuery())
->setViewer($this->getViewer())
->withUnlisted(false)
diff --git a/src/applications/dashboard/customfield/PhabricatorDashboardPanelSearchQueryCustomField.php b/src/applications/dashboard/customfield/PhabricatorDashboardPanelSearchQueryCustomField.php
--- a/src/applications/dashboard/customfield/PhabricatorDashboardPanelSearchQueryCustomField.php
+++ b/src/applications/dashboard/customfield/PhabricatorDashboardPanelSearchQueryCustomField.php
@@ -12,11 +12,10 @@
}
public function renderEditControl(array $handles) {
-
- $engines = id(new PhutilSymbolLoader())
+ $engines = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorApplicationSearchEngine')
- ->loadObjects();
- $engines = mfilter($engines, 'canUseInPanelContext');
+ ->setFilterMethod('canUseInPanelContext')
+ ->execute();
$value = $this->getFieldValue();
diff --git a/src/applications/differential/landing/DifferentialLandingActionMenuEventListener.php b/src/applications/differential/landing/DifferentialLandingActionMenuEventListener.php
--- a/src/applications/differential/landing/DifferentialLandingActionMenuEventListener.php
+++ b/src/applications/differential/landing/DifferentialLandingActionMenuEventListener.php
@@ -37,9 +37,10 @@
return null;
}
- $strategies = id(new PhutilSymbolLoader())
+ $strategies = id(new PhutilClassMapQuery())
->setAncestorClass('DifferentialLandingStrategy')
- ->loadObjects();
+ ->execute();
+
foreach ($strategies as $strategy) {
$viewer = $event->getUser();
$action = $strategy->createMenuItem($viewer, $revision, $repository);
diff --git a/src/applications/diffusion/controller/DiffusionSymbolController.php b/src/applications/diffusion/controller/DiffusionSymbolController.php
--- a/src/applications/diffusion/controller/DiffusionSymbolController.php
+++ b/src/applications/diffusion/controller/DiffusionSymbolController.php
@@ -64,9 +64,10 @@
$external_query->withLanguages(array($request->getStr('lang')));
}
- $external_sources = id(new PhutilSymbolLoader())
+ $external_sources = id(new PhutilClassMapQuery())
->setAncestorClass('DiffusionExternalSymbolsSource')
- ->loadObjects();
+ ->execute();
+
$results = array($symbols);
foreach ($external_sources as $source) {
$results[] = $source->executeQuery($external_query);
diff --git a/src/applications/diviner/workflow/DivinerGenerateWorkflow.php b/src/applications/diviner/workflow/DivinerGenerateWorkflow.php
--- a/src/applications/diviner/workflow/DivinerGenerateWorkflow.php
+++ b/src/applications/diviner/workflow/DivinerGenerateWorkflow.php
@@ -177,7 +177,7 @@
$this->buildGraphCache();
$publisher_class = $args->getArg('publisher');
- $symbols = id(new PhutilSymbolLoader())
+ $symbols = id(new PhutilClassMapQuery())
->setName($publisher_class)
->setConcreteOnly(true)
->setAncestorClass('DivinerPublisher')
diff --git a/src/applications/doorkeeper/engine/DoorkeeperImportEngine.php b/src/applications/doorkeeper/engine/DoorkeeperImportEngine.php
--- a/src/applications/doorkeeper/engine/DoorkeeperImportEngine.php
+++ b/src/applications/doorkeeper/engine/DoorkeeperImportEngine.php
@@ -88,14 +88,12 @@
}
if (!$this->localOnly) {
- $bridges = id(new PhutilSymbolLoader())
+ $bridges = id(new PhutilClassMapQuery())
->setAncestorClass('DoorkeeperBridge')
- ->loadObjects();
+ ->setFilterMethod('isEnabled')
+ ->execute();
foreach ($bridges as $key => $bridge) {
- if (!$bridge->isEnabled()) {
- unset($bridges[$key]);
- }
$bridge->setViewer($viewer);
$bridge->setThrowOnMissingLink($this->throwOnMissingLink);
}
diff --git a/src/applications/doorkeeper/option/PhabricatorAsanaConfigOptions.php b/src/applications/doorkeeper/option/PhabricatorAsanaConfigOptions.php
--- a/src/applications/doorkeeper/option/PhabricatorAsanaConfigOptions.php
+++ b/src/applications/doorkeeper/option/PhabricatorAsanaConfigOptions.php
@@ -120,9 +120,9 @@
$viewer = $request->getUser();
- $publishers = id(new PhutilSymbolLoader())
+ $publishers = id(new PhutilClassMapQuery())
->setAncestorClass('DoorkeeperFeedStoryPublisher')
- ->loadObjects();
+ ->execute();
$out = array();
$out[] = pht(
diff --git a/src/applications/doorkeeper/worker/DoorkeeperFeedWorker.php b/src/applications/doorkeeper/worker/DoorkeeperFeedWorker.php
--- a/src/applications/doorkeeper/worker/DoorkeeperFeedWorker.php
+++ b/src/applications/doorkeeper/worker/DoorkeeperFeedWorker.php
@@ -125,9 +125,9 @@
$viewer = $this->getViewer();
$object = $this->getStoryObject();
- $publishers = id(new PhutilSymbolLoader())
+ $publishers = id(new PhutilClassMapQuery())
->setAncestorClass('DoorkeeperFeedStoryPublisher')
- ->loadObjects();
+ ->execute();
foreach ($publishers as $publisher) {
if (!$publisher->canPublishStory($story, $object)) {
diff --git a/src/applications/feed/worker/FeedPublisherWorker.php b/src/applications/feed/worker/FeedPublisherWorker.php
--- a/src/applications/feed/worker/FeedPublisherWorker.php
+++ b/src/applications/feed/worker/FeedPublisherWorker.php
@@ -23,6 +23,7 @@
);
// Find and schedule all the enabled Doorkeeper publishers.
+ // TODO: Use PhutilClassMapQuery?
$doorkeeper_workers = id(new PhutilSymbolLoader())
->setAncestorClass('DoorkeeperFeedWorker')
->loadObjects($argv);
diff --git a/src/applications/files/storage/PhabricatorFile.php b/src/applications/files/storage/PhabricatorFile.php
--- a/src/applications/files/storage/PhabricatorFile.php
+++ b/src/applications/files/storage/PhabricatorFile.php
@@ -882,18 +882,9 @@
}
public static function buildAllEngines() {
- $engines = id(new PhutilSymbolLoader())
- ->setType('class')
- ->setConcreteOnly(true)
+ return id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorFileStorageEngine')
- ->selectAndLoadSymbols();
-
- $results = array();
- foreach ($engines as $engine_class) {
- $results[] = newv($engine_class['name'], array());
- }
-
- return $results;
+ ->execute();
}
public function getViewableMimeType() {
diff --git a/src/applications/flag/query/PhabricatorFlagSearchEngine.php b/src/applications/flag/query/PhabricatorFlagSearchEngine.php
--- a/src/applications/flag/query/PhabricatorFlagSearchEngine.php
+++ b/src/applications/flag/query/PhabricatorFlagSearchEngine.php
@@ -100,11 +100,13 @@
}
private function getObjectFilterOptions() {
- $objects = id(new PhutilSymbolLoader())
+ $objects = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorFlaggableInterface')
- ->loadObjects();
+ ->execute();
+
$all_types = PhabricatorPHIDType::getAllTypes();
$options = array();
+
foreach ($objects as $object) {
$phid = $object->generatePHID();
$phid_type = phid_get_type($phid);
diff --git a/src/applications/harbormaster/storage/build/HarbormasterBuild.php b/src/applications/harbormaster/storage/build/HarbormasterBuild.php
--- a/src/applications/harbormaster/storage/build/HarbormasterBuild.php
+++ b/src/applications/harbormaster/storage/build/HarbormasterBuild.php
@@ -287,9 +287,9 @@
}
public static function getAvailableBuildVariables() {
- $objects = id(new PhutilSymbolLoader())
+ $objects = id(new PhutilClassMapQuery())
->setAncestorClass('HarbormasterBuildableInterface')
- ->loadObjects();
+ ->execute();
$variables = array();
$variables[] = array(
diff --git a/src/applications/herald/adapter/HeraldAdapter.php b/src/applications/herald/adapter/HeraldAdapter.php
--- a/src/applications/herald/adapter/HeraldAdapter.php
+++ b/src/applications/herald/adapter/HeraldAdapter.php
@@ -107,30 +107,16 @@
public function getCustomActions() {
if ($this->customActions === null) {
- $custom_actions = id(new PhutilSymbolLoader())
+ $this->customActions = id(new PhutilClassMapQuery())
->setAncestorClass('HeraldCustomAction')
- ->loadObjects();
+ ->setUniqueMethod('getActionKey')
+ ->execute();
- foreach ($custom_actions as $key => $object) {
+ foreach ($this->customActions as $key => $object) {
if (!$object->appliesToAdapter($this)) {
- unset($custom_actions[$key]);
+ unset($this->customActions[$key]);
}
}
-
- $this->customActions = array();
- foreach ($custom_actions as $action) {
- $key = $action->getActionKey();
-
- if (array_key_exists($key, $this->customActions)) {
- throw new Exception(
- pht(
- "More than one Herald custom action implementation ".
- "handles the action key: '%s'.",
- $key));
- }
-
- $this->customActions[$key] = $action;
- }
}
return $this->customActions;
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
@@ -20,9 +20,9 @@
public function execute(PhutilArgumentParser $args) {
$console = PhutilConsole::getConsole();
- $supported_types = id(new PhutilSymbolLoader())
+ $supported_types = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorTestDataGenerator')
- ->loadObjects();
+ ->execute();
$console->writeOut(
"%s:\n\t%s\n",
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
@@ -105,15 +105,13 @@
'to' => $to.'+1+'.$pseudohash,
));
- $receivers = id(new PhutilSymbolLoader())
+ $receivers = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorMailReceiver')
- ->loadObjects();
+ ->setFilterMethod('isEnabled')
+ ->execute();
$receiver = null;
foreach ($receivers as $possible_receiver) {
- if (!$possible_receiver->isEnabled()) {
- continue;
- }
if (!$possible_receiver->canAcceptMail($pseudomail)) {
continue;
}
diff --git a/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php b/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php
--- a/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php
+++ b/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php
@@ -265,15 +265,13 @@
* accepts this mail, if one exists.
*/
private function loadReceiver() {
- $receivers = id(new PhutilSymbolLoader())
+ $receivers = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorMailReceiver')
- ->loadObjects();
+ ->setFilterMethod('isEnabled')
+ ->execute();
$accept = array();
foreach ($receivers as $key => $receiver) {
- if (!$receiver->isEnabled()) {
- continue;
- }
if ($receiver->canAcceptMail($this)) {
$accept[$key] = $receiver;
}
diff --git a/src/applications/policy/__tests__/PhabricatorPolicyTestCase.php b/src/applications/policy/__tests__/PhabricatorPolicyTestCase.php
--- a/src/applications/policy/__tests__/PhabricatorPolicyTestCase.php
+++ b/src/applications/policy/__tests__/PhabricatorPolicyTestCase.php
@@ -307,9 +307,9 @@
}
public function testAllQueriesBelongToActualApplications() {
- $queries = id(new PhutilSymbolLoader())
+ $queries = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorPolicyAwareQuery')
- ->loadObjects();
+ ->execute();
foreach ($queries as $qclass => $query) {
$class = $query->getQueryApplicationClass();
diff --git a/src/applications/policy/config/PolicyLockOptionType.php b/src/applications/policy/config/PolicyLockOptionType.php
--- a/src/applications/policy/config/PolicyLockOptionType.php
+++ b/src/applications/policy/config/PolicyLockOptionType.php
@@ -4,10 +4,10 @@
extends PhabricatorConfigJSONOptionType {
public function validateOption(PhabricatorConfigOption $option, $value) {
- $capabilities = id(new PhutilSymbolLoader())
+ $capabilities = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorPolicyCapability')
- ->loadObjects();
- $capabilities = mpull($capabilities, null, 'getCapabilityKey');
+ ->setUniqueMethod('getCapabilityKey')
+ ->execute();
$policy_phids = array();
foreach ($value as $capability_key => $policy) {
diff --git a/src/applications/policy/controller/PhabricatorPolicyEditController.php b/src/applications/policy/controller/PhabricatorPolicyEditController.php
--- a/src/applications/policy/controller/PhabricatorPolicyEditController.php
+++ b/src/applications/policy/controller/PhabricatorPolicyEditController.php
@@ -37,9 +37,9 @@
PhabricatorPolicy::ACTION_DENY => pht('Deny'),
);
- $rules = id(new PhutilSymbolLoader())
+ $rules = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorPolicyRule')
- ->loadObjects();
+ ->execute();
foreach ($rules as $key => $rule) {
if (!$rule->canApplyToObject($object)) {
diff --git a/src/applications/policy/query/PhabricatorPolicyQuery.php b/src/applications/policy/query/PhabricatorPolicyQuery.php
--- a/src/applications/policy/query/PhabricatorPolicyQuery.php
+++ b/src/applications/policy/query/PhabricatorPolicyQuery.php
@@ -305,9 +305,9 @@
}
public static function getObjectPolicyRules($object) {
- $rules = id(new PhutilSymbolLoader())
+ $rules = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorPolicyRule')
- ->loadObjects();
+ ->execute();
$results = array();
foreach ($rules as $rule) {
diff --git a/src/applications/search/index/PhabricatorSearchIndexer.php b/src/applications/search/index/PhabricatorSearchIndexer.php
--- a/src/applications/search/index/PhabricatorSearchIndexer.php
+++ b/src/applications/search/index/PhabricatorSearchIndexer.php
@@ -15,9 +15,9 @@
}
public function indexDocumentByPHID($phid, $context) {
- $indexers = id(new PhutilSymbolLoader())
+ $indexers = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorSearchDocumentIndexer')
- ->loadObjects();
+ ->execute();
foreach ($indexers as $indexer) {
if ($indexer->shouldIndexDocumentByPHID($phid)) {
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
@@ -122,9 +122,9 @@
}
private function loadPHIDsByTypes($type) {
- $indexers = id(new PhutilSymbolLoader())
+ $indexers = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorSearchDocumentIndexer')
- ->loadObjects();
+ ->execute();
$phids = array();
foreach ($indexers as $indexer) {
diff --git a/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php b/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php
--- a/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php
+++ b/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php
@@ -204,9 +204,9 @@
// TODO: This is inelegant and not very efficient, but gets us reasonable
// results. It would be nice to do this more elegantly.
- $indexers = id(new PhutilSymbolLoader())
+ $indexers = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorSearchDocumentIndexer')
- ->loadObjects();
+ ->execute();
if ($viewer) {
$types = PhabricatorPHIDType::getAllInstalledTypes($viewer);
diff --git a/src/applications/settings/controller/PhabricatorSettingsMainController.php b/src/applications/settings/controller/PhabricatorSettingsMainController.php
--- a/src/applications/settings/controller/PhabricatorSettingsMainController.php
+++ b/src/applications/settings/controller/PhabricatorSettingsMainController.php
@@ -81,19 +81,11 @@
}
private function buildPanels() {
- $panel_specs = id(new PhutilSymbolLoader())
+ $panels = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorSettingsPanel')
- ->setConcreteOnly(true)
- ->selectAndLoadSymbols();
-
- $panels = array();
- foreach ($panel_specs as $spec) {
- $class = newv($spec['name'], array());
- $panels[] = $class->buildPanels();
- }
-
- $panels = array_mergev($panels);
- $panels = mpull($panels, null, 'getPanelKey');
+ ->setExpandMethod('buildPanels')
+ ->setUniqueMethod('getPanelKey')
+ ->execute();
$result = array();
foreach ($panels as $key => $panel) {
diff --git a/src/applications/settings/panel/PhabricatorEmailPreferencesSettingsPanel.php b/src/applications/settings/panel/PhabricatorEmailPreferencesSettingsPanel.php
--- a/src/applications/settings/panel/PhabricatorEmailPreferencesSettingsPanel.php
+++ b/src/applications/settings/panel/PhabricatorEmailPreferencesSettingsPanel.php
@@ -191,16 +191,12 @@
}
private function getAllEditorsWithTags(PhabricatorUser $user) {
- $editors = id(new PhutilSymbolLoader())
+ $editors = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorApplicationTransactionEditor')
- ->loadObjects();
+ ->setFilterMethod('getMailTagsMap')
+ ->execute();
foreach ($editors as $key => $editor) {
- // Remove editors which do not support mail tags.
- if (!$editor->getMailTagsMap()) {
- unset($editors[$key]);
- }
-
// Remove editors for applications which are not installed.
$app = $editor->getEditorApplicationClass();
if ($app !== null) {
diff --git a/src/applications/transactions/controller/PhabricatorApplicationTransactionShowOlderController.php b/src/applications/transactions/controller/PhabricatorApplicationTransactionShowOlderController.php
--- a/src/applications/transactions/controller/PhabricatorApplicationTransactionShowOlderController.php
+++ b/src/applications/transactions/controller/PhabricatorApplicationTransactionShowOlderController.php
@@ -23,9 +23,9 @@
}
$template = $object->getApplicationTransactionTemplate();
- $queries = id(new PhutilSymbolLoader())
+ $queries = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorApplicationTransactionQuery')
- ->loadObjects();
+ ->execute();
$object_query = null;
foreach ($queries as $query) {
diff --git a/src/applications/transactions/phid/PhabricatorApplicationTransactionTransactionPHIDType.php b/src/applications/transactions/phid/PhabricatorApplicationTransactionTransactionPHIDType.php
--- a/src/applications/transactions/phid/PhabricatorApplicationTransactionTransactionPHIDType.php
+++ b/src/applications/transactions/phid/PhabricatorApplicationTransactionTransactionPHIDType.php
@@ -28,9 +28,9 @@
static $queries;
if ($queries === null) {
- $objects = id(new PhutilSymbolLoader())
+ $objects = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorApplicationTransactionQuery')
- ->loadObjects();
+ ->execute();
$queries = array();
foreach ($objects as $object) {
diff --git a/src/applications/transactions/worker/PhabricatorApplicationTransactionPublishWorker.php b/src/applications/transactions/worker/PhabricatorApplicationTransactionPublishWorker.php
--- a/src/applications/transactions/worker/PhabricatorApplicationTransactionPublishWorker.php
+++ b/src/applications/transactions/worker/PhabricatorApplicationTransactionPublishWorker.php
@@ -112,9 +112,9 @@
* the transactions.
*/
private function buildTransactionQuery($type) {
- $queries = id(new PhutilSymbolLoader())
+ $queries = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorApplicationTransactionQuery')
- ->loadObjects();
+ ->execute();
foreach ($queries as $query) {
$query_type = $query
diff --git a/src/applications/typeahead/controller/PhabricatorTypeaheadFunctionHelpController.php b/src/applications/typeahead/controller/PhabricatorTypeaheadFunctionHelpController.php
--- a/src/applications/typeahead/controller/PhabricatorTypeaheadFunctionHelpController.php
+++ b/src/applications/typeahead/controller/PhabricatorTypeaheadFunctionHelpController.php
@@ -11,9 +11,10 @@
$viewer = $this->getViewer();
$class = $request->getURIData('class');
- $sources = id(new PhutilSymbolLoader())
+ $sources = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorTypeaheadDatasource')
- ->loadObjects();
+ ->execute();
+
if (!isset($sources[$class])) {
return new Aphront404Response();
}
diff --git a/src/applications/typeahead/controller/PhabricatorTypeaheadModularDatasourceController.php b/src/applications/typeahead/controller/PhabricatorTypeaheadModularDatasourceController.php
--- a/src/applications/typeahead/controller/PhabricatorTypeaheadModularDatasourceController.php
+++ b/src/applications/typeahead/controller/PhabricatorTypeaheadModularDatasourceController.php
@@ -29,9 +29,10 @@
// This makes form submission easier in the debug view.
$class = nonempty($request->getURIData('class'), $request->getStr('class'));
- $sources = id(new PhutilSymbolLoader())
+ $sources = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorTypeaheadDatasource')
- ->loadObjects();
+ ->execute();
+
if (isset($sources[$class])) {
$source = $sources[$class];
$source->setParameters($request->getRequestData());
diff --git a/src/applications/uiexample/controller/PhabricatorUIExampleRenderController.php b/src/applications/uiexample/controller/PhabricatorUIExampleRenderController.php
--- a/src/applications/uiexample/controller/PhabricatorUIExampleRenderController.php
+++ b/src/applications/uiexample/controller/PhabricatorUIExampleRenderController.php
@@ -13,11 +13,10 @@
}
public function processRequest() {
-
- $classes = id(new PhutilSymbolLoader())
+ $classes = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorUIExample')
- ->loadObjects();
- $classes = msort($classes, 'getName');
+ ->setSortMethod('getName')
+ ->execute();
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI($this->getApplicationURI('view/')));
diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomField.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomField.php
--- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomField.php
+++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomField.php
@@ -22,9 +22,9 @@
PhabricatorCustomField $template,
array $config) {
- $types = id(new PhutilSymbolLoader())
+ $types = id(new PhutilClassMapQuery())
->setAncestorClass(__CLASS__)
- ->loadObjects();
+ ->execute();
$types = mpull($types, null, 'getFieldType');
$fields = array();
diff --git a/src/infrastructure/daemon/workers/PhabricatorTriggerDaemon.php b/src/infrastructure/daemon/workers/PhabricatorTriggerDaemon.php
--- a/src/infrastructure/daemon/workers/PhabricatorTriggerDaemon.php
+++ b/src/infrastructure/daemon/workers/PhabricatorTriggerDaemon.php
@@ -385,9 +385,9 @@
* @task garbage
*/
private function loadGarbageCollectors() {
- return id(new PhutilSymbolLoader())
+ return id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorGarbageCollector')
- ->loadObjects();
+ ->execute();
}
diff --git a/src/infrastructure/env/PhabricatorEnv.php b/src/infrastructure/env/PhabricatorEnv.php
--- a/src/infrastructure/env/PhabricatorEnv.php
+++ b/src/infrastructure/env/PhabricatorEnv.php
@@ -200,10 +200,11 @@
$default_source->loadExternalOptions();
// If this install has site config sources, load them now.
- $site_sources = id(new PhutilSymbolLoader())
+ $site_sources = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorConfigSiteSource')
- ->loadObjects();
- $site_sources = msort($site_sources, 'getPriority');
+ ->setSortMethod('getPriority')
+ ->execute();
+
foreach ($site_sources as $site_source) {
$stack->pushSource($site_source);
}
diff --git a/src/infrastructure/events/PhabricatorEventEngine.php b/src/infrastructure/events/PhabricatorEventEngine.php
--- a/src/infrastructure/events/PhabricatorEventEngine.php
+++ b/src/infrastructure/events/PhabricatorEventEngine.php
@@ -9,9 +9,9 @@
// be able to run `bin/config` in order to remove an invalid listener.
// Load automatic listeners.
- $listeners = id(new PhutilSymbolLoader())
+ $listeners = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorAutoEventListener')
- ->loadObjects();
+ ->execute();
// Load configured listeners.
$config_listeners = PhabricatorEnv::getEnvConfig('events.listeners');
diff --git a/src/infrastructure/markup/PhabricatorMarkupEngine.php b/src/infrastructure/markup/PhabricatorMarkupEngine.php
--- a/src/infrastructure/markup/PhabricatorMarkupEngine.php
+++ b/src/infrastructure/markup/PhabricatorMarkupEngine.php
@@ -622,15 +622,15 @@
}
private static function loadCustomInlineRules() {
- return id(new PhutilSymbolLoader())
+ return id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorRemarkupCustomInlineRule')
- ->loadObjects();
+ ->execute();
}
private static function loadCustomBlockRules() {
- return id(new PhutilSymbolLoader())
+ return id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorRemarkupCustomBlockRule')
- ->loadObjects();
+ ->execute();
}
}
diff --git a/src/infrastructure/storage/patch/PhabricatorSQLPatchList.php b/src/infrastructure/storage/patch/PhabricatorSQLPatchList.php
--- a/src/infrastructure/storage/patch/PhabricatorSQLPatchList.php
+++ b/src/infrastructure/storage/patch/PhabricatorSQLPatchList.php
@@ -37,31 +37,15 @@
}
final public static function buildAllPatches() {
- $patch_lists = id(new PhutilSymbolLoader())
+ $patch_lists = id(new PhutilClassMapQuery())
->setAncestorClass(__CLASS__)
- ->setConcreteOnly(true)
- ->selectAndLoadSymbols();
+ ->setUniqueMethod('getNamespace')
+ ->execute();
$specs = array();
$seen_namespaces = array();
- foreach ($patch_lists as $patch_class) {
- $patch_class = $patch_class['name'];
- $patch_list = newv($patch_class, array());
-
- $namespace = $patch_list->getNamespace();
- if (isset($seen_namespaces[$namespace])) {
- $prior = $seen_namespaces[$namespace];
- throw new Exception(
- pht(
- "%s '%s' has the same namespace, '%s', as another patch list ".
- "class, '%s'. Each patch list MUST have a unique namespace.",
- __CLASS__,
- $patch_class,
- $namespace,
- $prior));
- }
-
+ foreach ($patch_lists as $patch_list) {
$last_key = null;
foreach ($patch_list->getPatches() as $key => $patch) {
if (!is_array($patch)) {
@@ -69,7 +53,7 @@
pht(
"%s '%s' has a patch '%s' which is not an array.",
__CLASS__,
- $patch_class,
+ get_class($patch_list),
$key));
}
@@ -88,7 +72,7 @@
"%s '%s' has a patch, '%s', with an unknown property, '%s'.".
"Patches must have only valid keys: %s.",
__CLASS__,
- $patch_class,
+ get_class($patch_list),
$key,
$pkey,
implode(', ', array_keys($valid))));
@@ -101,7 +85,7 @@
"%s '%s' has a patch with a numeric key, '%s'. ".
"Patches must use string keys.",
__CLASS__,
- $patch_class,
+ get_class($patch_list),
$key));
}
@@ -111,10 +95,11 @@
"%s '%s' has a patch with a colon in the key name, '%s'. ".
"Patch keys may not contain colons.",
__CLASS__,
- $patch_class,
+ get_class($patch_list),
$key));
}
+ $namespace = $patch_list->getNamespace();
$full_key = "{$namespace}:{$key}";
if (isset($specs[$full_key])) {
@@ -123,7 +108,7 @@
"%s '%s' has a patch '%s' which duplicates an ".
"existing patch key.",
__CLASS__,
- $patch_class,
+ get_class($patch_list),
$key));
}
@@ -152,7 +137,7 @@
"determined implicitly. The first patch in a patch list must ".
"list the patch or patches it depends on explicitly.",
$full_key,
- $patch_class));
+ get_class($patch_list)));
} else {
$patch['after'] = array($last_key);
}
diff --git a/support/aphlict/server/aphlict_launcher.php b/support/aphlict/server/aphlict_launcher.php
--- a/support/aphlict/server/aphlict_launcher.php
+++ b/support/aphlict/server/aphlict_launcher.php
@@ -16,8 +16,8 @@
);
$args->parseStandardArguments();
-$workflows = id(new PhutilSymbolLoader())
+$workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorAphlictManagementWorkflow')
- ->loadObjects();
+ ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows);

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 19, 7:08 PM (2 h, 24 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6908380
Default Alt Text
D13589.id32842.diff (49 KB)

Event Timeline