@@ -72,6 +72,14 @@ public function load(array $configs, ContainerBuilder $container)
7272
7373$ loader ->load ('web.xml ' );
7474$ loader ->load ('services.xml ' );
75+
76+ if (PHP_VERSION_ID <70000 ) {
77+ $ definition =$ container ->getDefinition ('kernel.class_cache.cache_warmer ' );
78+ $ definition ->addTag ('kernel.cache_warmer ' );
79+ // Ignore deprecation for PHP versions below 7.0
80+ $ definition ->setDeprecated (false );
81+ }
82+
7583$ loader ->load ('fragment_renderer.xml ' );
7684
7785// Property access is used by both the Form and the Validator component
@@ -203,47 +211,49 @@ public function load(array $configs, ContainerBuilder $container)
203211'Symfony \\Bundle \\FrameworkBundle \\Controller \\Controller ' ,
204212 ));
205213
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- ));
214+ if (PHP_VERSION_ID <70000 ) {
215+ $ this ->addClassesToCompile (array (
216+ 'Symfony \\Component \\Config \\ConfigCache ' ,
217+ 'Symfony \\Component \\Config \\FileLocator ' ,
218+
219+ 'Symfony \\Component \\Debug \\ErrorHandler ' ,
220+
221+ 'Symfony \\Component \\DependencyInjection \\ContainerAwareInterface ' ,
222+ 'Symfony \\Component \\DependencyInjection \\Container ' ,
223+
224+ 'Symfony \\Component \\EventDispatcher \\Event ' ,
225+ 'Symfony \\Component \\EventDispatcher \\ContainerAwareEventDispatcher ' ,
226+
227+ 'Symfony \\Component \\HttpFoundation \\Response ' ,
228+ 'Symfony \\Component \\HttpFoundation \\ResponseHeaderBag ' ,
229+
230+ 'Symfony \\Component \\HttpKernel \\EventListener \\ResponseListener ' ,
231+ 'Symfony \\Component \\HttpKernel \\EventListener \\RouterListener ' ,
232+ 'Symfony \\Component \\HttpKernel \\Bundle \\Bundle ' ,
233+ 'Symfony \\Component \\HttpKernel \\Controller \\ControllerResolver ' ,
234+ 'Symfony \\Component \\HttpKernel \\Controller \\ArgumentResolver ' ,
235+ 'Symfony \\Component \\HttpKernel \\ControllerMetadata \\ArgumentMetadata ' ,
236+ 'Symfony \\Component \\HttpKernel \\ControllerMetadata \\ArgumentMetadataFactory ' ,
237+ 'Symfony \\Component \\HttpKernel \\Event \\KernelEvent ' ,
238+ 'Symfony \\Component \\HttpKernel \\Event \\FilterControllerEvent ' ,
239+ 'Symfony \\Component \\HttpKernel \\Event \\FilterResponseEvent ' ,
240+ 'Symfony \\Component \\HttpKernel \\Event \\GetResponseEvent ' ,
241+ 'Symfony \\Component \\HttpKernel \\Event \\GetResponseForControllerResultEvent ' ,
242+ 'Symfony \\Component \\HttpKernel \\Event \\GetResponseForExceptionEvent ' ,
243+ 'Symfony \\Component \\HttpKernel \\HttpKernel ' ,
244+ 'Symfony \\Component \\HttpKernel \\KernelEvents ' ,
245+ 'Symfony \\Component \\HttpKernel \\Config \\FileLocator ' ,
246+
247+ 'Symfony \\Bundle \\FrameworkBundle \\Controller \\ControllerNameParser ' ,
248+ 'Symfony \\Bundle \\FrameworkBundle \\Controller \\ControllerResolver ' ,
249+
250+ // Cannot be included because annotations will parse the big compiled class file
251+ // 'Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller',
252+
253+ // cannot be included as commands are discovered based on the path to this class via Reflection
254+ // 'Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle',
255+ ));
256+ }
247257 }
248258
249259/**
@@ -534,13 +544,15 @@ private function registerRouterConfiguration(array $config, ContainerBuilder $co
534544$ container ->setParameter ('request_listener.http_port ' ,$ config ['http_port ' ]);
535545$ container ->setParameter ('request_listener.https_port ' ,$ config ['https_port ' ]);
536546
537- $ this ->addClassesToCompile (array (
538- 'Symfony \\Component \\Routing \\Generator \\UrlGenerator ' ,
539- 'Symfony \\Component \\Routing \\RequestContext ' ,
540- 'Symfony \\Component \\Routing \\Router ' ,
541- 'Symfony \\Bundle \\FrameworkBundle \\Routing \\RedirectableUrlMatcher ' ,
542- $ container ->findDefinition ('router.default ' )->getClass (),
543- ));
547+ if (PHP_VERSION_ID <70000 ) {
548+ $ this ->addClassesToCompile (array (
549+ 'Symfony \\Component \\Routing \\Generator \\UrlGenerator ' ,
550+ 'Symfony \\Component \\Routing \\RequestContext ' ,
551+ 'Symfony \\Component \\Routing \\Router ' ,
552+ 'Symfony \\Bundle \\FrameworkBundle \\Routing \\RedirectableUrlMatcher ' ,
553+ $ container ->findDefinition ('router.default ' )->getClass (),
554+ ));
555+ }
544556 }
545557
546558/**
@@ -583,20 +595,22 @@ private function registerSessionConfiguration(array $config, ContainerBuilder $c
583595
584596$ container ->setParameter ('session.save_path ' ,$ config ['save_path ' ]);
585597
586- $ this ->addClassesToCompile (array (
587- 'Symfony \\Bundle \\FrameworkBundle \\EventListener \\SessionListener ' ,
588- 'Symfony \\Component \\HttpFoundation \\Session \\Storage \\NativeSessionStorage ' ,
589- 'Symfony \\Component \\HttpFoundation \\Session \\Storage \\PhpBridgeSessionStorage ' ,
590- 'Symfony \\Component \\HttpFoundation \\Session \\Storage \\Handler \\NativeFileSessionHandler ' ,
591- 'Symfony \\Component \\HttpFoundation \\Session \\Storage \\Proxy \\AbstractProxy ' ,
592- 'Symfony \\Component \\HttpFoundation \\Session \\Storage \\Proxy \\SessionHandlerProxy ' ,
593- $ container ->getDefinition ('session ' )->getClass (),
594- ));
595-
596- if ($ container ->hasDefinition ($ config ['storage_id ' ])) {
598+ if (PHP_VERSION_ID <70000 ) {
597599$ this ->addClassesToCompile (array (
598- $ container ->findDefinition ('session.storage ' )->getClass (),
600+ 'Symfony \\Bundle \\FrameworkBundle \\EventListener \\SessionListener ' ,
601+ 'Symfony \\Component \\HttpFoundation \\Session \\Storage \\NativeSessionStorage ' ,
602+ 'Symfony \\Component \\HttpFoundation \\Session \\Storage \\PhpBridgeSessionStorage ' ,
603+ 'Symfony \\Component \\HttpFoundation \\Session \\Storage \\Handler \\NativeFileSessionHandler ' ,
604+ 'Symfony \\Component \\HttpFoundation \\Session \\Storage \\Proxy \\AbstractProxy ' ,
605+ 'Symfony \\Component \\HttpFoundation \\Session \\Storage \\Proxy \\SessionHandlerProxy ' ,
606+ $ container ->getDefinition ('session ' )->getClass (),
599607 ));
608+
609+ if ($ container ->hasDefinition ($ config ['storage_id ' ])) {
610+ $ this ->addClassesToCompile (array (
611+ $ container ->findDefinition ('session.storage ' )->getClass (),
612+ ));
613+ }
600614 }
601615
602616$ container ->setParameter ('session.metadata.update_threshold ' ,$ config ['metadata_update_threshold ' ]);
@@ -666,12 +680,14 @@ private function registerTemplatingConfiguration(array $config, ContainerBuilder
666680$ container ->setDefinition ('templating.loader ' ,$ loaderCache );
667681 }
668682
669- $ this ->addClassesToCompile (array (
670- 'Symfony \\Bundle \\FrameworkBundle \\Templating \\GlobalVariables ' ,
671- 'Symfony \\Bundle \\FrameworkBundle \\Templating \\TemplateReference ' ,
672- 'Symfony \\Bundle \\FrameworkBundle \\Templating \\TemplateNameParser ' ,
673- $ container ->findDefinition ('templating.locator ' )->getClass (),
674- ));
683+ if (PHP_VERSION_ID <70000 ) {
684+ $ this ->addClassesToCompile (array (
685+ 'Symfony \\Bundle \\FrameworkBundle \\Templating \\GlobalVariables ' ,
686+ 'Symfony \\Bundle \\FrameworkBundle \\Templating \\TemplateReference ' ,
687+ 'Symfony \\Bundle \\FrameworkBundle \\Templating \\TemplateNameParser ' ,
688+ $ container ->findDefinition ('templating.locator ' )->getClass (),
689+ ));
690+ }
675691
676692$ container ->setParameter ('templating.engines ' ,$ config ['engines ' ]);
677693$ engines =array_map (function ($ engine ) {return new Reference ('templating.engine. ' .$ engine ); },$ config ['engines ' ]);
@@ -704,11 +720,13 @@ private function registerTemplatingConfiguration(array $config, ContainerBuilder
704720$ container ->setAlias ('debug.templating.engine.php ' ,'templating.engine.php ' );
705721 }
706722
707- $ this ->addClassesToCompile (array (
708- 'Symfony \\Component \\Templating \\Storage \\FileStorage ' ,
709- 'Symfony \\Bundle \\FrameworkBundle \\Templating \\PhpEngine ' ,
710- 'Symfony \\Bundle \\FrameworkBundle \\Templating \\Loader \\FilesystemLoader ' ,
711- ));
723+ if (PHP_VERSION_ID <70000 ) {
724+ $ this ->addClassesToCompile (array (
725+ 'Symfony \\Component \\Templating \\Storage \\FileStorage ' ,
726+ 'Symfony \\Bundle \\FrameworkBundle \\Templating \\PhpEngine ' ,
727+ 'Symfony \\Bundle \\FrameworkBundle \\Templating \\Loader \\FilesystemLoader ' ,
728+ ));
729+ }
712730
713731if ($ container ->has ('assets.packages ' )) {
714732$ container ->getDefinition ('templating.helper.assets ' )->replaceArgument (0 ,new Reference ('assets.packages ' ));
@@ -1022,10 +1040,12 @@ private function registerAnnotationsConfiguration(array $config, ContainerBuilde
10221040$ definition =$ container ->findDefinition ('annotations.cache_warmer ' );
10231041$ definition ->addTag ('kernel.cache_warmer ' );
10241042
1025- $ this ->addClassesToCompile (array (
1026- 'Symfony\Component\Cache\Adapter\PhpArrayAdapter ' ,
1027- 'Symfony\Component\Cache\DoctrineProvider ' ,
1028- ));
1043+ if (PHP_VERSION_ID <70000 ) {
1044+ $ this ->addClassesToCompile (array (
1045+ 'Symfony\Component\Cache\Adapter\PhpArrayAdapter ' ,
1046+ 'Symfony\Component\Cache\DoctrineProvider ' ,
1047+ ));
1048+ }
10291049 }elseif ('file ' ===$ config ['cache ' ]) {
10301050$ cacheDir =$ container ->getParameterBag ()->resolveValue ($ config ['file_cache_dir ' ]);
10311051
@@ -1279,11 +1299,13 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con
12791299$ propertyAccessDefinition ->addTag ('monolog.logger ' ,array ('channel ' =>'cache ' ));
12801300 }
12811301
1282- $ this ->addClassesToCompile (array (
1283- 'Symfony\Component\Cache\Adapter\ApcuAdapter ' ,
1284- 'Symfony\Component\Cache\Adapter\FilesystemAdapter ' ,
1285- 'Symfony\Component\Cache\CacheItem ' ,
1286- ));
1302+ if (PHP_VERSION_ID <70000 ) {
1303+ $ this ->addClassesToCompile (array (
1304+ 'Symfony\Component\Cache\Adapter\ApcuAdapter ' ,
1305+ 'Symfony\Component\Cache\Adapter\FilesystemAdapter ' ,
1306+ 'Symfony\Component\Cache\CacheItem ' ,
1307+ ));
1308+ }
12871309 }
12881310
12891311/**