diff --git a/UPGRADE-3.3.md b/UPGRADE-3.3.md index f068e4f432..6c80873c27 100644 --- a/UPGRADE-3.3.md +++ b/UPGRADE-3.3.md @@ -168,8 +168,10 @@ FrameworkBundle * The "framework.trusted_proxies" configuration option and the corresponding "kernel.trusted_proxies" parameter have been deprecated and will be removed in 4.0. Use the Request::setTrustedProxies() method in your front controller instead. + * The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\CompilerDebugDumpPass` has been deprecated. - * The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddConsoleCommandPass` has been deprecated. Use `Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass` instead. + * The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddConsoleCommandPass` has been deprecated. + Use `Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass` instead. * The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\SerializerPass` class has been deprecated and will be removed in 4.0. diff --git a/UPGRADE-4.0.md b/UPGRADE-4.0.md index 401f3ae736..9fb064b08f 100644 --- a/UPGRADE-4.0.md +++ b/UPGRADE-4.0.md @@ -267,7 +267,10 @@ FrameworkBundle `serializer.mapping.cache.apc` and `serializer.mapping.cache.doctrine.apc` have been removed. APCu should now be automatically used when available. - * The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddConsoleCommandPass` has been removed. Use `Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass` instead. + * The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\CompilerDebugDumpPass` has been removed. + + * The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddConsoleCommandPass` has been removed. + Use `Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass` instead. * The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\SerializerPass` class has been removed. Use the `Symfony\Component\Serializer\DependencyInjection\SerializerPass` class instead. diff --git a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md index fa74f33a77..e733a6a0bf 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md @@ -4,6 +4,7 @@ CHANGELOG 3.3.0 ----- + * Deprecated the `CompilerDebugDumpPass` class * [BC BREAK] Removed the "framework.trusted_proxies" configuration option and the corresponding "kernel.trusted_proxies" parameter * Added a new new version strategy option called json_manifest_path that allows you to use the `JsonManifestVersionStrategy`. diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CompilerDebugDumpPass.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CompilerDebugDumpPass.php index f152ce8c50..714d01d01d 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CompilerDebugDumpPass.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CompilerDebugDumpPass.php @@ -11,12 +11,17 @@ namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; +@trigger_error(sprintf('The %s class is deprecated since version 3.3 and will be removed in 4.0.', CompilerDebugDumpPass::class), E_USER_DEPRECATED); + use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\Filesystem\Exception\IOException; use Symfony\Component\Filesystem\Filesystem; +/** + * @deprecated since version 3.3, to be removed in 4.0. + */ class CompilerDebugDumpPass implements CompilerPassInterface { public function process(ContainerBuilder $container) diff --git a/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php b/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php index c1ca4ff3c4..8af5aa5228 100644 --- a/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php +++ b/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php @@ -25,7 +25,6 @@ use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddCacheWarmerPa use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddCacheClearerPass; use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddExpressionLanguageProvidersPass; use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ContainerBuilderDebugDumpPass; -use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\CompilerDebugDumpPass; use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\TranslationExtractorPass; use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\TranslationDumperPass; use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\UnusedTagsPass; @@ -115,7 +114,6 @@ class FrameworkBundle extends Bundle $container->addCompilerPass(new AddDebugLogProcessorPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, -32); $container->addCompilerPass(new UnusedTagsPass(), PassConfig::TYPE_AFTER_REMOVING); $container->addCompilerPass(new ContainerBuilderDebugDumpPass(), PassConfig::TYPE_AFTER_REMOVING); - $container->addCompilerPass(new CompilerDebugDumpPass(), PassConfig::TYPE_AFTER_REMOVING, -32); $this->addCompilerPassIfExists($container, ConfigCachePass::class); $container->addCompilerPass(new CacheCollectorPass()); } diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 6236fcef8b..47ed7a410a 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -515,7 +515,13 @@ abstract class Kernel implements KernelInterface, TerminableInterface $fresh = true; if (!$cache->isFresh()) { $container = $this->buildContainer(); - $container->compile(); + try { + $container->compile(); + } finally { + if ($this->debug) { + file_put_contents($this->getCacheDir().'/'.$class.'Compiler.log', implode("\n", $container->getCompiler()->getLog())); + } + } $this->dumpContainer($cache, $container, $class, $this->getContainerBaseClass()); $fresh = false;