Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F450315
DiffusionRepositoryMetricsSearchEngineAttachment.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
993 B
Referenced Files
None
Subscribers
None
DiffusionRepositoryMetricsSearchEngineAttachment.php
View Options
<?php
final
class
DiffusionRepositoryMetricsSearchEngineAttachment
extends
PhabricatorSearchEngineAttachment
{
public
function
getAttachmentName
()
{
return
pht
(
'Repository Metrics'
);
}
public
function
getAttachmentDescription
()
{
return
pht
(
'Get metrics (like commit count and most recent commit) for each '
.
'repository.'
);
}
public
function
willLoadAttachmentData
(
$query
,
$spec
)
{
$query
->
needCommitCounts
(
true
)
->
needMostRecentCommits
(
true
);
}
public
function
getAttachmentForObject
(
$object
,
$data
,
$spec
)
{
$commit
=
$object
->
getMostRecentCommit
();
if
(
$commit
!==
null
)
{
$recent_commit
=
$commit
->
getFieldValuesForConduit
();
}
else
{
$recent_commit
=
null
;
}
$commit_count
=
$object
->
getCommitCount
();
if
(
$commit_count
!==
null
)
{
$commit_count
=
(
int
)
$commit_count
;
}
return
array
(
'commitCount'
=>
$commit_count
,
'recentCommit'
=>
$recent_commit
,
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, May 4, 8:31 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
67759
Default Alt Text
DiffusionRepositoryMetricsSearchEngineAttachment.php (993 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment