Download the PHP package ditliti/php-sdk without Composer
On this page you can find all versions of the php package ditliti/php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ditliti/php-sdk
More information about ditliti/php-sdk
Files in ditliti/php-sdk
Package php-sdk
Short Description Official framework-agnostic PHP SDK for Ditliti (works with Symfony, WordPress, or vanilla PHP) - error tracking, tracing, replays, and profiling ingestion.
License MIT
Homepage https://github.com/kangartha/inspectora/tree/main/sdk/php
Informations about the package php-sdk
ditliti/php-sdk
Official framework-agnostic PHP SDK for Ditliti - error tracking, tracing, session replay, and profiling ingestion. Works in plain PHP, Symfony, WordPress, or anywhere else PHP runs - it has no dependency beyond the curl and json extensions that ship with virtually every PHP install, so it doesn't require Composer at all if you'd rather not use it (see "Without Composer" below).
Looking for Laravel-specific auto-registration via the framework's exception handler? See sdk/php-laravel instead.
This SDK talks to a self-hosted Ditliti instance (ingestion-api). It does not connect to any managed/hosted service - point it at your own deployment's ingestion URL.
Install
The artifact repository is the canonical fallback until Packagist confirms publication.
Without Composer (e.g. a WordPress plugin)
Copy src/DitlitiClient.php into your project and require it directly - it declares the Ditliti\DitlitiClient, Ditliti\TraceContext, and Ditliti\Span classes with no other file dependencies:
Quick start
WordPress
Symfony
API
new DitlitiClient(endpoint, apiKey, projectId, release: null, environment: null)$client->setUser(?array $user)/$client->setSession(?string $sessionId)/$client->setTimeout(float $seconds)$client->addBreadcrumb(message, category: null, level: 'info', data: [])$client->captureException(\Throwable $e, array $context = [], array $options = [])$client->captureMessage(string $message, string $level = 'info', array $context = [], array $tags = [])$client->captureReplaySegment(float $durationMs, array $events, array $options = [])$client->captureProfile(int $durationMs, array $samples, array $options = [])$client->sendEnvelope(array $envelope)- low-level batch submit.
Distributed tracing
Generates real W3C traceparent (https://www.w3.org/TR/trace-context/) trace context, so a trace can be propagated across service/microservice boundaries instead of staying siloed per project:
$client->startTrace(?string $incomingTraceparent = null): TraceContext- starts a new trace, or continues one from an inboundtraceparentheader.$client->getTraceparent(): ?string- the header value to forward on outgoing requests.$client->startSpan(string $operationName, array $tags = []): Span→$span->finish(array $extraTags = []).
Database query instrumentation (Database Insights)
Ditliti\DbTracing wraps a query with a db.query span carrying the OpenTelemetry-shaped attributes the backend uses for Database Insights (slow query / N+1 / error-rate / regression detection). The server parameterizes and hashes db.query.text itself - send the real SQL text, never a redacted one:
Neither ever sets db.query.summary or ditliti.query_hash (server-computed). On failure they record error.type and re-throw the original exception unchanged; on success they record db.response.returned_rows from the driver's affected/row count where available.
Transport behavior
- Uses PHP's
curlextension directly - no HTTP client dependency to conflict with WordPress's bundledRequestslibrary or a host Symfony app's own HTTP client version. - All calls are best-effort:
curl_execfailures are swallowed so reporting can never break the host application's response path. There is no retry/queue - if you need that, wrap calls yourself or batch viasendEnvelope.
License
MIT - see LICENSE.
All versions of php-sdk with dependencies
ext-curl Version *
ext-json Version *