Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2889218
PhabricatorMonogramDatasourceEngineExtension.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorMonogramDatasourceEngineExtension.php
View Options
<?php
final
class
PhabricatorMonogramDatasourceEngineExtension
extends
PhabricatorDatasourceEngineExtension
{
public
function
newQuickSearchDatasources
(
)
{
return
array
(
new
PhabricatorTypeaheadMonogramDatasource
(
)
,
)
;
}
public
function
newJumpURI
(
$query
)
{
$viewer
=
$this
->
getViewer
(
)
;
// These first few rules are sort of random but don't fit anywhere else
// today and don't feel worth adding separate extensions for.
// Send "f" to Feed.
if
(
preg_match
(
'/^f\z/i'
,
$query
)
)
{
return
'/feed/'
;
}
// Send "d" to Differential.
if
(
preg_match
(
'/^d\z/i'
,
$query
)
)
{
return
'/differential/'
;
}
// Send "t" to Maniphest.
if
(
preg_match
(
'/^t\z/i'
,
$query
)
)
{
return
'/maniphest/'
;
}
// Otherwise, if the user entered an object name, jump to that object.
$objects
=
id
(
new
PhabricatorObjectQuery
(
)
)
->
setViewer
(
$viewer
)
->
withNames
(
array
(
$query
)
)
->
execute
(
)
;
if
(
count
(
$objects
)
==
1
)
{
$object
=
head
(
$objects
)
;
$object_phid
=
$object
->
getPHID
(
)
;
$handles
=
$viewer
->
loadHandles
(
array
(
$object_phid
)
)
;
$handle
=
$handles
[
$object_phid
]
;
if
(
$handle
->
isComplete
(
)
)
{
return
$handle
->
getURI
(
)
;
}
}
return
null
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Jan 19 2025, 11:50 (5 w, 16 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1124254
Default Alt Text
PhabricatorMonogramDatasourceEngineExtension.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment