The Sentry PHP error reporter tracks errors and exceptions that happen during the execution of your application and provides instant notification with detailed information needed to prioritize, identify, reproduce and fix each issue.
The current master branch is our new major release of the SDK
2.0
. We currently ship2.0
with thebeta
tag, which means you have to install it by exactly providing the version otherwise you wont get2.0
. We will drop thebeta
tag as soon as we do no longer expect any public API changes.
To install the SDK you will need to be using Composer in your project. To install it please see the docs.
Sentry PHP is not tied to any specific library that sends HTTP messages. Instead, it uses Httplug to let users choose whichever PSR-7 implementation and HTTP client they want to use.
If you just want to get started quickly you should run the following command:
php composer.phar require sentry/sentry:2.0.0-beta1 php-http/curl-client guzzlehttp/psr7
This will install the library itself along with an HTTP client adapter that uses
cURL as transport method (provided by Httplug) and a PSR-7 implementation
(provided by Guzzle). You do not have to use those packages if you do not want to.
The SDK does not care about which transport method you want to use because it's
an implementation detail of your application. You may use any package that provides
php-http/async-client-implementation
and http-message-implementation
.
use function Sentry\init;
use function Sentry\captureException;
init(['dsn' => '___PUBLIC_DSN___' ]);
try {
thisFunctionThrows(); // -> throw new \Exception('foo bar');
} catch (\Exception $exception) {
captureException($exception);
}
The following integrations are fully supported and maintained by the Sentry team.
The following integrations are available and maintained by members of the Sentry community.
- Nette
- ZendFramework
- WordPress
- Drupal
- OpenCart
- ... feel free to be famous, create a port to your favourite platform!
Dependencies are managed through composer:
$ composer install
Tests can then be run via phpunit:
$ vendor/bin/phpunit