@@ -71,6 +71,14 @@ public function load(array $configs, ContainerBuilder $container)
71
71
72
72
$ loader ->load ('web.xml ' );
73
73
$ 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
+
74
82
$ loader ->load ('fragment_renderer.xml ' );
75
83
76
84
// Property access is used by both the Form and the Validator component
@@ -194,47 +202,49 @@ public function load(array $configs, ContainerBuilder $container)
194
202
'Symfony \\Bundle \\FrameworkBundle \\Controller \\Controller ' ,
195
203
));
196
204
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
+ }
238
248
}
239
249
240
250
/**
@@ -525,13 +535,15 @@ private function registerRouterConfiguration(array $config, ContainerBuilder $co
525
535
$ container ->setParameter ('request_listener.http_port ' , $ config ['http_port ' ]);
526
536
$ container ->setParameter ('request_listener.https_port ' , $ config ['https_port ' ]);
527
537
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
+ }
535
547
}
536
548
537
549
/**
@@ -574,20 +586,22 @@ private function registerSessionConfiguration(array $config, ContainerBuilder $c
574
586
575
587
$ container ->setParameter ('session.save_path ' , $ config ['save_path ' ]);
576
588
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 ) {
588
590
$ 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 (),
590
598
));
599
+
600
+ if ($ container ->hasDefinition ($ config ['storage_id ' ])) {
601
+ $ this ->addClassesToCompile (array (
602
+ $ container ->findDefinition ('session.storage ' )->getClass (),
603
+ ));
604
+ }
591
605
}
592
606
593
607
$ container ->setParameter ('session.metadata.update_threshold ' , $ config ['metadata_update_threshold ' ]);
@@ -657,12 +671,14 @@ private function registerTemplatingConfiguration(array $config, ContainerBuilder
657
671
$ container ->setDefinition ('templating.loader ' , $ loaderCache );
658
672
}
659
673
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
+ }
666
682
667
683
$ container ->setParameter ('templating.engines ' , $ config ['engines ' ]);
668
684
$ engines = array_map (function ($ engine ) { return new Reference ('templating.engine. ' .$ engine ); }, $ config ['engines ' ]);
@@ -695,11 +711,13 @@ private function registerTemplatingConfiguration(array $config, ContainerBuilder
695
711
$ container ->setAlias ('debug.templating.engine.php ' , 'templating.engine.php ' );
696
712
}
697
713
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
+ }
703
721
704
722
if ($ container ->has ('assets.packages ' )) {
705
723
$ container ->getDefinition ('templating.helper.assets ' )->replaceArgument (0 , new Reference ('assets.packages ' ));
@@ -1015,10 +1033,12 @@ private function registerAnnotationsConfiguration(array $config, ContainerBuilde
1015
1033
$ definition = $ container ->findDefinition ('annotations.cache_warmer ' );
1016
1034
$ definition ->addTag ('kernel.cache_warmer ' );
1017
1035
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
+ }
1022
1042
} elseif ('file ' === $ config ['cache ' ]) {
1023
1043
$ cacheDir = $ container ->getParameterBag ()->resolveValue ($ config ['file_cache_dir ' ]);
1024
1044
@@ -1270,11 +1290,13 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con
1270
1290
$ propertyAccessDefinition ->addTag ('monolog.logger ' , array ('channel ' => 'cache ' ));
1271
1291
}
1272
1292
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
+ }
1278
1300
}
1279
1301
1280
1302
/**
0 commit comments