48

GitHub - getsentry/sentry-php: The official PHP SDK for Sentry (sentry.io)

 4 years ago
source link: https://github.com/getsentry/sentry-php
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

68747470733a2f2f73656e7472792d6272616e642e73746f726167652e676f6f676c65617069732e636f6d2f73656e7472792d6c6f676f2d626c61636b2e706e67

Sentry for PHP

Build Status AppVeyor Build Status Total Downloads Monthly Downloads Latest Stable Version License Scrutinizer Code Quality Code Coverage

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.

Install

To install the SDK you will need to be using Composer in your project. To install it please see the docs.

This is our "core" SDK, meaning that all the important code regarding error handling lives here. If you are happy with using the HTTP client we recommend install the SDK like: sentry/sdk

php composer.phar require sentry/sdk

This package (sentry/sentry) 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 php-http/curl-client guzzlehttp/psr7

This is basically what our metapackage (sentry/sdk) provides.

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.

Usage

\Sentry\init(['dsn' => '___PUBLIC_DSN___' ]);

try {
    thisFunctionThrows(); // -> throw new \Exception('foo bar');
} catch (\Exception $exception) {
    \Sentry\captureException($exception);
}

Official integrations

The following integrations are fully supported and maintained by the Sentry team.

3rd party integrations

The following integrations are available and maintained by members of the Sentry community.

Community

Contributing

Dependencies are managed through composer:

$ composer install

Tests can then be run via phpunit:

$ vendor/bin/phpunit

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK