Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97257248
DiffusionCommitBranchesController.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
Fri, Jan 3, 20:28
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Jan 5, 20:28 (2 d)
Engine
blob
Format
Raw Data
Handle
23366779
Attached To
rPH Phabricator
DiffusionCommitBranchesController.php
View Options
<?php
final
class
DiffusionCommitBranchesController
extends
DiffusionController
{
public
function
shouldAllowPublic
()
{
return
true
;
}
public
function
handleRequest
(
AphrontRequest
$request
)
{
$response
=
$this
->
loadDiffusionContext
();
if
(
$response
)
{
return
$response
;
}
$drequest
=
$this
->
getDiffusionRequest
();
$repository
=
$drequest
->
getRepository
();
$branch_limit
=
10
;
$branches
=
DiffusionRepositoryRef
::
loadAllFromDictionaries
(
$this
->
callConduitWithDiffusionRequest
(
'diffusion.branchquery'
,
array
(
'contains'
=>
$drequest
->
getCommit
(),
'limit'
=>
$branch_limit
+
1
,
'branch'
=>
null
,
)));
$has_more_branches
=
(
count
(
$branches
)
>
$branch_limit
);
$branches
=
array_slice
(
$branches
,
0
,
$branch_limit
);
$branch_links
=
array
();
foreach
(
$branches
as
$branch
)
{
$branch_links
[]
=
phutil_tag
(
'a'
,
array
(
'href'
=>
$drequest
->
generateURI
(
array
(
'action'
=>
'browse'
,
'branch'
=>
$branch
->
getShortName
(),
)),
),
$branch
->
getShortName
());
}
if
(
$has_more_branches
)
{
$branch_links
[]
=
phutil_tag
(
'a'
,
array
(
'href'
=>
$drequest
->
generateURI
(
array
(
'action'
=>
'branches'
,
)),
),
pht
(
"More Branches
\x
E2
\x
80
\x
A6"
));
}
return
id
(
new
AphrontAjaxResponse
())
->
setContent
(
$branch_links
?
implode
(
', '
,
$branch_links
)
:
pht
(
'None'
));
}
}
Event Timeline
Log In to Comment