Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93196101
DiffusionRepositoryURIsIndexEngineExtension.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
Tue, Nov 26, 22:49
Size
808 B
Mime Type
text/x-php
Expires
Thu, Nov 28, 22:49 (2 d)
Engine
blob
Format
Raw Data
Handle
22593672
Attached To
rPH Phabricator
DiffusionRepositoryURIsIndexEngineExtension.php
View Options
<?php
final
class
DiffusionRepositoryURIsIndexEngineExtension
extends
PhabricatorIndexEngineExtension
{
const
EXTENSIONKEY
=
'diffusion.repositories.uri'
;
public
function
getExtensionName
()
{
return
pht
(
'Repository URIs'
);
}
public
function
shouldIndexObject
(
$object
)
{
return
(
$object
instanceof
PhabricatorRepository
);
}
public
function
indexObject
(
PhabricatorIndexEngine
$engine
,
$object
)
{
// Reload the repository to pick up URIs, which we need in order to update
// the URI index.
$object
=
id
(
new
PhabricatorRepositoryQuery
())
->
setViewer
(
PhabricatorUser
::
getOmnipotentUser
())
->
withPHIDs
(
array
(
$object
->
getPHID
()))
->
needURIs
(
true
)
->
executeOne
();
if
(!
$object
)
{
return
;
}
$object
->
updateURIIndex
();
}
}
Event Timeline
Log In to Comment