{"id":30353135,"url":"https://github.com/xinningsu/thinkphp-sentry","last_synced_at":"2025-08-19T01:21:00.941Z","repository":{"id":310104558,"uuid":"1038555817","full_name":"xinningsu/thinkphp-sentry","owner":"xinningsu","description":"Sentry integration for ThinkPHP, Sentry整合ThinkPHP。","archived":false,"fork":false,"pushed_at":"2025-08-15T12:52:46.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-15T20:19:50.904Z","etag":null,"topics":["error-handling","error-reporting","error-traces","error-tracking","sentry","sentry-php","thinkphp"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xinningsu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-15T12:24:13.000Z","updated_at":"2025-08-15T12:27:34.000Z","dependencies_parsed_at":"2025-08-15T20:19:54.093Z","dependency_job_id":"48306470-44b9-4540-b427-338defe8fad3","html_url":"https://github.com/xinningsu/thinkphp-sentry","commit_stats":null,"previous_names":["xinningsu/thinkphp-sentry"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/xinningsu/thinkphp-sentry","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xinningsu%2Fthinkphp-sentry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xinningsu%2Fthinkphp-sentry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xinningsu%2Fthinkphp-sentry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xinningsu%2Fthinkphp-sentry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xinningsu","download_url":"https://codeload.github.com/xinningsu/thinkphp-sentry/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xinningsu%2Fthinkphp-sentry/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271086162,"owners_count":24696835,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["error-handling","error-reporting","error-traces","error-tracking","sentry","sentry-php","thinkphp"],"created_at":"2025-08-19T01:20:58.678Z","updated_at":"2025-08-19T01:21:00.929Z","avatar_url":"https://github.com/xinningsu.png","language":"PHP","readme":"# Sentry integration for ThinkPHP\nSentry integration for ThinkPHP, Sentry整合ThinkPHP。\n\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)\n[![Build Status](https://scrutinizer-ci.com/g/xinningsu/thinkphp-sentry/badges/build.png?b=master)](https://scrutinizer-ci.com/g/xinningsu/thinkphp-sentry/build-status/master)\n[![Code Coverage](https://scrutinizer-ci.com/g/xinningsu/thinkphp-sentry/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/xinningsu/thinkphp-sentry/?branch=master)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/xinningsu/thinkphp-sentry/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/xinningsu/thinkphp-sentry)\n[![Code Intelligence Status](https://scrutinizer-ci.com/g/xinningsu/thinkphp-sentry/badges/code-intelligence.svg?b=master)](https://scrutinizer-ci.com/g/xinningsu/thinkphp-sentry)\n\n# 安装\n\n```\ncomposer require xinningsu/thinkphp-sentry\n\n```\n\n# 配置\n\n1. 拷贝这个 [配置文件](./config/sentry.php) 到 `config/sentry.php`, 请务必替换你的 dsn。\n\n    ```php\n    return [\n        'dsn' =\u003e 'your_sentry_dsn',\n        // ...\n    ```\n\n    其他配置项根据自己的需要修改。\n    更多配置项请参考: https://docs.sentry.io/platforms/php/configuration/options/\n\n\n2. 打开 `app/ExceptionHandle.php`，在 `report` 方法里新增一行代码\n    ```php\n    class ExceptionHandle extends Handle\n    {\n        // ...\n        public function report(Throwable $exception): void\n        {\n            // 使用内置的方式记录异常日志\n            parent::report($exception);\n      \n            // 在 report 方法里新增下面这行代码\n            \\Sentry\\captureException($exception);\n        }\n    }\n    ```\n\n# 测试\n\n可以在 `controller` 中加入下面代码\n```php\n\\Sentry\\Sentry::log('error', new \\Exception('test exception'));\n```\n或直接在 `controller` 中接抛出异常\n```php\nthrow new \\Exception('test exception');\n```\n然后看是否能在 Sentry 上看到错误报告。\n\n# License\n\n[MIT](./LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxinningsu%2Fthinkphp-sentry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxinningsu%2Fthinkphp-sentry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxinningsu%2Fthinkphp-sentry/lists"}