Symfony Adapter
The Symfony adapter bridges ADP Kernel and API into Symfony 6.4+ / 7.x / 8.x via a Symfony Bundle.
Installation
composer require app-dev-panel/adapter-symfonyBundle Registration
Register the bundle in config/bundles.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
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:
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 bundles — AssetMapperSubscriber
AppDevPanel\Adapter\Symfony\EventSubscriber\AssetMapperSubscribercollects mapped assets fromAssetMapperInterfaceat the end of each request (requiressymfony/asset-mapper).
Installing Assets
The panel and toolbar bundles are shipped by the Composer package app-dev-panel/frontend-assetsapp-dev-panel/frontend-assetsView on Packagist (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/:
# 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/htmlThe 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 order | When it kicks in |
|---|---|
1. <projectDir>/public/bundles/appdevpanel/bundle.js exists → /bundles/appdevpanel | After bin/console app-dev-panel:assets:install |
2. Resources/public/bundle.js exists → /bundles/appdevpanel | Legacy 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. with SymfonyTranslatorProxyAppDevPanel\Adapter\Symfony\Proxy\SymfonyTranslatorProxyDecorates Symfony's TranslatorInterface to feed translation lookups to TranslatorCollector. via the compiler pass. All trans() calls are intercepted and logged to TranslatorCollectorAppDevPanel\Kernel\Collector\TranslatorCollectorCaptures translation lookups during request execution. — 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. 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. otherwise.