Pollen Solutions - Debug Component - Collection of debugging tools.

Installs: 390

Dependents: 2

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:presstify-component

v1.0.1 2021-07-09 00:00 UTC

This package is auto-updated.

Last update: 2024-03-30 00:26:20 UTC


README

Latest Version MIT Licensed PHP Supported Versions

Pollen Solutions Debug Component provides a collection of tools dedicated to debugging.

Installation

composer require pollen-solutions/debug

Basic Usage

ErrorHandler

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();

DebugBar

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;