-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Deprecate ClassCollectionLoader and Kernel::loadClassCa 8000 che #20735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,6 +71,14 @@ public function load(array $configs, ContainerBuilder $container) | |
|
||
$loader->load('web.xml'); | ||
$loader->load('services.xml'); | ||
|
||
if (PHP_VERSION_ID < 70000) { | ||
$definition = $container->getDefinition('kernel.class_cache.cache_warmer'); | ||
$definition->addTag('kernel.cache_warmer'); | ||
// Ignore deprecation for PHP versions below 7.0 | ||
$definition->setDeprecated(false); | ||
} | ||
|
||
$loader->load('fragment_renderer.xml'); | ||
|
||
// Property access is used by both the Form and the Validator component | ||
|
@@ -194,47 +202,49 @@ public function load(array $configs, ContainerBuilder $container) | |
'Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller', | ||
)); | ||
|
||
$this->addClassesToCompile(array( | ||
'Symfony\\Component\\Config\\ConfigCache', | ||
'Symfony\\Component\\Config\\FileLocator', | ||
|
||
'Symfony\\Component\\Debug\\ErrorHandler', | ||
|
||
'Symfony\\Component\\DependencyInjection\\ContainerAwareInterface', | ||
'Symfony\\Component\\DependencyInjection\\Container', | ||
|
||
'Symfony\\Component\\EventDispatcher\\Event', | ||
'Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher', | ||
|
||
'Symfony\\Component\\HttpFoundation\\Response', | ||
'Symfony\\Component\\HttpFoundation\\ResponseHeaderBag', | ||
|
||
'Symfony\\Component\\HttpKernel\\EventListener\\ResponseListener', | ||
'Symfony\\Component\\HttpKernel\\EventListener\\RouterListener', | ||
'Symfony\\Component\\HttpKernel\\Bundle\\Bundle', | ||
'Symfony\\Component\\HttpKernel\\Controller\\ControllerResolver', | ||
'Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver', | ||
'Symfony\\Component\\HttpKernel\\ControllerMetadata\\ArgumentMetadata', | ||
'Symfony\\Component\\HttpKernel\\ControllerMetadata\\ArgumentMetadataFactory', | ||
'Symfony\\Component\\HttpKernel\\Event\\KernelEvent', | ||
'Symfony\\Component\\HttpKernel\\Event\\FilterControllerEvent', | ||
'Symfony\\Component\\HttpKernel\\Event\\FilterResponseEvent', | ||
'Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent', | ||
'Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent', | ||
'Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent', | ||
'Symfony\\Component\\HttpKernel\\HttpKernel', | ||
'Symfony\\Component\\HttpKernel\\KernelEvents', | ||
'Symfony\\Component\\HttpKernel\\Config\\FileLocator', | ||
|
||
'Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerNameParser', | ||
'Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerResolver', | ||
|
||
// Cannot be included because annotations will parse the big compiled class file | ||
// 'Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller', | ||
|
||
// cannot be included as commands are discovered based on the path to this class via Reflection | ||
// 'Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle', | ||
)); | ||
if (PHP_VERSION_ID < 70000) { | ||
$this->addClassesToCompile(array( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here about deprecation warnings |
||
'Symfony\\Component\\Config\\ConfigCache', | ||
'Symfony\\Component\\Config\\FileLocator', | ||
|
||
'Symfony\\Component\\Debug\\ErrorHandler', | ||
|
||
'Symfony\\Component\\DependencyInjection\\ContainerAwareInterface', | ||
'Symfony\\Component\\DependencyInjection\\Container', | ||
|
||
'Symfony\\Component\\EventDispatcher\\Event', | ||
'Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher', | ||
|
||
'Symfony\\Component\\HttpFoundation\\Response', | ||
'Symfony\\Component\\HttpFoundation\\ResponseHeaderBag', | ||
|
||
'Symfony\\Component\\HttpKernel\\EventListener\\ResponseListener', | ||
'Symfony\\Component\\HttpKernel\\EventListener\\RouterListener', | ||
'Symfony\\Component\\HttpKernel\\Bundle\\Bundle', | ||
'Symfony\\Component\\HttpKernel\\Controller\\ControllerResolver', | ||
'Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver', | ||
'Symfony\\Component\\HttpKernel\\ControllerMetadata\\ArgumentMetadata', | ||
'Symfony\\Component\\HttpKernel\\ControllerMetadata\\ArgumentMetadataFactory', | ||
'Symfony\\Component\\HttpKernel\\Event\\KernelEvent', | ||
'Symfony\\Component\\HttpKernel\\Event\\FilterControllerEvent', | ||
'Symfony\\Component\\HttpKernel\\Event\\FilterResponseEvent', | ||
'Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent', | ||
'Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent', | ||
'Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent', | ||
'Symfony\\Component\\HttpKernel\\HttpKernel', | ||
'Symfony\\Component\\HttpKernel\\KernelEvents', | ||
'Symfony\\Component\\HttpKernel\\Config\\FileLocator', | ||
|
||
'Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerNameParser', | ||
'Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerResolver', | ||
|
||
// Cannot be included because annotations will parse the big compiled class file | ||
// 'Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller', | ||
|
||
// cannot be included as commands are discovered based on the path to this class via Reflection | ||
// 'Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle', | ||
)); | ||
} | ||
} | ||
|
||
/** | ||
|
@@ -525,13 +535,15 @@ private function registerRouterConfiguration(array $config, ContainerBuilder $co | |
$container->setParameter('request_listener.http_port', $config['http_port']); | ||
$container->setParameter('request_listener.https_port', $config['https_port']); | ||
|
||
$this->addClassesToCompile(array( | ||
'Symfony\\Component\\Routing\\Generator\\UrlGenerator', | ||
'Symfony\\Component\\Routing\\RequestContext', | ||
'Symfony\\Component\\Routing\\Router', | ||
'Symfony\\Bundle\\FrameworkBundle\\Routing\\RedirectableUrlMatcher', | ||
$container->findDefinition('router.default')->getClass(), | ||
)); | ||
if (PHP_VERSION_ID < 70000) { | ||
$this->addClassesToCompile(array( | ||
'Symfony\\Component\\Routing\\Generator\\UrlGenerator', | ||
'Symfony\\Component\\Routing\\RequestContext', | ||
'Symfony\\Component\\Routing\\Router', | ||
'Symfony\\Bundle\\FrameworkBundle\\Routing\\RedirectableUrlMatcher', | ||
$container->findDefinition('router.default')->getClass(), | ||
)); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would wrap the next call instead of returning early here to make the intent clear. |
||
} | ||
|
||
/** | ||
|
@@ -574,20 +586,22 @@ private function registerSessionConfiguration(array $config, ContainerBuilder $c | |
|
||
$container->setParameter('session.save_path', $config['save_path']); | ||
|
||
$this->addClassesToCompile(array( | ||
'Symfony\\Bundle\\FrameworkBundle\\EventListener\\SessionListener', | ||
'Symfony\\Component\\HttpFoundation\\Session\\Storage\\NativeSessionStorage', | ||
'Symfony\\Component\\HttpFoundation\\Session\\Storage\\PhpBridgeSessionStorage', | ||
'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\NativeFileSessionHandler', | ||
'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\AbstractProxy', | ||
'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\SessionHandlerProxy', | ||
$container->getDefinition('session')->getClass(), | ||
)); | ||
|
||
if ($container->hasDefinition($config['storage_id'])) { | ||
if (PHP_VERSION_ID < 70000) { | ||
$this->addClassesToCompile(array( | ||
$container->findDefinition('session.storage')->getClass(), | ||
'Symfony\\Bundle\\FrameworkBundle\\EventListener\\SessionListener', | ||
'Symfony\\Component\\HttpFoundation\\Session\\Storage\\NativeSessionStorage', | ||
'Symfony\\Component\\HttpFoundation\\Session\\Storage\\PhpBridgeSessionStorage', | ||
'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\NativeFileSessionHandler', | ||
'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\AbstractProxy', | ||
'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\SessionHandlerProxy', | ||
$container->getDefinition('session')->getClass(), | ||
)); | ||
|
||
if ($container->hasDefinition($config['storage_id'])) { | ||
$this->addClassesToCompile(array( | ||
$container->findDefinition('session.storage')->getClass(), | ||
)); | ||
} | ||
} | ||
|
||
$container->setParameter('session.metadata.update_threshold', $config['metadata_update_threshold']); | ||
|
@@ -657,12 +671,14 @@ private function registerTemplatingConfiguration(array $config, ContainerBuilder | |
$container->setDefinition('templating.loader', $loaderCache); | ||
} | ||
|
||
$this->addClassesToCompile(array( | ||
'Symfony\\Bundle\\FrameworkBundle\\Templating\\GlobalVariables', | ||
'Symfony\\Bundle\\FrameworkBundle\\Templating\\TemplateReference', | ||
'Symfony\\Bundle\\FrameworkBundle\\Templating\\TemplateNameParser', | ||
$container->findDefinition('templating.locator')->getClass(), | ||
)); | ||
if (PHP_VERSION_ID < 70000) { | ||
$this->addClassesToCompile(array( | ||
'Symfony\\Bundle\\FrameworkBundle\\Templating\\GlobalVariables', | ||
'Symfony\\Bundle\\FrameworkBundle\\Templating\\TemplateReference', | ||
'Symfony\\Bundle\\FrameworkBundle\\Templating\\TemplateNameParser', | ||
$container->findDefinition('templating.locator')->getClass(), | ||
)); | ||
} | ||
|
||
$container->setParameter('templating.engines', $config['engines']); | ||
$engines = array_map(function ($engine) { return new Reference('templating.engine.'.$engine); }, $config['engines']); | ||
|
@@ -695,11 +711,13 @@ private function registerTemplatingConfiguration(array $config, ContainerBuilder | |
$container->setAlias('debug.templating.engine.php', 'templating.engine.php'); | ||
} | ||
|
||
$this->addClassesToCompile(array( | ||
'Symfony\\Component\\Templating\\Storage\\FileStorage', | ||
'Symfony\\Bundle\\FrameworkBundle\\Templating\\PhpEngine', | ||
'Symfony\\Bundle\\FrameworkBundle\\Templating\\Loader\\FilesystemLoader', | ||
)); | ||
if (PHP_VERSION_ID < 70000) { | ||
$this->addClassesToCompile(array( | ||
'Symfony\\Component\\Templating\\Storage\\FileStorage', | ||
'Symfony\\Bundle\\FrameworkBundle\\Templating\\PhpEngine', | ||
'Symfony\\Bundle\\FrameworkBundle\\Templating\\Loader\\FilesystemLoader', | ||
)); | ||
} | ||
|
||
if ($container->has('assets.packages')) { | ||
$container->getDefinition('templating.helper.assets')->replaceArgument(0, new Reference('assets.packages')); | ||
|
@@ -1015,10 +1033,12 @@ private function registerAnnotationsConfiguration(array $config, ContainerBuilde | |
$definition = $container->findDefinition('annotations.cache_warmer'); | ||
$definition->addTag('kernel.cache_warmer'); | ||
|
||
$this->addClassesToCompile(array( | ||
'Symfony\Component\Cache\Adapter\PhpArrayAdapter', | ||
'Symfony\Component\Cache\DoctrineProvider', | ||
)); | ||
if (PHP_VERSION_ID < 70000) { | ||
$this-> 10000 ;addClassesToCompile(array( | ||
'Symfony\Component\Cache\Adapter\PhpArrayAdapter', | ||
'Symfony\Component\Cache\DoctrineProvider', | ||
)); | ||
} | ||
} elseif ('file' === $config['cache']) { | ||
$cacheDir = $container->getParameterBag()->resolveValue($config['file_cache_dir']); | ||
|
||
|
@@ -1270,11 +1290,13 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con | |
$propertyAccessDefinition->addTag('monolog.logger', array('channel' => 'cache')); | ||
} | ||
|
||
$this->addClassesToCompile(array( | ||
'Symfony\Component\Cache\Adapter\ApcuAdapter', | ||
'Symfony\Component\Cache\Adapter\FilesystemAdapter', | ||
'Symfony\Component\Cache\CacheItem', | ||
)); | ||
if (PHP_VERSION_ID < 70000) { | ||
$this->addClassesToCompile(array( | ||
'Symfony\Component\Cache\Adapter\ApcuAdapter', | ||
'Symfony\Component\Cache\Adapter\FilesystemAdapter', | ||
'Symfony\Component\Cache\CacheItem', | ||
)); | ||
} | ||
} | ||
|
||
/** | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will still trigger a deprecation warning for PHP 5.6 users. Do we want it ?