devpulse/core
Composer 安装命令:
composer require devpulse/core
包简介
DevPulse PHP SDK — core error capture and transport
README 文档
README
PHP core SDK for DevPulse — low-level error capture and HTTP transport.
This package is the foundation used by the Laravel integration and can be used standalone in any PHP 8.1+ project.
Requirements
- PHP 8.1+
- A running DevPulse server (v1.0+)
Installation
composer require devpulse/core
Quick Start
use DevPulse\Client; $client = new Client([ 'dsn' => 'https://your-devpulse-host/api/ingest/YOUR_API_KEY', 'environment' => 'production', 'release' => '1.0.0', // optional 'async' => true, // fire-and-forget via register_shutdown_function (default) 'timeout' => 2, // HTTP timeout in seconds ]); // Register global error/exception/shutdown handlers $client->register();
After register(), all unhandled exceptions, PHP errors, and fatal shutdown errors are captured automatically.
Manual Capture
try { riskyOperation(); } catch (\Throwable $e) { $client->captureException($e, ['order_id' => $orderId]); } $client->captureMessage('Payment gateway timeout', 'warning', ['gateway' => 'stripe']);
Static Facade
use DevPulse\DevPulse; DevPulse::init([ 'dsn' => 'https://your-devpulse-host/api/ingest/YOUR_API_KEY', 'environment' => 'production', ]); DevPulse::captureException($e); DevPulse::captureMessage('Something happened', 'info');
What's Captured
Each event automatically includes:
- Exception type, message, and stack trace with source context (±5 lines)
- PHP version, OS, SAPI, and peak memory
- Request context — URL, method, client IP, sanitised headers (no auth/cookie/x-api-key)
- SDK version —
devpulse-php/2.0.0for SDK version tracking
IP resolution
The SDK reads X-Forwarded-For only when REMOTE_ADDR is a known trusted proxy, preventing IP spoofing. The default trusted ranges are RFC-1918 private networks.
Development
composer install vendor/bin/phpunit # run tests vendor/bin/phpstan analyse # static analysis
License
MIT — see LICENSE
devpulse/core 适用场景与选型建议
devpulse/core 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 49 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 02 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 devpulse/core 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 devpulse/core 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 49
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 21
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-21