Skip to content
Snippets Groups Projects
Commit 7b40e32a authored by llaffont's avatar llaffont
Browse files

XHProf: génère l'url de profiling avec Zend_Url

parent 817677c5
Branches
Tags
No related merge requests found
......@@ -33,12 +33,15 @@ class ZendAfi_Controller_Plugin_XHProfile extends Zend_Controller_Plugin_Abstrac
if (!Class_Users::isCurrentUserSuperAdmin())
return;
if (function_exists('xhprof_enable'))
if (function_exists('xhprof_enable')) {
$view=new ZendAfi_Controller_Action_Helper_View();
Class_ScriptLoader::getInstance()
->addJQueryReady('$("<button>Profile</button>")
.attr("onclick", "window.open(window.location+\'?xhprof=1\', \'_blank\')")
.attr("onclick", "window.open(\''.$view->url(["xhprof" => 1]).'\', \'_blank\')")
.attr("style", "position:absolute;top:0;right:0")
.appendTo(\'body\')');
}
if (!$request->getParam('xhprof', false))
return;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment