Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97584662
PhabricatorPeopleDatasourceEngineExtension.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Jan 5, 11:41
Size
802 B
Mime Type
text/x-php
Expires
Tue, Jan 7, 11:41 (2 d)
Engine
blob
Format
Raw Data
Handle
23431131
Attached To
rPH Phabricator
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
;
}
}
Event Timeline
Log In to Comment