spiral / dumper
Dumper for PHP variables based on Symfony VarDumper for Spiral Framework and RoadRunner
Fund package maintenance!
spiral
Requires
- php: >= 8.1
- buggregator/trap: ^1.8
- spiral/boot: ^3.7
- symfony/var-dumper: ^6.1 || ^7.0
Requires (Dev)
- psr/http-factory: ^1.0
- psr/http-server-middleware: ^1.0
- vimeo/psalm: ^5.14
- 3.3.1
- 3.3.0
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.0
- 3.0.x-dev
- 3.0.0
- dev-master / 2.15.x-dev
- 2.14.1
- 2.14.0
- 2.13.1
- 2.13.0
- 2.12.0
- 2.11.0
- 2.10.1
- 2.10.0
- 2.9.x-dev
- 2.9.1
- 2.9.0
- 2.8.x-dev
- v2.8.12
- v2.8.10
- v2.8.9
- v2.8.8
- v2.8.7
- v2.8.5
- v2.8.4
- v2.8.2
- v2.8.1
- v2.8.0
- 2.7.x-dev
- v2.7.9
- v2.7.8
- v2.7.7
- v2.7.6
- v2.7.5
- v2.7.4
- v2.7.3
- 2.7.2
- 2.7.1
- 2.7.0
- v2.6.3
- v2.6.2
- v2.6.1
- v2.6.0
- v1.1.7
- v1.1.6
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.2
- v1.0.1
- v1.0.0
- dev-feature/attributes
This package is auto-updated.
Last update: 2024-09-22 10:40:15 UTC
README
With spiral/dumper
, developers can easily inspect and analyze variable values during the development process, making it an indispensable tool for debugging and troubleshooting in web and CLI applications.
The component provides a wrapper over the symfony/var-dumper
library. This component sends dumps directly to the browser within HTTP workers or to the STDERR
output in other environments.
Installation
Use Composer to install the package:
composer require spiral/dumper
Usage
Symfony VarDumper
In your code:
dump($variable);
In an application using RoadRunner, you cannot use the dd()
function. But the package provides an alternative \rr\dd()
function.
To use it, you need to add Spiral\Debug\Middleware\DumperMiddleware
in the application, after ErrorHandlerMiddleware
:
use Spiral\Bootloader\Http\RoutesBootloader as BaseRoutesBootloader; use Spiral\Debug\Middleware\DumperMiddleware; use Spiral\Http\Middleware\ErrorHandlerMiddleware; final class RoutesBootloader extends BaseRoutesBootloader { protected function globalMiddleware(): array { return [ ErrorHandlerMiddleware::class, DumperMiddleware::class, // ... ]; } // ... }
Buggregator
The package provides a built-in integration with the Buggregator service via Trap library.
- Run a Buggregator server:
- Full server using Docker:
docker run --rm --pull always -p 127.0.0.1:8000:8000 -p 127.0.0.1:1025:1025 -p 127.0.0.1:9912:9912 -p 127.0.0.1:9913:9913 ghcr.io/buggregator/server:latest
- Mini server using PHP:
./vendor/bin/trap
- Full server using Docker:
- Use
trap()
function instead ofdump()
to send dumps to the Buggregator server:trap($variable);
License
The MIT License (MIT). Please see LICENSE
for more information. Maintained by SpiralScout.