Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98145298
PhabricatorXHProfProfileController.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 10, 06:48
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Jan 12, 06:48 (2 d)
Engine
blob
Format
Raw Data
Handle
23493344
Attached To
rPH Phabricator
PhabricatorXHProfProfileController.php
View Options
<?php
final
class
PhabricatorXHProfProfileController
extends
PhabricatorXHProfController
{
private
$phid
;
public
function
willProcessRequest
(
array
$data
)
{
$this
->
phid
=
$data
[
'phid'
];
}
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$file
=
id
(
new
PhabricatorFileQuery
())
->
setViewer
(
$request
->
getUser
())
->
withPHIDs
(
array
(
$this
->
phid
))
->
executeOne
();
if
(!
$file
)
{
return
new
Aphront404Response
();
}
$data
=
$file
->
loadFileData
();
try
{
$data
=
phutil_json_decode
(
$data
);
}
catch
(
PhutilJSONParserException
$ex
)
{
throw
new
PhutilProxyException
(
pht
(
'Failed to unserialize XHProf profile!'
),
$ex
);
}
$symbol
=
$request
->
getStr
(
'symbol'
);
$is_framed
=
$request
->
getBool
(
'frame'
);
if
(
$symbol
)
{
$view
=
new
PhabricatorXHProfProfileSymbolView
();
$view
->
setSymbol
(
$symbol
);
}
else
{
$view
=
new
PhabricatorXHProfProfileTopLevelView
();
$view
->
setFile
(
$file
);
$view
->
setLimit
(
100
);
}
$view
->
setBaseURI
(
$request
->
getRequestURI
()->
getPath
());
$view
->
setIsFramed
(
$is_framed
);
$view
->
setProfileData
(
$data
);
$crumbs
=
$this
->
buildApplicationCrumbs
();
$crumbs
->
addTextCrumb
(
pht
(
'%s Profile'
,
$symbol
));
return
$this
->
buildStandardPageResponse
(
array
(
$crumbs
,
$view
),
array
(
'title'
=>
pht
(
'Profile'
),
'frame'
=>
$is_framed
,
));
}
}
Event Timeline
Log In to Comment