PHP code example of pollen-solutions / debug

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

    

pollen-solutions / debug example snippets


use Pollen\Debug\DebugManager;

// DebugManager instantiation
$debug = new DebugManager();

// ErrorHandler activation
$debug->errorHandler()->enable();

// ErrorHandler test
function errorHandlerTest()
{
    throw new InvalidArgumentException('Test de Whoops');
}
errorHandlerTest();

use Pollen\Debug\DebugManager;

// DebugManager instantiation
$debug = new DebugManager();

// DebugBar activation
$debug->debugBar()->enable();

// DebugBar test
echo <<< HTML
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Debug Bar Test</title>
HTML;

// DebugBar head assets
echo $debug->debugBar()->renderHead();

echo <<< HTML
</head>
<body>
HTML;

// DebugBar render
echo $debug->debugBar()->render();

echo <<< HTML
</body>
</html>
HTML;
exit;