1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-19 16:58:48 +02:00

Formalize phid.external-loaders

Test Plan: /config/issue/

Reviewers: edward, codeblock, epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4516
This commit is contained in:
vrana 2013-01-19 10:20:22 -08:00 committed by epriestley
parent df60053e9c
commit 3a93ecdc53
4 changed files with 38 additions and 0 deletions

View file

@ -578,6 +578,7 @@ phutil_register_library_map(array(
'ManiphestView' => 'applications/maniphest/view/ManiphestView.php',
'MetaMTAConstants' => 'applications/metamta/constants/MetaMTAConstants.php',
'MetaMTANotificationType' => 'applications/metamta/constants/MetaMTANotificationType.php',
'ObjectHandleLoader' => 'applications/phid/handle/ObjectHandleLoader.php',
'OwnersPackageReplyHandler' => 'applications/owners/OwnersPackageReplyHandler.php',
'PackageCreateMail' => 'applications/owners/mail/PackageCreateMail.php',
'PackageDeleteMail' => 'applications/owners/mail/PackageDeleteMail.php',
@ -1040,6 +1041,7 @@ phutil_register_library_map(array(
'PhabricatorOwnersPath' => 'applications/owners/storage/PhabricatorOwnersPath.php',
'PhabricatorPHDConfigOptions' => 'applications/config/option/PhabricatorPHDConfigOptions.php',
'PhabricatorPHID' => 'applications/phid/storage/PhabricatorPHID.php',
'PhabricatorPHIDConfigOptions' => 'applications/phid/config/PhabricatorPHIDConfigOptions.php',
'PhabricatorPHIDConstants' => 'applications/phid/PhabricatorPHIDConstants.php',
'PhabricatorPHIDController' => 'applications/phid/controller/PhabricatorPHIDController.php',
'PhabricatorPHIDLookupController' => 'applications/phid/controller/PhabricatorPHIDLookupController.php',
@ -2403,6 +2405,7 @@ phutil_register_library_map(array(
'PhabricatorOwnersPackageTestCase' => 'PhabricatorTestCase',
'PhabricatorOwnersPath' => 'PhabricatorOwnersDAO',
'PhabricatorPHDConfigOptions' => 'PhabricatorApplicationConfigOptions',
'PhabricatorPHIDConfigOptions' => 'PhabricatorApplicationConfigOptions',
'PhabricatorPHIDController' => 'PhabricatorController',
'PhabricatorPHIDLookupController' => 'PhabricatorPHIDController',
'PhabricatorPHPMailerConfigOptions' => 'PhabricatorApplicationConfigOptions',

View file

@ -0,0 +1,27 @@
<?php
final class PhabricatorPHIDConfigOptions
extends PhabricatorApplicationConfigOptions {
public function getName() {
return pht("PHID");
}
public function getDescription() {
return pht("Configure PHID generation and lookup.");
}
public function getOptions() {
return array(
$this->newOption(
'phid.external-loaders',
'wild',
null)
->setDescription(
pht(
'For each new 4-char PHID type, point to an external loader for '.
'that type.')),
);
}
}

View file

@ -0,0 +1,7 @@
<?php
abstract class ObjectHandleLoader {
abstract public function loadHandles(array $phids);
}

View file

@ -689,6 +689,7 @@ final class PhabricatorObjectHandleData {
if ($loader) {
$object = newv($loader, array());
assert_instances_of(array($type => $object), 'ObjectHandleLoader');
$handles += $object->loadHandles($phids);
break;
}