brainworxx / krexx
PHP debugger which displays information about objects and variables in it's own draggable debug output.
v5.0.6
2024-10-25 06:35 UTC
Requires
- php: ^7.2 || ^8
- ext-json: *
Requires (Dev)
- php-mock/php-mock-phpunit: ^2
- phpunit/phpunit: ^8.5 || ^9.5 || ^10.5
- dev-main
- 5.0.x-dev
- v5.0.6
- v5.0.5
- v5.0.4
- v5.0.3
- v5.0.2
- v5.0.1
- v5.0.0
- 4.1.x-dev
- v4.1.10
- v4.1.9
- v4.1.8
- v4.1.7
- v4.1.6
- v4.1.5
- v4.1.4
- v4.1.3
- v4.1.2
- v4.1.1
- v4.1.0
- v4.0.0
- v3.2.x-dev
- v3.2.4
- v3.2.3
- v3.2.2
- v3.2.1
- v3.2.0
- v3.1.0
- v3.0.2
- v3.0.1
- v3.0.0
- v2.4.0
- v2.3.1
- v2.2.0
- v2.1.1
- v2.1.0
- v2.0.1
- v2.0.0
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.6
- v1.3.5
- v1.3.4
- v1.3.3
- v1.3.2
- dev-develop
This package is auto-updated.
Last update: 2024-11-13 13:42:51 UTC
README
kreXX Debugger
- Key features:
- Dumping of protected variables
- Dumping of private variables
- Dumping of traversable data
- Configurable debug callbacks, which will be called on objects (if present). The output will then be dumped.
- Analysis of the methods of objects (comments, where declared, parameters). Comment dumping supports
{@inheritdoc}
. - Output is draggable and has a closing button.
- All features can be globally configured in a configuration file.
- All features can be locally configured in the browser. The settings will be stored in a cookie.
- Configurable local opening function, to prevent other developers from calling your debug commands.
- Output can be saved to an output folder. Very useful in m2m communication.
- Several security measures to prevent prevent hangups with too large memory usage or a timeout.
- Benchmarking
- Fatal error handler with a full backtrace
- Code generation to reach the displayed values, if possible.
Analysis of an extbase query result
Installation
Manual installation
- Upload the whole kreXX directory to your webserver. Put it somewhere, where you are able to include it to your project.
- Include as early as possible the file bootstrap.php into your project. Normally this is the index.php.
Using composer
composer require brainworxx/krexx`
Our composer page can be found here: https://packagist.org/packages/brainworxx/krexx
Usage inside the PHP code
kreXX will be called from within the PHP source code:
Main analytic function
krexx($myObject); // or as an alias: \Krexx::open($myObject)
Benchmarking
// start the benchmark test and define a "moment" during the test \Krexx::timerMoment('meaningful string, like started db query 123'); // display the result \Krexx::timerEnd();
Backtrace
\Krexx::backtrace();
Fatal error handler
// PHP 5 only. // Register the fatal error handler \Krexx::registerFatal(); // Unregister the fatal error handler \Krexx::unregisterFatal();
Edit your settings
// display the edit settings dialog \Krexx::editSettings();
Scope analysis
Often enough a kreXX call will look like this:
krexx($this);
Analysing "$this" means, that all protected and private values and methods are reachable from this point inside the code. When kreXX notices this, it will analyse all reachable variables and methods of this class.
Force logging
// The following commands create a log file instead of a browser output. \Krexx::log($myObject); \Krexx::logBacktrace(); \Krexx::logTimerEnd();