sentry-php

The official PHP SDK for Sentry (sentry.io)

Sentry SDK for PHP

Total Downloads
Monthly Downloads
Latest Stable Version
License
Discord, Version, Build Status, Code Coverage, :---------:, :-------------:, :-----:, master, Build Status Build Status, Coverage Status, develop, Build Status Build Status, Coverage Status, 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

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). 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.

3rd party integrations using old SDK 1.x

Community

Contributing

Dependencies are managed through composer:

$ composer install

Tests can then be run via phpunit:

$ vendor/bin/phpunit

主要指標

概覽
名稱與所有者getsentry/sentry-php
主編程語言PHP
編程語言Makefile (語言數: 2)
平台
許可證MIT License
所有者活动
創建於2012-01-23 07:34:48
推送於2025-04-16 21:56:10
最后一次提交2025-04-14 09:20:09
發布數147
最新版本名稱4.11.0 (發布於 )
第一版名稱0.1.0 (發布於 2012-02-01 00:18:23)
用户参与
星數1.9k
關注者數89
派生數452
提交數1.8k
已啟用問題?
問題數635
打開的問題數9
拉請求數928
打開的拉請求數7
關閉的拉請求數212
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?