daemon8/php
最新稳定版本:v0.1.0
Composer 安装命令:
composer require daemon8/php
包简介
Daemon8 SDK for PHP — framework-agnostic runtime observation primitives
README 文档
README
Send observations from any PHP 8.4+ app to Daemon8.
Tip
Help keep Daemon8 open source — star the main repo.
Install
composer require daemon8/php
daemon8 install # if you haven't already
Requires the Daemon8 daemon running locally. Without it, SDK calls are silent no-ops.
Usage
use Daemon8\Daemon8; Daemon8::log('checkout completed', severity: 'info'); Daemon8::warn('rate limit near threshold'); Daemon8::exception(new \RuntimeException('pay gateway timeout')); Daemon8::query('SELECT * FROM users WHERE active = ?', durationMs: 42.1);
For DI-friendly code, inject Daemon8Client directly:
use Daemon8\Config; use Daemon8\Daemon8Client; $client = new Daemon8Client(Config::create(appName: 'checkout-api')); $client->log('job dispatched');
Configuration
All optional. Env vars or Config::create():
DAEMON8_URL=http://127.0.0.1:9077/ingest DAEMON8_APP=my-app DAEMON8_TIMEOUT_MS=50 DAEMON8_BATCH_SIZE=100 DAEMON8_DEBUG=1
Sensitive data
use Daemon8\Sanitization\SensitiveRules; $rules = new SensitiveRules( fields: ['password', 'api_key', 'authorization'], patterns: ['/\bsk-[a-z0-9]{24,}\b/i'], ); $config = Config::create(sensitiveRules: $rules);
Field-name matching, regex patterns, and Sensitive::wrap() for per-value redaction.
Requirements
- PHP 8.4+
ext-curl(optional — falls back to fsockopen)ext-sockets(optional — for UDP transport)
Development
composer install
composer check # phpstan + rector dry-run + phpcs + phpunit
Links
License
MIT. See LICENSE.
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-21