@@ -71,6 +71,14 @@ public function load(array $configs, ContainerBuilder $container)
7171
7272$ loader ->load ('web.xml ' );
7373$ loader ->load ('services.xml ' );
74+
75+ if (PHP_VERSION_ID <70000 ) {
76+ $ definition =$ container ->getDefinition ('kernel.class_cache.cache_warmer ' );
77+ $ definition ->addTag ('kernel.cache_warmer ' );
78+ // Ignore deprecation for PHP versions below 7.0
79+ $ definition ->setDeprecated (false );
80+ }
81+
7482$ loader ->load ('fragment_renderer.xml ' );
7583
7684// Property access is used by both the Form and the Validator component
@@ -194,47 +202,49 @@ public function load(array $configs, ContainerBuilder $container)
194202'Symfony \\Bundle \\FrameworkBundle \\Controller \\Controller ' ,
195203 ));
196204
197- $ this ->addClassesToCompile (array (
198- 'Symfony \\Component \\Config \\ConfigCache ' ,
199- 'Symfony \\Component \\Config \\FileLocator ' ,
200-
201- 'Symfony \\Component \\Debug \\ErrorHandler ' ,
202-
203- 'Symfony \\Component \\DependencyInjection \\ContainerAwareInterface ' ,
204- 'Symfony \\Component \\DependencyInjection \\Container ' ,
205-
206- 'Symfony \\Component \\EventDispatcher \\Event ' ,
207- 'Symfony \\Component \\EventDispatcher \\ContainerAwareEventDispatcher ' ,
208-
209- 'Symfony \\Component \\HttpFoundation \\Response ' ,
210- 'Symfony \\Component \\HttpFoundation \\ResponseHeaderBag ' ,
211-
212- 'Symfony \\Component \\HttpKernel \\EventListener \\ResponseListener ' ,
213- 'Symfony \\Component \\HttpKernel \\EventListener \\RouterListener ' ,
214- 'Symfony \\Component \\HttpKernel \\Bundle \\Bundle ' ,
215- 'Symfony \\Component \\HttpKernel \\Controller \\ControllerResolver ' ,
216- 'Symfony \\Component \\HttpKernel \\Controller \\ArgumentResolver ' ,
217- 'Symfony \\Component \\HttpKernel \\ControllerMetadata \\ArgumentMetadata ' ,
218- 'Symfony \\Component \\HttpKernel \\ControllerMetadata \\ArgumentMetadataFactory ' ,
219- 'Symfony \\Component \\HttpKernel \\Event \\KernelEvent ' ,
220- 'Symfony \\Component \\HttpKernel \\Event \\FilterControllerEvent ' ,
221- 'Symfony \\Component \\HttpKernel \\Event \\FilterResponseEvent ' ,
222- 'Symfony \\Component \\HttpKernel \\Event \\GetResponseEvent ' ,
223- 'Symfony \\Component \\HttpKernel \\Event \\GetResponseForControllerResultEvent ' ,
224- 'Symfony \\Component \\HttpKernel \\Event \\GetResponseForExceptionEvent ' ,
225- 'Symfony \\Component \\HttpKernel \\HttpKernel ' ,
226- 'Symfony \\Component \\HttpKernel \\KernelEvents ' ,
227- 'Symfony \\Component \\HttpKernel \\Config \\FileLocator ' ,
228-
229- 'Symfony \\Bundle \\FrameworkBundle \\Controller \\ControllerNameParser ' ,
230- 'Symfony \\Bundle \\FrameworkBundle \\Controller \\ControllerResolver ' ,
231-
232- // Cannot be included because annotations will parse the big compiled class file
233- // 'Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller',
234-
235- // cannot be included as commands are discovered based on the path to this class via Reflection
236- // 'Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle',
237- ));
205+ if (PHP_VERSION_ID <70000 ) {
206+ $ this ->addClassesToCompile (array (
207+ 'Symfony \\Component \\Config \\ConfigCache ' ,
208+ 'Symfony \\Component \\Config \\FileLocator ' ,
209+
210+ 'Symfony \\Component \\Debug \\ErrorHandler ' ,
211+
212+ 'Symfony \\Component \\DependencyInjection \\ContainerAwareInterface ' ,
213+ 'Symfony \\Component \\DependencyInjection \\Container ' ,
214+
215+ 'Symfony \\Component \\EventDispatcher \\Event ' ,
216+ 'Symfony \\Component \\EventDispatcher \\ContainerAwareEventDispatcher ' ,
217+
218+ 'Symfony \\Component \\HttpFoundation \\Response ' ,
219+ 'Symfony \\Component \\HttpFoundation \\ResponseHeaderBag ' ,
220+
221+ 'Symfony \\Component \\HttpKernel \\EventListener \\ResponseListener ' ,
222+ 'Symfony \\Component \\HttpKernel \\EventListener \\RouterListener ' ,
223+ 'Symfony \\Component \\HttpKernel \\Bundle \\Bundle ' ,
224+ 'Symfony \\Component \\HttpKernel \\Controller \\ControllerResolver ' ,
225+ 'Symfony \\Component \\HttpKernel \\Controller \\ArgumentResolver ' ,
226+ 'Symfony \\Component \\HttpKernel \\ControllerMetadata \\ArgumentMetadata ' ,
227+ 'Symfony \\Component \\HttpKernel \\ControllerMetadata \\ArgumentMetadataFactory ' ,
228+ 'Symfony \\Component \\HttpKernel \\Event \\KernelEvent ' ,
229+ 'Symfony \\Component \\HttpKernel \\Event \\FilterControllerEvent ' ,
230+ 'Symfony \\Component \\HttpKernel \\Event \\FilterResponseEvent ' ,
231+ 'Symfony \\Component \\HttpKernel \\Event \\GetResponseEvent ' ,
232+ 'Symfony \\Component \\HttpKernel \\Event \\GetResponseForControllerResultEvent ' ,
233+ 'Symfony \\Component \\HttpKernel \\Event \\GetResponseForExceptionEvent ' ,
234+ 'Symfony \\Component \\HttpKernel \\HttpKernel ' ,
235+ 'Symfony \\Component \\HttpKernel \\KernelEvents ' ,
236+ 'Symfony \\Component \\HttpKernel \\Config \\FileLocator ' ,
237+
238+ 'Symfony \\Bundle \\FrameworkBundle \\Controller \\ControllerNameParser ' ,
239+ 'Symfony \\Bundle \\FrameworkBundle \\Controller \\ControllerResolver ' ,
240+
241+ // Cannot be included because annotations will parse the big compiled class file
242+ // 'Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller',
243+
244+ // cannot be included as commands are discovered based on the path to this class via Reflection
245+ // 'Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle',
246+ ));
247+ }
238248 }
239249
240250/**
@@ -525,13 +535,15 @@ private function registerRouterConfiguration(array $config, ContainerBuilder $co
525535$ container ->setParameter ('request_listener.http_port ' ,$ config ['http_port ' ]);
526536$ container ->setParameter ('request_listener.https_port ' ,$ config ['https_port ' ]);
527537
528- $ this ->addClassesToCompile (array (
529- 'Symfony \\Component \\Routing \\Generator \\UrlGenerator ' ,
530- 'Symfony \\Component \\Routing \\RequestContext ' ,
531- 'Symfony \\Component \\Routing \\Router ' ,
532- 'Symfony \\Bundle \\FrameworkBundle \\Routing \\RedirectableUrlMatcher ' ,
533- $ container ->findDefinition ('router.default ' )->getClass (),
534- ));
538+ if (PHP_VERSION_ID <70000 ) {
539+ $ this ->addClassesToCompile (array (
540+ 'Symfony \\Component \\Routing \\Generator \\UrlGenerator ' ,
541+ 'Symfony \\Component \\Routing \\RequestContext ' ,
542+ 'Symfony \\Component \\Routing \\Router ' ,
543+ 'Symfony \\Bundle \\FrameworkBundle \\Routing \\RedirectableUrlMatcher ' ,
544+ $ container ->findDefinition ('router.default ' )->getClass (),
545+ ));
546+ }
535547 }
536548
537549/**
@@ -574,20 +586,22 @@ private function registerSessionConfiguration(array $config, ContainerBuilder $c
574586
575587$ container ->setParameter ('session.save_path ' ,$ config ['save_path ' ]);
576588
577- $ this ->addClassesToCompile (array (
578- 'Symfony \\Bundle \\FrameworkBundle \\EventListener \\SessionListener ' ,
579- 'Symfony \\Component \\HttpFoundation \\Session \\Storage \\NativeSessionStorage ' ,
580- 'Symfony \\Component \\HttpFoundation \\Session \\Storage \\PhpBridgeSessionStorage ' ,
581- 'Symfony \\Component \\HttpFoundation \\Session \\Storage \\Handler \\NativeFileSessionHandler ' ,
582- 'Symfony \\Component \\HttpFoundation \\Session \\Storage \\Proxy \\AbstractProxy ' ,
583- 'Symfony \\Component \\HttpFoundation \\Session \\Storage \\Proxy \\SessionHandlerProxy ' ,
584- $ container ->getDefinition ('session ' )->getClass (),
585- ));
586-
587- if ($ container ->hasDefinition ($ config ['storage_id ' ])) {
589+ if (PHP_VERSION_ID <70000 ) {
588590$ this ->addClassesToCompile (array (
589- $ container ->findDefinition ('session.storage ' )->getClass (),
591+ 'Symfony \\Bundle \\FrameworkBundle \\EventListener \\SessionListener ' ,
592+ 'Symfony \\Component \\HttpFoundation \\Session \\Storage \\NativeSessionStorage ' ,
593+ 'Symfony \\Component \\HttpFoundation \\Session \\Storage \\PhpBridgeSessionStorage ' ,
594+ 'Symfony \\Component \\HttpFoundation \\Session \\Storage \\Handler \\NativeFileSessionHandler ' ,
595+ 'Symfony \\Component \\HttpFoundation \\Session \\Storage \\Proxy \\AbstractProxy ' ,
596+ 'Symfony \\Component \\HttpFoundation \\Session \\Storage \\Proxy \\SessionHandlerProxy ' ,
597+ $ container ->getDefinition ('session ' )->getClass (),
590598 ));
599+
600+ if ($ container ->hasDefinition ($ config ['storage_id ' ])) {
601+ $ this ->addClassesToCompile (array (
602+ $ container ->findDefinition ('session.storage ' )->getClass (),
603+ ));
604+ }
591605 }
592606
593607$ container ->setParameter ('session.metadata.update_threshold ' ,$ config ['metadata_update_threshold ' ]);
@@ -657,12 +671,14 @@ private function registerTemplatingConfiguration(array $config, ContainerBuilder
657671$ container ->setDefinition ('templating.loader ' ,$ loaderCache );
658672 }
659673
660- $ this ->addClassesToCompile (array (
661- 'Symfony \\Bundle \\FrameworkBundle \\Templating \\GlobalVariables ' ,
662- 'Symfony \\Bundle \\FrameworkBundle \\Templating \\TemplateReference ' ,
663- 'Symfony \\Bundle \\FrameworkBundle \\Templating \\TemplateNameParser ' ,
664- $ container ->findDefinition ('templating.locator ' )->getClass (),
665- ));
674+ if (PHP_VERSION_ID <70000 ) {
675+ $ this ->addClassesToCompile (array (
676+ 'Symfony \\Bundle \\FrameworkBundle \\Templating \\GlobalVariables ' ,
677+ 'Symfony \\Bundle \\FrameworkBundle \\Templating \\TemplateReference ' ,
678+ 'Symfony \\Bundle \\FrameworkBundle \\Templating \\TemplateNameParser ' ,
679+ $ container ->findDefinition ('templating.locator ' )->getClass (),
680+ ));
681+ }
666682
667683$ container ->setParameter ('templating.engines ' ,$ config ['engines ' ]);
668684$ engines =array_map (function ($ engine ) {return new Reference ('templating.engine. ' .$ engine ); },$ config ['engines ' ]);
@@ -695,11 +711,13 @@ private function registerTemplatingConfiguration(array $config, ContainerBuilder
695711$ container ->setAlias ('debug.templating.engine.php ' ,'templating.engine.php ' );
696712 }
697713
698- $ this ->addClassesToCompile (array (
699- 'Symfony \\Component \\Templating \\Storage \\FileStorage ' ,
700- 'Symfony \\Bundle \\FrameworkBundle \\Templating \\PhpEngine ' ,
701- 'Symfony \\Bundle \\FrameworkBundle \\Templating \\Loader \\FilesystemLoader ' ,
702- ));
714+ if (PHP_VERSION_ID <70000 ) {
715+ $ this ->addClassesToCompile (array (
716+ 'Symfony \\Component \\Templating \\Storage \\FileStorage ' ,
717+ 'Symfony \\Bundle \\FrameworkBundle \\Templating \\PhpEngine ' ,
718+ 'Symfony \\Bundle \\FrameworkBundle \\Templating \\Loader \\FilesystemLoader ' ,
719+ ));
720+ }
703721
704722if ($ container ->has ('assets.packages ' )) {
705723$ container ->getDefinition ('templating.helper.assets ' )->replaceArgument (0 ,new Reference ('assets.packages ' ));
@@ -1015,10 +1033,12 @@ private function registerAnnotationsConfiguration(array $config, ContainerBuilde
10151033$ definition =$ container ->findDefinition ('annotations.cache_warmer ' );
10161034$ definition ->addTag ('kernel.cache_warmer ' );
10171035
1018- $ this ->addClassesToCompile (array (
1019- 'Symfony\Component\Cache\Adapter\PhpArrayAdapter ' ,
1020- 'Symfony\Component\Cache\DoctrineProvider ' ,
1021- ));
1036+ if (PHP_VERSION_ID <70000 ) {
1037+ $ this ->addClassesToCompile (array (
1038+ 'Symfony\Component\Cache\Adapter\PhpArrayAdapter ' ,
1039+ 'Symfony\Component\Cache\DoctrineProvider ' ,
1040+ ));
1041+ }
10221042 }elseif ('file ' ===$ config ['cache ' ]) {
10231043$ cacheDir =$ container ->getParameterBag ()->resolveValue ($ config ['file_cache_dir ' ]);
10241044
@@ -1270,11 +1290,13 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con
12701290$ propertyAccessDefinition ->addTag ('monolog.logger ' ,array ('channel ' =>'cache ' ));
12711291 }
12721292
1273- $ this ->addClassesToCompile (array (
1274- 'Symfony\Component\Cache\Adapter\ApcuAdapter ' ,
1275- 'Symfony\Component\Cache\Adapter\FilesystemAdapter ' ,
1276- 'Symfony\Component\Cache\CacheItem ' ,
1277- ));
1293+ if (PHP_VERSION_ID <70000 ) {
1294+ $ this ->addClassesToCompile (array (
1295+ 'Symfony\Component\Cache\Adapter\ApcuAdapter ' ,
1296+ 'Symfony\Component\Cache\Adapter\FilesystemAdapter ' ,
1297+ 'Symfony\Component\Cache\CacheItem ' ,
1298+ ));
1299+ }
12781300 }
12791301
12801302/**