Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F547604
PhabricatorPeopleDatasourceEngineExtension.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
802 B
Referenced Files
None
Subscribers
None
PhabricatorPeopleDatasourceEngineExtension.php
View Options
<?php
final
class
PhabricatorPeopleDatasourceEngineExtension
extends
PhabricatorDatasourceEngineExtension
{
public
function
newQuickSearchDatasources
()
{
return
array
(
new
PhabricatorPeopleDatasource
(),
);
}
public
function
newJumpURI
(
$query
)
{
$viewer
=
$this
->
getViewer
();
// Send "u" to the user directory.
if
(
preg_match
(
'/^u
\z
/i'
,
$query
))
{
return
'/people/'
;
}
// Send "u <string>" to the user's profile page.
$matches
=
null
;
if
(
preg_match
(
'/^u
\s
+(.+)
\z
/i'
,
$query
,
$matches
))
{
$raw_query
=
$matches
[
1
];
// TODO: We could test that this is a valid username and jump to
// a search in the user directory if it isn't.
return
urisprintf
(
'/p/%s/'
,
$raw_query
);
}
return
null
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 1:35 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
122893
Default Alt Text
PhabricatorPeopleDatasourceEngineExtension.php (802 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment