szemul / debug-data-creator
Debug file creating error handler
Installs: 2 084
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^8.0
- szemul/error-handler: ^2.0.0
- szemul/helper: ^1.1.0
Requires (Dev)
- ext-posix: *
- friendsofphp/php-cs-fixer: ^3.0.0
- jetbrains/phpstorm-attributes: ^1.0
- mockery/mockery: ^1.0
- phpstan/phpstan: ^0.12.80
- phpunit/phpunit: ^9.5.5
README
Error handler to create debug/trace files to aid in debugging.
Data categories
- Error message - A description of the error or exception
- Exception - If the debug is for an exception or other throwable, the dump of the throwable itself
- Back trace - The backtrace for the error. In case of an exception or a throwable the exception category contains this
- Server - The contents of the $_SERVER superglobal
- Get - The contents of the $_GET superglobal
- Post - The contents of the $_POST superglobal
- Cookie - The contents of the $_COOKIE superglobal
- Env - The contents of the $_ENV superglobal
All of the above categories are dumped using the var_dump()
PHP function except for the error message.
Config
Each section above can be enabled or disabled. To avoid potential security issues the following categories are disabled by default:
- Server - This may contain environment variables and sensitive configuration data.
- Post - This may contain credentials in case of a login for example.
- Cookie - This may contain session cookies for example.
- Env - This may contain environment variables and sensitive configuration data.
When enabling any of these, it's strongly recommended to use sanitizers to sanitize the categories
Input sanitization
A sanitizer will process the individual categories and remove or mask any sensitive values.
Object sanitization
Any sanitizer may process any object it knows, but an easier way to handle object sanitization is to implement the
__debugInfo
magic method in them.