Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92696722
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, Nov 22, 21:12
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Nov 24, 21:12 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22489829
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
();
$data
=
unserialize
(
$data
);
if
(!
$data
)
{
throw
new
Exception
(
"Failed to unserialize XHProf profile!"
);
}
$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
);
return
$this
->
buildStandardPageResponse
(
$view
,
array
(
'title'
=>
'Profile'
,
'frame'
=>
$is_framed
,
));
}
}
Event Timeline
Log In to Comment