checkend/checkend
Composer 安装命令:
composer require checkend/checkend
包简介
PHP SDK for Checkend error monitoring
README 文档
README
PHP SDK for Checkend error monitoring. Zero dependencies, works with any PHP application.
Features
- Zero dependencies - Uses only PHP standard library
- Framework integrations - Laravel, generic PHP error handler
- Automatic context - Request, user, and custom context tracking
- Sensitive data filtering - Automatic scrubbing of passwords, tokens, etc.
- Testing utilities - Capture errors in tests without sending
Requirements
- PHP 8.1+
- No external dependencies
Installation
composer require checkend/checkend
Quick Start
<?php use Checkend\Checkend; // Configure the SDK Checkend::configure(['api_key' => 'your-api-key']); // Report an error try { doSomething(); } catch (Exception $e) { Checkend::notify($e); }
Configuration
<?php use Checkend\Checkend; Checkend::configure([ 'api_key' => 'your-api-key', // Required 'endpoint' => 'https://app.checkend.com', // Optional: Custom endpoint 'environment' => 'production', // Optional: Auto-detected 'enabled' => true, // Optional: Enable/disable 'async_send' => true, // Optional: Queue sending (default: true) 'timeout' => 15, // Optional: HTTP timeout in seconds 'filter_keys' => ['custom_secret'], // Optional: Additional keys to filter 'ignored_exceptions' => [NotFoundException::class], // Optional: Exceptions to ignore 'debug' => false, // Optional: Enable debug logging ]);
Environment Variables
CHECKEND_API_KEY=your-api-key CHECKEND_ENDPOINT=https://your-server.com CHECKEND_ENVIRONMENT=production CHECKEND_DEBUG=true
Manual Error Reporting
<?php use Checkend\Checkend; // Basic error reporting try { riskyOperation(); } catch (Exception $e) { Checkend::notify($e); } // With additional context try { processOrder($orderId); } catch (Exception $e) { Checkend::notify($e, [ 'context' => ['order_id' => $orderId], 'user' => ['id' => $user->id, 'email' => $user->email], 'tags' => ['orders', 'critical'], 'fingerprint' => 'order-processing-error', ]); } // Synchronous sending (blocks until sent) $response = Checkend::notifySync($e); echo "Notice ID: " . $response['id'];
Context & User Tracking
<?php use Checkend\Checkend; // Set context for all errors in this request Checkend::setContext([ 'order_id' => 12345, 'feature_flag' => 'new-checkout', ]); // Set user information Checkend::setUser([ 'id' => $user->id, 'email' => $user->email, 'name' => $user->name, ]); // Set request information Checkend::setRequest([ 'url' => $_SERVER['REQUEST_URI'], 'method' => $_SERVER['REQUEST_METHOD'], ]); // Clear all context (call at end of request) Checkend::clear();
Framework Integrations
Laravel
Add the exception handler integration to your app/Exceptions/Handler.php:
<?php namespace App\Exceptions; use Checkend\Checkend; use Checkend\Integrations\LaravelExceptionHandler; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Throwable; class Handler extends ExceptionHandler { public function register(): void { // Configure Checkend Checkend::configure(['api_key' => env('CHECKEND_API_KEY')]); $this->reportable(function (Throwable $e) { LaravelExceptionHandler::reportWithContext($e, [ 'user' => auth()->user()?->only(['id', 'email']), ]); }); } }
Generic PHP
Use the generic error handler for any PHP application:
<?php use Checkend\Checkend; use Checkend\Integrations\GenericErrorHandler; // Configure and register Checkend::configure(['api_key' => 'your-api-key']); GenericErrorHandler::register(); // Your application code... // All errors and uncaught exceptions will be reported automatically
Testing
Use the Testing class to capture errors without sending them:
<?php use Checkend\Checkend; use Checkend\Testing; use PHPUnit\Framework\TestCase; class MyTest extends TestCase { protected function setUp(): void { Testing::setup(); Checkend::configure(['api_key' => 'test-key', 'enabled' => true]); } protected function tearDown(): void { Checkend::reset(); Testing::teardown(); } public function testErrorReporting(): void { try { throw new \Exception('Test error'); } catch (\Exception $e) { Checkend::notify($e); } $this->assertTrue(Testing::hasNotices()); $this->assertEquals(1, Testing::noticeCount()); $notice = Testing::lastNotice(); $this->assertEquals('Exception', $notice->errorClass); } }
Filtering Sensitive Data
By default, these keys are filtered: password, secret, token, api_key, authorization, credit_card, cvv, ssn, etc.
Add custom keys:
Checkend::configure([ 'api_key' => 'your-api-key', 'filter_keys' => ['custom_secret', 'internal_token'], ]);
Filtered values appear as [FILTERED] in the dashboard.
Ignoring Exceptions
Checkend::configure([ 'api_key' => 'your-api-key', 'ignored_exceptions' => [ NotFoundException::class, ValidationException::class, 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException', ], ]);
Before Notify Callbacks
Checkend::configure([ 'api_key' => 'your-api-key', 'before_notify' => [ function ($notice) { $notice->context['server'] = gethostname(); return true; // Continue sending }, function ($notice) { if (str_contains($notice->message, 'ignore-me')) { return false; // Skip sending } return true; }, ], ]);
Shutdown Handling
The SDK automatically:
- Flushes pending notices on script shutdown
- Captures fatal errors (E_ERROR, E_PARSE, etc.)
For manual control:
// Flush pending notices Checkend::flush(); // Stop the worker Checkend::stop();
Development
# Install dependencies composer install # Run tests composer test # Or with PHPUnit directly ./vendor/bin/phpunit
License
MIT License - see LICENSE for details.
checkend/checkend 适用场景与选型建议
checkend/checkend 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 01 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「debugging」 「error-monitoring」 「exception-tracking」 「checkend」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 checkend/checkend 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 checkend/checkend 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 checkend/checkend 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PHP package that takes a snapshot of your application and allows you to retrieve it later to help with debugging.
Capture and monitor detailed error logs with nice dashboard and UI.
Laravel Database Query Logger and debug helper.
A PHP SDK for PAB (https://studio-creativa.pl)
Yii2 SDK for Sentry (https://sentry.io)
client for dawilog
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 20
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-15