hellonico / var-dumper-configurator
Configure Symfony var-dumper when using outside Symfony
Installs: 2 368
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- symfony/polyfill-php80: ^1.26
- symfony/var-dumper: ^4.2 || ^5.0 || ^6.0
Requires (Dev)
README
VarDumper component has some nice features when used with the complete Symfony stack. However, those features are lost or tedious to configure application wide when using in standalone mode.
This package aims to provide a simple way to configure these options such as theme
and fileLinkFormat
which puts links on dumped objects that directly open related file in your favorite IDE.
Usage
Install the package:
composer req hellonico/var-dumper-configurator --dev
The component is automatically configured with environment variables:
If you're using a .env
file:
VAR_DUMPER_THEME=light VAR_DUMPER_IDE=vscode
Or in pure PHP:
$_SERVER['VAR_DUMPER_THEME'] = 'light'; $_SERVER['VAR_DUMPER_IDE'] = 'vscode'; // OR putenv('VAR_DUMPER_THEME=light'); putenv('VAR_DUMPER_IDE=vscode');
⚠️ Put those lines BEFORE requiring your vendor/autoload.php
file.
You can also call the VarDumperConfigurator::configure
method yourself.
HelloNico\VarDumperConfigurator\VarDumperConfigurator::configure('vscode', 'light');
⚠️ Don't require --dev
if using it that way.
IDE supported
Check the Symfony docs for a full list of supported IDE: https://symfony.com/doc/current/reference/configuration/framework.html#ide