<?php error_reporting(-1); error_reporting(E_ALL); ini_set('display_errors', TRUE); try { if (!defined('DIRS')) { define('DIRS', DIRECTORY_SEPARATOR); } if (!defined('ROOTFULLPATH')) { define('ROOTFULLPATH', dirname(__DIR__)); } if (!defined('TRACK')) { define('TRACK', TRUE); } require_once ROOTFULLPATH . '/vendor/autoload.php'; $profiler = new \Fabfuel\Prophiler\Profiler(); $bootstrap = $profiler->start('Bootstrap', ['lorem' => 'ipsum'], 'Application'); require_once 'bootstrap/Load.php'; $di = new \Phalcon\DI\FactoryDefault(); $di->setShared('profiler', $profiler); $Load = new Load($di); $app = $Load->run(); $profiler->stop($bootstrap); echo $app->handle()->getContent(); } catch (\Phalcon\Exception $e) { echo $e->getMessage(); } $toolbar = new \Fabfuel\Prophiler\Toolbar($profiler); $toolbar->addDataCollector(new \Fabfuel\Prophiler\DataCollector\Request()); //echo $toolbar->render();
</div> </body> </html> <?php require dirname(dirname(__DIR__)) . '/vendor/autoload.php'; require __DIR__ . '/DataCollector/User.php'; require __DIR__ . '/DataCollector/Request.php'; $profiler = new \Fabfuel\Prophiler\Profiler(); $logger = new \Fabfuel\Prophiler\Adapter\Psr\Log\Logger($profiler); $multiplicator = 20; $wait = function ($time) use($multiplicator) { return $time * rand($multiplicator * 0.8, $multiplicator * 1.2); }; $bootstrap = $profiler->start('Bootstrap', ['lorem' => 'ipsum'], 'Application'); usleep($wait(50)); $profiler->stop($bootstrap); $logger->info('Bootstrap has finished', ['some' => 'context']); $bootstrap = $profiler->start('Session::load', ['lorem' => 'ipsum'], 'Sessions'); usleep($wait(45)); $profiler->stop($bootstrap); $dispatcher = $profiler->start('Dispatcher', ['abc' => '123', 'foobar' => true], 'Dispatcher'); usleep($wait(25)); $logger->warning('Not everything ready to go', ['some' => 'context']); $router = $profiler->start('Router', ['some' => 'value', 'foobar' => 123], 'Dispatcher'); usleep($wait(150)); $profiler->stop($router); $logger->alert('Route could not be found'); $controller = $profiler->start('Controller', ['some' => 'value', 'foobar' => 123, 'array' => ['foo' => 'bar', 'lorem' => true, 'ipsum' => 1.5]], 'Application'); usleep($wait(200));