immobiliare / sentry-php
Fork of a PHP client for Sentry (http://getsentry.com) that work also with php5.2
Installs: 52 092
Dependents: 0
Suggesters: 0
Security: 0
Stars: 17
Watchers: 7
Forks: 452
Open Issues: 0
Requires
- php: >=5.2.4
- ext-curl: *
Requires (Dev)
- friendsofphp/php-cs-fixer: ^1.8.0
- monolog/monolog: *
- phpunit/phpunit: ^4.8 || ^5.0
Suggests
- ext-hash: *
- ext-json: *
- ext-mbstring: *
- monolog/monolog: Automatically capture Monolog events as breadcrumbs
Conflicts
- raven/raven: *
This package is auto-updated.
Last update: 2024-11-10 00:19:44 UTC
README
This project is a fork of official PHP SDK v1.7 for Sentry to work even with php5.2.
Features
- Automatically report (un)handled exceptions and errors
- Send customized diagnostic data
- Process and sanitize data before sending it over the network
Installation
There are various ways to install the PHP integration for Sentry. The recommended way is to use Composer.
$ composer require immobiliare/sentry-php
Alternatively you can manually install it:
- Download and extract the latest sentry-php archive to your PHP project.
- Require the autoloader in your application:
require_once '/path/to/Raven/library/Raven/Autoloader.php'; Raven_Autoloader::register();
Usage
// Instantiate a new client with a compatible DSN and install built-in // handlers $sentryClient = new Raven_Client('https://e9ebbd88548a441288393c457ec90441:399aaee02d454e2ca91351f29bdc3a07@app.getsentry.com/3235'); $sentryClient->install(); // Capture an exception $event_id = $sentryClient->captureException($ex); // Give the user feedback echo "Sorry, there was an error!"; echo "Your reference ID is " . $event_id;
For more information, see the documentation.
Integration with frameworks
Other packages exists to integrate this SDK into the most common frameworks.
Community
Contributing
Dependencies are managed through composer:
$ composer install
Tests can then be run via phpunit:
$ vendor/bin/phpunit