Adding XHProf report in the web profiler (Silex).
-
xhprof.location : The path in which XHProf will be found.
-
xhprof.host : The xhprof host website.
To enable it, add this dependency to your composer.json
file:
"oziks/xhprof-service-provider": "dev-master"
And enable it in your application:
<?php
$app['xhprof.location'] = '/var/www/utils/xhprof';
$app['xhprof.host'] = 'http://localhost/xhprof/';
$app->register(new \Oziks\Provider\XHProfServiceProvider());
<?php
$app['xhprof']->start();
for ($i = 0; $i <= 1000; $i++) {
$a = $i * $i;
}
$app['xhprof']->end();