PHP code example of t4web / profiler

1. Go to this page and download the library: Download t4web/profiler library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

t4web / profiler example snippets



return array(
    'modules' => array(
        // ...
        'T4web\DefaultService',
        'T4web\Profiler',
    ),
    // ...
);

'service_manager' => [
    'factories' => [
        \T4web\Profiler\StorageAdapter\StorageAdapterInterface::class => \T4web\Profiler\StorageAdapter\DbAdapterFactory::class,
    ],
],

't4web-profiler' => [
    'profiling-timeout' => 500, // in ms
    'use-default-listeners' => false,
],

$profiler = $serviceLocator->get(T4web\Profiler\Profiler::class);
$profiler->startTimer('My slow function');
// ...
$profiler->endTimer('My slow function');
bash
$ php composer.phar update
shell
$ php public/index.php profiler init