Skip to content
PHP Ecosystem
Explore

ConnectionInstrumentation

API reference › Yii3 Debug › Db › ConnectionInstrumentation

final readonly classYii3\Debug\Db\ConnectionInstrumentation
Sourcesrc/Db/ConnectionInstrumentation.php

Attaches the debugger to the application database connection at bootstrap.

MethodDescriptionDefined by
apply() staticAttaches available observers to the application connection.ConnectionInstrumentation
public static function apply(Psr\Container\ContainerInterface $container): void

Attaches available observers to the application connection.

Logger attachment applies to logger-aware connections. Profiler instrumentation applies independently to PDO-backed, profiler-aware connections. Missing services or unsupported capabilities leave that operation untouched. Attaching is idempotent, so application wiring remains valid.

Parameters

ParameterTypeDescription
$containerPsr\Container\ContainerInterfaceContainer the connection and its observers are resolved from.