Skip to content

Symfony Adapter

The Symfony adapter bridges ADP Kernel and API into Symfony 6.4+ / 7.x / 8.x via a Symfony Bundle.

Installation

bash
composer require app-dev-panel/adapter-symfony

Bundle Registration

Register the bundle in config/bundles.php:

php
return [
    // ...
    AppDevPanel\Adapter\Symfony\AppDevPanelBundle::class => ['dev' => true, 'test' => true],
];

Configuration

Create config/packages/app_dev_panel.yaml:

yaml
app_dev_panel:
    enabled: true
    storage:
        path: '%kernel.project_dir%/var/debug'
        history_size: 50
    collectors:
        request: true
        exception: true
        log: true
        event: true
        doctrine: true        # requires doctrine/dbal
        twig: true             # requires twig/twig
        security: true         # requires symfony/security-bundle
        cache: true
        mailer: true           # requires symfony/mailer
        messenger: true        # requires symfony/messenger
        code_coverage: false   # opt-in; requires pcov or xdebug
    ignored_requests:
        - '/_wdt/*'
        - '/_profiler/*'
        - '/debug/api/**'
    api:
        enabled: true
        allowed_ips: ['127.0.0.1', '::1']

Collectors

Supports all Kernel collectors plus Symfony-specific ones: Twig templates, Security (user/roles/firewall), Cache, Messenger, Translator, Doctrine database queries, and Redis commands (via Predis plugin or phpredis decorator).

Translator Integration

The adapter automatically decorates Symfony's TranslatorInterfaceSymfony\Contracts\Translation\TranslatorInterfaceSymfony Translation Contract. Translates messages using message catalogs.Symfony · interface with SymfonyTranslatorProxyAppDevPanel\Adapter\Symfony\Proxy\SymfonyTranslatorProxyDecorates Symfony's TranslatorInterface to feed translation lookups to TranslatorCollector.final Adapter/Symfony · class · implements TranslatorInterface via the compiler pass. All trans() calls are intercepted and logged to TranslatorCollectorAppDevPanel\Kernel\Collector\TranslatorCollectorCaptures translation lookups during request execution.final Kernel · class · implements SummaryCollectorInterface — no code changes needed. See Translator for details.

Database Inspector

When doctrine/dbal is available, DoctrineSchemaProviderAppDevPanel\Adapter\Symfony\Inspector\DoctrineSchemaProviderProvides database schema inspection via Doctrine DBAL.final Adapter/Symfony · class · implements SchemaProviderInterface provides database schema inspection. Falls back to NullSchemaProviderAppDevPanel\Adapter\Symfony\Inspector\NullSchemaProviderNo-op schema provider for when no database is configured. Returns empty results instead of causing a 500 error.final Adapter/Symfony · class · implements SchemaProviderInterface otherwise.

Released under the MIT License.