A small and lightweight debug/benchmark helper for PHP.
Use composer:
composer require myaaghubi/debench
Then have it like:
namespace DEBENCH;
require __DIR__ . '/vendor/autoload.php';
// call it from your index.php after autoload
// then check the webpage with your browser
// $debench = new Debench(true, 'theme');
Debench::getInstance(true, 'theme');
// for enable() or minimalOnly() you can
// call them even before getInstance
Debench::enable(false);
// for dump(), info(), warning() and error() you can
// call them before getInstance too
Debench::info('let\'s use some memory');
$st = str_repeat("Debench!", 10000);
Debench::point('one');
$st .= str_repeat("Debench!", 10000);
// $debench->newPoint("two");
Debench::point('two');
For minimal
mode:
// it is safe and secure to use
// $debench->setMinimalOnly(true);
Debench::minimalOnly(true);
For production
mode
// it's better to do it on initializing
//$debench = new Debench(false);
Debench::getInstance(false);
// or
Debench::enable(false);
You are allowed to use this plugin under the terms of the MIT License.
Copyright (C) 2024 Mohammad Yaaghubi