bugban/php-sdk
Composer 安装命令:
composer require bugban/php-sdk
包简介
Bugban error & monitoring SDK — framework-agnostic PHP core (captures exceptions, requests, auth & session).
README 文档
README
Error & monitoring SDK for any PHP project — captures exceptions, requests, auth user & session and ships them to your Bugban platform.
- ✅ Framework-agnostic core (pure PHP, CodeIgniter, Symfony, WordPress, Slim…)
- ✅ First-class Laravel integration (auto exception + request + auth/session capture)
- ✅ PHP 7.0 → 8.x compatible (works on legacy hosts)
- ✅ Manual, Composer-free install for old projects
- ✅ Fire-and-forget transport — never breaks or slows the host app
Install
A) Composer (recommended)
composer require bugban/php-sdk
From a private/VCS repo (before Packagist), add to the host project's composer.json:
{
"repositories": [
{ "type": "vcs", "url": "https://github.com/Umid-ismayilov/bugban.git" }
]
}
then composer require bugban/php-sdk.
B) Manual (legacy projects, no Composer)
Copy the bugban-php-sdk folder into your project and:
require __DIR__ . '/libs/bugban-php-sdk/autoload.php';
Usage
Pure PHP / any framework
\Bugban\Sdk\Bugban::init([ 'api_key' => 'bb_xxxxxxxx', // from Bugban panel → Projects 'host' => 'https://bugban.online', 'environment' => 'production', 'release' => '1.4.2', ]); // Automatic capture of errors, uncaught exceptions and fatals: \Bugban\Sdk\Bugban::registerHandlers(); // Manual: try { risky(); } catch (\Throwable $e) { \Bugban\Sdk\Bugban::capture($e); } // Procedural helpers (legacy code): bugban_capture($e); bugban_message('Cache miss', 'warning');
Laravel
composer require bugban/php-sdk
php artisan vendor:publish --tag=bugban-config # optional
.env:
BUGBAN_API_KEY=bb_xxxxxxxx
BUGBAN_HOST=https://bugban.online
BUGBAN_CAPTURE_REQUESTS=true
That's it — the service provider auto-registers and captures every reported exception together with the authenticated user, session and request. Zero code changes.
CodeIgniter / old MVC
In index.php (front controller), after the autoloader:
require APPPATH . '../libs/bugban-php-sdk/autoload.php'; \Bugban\Sdk\Bugban::init(['api_key' => 'bb_xxx', 'host' => 'https://bugban.online']); \Bugban\Sdk\Bugban::registerHandlers();
Configuration
| Key | Default | Meaning |
|---|---|---|
api_key |
'' |
Public project key (required) |
host |
https://bugban.online |
Bugban platform URL |
environment |
production |
Environment tag |
release |
null |
Version / release string |
enabled |
true |
Master switch |
timeout |
3 |
Transport timeout (s) |
sample_rate |
1.0 |
0–1 fraction of events to send |
capture_requests |
false |
Push per-request performance logs |
redact |
common secrets | Keys scrubbed before sending |
before_send |
null |
fn(array $payload): ?array filter/mutate |
What gets sent
POST {host}/api/ingest/events with header X-Bugban-Key: {api_key} — exception class, message, file/line, stacktrace, request, auth user, session, breadcrumbs, context. Request logs go to POST {host}/api/ingest/requests.
API key & plans
Your API key is issued from the Bugban panel per project and is tied to your plan/subscription. Higher plans raise ingest rate limits and retention.
bugban/php-sdk 适用场景与选型建议
bugban/php-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 07 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「exceptions」 「monitoring」 「error-tracking」 「bugban」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 bugban/php-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bugban/php-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 bugban/php-sdk 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
php7ify is a project that brings new php7 classes and exceptions to php 5.x.
The CodenamePHP Platform core that contains basic interfaces, exceptions etc..
A Symfony bundle for chameleon-system/sanitycheck
SoftWax Health Check Bundle for Symfony framework
1Pilot client for Symfony
A simple package to better handle Exceptions.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-07-15