diff --git a/src/Symfony/Bundle/DebugBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/DebugBundle/DependencyInjection/Configuration.php index 436a95c50b6f7..5f98efab0d9a8 100644 --- a/src/Symfony/Bundle/DebugBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/DebugBundle/DependencyInjection/Configuration.php @@ -13,6 +13,7 @@ use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; +use Symfony\Component\VarDumper\Dumper\HtmlDumper; /** * DebugExtension configuration structure. @@ -28,8 +29,8 @@ public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('debug'); - $treeBuilder->getRootNode() - ->children() + $rootNode = $treeBuilder->getRootNode(); + $rootNode->children() ->integerNode('max_items') ->info('Max number of displayed items past the first level, -1 means no limit') ->min(-1) @@ -53,6 +54,19 @@ public function getConfigTreeBuilder() ->end() ; + if (method_exists(HtmlDumper::class, 'setTheme')) { + $rootNode + ->children() + ->enumNode('theme') + ->info('Changes the color of the dump() output when rendered directly on the templating. "dark" (default) or "light"') + ->example('dark') + ->values(array('dark', 'light')) + ->defaultValue('dark') + ->end() + ->end() + ; + } + return $treeBuilder; } } diff --git a/src/Symfony/Bundle/DebugBundle/DependencyInjection/DebugExtension.php b/src/Symfony/Bundle/DebugBundle/DependencyInjection/DebugExtension.php index 317f2fba4e093..968fa81f75f9f 100644 --- a/src/Symfony/Bundle/DebugBundle/DependencyInjection/DebugExtension.php +++ b/src/Symfony/Bundle/DebugBundle/DependencyInjection/DebugExtension.php @@ -18,6 +18,7 @@ use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\VarDumper\Dumper\CliDumper; +use Symfony\Component\VarDumper\Dumper\HtmlDumper; /** * DebugExtension. @@ -42,6 +43,11 @@ public function load(array $configs, ContainerBuilder $container) ->addMethodCall('setMinDepth', array($config['min_depth'])) ->addMethodCall('setMaxString', array($config['max_string_length'])); + if (method_exists(HtmlDumper::class, 'setTheme') && 'dark' !== $config['theme']) { + $container->getDefinition('var_dumper.html_dumper') + ->addMethodCall('setTheme', array($config['theme'])); + } + if (null === $config['dump_destination']) { $container->getDefinition('var_dumper.command.server_dump') ->setClass(ServerDumpPlaceholderCommand::class)
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: