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],
];

Routes

Create config/routes/app_dev_panel.php to mount /debug, /debug/api/*, and /inspect/api/*:

php
<?php

declare(strict_types=1);

use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;

return static function (RoutingConfigurator $routes): void {
    $routes->import('@AppDevPanelBundle/config/routes/adp.php');
};

Without this file the panel routes are not registered and /debug returns 404. (Once a Flex recipe lands, this file will be created automatically by composer require.)

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
        queue: true            # requires symfony/messenger
        assets: true           # requires symfony/asset-mapper
        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).

Additionally:

  • Asset bundlesAssetMapperSubscriberAppDevPanel\Adapter\Symfony\EventSubscriber\AssetMapperSubscriber collects mapped assets from AssetMapperInterface at the end of each request (requires symfony/asset-mapper).

Installing Assets

The panel and toolbar bundles are shipped by the Composer package app-dev-panel/frontend-assetsversiondownloadsapp-dev-panel/frontend-assetsView on Packagistversiondownloadslicensephp version (installed transitively when you composer require app-dev-panel/adapter-symfony). Static files are served by the web server — PHP never proxies them. Run the bundled command once after install to publish them under public/:

bash
# copy (safe on all platforms)
php bin/console app-dev-panel:assets:install

# or symlink for zero-cost updates when FrontendAssets changes
php bin/console app-dev-panel:assets:install --symlink
php bin/console app-dev-panel:assets:install --relative

# override the public dir (defaults to %kernel.project_dir%/public)
php bin/console app-dev-panel:assets:install --public-dir=/var/www/html

The bundle auto-detects the published copy and points the panel at /bundles/appdevpanel. Until you run the command, the panel falls back to the GitHub Pages CDN.

static_url resolution orderWhen it kicks in
1. <projectDir>/public/bundles/appdevpanel/bundle.js exists → /bundles/appdevpanelAfter bin/console app-dev-panel:assets:install
2. Resources/public/bundle.js exists → /bundles/appdevpanelLegacy make build-panel flow before Symfony's assets:install
3. PanelConfig::DEFAULT_STATIC_URL (GitHub Pages)Default — works right after composer require, no commands required

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.