myaaghubi / debench
PHP的一个小型调试/基准测试助手
1.6
2024-09-29 10:25 UTC
Requires (Dev)
- phpunit/phpunit: ^10.0
README
PHP的一个小型且轻量级的调试/基准测试助手。
如何使用
使用composer
composer require myaaghubi/debench
然后像这样使用
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');
对于minimal模式
// it is safe and secure to use
// $debench->setMinimalOnly(true);
Debench::minimalOnly(true);
对于production模式
// it's better to do it on initializing
//$debench = new Debench(false);
Debench::getInstance(false);
// or
Debench::enable(false);
许可证
您可以在MIT许可证的条款下使用此插件。
版权 (C) 2024 Mohammad Yaaghubi

