PHP code example of kodhe / profiler

1. Go to this page and download the library: Download kodhe/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/ */

    

kodhe / profiler example snippets




declare(strict_types=1);

ofiler;

$profiler = new Profiler();

echo $pageHtml . $profiler->run();
// Panel debug dirender di akhir output halaman

$profiler = new Profiler([
    'sections' => [
        'benchmarks'   => true,
        'memory_usage' => true,
        'get'          => true,
        'post'         => false,
    ],
]);

// Atau runtime:
$profiler->disableSection('database');
$profiler->enableSection('config');
var_dump($profiler->isSectionEnabled('uri')); // bool

use Kodhe\Framework\Profiler\Collectors\MyCustomCollector;

$profiler->addCollector('my_metrics', new MyCustomCollector());

use Kodhe\Framework\Profiler\Profiler;

src/
├── Profiler.php                  # Kelas utama (API kompatibel CI3)
├── Contracts/                    # ProfilerInterface, CollectorInterface
├── Collectors/                   # Benchmark, Database, Memory, Uri, Config,
│                                 # Session, Controller, HttpHeaders
├── Renderers/                    # HtmlRenderer, TextRenderer
├── Factory/                      # CollectorFactory, RendererFactory
├── Support/
├── ValueObjects/                 # ProfileData, ProfileSection
└── language/profiler_lang.php