Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F545786
PhabricatorPeopleProfileCommitsController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorPeopleProfileCommitsController.php
View Options
<?php
final
class
PhabricatorPeopleProfileCommitsController
extends
PhabricatorPeopleProfileController
{
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$this
->
getViewer
();
$id
=
$request
->
getURIData
(
'id'
);
$user
=
id
(
new
PhabricatorPeopleQuery
())
->
setViewer
(
$viewer
)
->
withIDs
(
array
(
$id
))
->
needProfile
(
true
)
->
needProfileImage
(
true
)
->
needAvailability
(
true
)
->
executeOne
();
if
(!
$user
)
{
return
new
Aphront404Response
();
}
$class
=
'PhabricatorDiffusionApplication'
;
if
(!
PhabricatorApplication
::
isClassInstalledForViewer
(
$class
,
$viewer
))
{
return
new
Aphront404Response
();
}
$this
->
setUser
(
$user
);
$title
=
array
(
pht
(
'Recent Commits'
),
$user
->
getUsername
());
$header
=
$this
->
buildProfileHeader
();
$commits
=
$this
->
buildCommitsView
(
$user
);
$crumbs
=
$this
->
buildApplicationCrumbs
();
$crumbs
->
addTextCrumb
(
pht
(
'Recent Commits'
));
$crumbs
->
setBorder
(
true
);
$nav
=
$this
->
newNavigation
(
$user
,
PhabricatorPeopleProfileMenuEngine
::
ITEM_COMMITS
);
$view
=
id
(
new
PHUITwoColumnView
())
->
setHeader
(
$header
)
->
addClass
(
'project-view-home'
)
->
addClass
(
'project-view-people-home'
)
->
setFooter
(
array
(
$commits
,
));
return
$this
->
newPage
()
->
setTitle
(
$title
)
->
setCrumbs
(
$crumbs
)
->
setNavigation
(
$nav
)
->
appendChild
(
$view
);
}
private
function
buildCommitsView
(
PhabricatorUser
$user
)
{
$viewer
=
$this
->
getViewer
();
$commits
=
id
(
new
DiffusionCommitQuery
())
->
setViewer
(
$viewer
)
->
withAuthorPHIDs
(
array
(
$user
->
getPHID
()))
->
needCommitData
(
true
)
->
needIdentities
(
true
)
->
setLimit
(
100
)
->
execute
();
$list
=
id
(
new
DiffusionCommitGraphView
())
->
setViewer
(
$viewer
)
->
setCommits
(
$commits
);
return
$list
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 1:00 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
103327
Default Alt Text
PhabricatorPeopleProfileCommitsController.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment