1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-29 02:02:41 +01:00
phorge-phorge/src/applications/xhprof/controller/PhabricatorXHProfProfileController.php
Josh Cox d26cca27d7 Removing deprecated method calls
Summary: Removed call to the deprecated buildStandardPageResponse method from XHProfProfileController

Test Plan: Install, configure, and use XHProf. I'll need some guidance with this

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D16432
2016-08-23 03:26:34 -05:00

60 lines
1.5 KiB
PHP

<?php
final class PhabricatorXHProfProfileController
extends PhabricatorXHProfController {
public function shouldAllowPublic() {
return true;
}
public function handleRequest(AphrontRequest $request) {
$phid = $request->getURIData('phid');
$file = id(new PhabricatorFileQuery())
->setViewer($request->getUser())
->withPHIDs(array($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));
$title = pht('Profile');
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
->setFrameable(true)
->setShowChrome(false)
->setDisableConsole(true)
->appendChild($view);
}
}