geo6 / zend-expressive-sentry
Zend Expressive ErrorHandler able to send error to Sentry.io
Installs: 22
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/geo6/zend-expressive-sentry
Requires
- sentry/sdk: ^2.0
- zendframework/zend-expressive: ^3.2
- zendframework/zend-servicemanager: ^3.4
Requires (Dev)
- phpstan/phpstan: ^0.11.15
- phpstan/phpstan-strict-rules: ^0.11.1
- squizlabs/php_codesniffer: ^3.4
This package is auto-updated.
Last update: 2025-10-21 04:53:46 UTC
README
This library enables Zend Expressive to send errors and exceptions to Sentry.io.
Install
composer require geo6/zend-expressive-sentry
Configuration
Create a sentry.global.php file in your config directory with your correct DSN (and options, if necessary):
<?php declare(strict_types=1); return [ 'sentry' => [ 'dsn' => 'https://xxxxx@sentry.io/12345', ], ];
Usage
To enable it, you just have to add Geo6\Expressive\Sentry\ConfigProvider::class to your main configuration (usually config/config.php):
...
$aggregator = new ConfigAggregator([
+ Geo6\Expressive\Sentry\ConfigProvider::class,
...
], $cacheConfig['config_cache_path']);
...
The Sentry ErrorHandler will be active only in "production mode" (when $config['debug] is false).
To switch to "production mode", you can use composer run development-disable.
This library was inspired by stickeeuk/zend-expressive-sentry.
The main difference is that this library uses the last version of the PHP SDK.