1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-09 16:32:39 +01:00

Use PhutilClassMapQuery instead of PhutilSymbolLoader

Summary: Use `PhutilClassMaQuery` instead of `PhutilSymbolLoader`, mostly for consistency. Depends on D13588.

Test Plan: Poked around a bunch of pages.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D13589
This commit is contained in:
Joshua Spence 2015-08-14 07:49:00 +10:00
parent 7938d9a529
commit 368f359114
73 changed files with 180 additions and 257 deletions

View file

@ -14,8 +14,8 @@ EOSYNOPSIS
); );
$args->parseStandardArguments(); $args->parseStandardArguments();
$workflows = id(new PhutilSymbolLoader()) $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('AlmanacManagementWorkflow') ->setAncestorClass('AlmanacManagementWorkflow')
->loadObjects(); ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow(); $workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows); $args->parseWorkflows($workflows);

View file

@ -14,8 +14,8 @@ EOSYNOPSIS
); );
$args->parseStandardArguments(); $args->parseStandardArguments();
$workflows = id(new PhutilSymbolLoader()) $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorCacheManagementWorkflow') ->setAncestorClass('PhabricatorCacheManagementWorkflow')
->loadObjects(); ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow(); $workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows); $args->parseWorkflows($workflows);

View file

@ -16,8 +16,8 @@ EOSYNOPSIS
); );
$args->parseStandardArguments(); $args->parseStandardArguments();
$workflows = id(new PhutilSymbolLoader()) $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorDaemonManagementWorkflow') ->setAncestorClass('PhabricatorDaemonManagementWorkflow')
->loadObjects(); ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow(); $workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows); $args->parseWorkflows($workflows);

View file

@ -14,8 +14,8 @@ EOHELP
); );
$args->parseStandardArguments(); $args->parseStandardArguments();
$workflows = id(new PhutilSymbolLoader()) $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('DivinerWorkflow') ->setAncestorClass('DivinerWorkflow')
->loadObjects(); ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow(); $workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows); $args->parseWorkflows($workflows);

View file

@ -14,8 +14,8 @@ EOSYNOPSIS
); );
$args->parseStandardArguments(); $args->parseStandardArguments();
$workflows = id(new PhutilSymbolLoader()) $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('DrydockManagementWorkflow') ->setAncestorClass('DrydockManagementWorkflow')
->loadObjects(); ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow(); $workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows); $args->parseWorkflows($workflows);

View file

@ -15,8 +15,8 @@ EOSYNOPSIS
); );
$args->parseStandardArguments(); $args->parseStandardArguments();
$workflows = id(new PhutilSymbolLoader()) $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorFactManagementWorkflow') ->setAncestorClass('PhabricatorFactManagementWorkflow')
->loadObjects(); ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow(); $workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows); $args->parseWorkflows($workflows);

View file

@ -14,8 +14,8 @@ EOSYNOPSIS
); );
$args->parseStandardArguments(); $args->parseStandardArguments();
$workflows = id(new PhutilSymbolLoader()) $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorFilesManagementWorkflow') ->setAncestorClass('PhabricatorFilesManagementWorkflow')
->loadObjects(); ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow(); $workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows); $args->parseWorkflows($workflows);

View file

@ -14,8 +14,8 @@ EOSYNOPSIS
); );
$args->parseStandardArguments(); $args->parseStandardArguments();
$workflows = id(new PhutilSymbolLoader()) $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorLipsumManagementWorkflow') ->setAncestorClass('PhabricatorLipsumManagementWorkflow')
->loadObjects(); ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow(); $workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows); $args->parseWorkflows($workflows);

View file

@ -14,8 +14,8 @@ EOSYNOPSIS
); );
$args->parseStandardArguments(); $args->parseStandardArguments();
$workflows = id(new PhutilSymbolLoader()) $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorMailManagementWorkflow') ->setAncestorClass('PhabricatorMailManagementWorkflow')
->loadObjects(); ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow(); $workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows); $args->parseWorkflows($workflows);

View file

@ -15,8 +15,8 @@ EOSYNOPSIS
); );
$args->parseStandardArguments(); $args->parseStandardArguments();
$workflows = id(new PhutilSymbolLoader()) $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorRepositoryManagementWorkflow') ->setAncestorClass('PhabricatorRepositoryManagementWorkflow')
->loadObjects(); ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow(); $workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows); $args->parseWorkflows($workflows);

View file

@ -14,8 +14,8 @@ EOSYNOPSIS
); );
$args->parseStandardArguments(); $args->parseStandardArguments();
$workflows = id(new PhutilSymbolLoader()) $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorSearchManagementWorkflow') ->setAncestorClass('PhabricatorSearchManagementWorkflow')
->loadObjects(); ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow(); $workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows); $args->parseWorkflows($workflows);

View file

@ -14,8 +14,8 @@ EOSYNOPSIS
); );
$args->parseStandardArguments(); $args->parseStandardArguments();
$workflows = id(new PhutilSymbolLoader()) $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorAuditManagementWorkflow') ->setAncestorClass('PhabricatorAuditManagementWorkflow')
->loadObjects(); ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow(); $workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows); $args->parseWorkflows($workflows);

View file

@ -14,8 +14,8 @@ EOSYNOPSIS
); );
$args->parseStandardArguments(); $args->parseStandardArguments();
$workflows = id(new PhutilSymbolLoader()) $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorAuthManagementWorkflow') ->setAncestorClass('PhabricatorAuthManagementWorkflow')
->loadObjects(); ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow(); $workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows); $args->parseWorkflows($workflows);

View file

@ -14,8 +14,8 @@ EOSYNOPSIS
); );
$args->parseStandardArguments(); $args->parseStandardArguments();
$workflows = id(new PhutilSymbolLoader()) $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('CelerityManagementWorkflow') ->setAncestorClass('CelerityManagementWorkflow')
->loadObjects(); ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow(); $workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows); $args->parseWorkflows($workflows);

View file

@ -14,8 +14,8 @@ EOSYNOPSIS
); );
$args->parseStandardArguments(); $args->parseStandardArguments();
$workflows = id(new PhutilSymbolLoader()) $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorConfigManagementWorkflow') ->setAncestorClass('PhabricatorConfigManagementWorkflow')
->loadObjects(); ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow(); $workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows); $args->parseWorkflows($workflows);

View file

@ -14,8 +14,8 @@ EOSYNOPSIS
); );
$args->parseStandardArguments(); $args->parseStandardArguments();
$workflows = id(new PhutilSymbolLoader()) $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorFeedManagementWorkflow') ->setAncestorClass('PhabricatorFeedManagementWorkflow')
->loadObjects(); ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow(); $workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows); $args->parseWorkflows($workflows);

View file

@ -14,8 +14,8 @@ EOSYNOPSIS
); );
$args->parseStandardArguments(); $args->parseStandardArguments();
$workflows = id(new PhutilSymbolLoader()) $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('HarbormasterManagementWorkflow') ->setAncestorClass('HarbormasterManagementWorkflow')
->loadObjects(); ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow(); $workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows); $args->parseWorkflows($workflows);

View file

@ -14,8 +14,8 @@ EOSYNOPSIS
); );
$args->parseStandardArguments(); $args->parseStandardArguments();
$workflows = id(new PhutilSymbolLoader()) $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorHunksManagementWorkflow') ->setAncestorClass('PhabricatorHunksManagementWorkflow')
->loadObjects(); ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow(); $workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows); $args->parseWorkflows($workflows);

View file

@ -14,8 +14,8 @@ EOSYNOPSIS
); );
$args->parseStandardArguments(); $args->parseStandardArguments();
$workflows = id(new PhutilSymbolLoader()) $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorInternationalizationManagementWorkflow') ->setAncestorClass('PhabricatorInternationalizationManagementWorkflow')
->loadObjects(); ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow(); $workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows); $args->parseWorkflows($workflows);

View file

@ -14,8 +14,8 @@ EOSYNOPSIS
); );
$args->parseStandardArguments(); $args->parseStandardArguments();
$workflows = id(new PhutilSymbolLoader()) $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorPhortuneManagementWorkflow') ->setAncestorClass('PhabricatorPhortuneManagementWorkflow')
->loadObjects(); ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow(); $workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows); $args->parseWorkflows($workflows);

View file

@ -14,8 +14,8 @@ EOSYNOPSIS
); );
$args->parseStandardArguments(); $args->parseStandardArguments();
$workflows = id(new PhutilSymbolLoader()) $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorPolicyManagementWorkflow') ->setAncestorClass('PhabricatorPolicyManagementWorkflow')
->loadObjects(); ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow(); $workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows); $args->parseWorkflows($workflows);

View file

@ -14,8 +14,8 @@ EOSYNOPSIS
); );
$args->parseStandardArguments(); $args->parseStandardArguments();
$workflows = id(new PhutilSymbolLoader()) $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorSystemRemoveWorkflow') ->setAncestorClass('PhabricatorSystemRemoveWorkflow')
->loadObjects(); ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow(); $workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows); $args->parseWorkflows($workflows);

View file

@ -14,8 +14,8 @@ EOSYNOPSIS
); );
$args->parseStandardArguments(); $args->parseStandardArguments();
$workflows = id(new PhutilSymbolLoader()) $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorWorkerTriggerManagementWorkflow') ->setAncestorClass('PhabricatorWorkerTriggerManagementWorkflow')
->loadObjects(); ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow(); $workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows); $args->parseWorkflows($workflows);

View file

@ -14,8 +14,8 @@ EOSYNOPSIS
); );
$args->parseStandardArguments(); $args->parseStandardArguments();
$workflows = id(new PhutilSymbolLoader()) $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorWorkerManagementWorkflow') ->setAncestorClass('PhabricatorWorkerManagementWorkflow')
->loadObjects(); ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow(); $workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows); $args->parseWorkflows($workflows);

View file

@ -14,8 +14,8 @@ EOSYNOPSIS
); );
$args->parseStandardArguments(); $args->parseStandardArguments();
$workflows = id(new PhutilSymbolLoader()) $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorSMSManagementWorkflow') ->setAncestorClass('PhabricatorSMSManagementWorkflow')
->loadObjects(); ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow(); $workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows); $args->parseWorkflows($workflows);

View file

@ -160,9 +160,9 @@ try {
exit(1); exit(1);
} }
$workflows = id(new PhutilSymbolLoader()) $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorStorageManagementWorkflow') ->setAncestorClass('PhabricatorStorageManagementWorkflow')
->loadObjects(); ->execute();
$patches = PhabricatorSQLPatchList::buildAllPatches(); $patches = PhabricatorSQLPatchList::buildAllPatches();

View file

@ -190,11 +190,10 @@ try {
$user->getUsername())); $user->getUsername()));
} }
$workflows = id(new PhutilSymbolLoader()) $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorSSHWorkflow') ->setAncestorClass('PhabricatorSSHWorkflow')
->loadObjects(); ->setUniqueMethod('getName')
->execute();
$workflow_names = mpull($workflows, 'getName', 'getName');
if (!$original_argv) { if (!$original_argv) {
throw new Exception( throw new Exception(
@ -210,7 +209,7 @@ try {
$user->getUsername(), $user->getUsername(),
'git clone', 'git clone',
'hg push', 'hg push',
implode(', ', $workflow_names))); implode(', ', array_keys($workflows))));
} }
$log_argv = implode(' ', $original_argv); $log_argv = implode(' ', $original_argv);

View file

@ -3,9 +3,9 @@
final class PhabricatorConduitTestCase extends PhabricatorTestCase { final class PhabricatorConduitTestCase extends PhabricatorTestCase {
public function testConduitMethods() { public function testConduitMethods() {
$methods = id(new PhutilSymbolLoader()) $methods = id(new PhutilClassMapQuery())
->setAncestorClass('ConduitAPIMethod') ->setAncestorClass('ConduitAPIMethod')
->loadObjects(); ->execute();
// We're just looking for a side effect of ConduitCall construction // We're just looking for a side effect of ConduitCall construction
// here: it will throw if any methods define reserved parameter names. // here: it will throw if any methods define reserved parameter names.

View file

@ -139,34 +139,10 @@ abstract class ConduitAPIMethod
} }
public static function loadAllConduitMethods() { public static function loadAllConduitMethods() {
static $method_map = null; return id(new PhutilClassMapQuery())
->setAncestorClass(__CLASS__)
if ($method_map === null) { ->setUniqueMethod('getAPIMethodName')
$methods = id(new PhutilSymbolLoader()) ->execute();
->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;
} }
public static function getConduitMethod($method_name) { public static function getConduitMethod($method_name) {

View file

@ -19,10 +19,9 @@ final class ConduitQueryConduitAPIMethod extends ConduitAPIMethod {
} }
protected function execute(ConduitAPIRequest $request) { protected function execute(ConduitAPIRequest $request) {
$classes = id(new PhutilSymbolLoader()) $classes = id(new PhutilClassMapQuery())
->setAncestorClass('ConduitAPIMethod') ->setAncestorClass('ConduitAPIMethod')
->setType('class') ->execute();
->loadObjects();
$names_to_params = array(); $names_to_params = array();
foreach ($classes as $class) { foreach ($classes as $class) {

View file

@ -47,14 +47,10 @@ final class PhabricatorConduitMethodQuery
} }
private function getAllMethods() { private function getAllMethods() {
static $methods; return id(new PhutilClassMapQuery())
if ($methods === null) { ->setAncestorClass('ConduitAPIMethod')
$methods = id(new PhutilSymbolLoader()) ->setSortMethod('getSortOrder')
->setAncestorClass('ConduitAPIMethod') ->execute();
->loadObjects();
$methods = msort($methods, 'getSortOrder');
}
return $methods;
} }
private function filterMethods(array $methods) { private function filterMethods(array $methods) {

View file

@ -9,9 +9,9 @@ final class PhabricatorConfigCoreSchemaSpec
public function buildSchemata() { public function buildSchemata() {
// Build all Lisk table schemata. // Build all Lisk table schemata.
$lisk_objects = id(new PhutilSymbolLoader()) $lisk_objects = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorLiskDAO') ->setAncestorClass('PhabricatorLiskDAO')
->loadObjects(); ->execute();
$counters = array(); $counters = array();
foreach ($lisk_objects as $object) { foreach ($lisk_objects as $object) {

View file

@ -155,9 +155,9 @@ final class PhabricatorConfigSchemaQuery extends Phobject {
$databases = $this->getDatabaseNames(); $databases = $this->getDatabaseNames();
$info = $this->getAPI()->getCharsetInfo(); $info = $this->getAPI()->getCharsetInfo();
$specs = id(new PhutilSymbolLoader()) $specs = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorConfigSchemaSpec') ->setAncestorClass('PhabricatorConfigSchemaSpec')
->loadObjects(); ->execute();
$server_schema = new PhabricatorConfigServerSchema(); $server_schema = new PhabricatorConfigServerSchema();
foreach ($specs as $spec) { foreach ($specs as $spec) {

View file

@ -6,19 +6,13 @@ final class DarkConsoleCore extends Phobject {
const STORAGE_VERSION = 1; const STORAGE_VERSION = 1;
public function __construct() { public function __construct() {
$symbols = id(new PhutilSymbolLoader()) $this->plugins = id(new PhutilClassMapQuery())
->setType('class')
->setAncestorClass('DarkConsolePlugin') ->setAncestorClass('DarkConsolePlugin')
->selectAndLoadSymbols(); ->execute();
foreach ($symbols as $symbol) { foreach ($this->plugins as $plugin) {
$plugin = newv($symbol['name'], array());
if (!$plugin->shouldStartup()) {
continue;
}
$plugin->setConsoleCore($this); $plugin->setConsoleCore($this);
$plugin->didStartup(); $plugin->didStartup();
$this->plugins[$symbol['name']] = $plugin;
} }
} }

View file

@ -62,10 +62,6 @@ abstract class DarkConsolePlugin extends Phobject {
return $this->getRequest()->getRequestURI(); return $this->getRequest()->getRequestURI();
} }
public function shouldStartup() {
return true;
}
public function didStartup() { public function didStartup() {
return null; return null;
} }

View file

@ -6,8 +6,7 @@ abstract class PhabricatorDaemonManagementWorkflow
private $runDaemonsAsUser = null; private $runDaemonsAsUser = null;
final protected function loadAvailableDaemonClasses() { final protected function loadAvailableDaemonClasses() {
$loader = new PhutilSymbolLoader(); return id(new PhutilSymbolLoader())
return $loader
->setAncestorClass('PhutilDaemon') ->setAncestorClass('PhutilDaemon')
->setConcreteOnly(true) ->setConcreteOnly(true)
->selectSymbolsWithoutLoading(); ->selectSymbolsWithoutLoading();

View file

@ -12,11 +12,11 @@ final class PhabricatorDashboardPanelSearchApplicationCustomField
} }
public function renderEditControl(array $handles) { public function renderEditControl(array $handles) {
$engines = id(new PhutilClassMapQuery())
$engines = id(new PhutilSymbolLoader())
->setAncestorClass('PhabricatorApplicationSearchEngine') ->setAncestorClass('PhabricatorApplicationSearchEngine')
->loadObjects(); ->setFilterMethod('canUseInPanelContext')
$engines = mfilter($engines, 'canUseInPanelContext'); ->execute();
$all_apps = id(new PhabricatorApplicationQuery()) $all_apps = id(new PhabricatorApplicationQuery())
->setViewer($this->getViewer()) ->setViewer($this->getViewer())
->withUnlisted(false) ->withUnlisted(false)

View file

@ -12,11 +12,10 @@ final class PhabricatorDashboardPanelSearchQueryCustomField
} }
public function renderEditControl(array $handles) { public function renderEditControl(array $handles) {
$engines = id(new PhutilClassMapQuery())
$engines = id(new PhutilSymbolLoader())
->setAncestorClass('PhabricatorApplicationSearchEngine') ->setAncestorClass('PhabricatorApplicationSearchEngine')
->loadObjects(); ->setFilterMethod('canUseInPanelContext')
$engines = mfilter($engines, 'canUseInPanelContext'); ->execute();
$value = $this->getFieldValue(); $value = $this->getFieldValue();

View file

@ -37,9 +37,10 @@ final class DifferentialLandingActionMenuEventListener
return null; return null;
} }
$strategies = id(new PhutilSymbolLoader()) $strategies = id(new PhutilClassMapQuery())
->setAncestorClass('DifferentialLandingStrategy') ->setAncestorClass('DifferentialLandingStrategy')
->loadObjects(); ->execute();
foreach ($strategies as $strategy) { foreach ($strategies as $strategy) {
$viewer = $event->getUser(); $viewer = $event->getUser();
$action = $strategy->createMenuItem($viewer, $revision, $repository); $action = $strategy->createMenuItem($viewer, $revision, $repository);

View file

@ -64,9 +64,10 @@ final class DiffusionSymbolController extends DiffusionController {
$external_query->withLanguages(array($request->getStr('lang'))); $external_query->withLanguages(array($request->getStr('lang')));
} }
$external_sources = id(new PhutilSymbolLoader()) $external_sources = id(new PhutilClassMapQuery())
->setAncestorClass('DiffusionExternalSymbolsSource') ->setAncestorClass('DiffusionExternalSymbolsSource')
->loadObjects(); ->execute();
$results = array($symbols); $results = array($symbols);
foreach ($external_sources as $source) { foreach ($external_sources as $source) {
$results[] = $source->executeQuery($external_query); $results[] = $source->executeQuery($external_query);

View file

@ -414,10 +414,9 @@ final class DivinerGenerateWorkflow extends DivinerWorkflow {
$version['atom'] = DivinerAtom::getAtomSerializationVersion(); $version['atom'] = DivinerAtom::getAtomSerializationVersion();
$version['rules'] = $this->getRules(); $version['rules'] = $this->getRules();
$atomizers = id(new PhutilSymbolLoader()) $atomizers = id(new PhutilClassMapQuery())
->setAncestorClass('DivinerAtomizer') ->setAncestorClass('DivinerAtomizer')
->setConcreteOnly(true) ->execute();
->selectAndLoadSymbols();
$atomizer_versions = array(); $atomizer_versions = array();
foreach ($atomizers as $atomizer) { foreach ($atomizers as $atomizer) {

View file

@ -88,14 +88,12 @@ final class DoorkeeperImportEngine extends Phobject {
} }
if (!$this->localOnly) { if (!$this->localOnly) {
$bridges = id(new PhutilSymbolLoader()) $bridges = id(new PhutilClassMapQuery())
->setAncestorClass('DoorkeeperBridge') ->setAncestorClass('DoorkeeperBridge')
->loadObjects(); ->setFilterMethod('isEnabled')
->execute();
foreach ($bridges as $key => $bridge) { foreach ($bridges as $key => $bridge) {
if (!$bridge->isEnabled()) {
unset($bridges[$key]);
}
$bridge->setViewer($viewer); $bridge->setViewer($viewer);
$bridge->setThrowOnMissingLink($this->throwOnMissingLink); $bridge->setThrowOnMissingLink($this->throwOnMissingLink);
} }

View file

@ -120,9 +120,9 @@ final class PhabricatorAsanaConfigOptions
$viewer = $request->getUser(); $viewer = $request->getUser();
$publishers = id(new PhutilSymbolLoader()) $publishers = id(new PhutilClassMapQuery())
->setAncestorClass('DoorkeeperFeedStoryPublisher') ->setAncestorClass('DoorkeeperFeedStoryPublisher')
->loadObjects(); ->execute();
$out = array(); $out = array();
$out[] = pht( $out[] = pht(

View file

@ -125,9 +125,9 @@ abstract class DoorkeeperFeedWorker extends FeedPushWorker {
$viewer = $this->getViewer(); $viewer = $this->getViewer();
$object = $this->getStoryObject(); $object = $this->getStoryObject();
$publishers = id(new PhutilSymbolLoader()) $publishers = id(new PhutilClassMapQuery())
->setAncestorClass('DoorkeeperFeedStoryPublisher') ->setAncestorClass('DoorkeeperFeedStoryPublisher')
->loadObjects(); ->execute();
foreach ($publishers as $publisher) { foreach ($publishers as $publisher) {
if (!$publisher->canPublishStory($story, $object)) { if (!$publisher->canPublishStory($story, $object)) {

View file

@ -23,6 +23,7 @@ final class FeedPublisherWorker extends FeedPushWorker {
); );
// Find and schedule all the enabled Doorkeeper publishers. // Find and schedule all the enabled Doorkeeper publishers.
// TODO: Use PhutilClassMapQuery?
$doorkeeper_workers = id(new PhutilSymbolLoader()) $doorkeeper_workers = id(new PhutilSymbolLoader())
->setAncestorClass('DoorkeeperFeedWorker') ->setAncestorClass('DoorkeeperFeedWorker')
->loadObjects($argv); ->loadObjects($argv);

View file

@ -882,18 +882,9 @@ final class PhabricatorFile extends PhabricatorFileDAO
} }
public static function buildAllEngines() { public static function buildAllEngines() {
$engines = id(new PhutilSymbolLoader()) return id(new PhutilClassMapQuery())
->setType('class')
->setConcreteOnly(true)
->setAncestorClass('PhabricatorFileStorageEngine') ->setAncestorClass('PhabricatorFileStorageEngine')
->selectAndLoadSymbols(); ->execute();
$results = array();
foreach ($engines as $engine_class) {
$results[] = newv($engine_class['name'], array());
}
return $results;
} }
public function getViewableMimeType() { public function getViewableMimeType() {

View file

@ -100,11 +100,13 @@ final class PhabricatorFlagSearchEngine
} }
private function getObjectFilterOptions() { private function getObjectFilterOptions() {
$objects = id(new PhutilSymbolLoader()) $objects = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorFlaggableInterface') ->setAncestorClass('PhabricatorFlaggableInterface')
->loadObjects(); ->execute();
$all_types = PhabricatorPHIDType::getAllTypes(); $all_types = PhabricatorPHIDType::getAllTypes();
$options = array(); $options = array();
foreach ($objects as $object) { foreach ($objects as $object) {
$phid = $object->generatePHID(); $phid = $object->generatePHID();
$phid_type = phid_get_type($phid); $phid_type = phid_get_type($phid);

View file

@ -291,9 +291,9 @@ final class HarbormasterBuild extends HarbormasterDAO
} }
public static function getAvailableBuildVariables() { public static function getAvailableBuildVariables() {
$objects = id(new PhutilSymbolLoader()) $objects = id(new PhutilClassMapQuery())
->setAncestorClass('HarbormasterBuildableInterface') ->setAncestorClass('HarbormasterBuildableInterface')
->loadObjects(); ->execute();
$variables = array(); $variables = array();
$variables[] = array( $variables[] = array(

View file

@ -20,9 +20,9 @@ final class PhabricatorLipsumGenerateWorkflow
public function execute(PhutilArgumentParser $args) { public function execute(PhutilArgumentParser $args) {
$console = PhutilConsole::getConsole(); $console = PhutilConsole::getConsole();
$supported_types = id(new PhutilSymbolLoader()) $supported_types = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorTestDataGenerator') ->setAncestorClass('PhabricatorTestDataGenerator')
->loadObjects(); ->execute();
$console->writeOut( $console->writeOut(
"%s:\n\t%s\n", "%s:\n\t%s\n",

View file

@ -105,15 +105,13 @@ final class PhabricatorMailManagementReceiveTestWorkflow
'to' => $to.'+1+'.$pseudohash, 'to' => $to.'+1+'.$pseudohash,
)); ));
$receivers = id(new PhutilSymbolLoader()) $receivers = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorMailReceiver') ->setAncestorClass('PhabricatorMailReceiver')
->loadObjects(); ->setFilterMethod('isEnabled')
->execute();
$receiver = null; $receiver = null;
foreach ($receivers as $possible_receiver) { foreach ($receivers as $possible_receiver) {
if (!$possible_receiver->isEnabled()) {
continue;
}
if (!$possible_receiver->canAcceptMail($pseudomail)) { if (!$possible_receiver->canAcceptMail($pseudomail)) {
continue; continue;
} }

View file

@ -265,15 +265,13 @@ final class PhabricatorMetaMTAReceivedMail extends PhabricatorMetaMTADAO {
* accepts this mail, if one exists. * accepts this mail, if one exists.
*/ */
private function loadReceiver() { private function loadReceiver() {
$receivers = id(new PhutilSymbolLoader()) $receivers = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorMailReceiver') ->setAncestorClass('PhabricatorMailReceiver')
->loadObjects(); ->setFilterMethod('isEnabled')
->execute();
$accept = array(); $accept = array();
foreach ($receivers as $key => $receiver) { foreach ($receivers as $key => $receiver) {
if (!$receiver->isEnabled()) {
continue;
}
if ($receiver->canAcceptMail($this)) { if ($receiver->canAcceptMail($this)) {
$accept[$key] = $receiver; $accept[$key] = $receiver;
} }

View file

@ -307,9 +307,9 @@ final class PhabricatorPolicyTestCase extends PhabricatorTestCase {
} }
public function testAllQueriesBelongToActualApplications() { public function testAllQueriesBelongToActualApplications() {
$queries = id(new PhutilSymbolLoader()) $queries = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorPolicyAwareQuery') ->setAncestorClass('PhabricatorPolicyAwareQuery')
->loadObjects(); ->execute();
foreach ($queries as $qclass => $query) { foreach ($queries as $qclass => $query) {
$class = $query->getQueryApplicationClass(); $class = $query->getQueryApplicationClass();

View file

@ -4,10 +4,10 @@ final class PolicyLockOptionType
extends PhabricatorConfigJSONOptionType { extends PhabricatorConfigJSONOptionType {
public function validateOption(PhabricatorConfigOption $option, $value) { public function validateOption(PhabricatorConfigOption $option, $value) {
$capabilities = id(new PhutilSymbolLoader()) $capabilities = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorPolicyCapability') ->setAncestorClass('PhabricatorPolicyCapability')
->loadObjects(); ->setUniqueMethod('getCapabilityKey')
$capabilities = mpull($capabilities, null, 'getCapabilityKey'); ->execute();
$policy_phids = array(); $policy_phids = array();
foreach ($value as $capability_key => $policy) { foreach ($value as $capability_key => $policy) {

View file

@ -37,9 +37,9 @@ final class PhabricatorPolicyEditController
PhabricatorPolicy::ACTION_DENY => pht('Deny'), PhabricatorPolicy::ACTION_DENY => pht('Deny'),
); );
$rules = id(new PhutilSymbolLoader()) $rules = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorPolicyRule') ->setAncestorClass('PhabricatorPolicyRule')
->loadObjects(); ->execute();
foreach ($rules as $key => $rule) { foreach ($rules as $key => $rule) {
if (!$rule->canApplyToObject($object)) { if (!$rule->canApplyToObject($object)) {

View file

@ -305,9 +305,9 @@ final class PhabricatorPolicyQuery
} }
public static function getObjectPolicyRules($object) { public static function getObjectPolicyRules($object) {
$rules = id(new PhutilSymbolLoader()) $rules = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorPolicyRule') ->setAncestorClass('PhabricatorPolicyRule')
->loadObjects(); ->execute();
$results = array(); $results = array();
foreach ($rules as $rule) { foreach ($rules as $rule) {

View file

@ -15,9 +15,9 @@ final class PhabricatorSearchIndexer extends Phobject {
} }
public function indexDocumentByPHID($phid, $context) { public function indexDocumentByPHID($phid, $context) {
$indexers = id(new PhutilSymbolLoader()) $indexers = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorSearchDocumentIndexer') ->setAncestorClass('PhabricatorSearchDocumentIndexer')
->loadObjects(); ->execute();
foreach ($indexers as $indexer) { foreach ($indexers as $indexer) {
if ($indexer->shouldIndexDocumentByPHID($phid)) { if ($indexer->shouldIndexDocumentByPHID($phid)) {

View file

@ -122,9 +122,9 @@ final class PhabricatorSearchManagementIndexWorkflow
} }
private function loadPHIDsByTypes($type) { private function loadPHIDsByTypes($type) {
$indexers = id(new PhutilSymbolLoader()) $indexers = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorSearchDocumentIndexer') ->setAncestorClass('PhabricatorSearchDocumentIndexer')
->loadObjects(); ->execute();
$phids = array(); $phids = array();
foreach ($indexers as $indexer) { foreach ($indexers as $indexer) {

View file

@ -204,9 +204,9 @@ final class PhabricatorSearchApplicationSearchEngine
// TODO: This is inelegant and not very efficient, but gets us reasonable // TODO: This is inelegant and not very efficient, but gets us reasonable
// results. It would be nice to do this more elegantly. // results. It would be nice to do this more elegantly.
$indexers = id(new PhutilSymbolLoader()) $indexers = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorSearchDocumentIndexer') ->setAncestorClass('PhabricatorSearchDocumentIndexer')
->loadObjects(); ->execute();
if ($viewer) { if ($viewer) {
$types = PhabricatorPHIDType::getAllInstalledTypes($viewer); $types = PhabricatorPHIDType::getAllInstalledTypes($viewer);

View file

@ -75,19 +75,11 @@ final class PhabricatorSettingsMainController
} }
private function buildPanels() { private function buildPanels() {
$panel_specs = id(new PhutilSymbolLoader()) $panels = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorSettingsPanel') ->setAncestorClass('PhabricatorSettingsPanel')
->setConcreteOnly(true) ->setExpandMethod('buildPanels')
->selectAndLoadSymbols(); ->setUniqueMethod('getPanelKey')
->execute();
$panels = array();
foreach ($panel_specs as $spec) {
$class = newv($spec['name'], array());
$panels[] = $class->buildPanels();
}
$panels = array_mergev($panels);
$panels = mpull($panels, null, 'getPanelKey');
$result = array(); $result = array();
foreach ($panels as $key => $panel) { foreach ($panels as $key => $panel) {

View file

@ -191,16 +191,12 @@ final class PhabricatorEmailPreferencesSettingsPanel
} }
private function getAllEditorsWithTags(PhabricatorUser $user) { private function getAllEditorsWithTags(PhabricatorUser $user) {
$editors = id(new PhutilSymbolLoader()) $editors = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorApplicationTransactionEditor') ->setAncestorClass('PhabricatorApplicationTransactionEditor')
->loadObjects(); ->setFilterMethod('getMailTagsMap')
->execute();
foreach ($editors as $key => $editor) { 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. // Remove editors for applications which are not installed.
$app = $editor->getEditorApplicationClass(); $app = $editor->getEditorApplicationClass();
if ($app !== null) { if ($app !== null) {

View file

@ -23,9 +23,9 @@ final class PhabricatorApplicationTransactionShowOlderController
} }
$template = $object->getApplicationTransactionTemplate(); $template = $object->getApplicationTransactionTemplate();
$queries = id(new PhutilSymbolLoader()) $queries = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorApplicationTransactionQuery') ->setAncestorClass('PhabricatorApplicationTransactionQuery')
->loadObjects(); ->execute();
$object_query = null; $object_query = null;
foreach ($queries as $query) { foreach ($queries as $query) {

View file

@ -28,9 +28,9 @@ final class PhabricatorApplicationTransactionTransactionPHIDType
static $queries; static $queries;
if ($queries === null) { if ($queries === null) {
$objects = id(new PhutilSymbolLoader()) $objects = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorApplicationTransactionQuery') ->setAncestorClass('PhabricatorApplicationTransactionQuery')
->loadObjects(); ->execute();
$queries = array(); $queries = array();
foreach ($objects as $object) { foreach ($objects as $object) {

View file

@ -112,9 +112,9 @@ final class PhabricatorApplicationTransactionPublishWorker
* the transactions. * the transactions.
*/ */
private function buildTransactionQuery($type) { private function buildTransactionQuery($type) {
$queries = id(new PhutilSymbolLoader()) $queries = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorApplicationTransactionQuery') ->setAncestorClass('PhabricatorApplicationTransactionQuery')
->loadObjects(); ->execute();
foreach ($queries as $query) { foreach ($queries as $query) {
$query_type = $query $query_type = $query

View file

@ -11,9 +11,10 @@ final class PhabricatorTypeaheadFunctionHelpController
$viewer = $this->getViewer(); $viewer = $this->getViewer();
$class = $request->getURIData('class'); $class = $request->getURIData('class');
$sources = id(new PhutilSymbolLoader()) $sources = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorTypeaheadDatasource') ->setAncestorClass('PhabricatorTypeaheadDatasource')
->loadObjects(); ->execute();
if (!isset($sources[$class])) { if (!isset($sources[$class])) {
return new Aphront404Response(); return new Aphront404Response();
} }

View file

@ -29,9 +29,10 @@ final class PhabricatorTypeaheadModularDatasourceController
// This makes form submission easier in the debug view. // This makes form submission easier in the debug view.
$class = nonempty($request->getURIData('class'), $request->getStr('class')); $class = nonempty($request->getURIData('class'), $request->getStr('class'));
$sources = id(new PhutilSymbolLoader()) $sources = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorTypeaheadDatasource') ->setAncestorClass('PhabricatorTypeaheadDatasource')
->loadObjects(); ->execute();
if (isset($sources[$class])) { if (isset($sources[$class])) {
$source = $sources[$class]; $source = $sources[$class];
$source->setParameters($request->getRequestData()); $source->setParameters($request->getRequestData());

View file

@ -9,10 +9,10 @@ final class PhabricatorUIExampleRenderController extends PhabricatorController {
public function handleRequest(AphrontRequest $request) { public function handleRequest(AphrontRequest $request) {
$id = $request->getURIData('class'); $id = $request->getURIData('class');
$classes = id(new PhutilSymbolLoader()) $classes = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorUIExample') ->setAncestorClass('PhabricatorUIExample')
->loadObjects(); ->setSortMethod('getName')
$classes = msort($classes, 'getName'); ->execute();
$nav = new AphrontSideNavFilterView(); $nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI($this->getApplicationURI('view/'))); $nav->setBaseURI(new PhutilURI($this->getApplicationURI('view/')));

View file

@ -22,10 +22,10 @@ abstract class PhabricatorStandardCustomField
PhabricatorCustomField $template, PhabricatorCustomField $template,
array $config) { array $config) {
$types = id(new PhutilSymbolLoader()) $types = id(new PhutilClassMapQuery())
->setAncestorClass(__CLASS__) ->setAncestorClass(__CLASS__)
->loadObjects(); ->setUniqueMethod('getFieldType')
$types = mpull($types, null, 'getFieldType'); ->execute();
$fields = array(); $fields = array();
foreach ($config as $key => $value) { foreach ($config as $key => $value) {

View file

@ -385,9 +385,9 @@ final class PhabricatorTriggerDaemon
* @task garbage * @task garbage
*/ */
private function loadGarbageCollectors() { private function loadGarbageCollectors() {
return id(new PhutilSymbolLoader()) return id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorGarbageCollector') ->setAncestorClass('PhabricatorGarbageCollector')
->loadObjects(); ->execute();
} }

View file

@ -200,10 +200,11 @@ final class PhabricatorEnv extends Phobject {
$default_source->loadExternalOptions(); $default_source->loadExternalOptions();
// If this install has site config sources, load them now. // If this install has site config sources, load them now.
$site_sources = id(new PhutilSymbolLoader()) $site_sources = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorConfigSiteSource') ->setAncestorClass('PhabricatorConfigSiteSource')
->loadObjects(); ->setSortMethod('getPriority')
$site_sources = msort($site_sources, 'getPriority'); ->execute();
foreach ($site_sources as $site_source) { foreach ($site_sources as $site_source) {
$stack->pushSource($site_source); $stack->pushSource($site_source);
} }

View file

@ -9,9 +9,9 @@ final class PhabricatorEventEngine extends Phobject {
// be able to run `bin/config` in order to remove an invalid listener. // be able to run `bin/config` in order to remove an invalid listener.
// Load automatic listeners. // Load automatic listeners.
$listeners = id(new PhutilSymbolLoader()) $listeners = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorAutoEventListener') ->setAncestorClass('PhabricatorAutoEventListener')
->loadObjects(); ->execute();
// Load configured listeners. // Load configured listeners.
$config_listeners = PhabricatorEnv::getEnvConfig('events.listeners'); $config_listeners = PhabricatorEnv::getEnvConfig('events.listeners');

View file

@ -622,15 +622,15 @@ final class PhabricatorMarkupEngine extends Phobject {
} }
private static function loadCustomInlineRules() { private static function loadCustomInlineRules() {
return id(new PhutilSymbolLoader()) return id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorRemarkupCustomInlineRule') ->setAncestorClass('PhabricatorRemarkupCustomInlineRule')
->loadObjects(); ->execute();
} }
private static function loadCustomBlockRules() { private static function loadCustomBlockRules() {
return id(new PhutilSymbolLoader()) return id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorRemarkupCustomBlockRule') ->setAncestorClass('PhabricatorRemarkupCustomBlockRule')
->loadObjects(); ->execute();
} }
} }

View file

@ -37,31 +37,15 @@ abstract class PhabricatorSQLPatchList extends Phobject {
} }
final public static function buildAllPatches() { final public static function buildAllPatches() {
$patch_lists = id(new PhutilSymbolLoader()) $patch_lists = id(new PhutilClassMapQuery())
->setAncestorClass(__CLASS__) ->setAncestorClass(__CLASS__)
->setConcreteOnly(true) ->setUniqueMethod('getNamespace')
->selectAndLoadSymbols(); ->execute();
$specs = array(); $specs = array();
$seen_namespaces = array(); $seen_namespaces = array();
foreach ($patch_lists as $patch_class) { foreach ($patch_lists as $patch_list) {
$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));
}
$last_key = null; $last_key = null;
foreach ($patch_list->getPatches() as $key => $patch) { foreach ($patch_list->getPatches() as $key => $patch) {
if (!is_array($patch)) { if (!is_array($patch)) {
@ -69,7 +53,7 @@ abstract class PhabricatorSQLPatchList extends Phobject {
pht( pht(
"%s '%s' has a patch '%s' which is not an array.", "%s '%s' has a patch '%s' which is not an array.",
__CLASS__, __CLASS__,
$patch_class, get_class($patch_list),
$key)); $key));
} }
@ -88,7 +72,7 @@ abstract class PhabricatorSQLPatchList extends Phobject {
"%s '%s' has a patch, '%s', with an unknown property, '%s'.". "%s '%s' has a patch, '%s', with an unknown property, '%s'.".
"Patches must have only valid keys: %s.", "Patches must have only valid keys: %s.",
__CLASS__, __CLASS__,
$patch_class, get_class($patch_list),
$key, $key,
$pkey, $pkey,
implode(', ', array_keys($valid)))); implode(', ', array_keys($valid))));
@ -101,7 +85,7 @@ abstract class PhabricatorSQLPatchList extends Phobject {
"%s '%s' has a patch with a numeric key, '%s'. ". "%s '%s' has a patch with a numeric key, '%s'. ".
"Patches must use string keys.", "Patches must use string keys.",
__CLASS__, __CLASS__,
$patch_class, get_class($patch_list),
$key)); $key));
} }
@ -111,10 +95,11 @@ abstract class PhabricatorSQLPatchList extends Phobject {
"%s '%s' has a patch with a colon in the key name, '%s'. ". "%s '%s' has a patch with a colon in the key name, '%s'. ".
"Patch keys may not contain colons.", "Patch keys may not contain colons.",
__CLASS__, __CLASS__,
$patch_class, get_class($patch_list),
$key)); $key));
} }
$namespace = $patch_list->getNamespace();
$full_key = "{$namespace}:{$key}"; $full_key = "{$namespace}:{$key}";
if (isset($specs[$full_key])) { if (isset($specs[$full_key])) {
@ -123,7 +108,7 @@ abstract class PhabricatorSQLPatchList extends Phobject {
"%s '%s' has a patch '%s' which duplicates an ". "%s '%s' has a patch '%s' which duplicates an ".
"existing patch key.", "existing patch key.",
__CLASS__, __CLASS__,
$patch_class, get_class($patch_list),
$key)); $key));
} }
@ -152,7 +137,7 @@ abstract class PhabricatorSQLPatchList extends Phobject {
"determined implicitly. The first patch in a patch list must ". "determined implicitly. The first patch in a patch list must ".
"list the patch or patches it depends on explicitly.", "list the patch or patches it depends on explicitly.",
$full_key, $full_key,
$patch_class)); get_class($patch_list)));
} else { } else {
$patch['after'] = array($last_key); $patch['after'] = array($last_key);
} }

View file

@ -16,8 +16,8 @@ EOSYNOPSIS
); );
$args->parseStandardArguments(); $args->parseStandardArguments();
$workflows = id(new PhutilSymbolLoader()) $workflows = id(new PhutilClassMapQuery())
->setAncestorClass('PhabricatorAphlictManagementWorkflow') ->setAncestorClass('PhabricatorAphlictManagementWorkflow')
->loadObjects(); ->execute();
$workflows[] = new PhutilHelpArgumentWorkflow(); $workflows[] = new PhutilHelpArgumentWorkflow();
$args->parseWorkflows($workflows); $args->parseWorkflows($workflows);