daemon8/php

Daemon8 SDK for PHP — framework-agnostic runtime observation primitives

Maintainers

Package info

github.com/daemon8ai/daemon8-php

Homepage

Issues

pkg:composer/daemon8/php

Statistics

Installs: 14

Dependents: 2

Suggesters: 0

Stars: 0

v0.1.0 2026-04-25 23:50 UTC

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

Docs · Demo · Contact

License

MIT. See LICENSE.