daemon8 / php
Daemon8 SDK for PHP — framework-agnostic runtime observation primitives
v0.1.0
2026-04-25 23:50 UTC
Requires
- php: ^8.4
- ext-json: *
- spatie/backtrace: ^1.6
Requires (Dev)
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^11.0
- rector/rector: ^2.0
- rector/swiss-knife: ^2.3
- slevomat/coding-standard: ^8.15
- squizlabs/php_codesniffer: ^3.10
Suggests
- ext-curl: For fire-and-forget HTTP transport (curl_multi). Falls back to fsockopen.
- ext-sockets: For UDP transport (UdpTransport).
This package is auto-updated.
Last update: 2026-04-26 01:06:27 UTC
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.