mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-10 23:01:04 +01:00
Improve search/phid flexibility.
This commit is contained in:
parent
e1d68e852a
commit
2eb30aed9e
3 changed files with 22 additions and 2 deletions
|
@ -34,6 +34,8 @@ class PhabricatorObjectHandleData {
|
||||||
|
|
||||||
$handles = array();
|
$handles = array();
|
||||||
|
|
||||||
|
$external_loaders = PhabricatorEnv::getEnvConfig('phid.external-loaders');
|
||||||
|
|
||||||
foreach ($types as $type => $phids) {
|
foreach ($types as $type => $phids) {
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case PhabricatorPHIDConstants::PHID_TYPE_MAGIC:
|
case PhabricatorPHIDConstants::PHID_TYPE_MAGIC:
|
||||||
|
@ -200,6 +202,20 @@ class PhabricatorObjectHandleData {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
$loader = null;
|
||||||
|
if (isset($external_loaders[$type])) {
|
||||||
|
$loader = $external_loaders[$type];
|
||||||
|
} else if (isset($external_loaders['*'])) {
|
||||||
|
$loader = $external_loaders['*'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($loader) {
|
||||||
|
PhutilSymbolLoader::loadClass($loader);
|
||||||
|
$object = newv($loader, array());
|
||||||
|
$handles += $object->loadHandles($phids);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($phids as $phid) {
|
foreach ($phids as $phid) {
|
||||||
$handle = new PhabricatorObjectHandle();
|
$handle = new PhabricatorObjectHandle();
|
||||||
$handle->setType($type);
|
$handle->setType($type);
|
||||||
|
|
|
@ -30,7 +30,9 @@ class PhabricatorRepositorySvnCommitMessageParserWorker
|
||||||
$uri,
|
$uri,
|
||||||
$commit->getCommitIdentifier());
|
$commit->getCommitIdentifier());
|
||||||
|
|
||||||
// TODO: Need to slam UTF8.
|
// Subversion may send us back commit messages which won't parse because
|
||||||
|
// they have non UTF-8 garbage in them. Slam them into valid UTF-8.
|
||||||
|
$xml = phutil_utf8ize($xml);
|
||||||
|
|
||||||
$log = new SimpleXMLElement($xml);
|
$log = new SimpleXMLElement($xml);
|
||||||
$entry = $log->logentry[0];
|
$entry = $log->logentry[0];
|
||||||
|
|
|
@ -65,11 +65,13 @@ class PhabricatorSearchController extends PhabricatorSearchBaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$more = PhabricatorEnv::getEnvConfig('search.more-document-types', array());
|
||||||
|
|
||||||
$options = array(
|
$options = array(
|
||||||
'' => 'All Documents',
|
'' => 'All Documents',
|
||||||
PhabricatorPHIDConstants::PHID_TYPE_DREV => 'Differential Revisions',
|
PhabricatorPHIDConstants::PHID_TYPE_DREV => 'Differential Revisions',
|
||||||
PhabricatorPHIDConstants::PHID_TYPE_TASK => 'Maniphest Tasks',
|
PhabricatorPHIDConstants::PHID_TYPE_TASK => 'Maniphest Tasks',
|
||||||
);
|
) + $more;
|
||||||
|
|
||||||
$status_options = array(
|
$status_options = array(
|
||||||
0 => 'Open and Closed Documents',
|
0 => 'Open and Closed Documents',
|
||||||
|
|
Loading…
Reference in a new issue