Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jgauthi/component_debug
Debug tools like: varExport* functions, timer, server dump, debug handler, SQL Beautifier, etc.
https://github.com/jgauthi/component_debug
debugging php4 php54 php56 php74 php82 server-dump sql-beautifier timer
Last synced: 2 days ago
JSON representation
Debug tools like: varExport* functions, timer, server dump, debug handler, SQL Beautifier, etc.
- Host: GitHub
- URL: https://github.com/jgauthi/component_debug
- Owner: jgauthi
- License: gpl-3.0
- Created: 2020-09-08T09:43:20.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-08-15T14:34:58.000Z (over 1 year ago)
- Last Synced: 2024-10-13T12:03:42.742Z (about 1 month ago)
- Topics: debugging, php4, php54, php56, php74, php82, server-dump, sql-beautifier, timer
- Language: PHP
- Homepage:
- Size: 41 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Component Debug
Debug tools like: varExport* functions, timer, server dump, debug handler, SQL Beautifier, etc.* [VarExport*](src/VarExport.php) functions is a `var_export()` extended, with `
` and multiples arguments $var exported. You can use several streams for output debug var (html comment, debug file, values returned).
* [VarExport*_wp](src/VarExportWordpress.php) functions is a wordpress version of precedents functions. These debug functions is display on site or admin footer.
* [Class Timer](src/Timer.php) to evaluate time script and specific portion code.
* [Debug Handler](src/DebugHandler.php) is a script who display in the footer some debug information on the current page (dump values _GET, _POST..., files used, time script and memory, phpinfo, etc).## Prerequisite
* PHP 8.2 (v2.1), old version: 7.4 (v2), 5.6 (v1.2+), 5.4+ (v1.1), 4 (v1.0)## Install
Edit your [composer.json](https://getcomposer.org) (launch `composer update` after edit):
```json
{
"repositories": [
{ "type": "git", "url": "[email protected]:jgauthi/component_debug.git" }
],
"require-dev": {
"jgauthi/component_debug": "2.*"
}
}
```Define the constant for dump exported variable on the folder (require write permissions):
```php
define('DEBUG_EXPORT_PATH', sys_get_temp_dir());// Or, set manually
define('DEBUG_EXPORT_PATH', __DIR__.'/tmp');
```For use VarExport*_wp functions (wordpress), you can include the [VarExportWordpress.php](src/VarExportWordpress.php) file on `wp-config.php` or `theme init`:
```php
require_once __DIR__.'/vendor/autoload.php';if (defined('WP_DEBUG') && WP_DEBUG) {
include_once __DIR__.'/vendor/jgauthi/component_debug/src/VarExportWordpress.php';
}
```For use the VarDumperServer (optional): `composer require --dev symfony/var-dumper`, and launch the command on your terminal: `./vendor/bin/var-dump-server`.
## Documentation
You can look at [folder example](example).