Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdda3760

Browse files
committed
feature#20735 Deprecate ClassCollectionLoader and Kernel::loadClassCache (dbrumann)
This PR was merged into the 3.3-dev branch.Discussion----------Deprecate ClassCollectionLoader and Kernel::loadClassCache| Q | A| ------------- | ---| Branch? | "master"| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | yes| Tests pass? | yes| Fixed tickets |#20668| License | MITAs suggested by@nicolas-grekas in#20668 I added deprecation notices to ClassCollectionLoader and Kernel::loadClassCache.Commits-------660d79a Deprecates ClassCache-cache warmer.
2 parents53344d0 +660d79a commitdda3760

File tree

17 files changed

+202
-115
lines changed

17 files changed

+202
-115
lines changed

‎src/Symfony/Bridge/Twig/Form/TwigRendererEngineInterface.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/**
1717
* @author Bernhard Schussek <bschussek@gmail.com>
1818
*
19-
* @deprecatedDeprecatedsince version 3.2, to be removed in 4.0.
19+
* @deprecated since version 3.2, to be removed in 4.0.
2020
*/
2121
interface TwigRendererEngineInterfaceextends FormRendererEngineInterface
2222
{

‎src/Symfony/Bridge/Twig/Form/TwigRendererInterface.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/**
1717
* @author Bernhard Schussek <bschussek@gmail.com>
1818
*
19-
* @deprecatedDeprecatedsince version 3.2, to be removed in 4.0.
19+
* @deprecated since version 3.2, to be removed in 4.0.
2020
*/
2121
interface TwigRendererInterfaceextends FormRendererInterface
2222
{

‎src/Symfony/Bundle/FrameworkBundle/CacheWarmer/ClassCacheCacheWarmer.php‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,19 @@
1111

1212
namespaceSymfony\Bundle\FrameworkBundle\CacheWarmer;
1313

14+
if (PHP_VERSION_ID >=70000) {
15+
@trigger_error('The'.__NAMESPACE__.'\ClassCacheCacheWarmer class is deprecated since version 3.3 and will be removed in 4.0.',E_USER_DEPRECATED);
16+
}
17+
1418
useSymfony\Component\ClassLoader\ClassCollectionLoader;
1519
useSymfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface;
1620

1721
/**
1822
* Generates the Class Cache (classes.php) file.
1923
*
2024
* @author Tugdual Saunier <tucksaun@gmail.com>
25+
*
26+
* @deprecated since version 3.3, to be removed in 4.0.
2127
*/
2228
class ClassCacheCacheWarmerimplements CacheWarmerInterface
2329
{

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php‎

Lines changed: 102 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -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) {returnnewReference('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

713731
if ($container->has('assets.packages')) {
714732
$container->getDefinition('templating.helper.assets')->replaceArgument(0,newReference('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
/**

‎src/Symfony/Bundle/FrameworkBundle/Resources/config/services.xml‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,15 @@
2525
</service>
2626

2727
<serviceid="kernel.class_cache.cache_warmer"class="Symfony\Bundle\FrameworkBundle\CacheWarmer\ClassCacheCacheWarmer">
28-
<tagname="kernel.cache_warmer" />
2928
<argumenttype="collection">
3029
<argument>Symfony\Component\HttpFoundation\ParameterBag</argument>
3130
<argument>Symfony\Component\HttpFoundation\HeaderBag</argument>
3231
<argument>Symfony\Component\HttpFoundation\FileBag</argument>
3332
<argument>Symfony\Component\HttpFoundation\ServerBag</argument>
3433
<argument>Symfony\Component\HttpFoundation\Request</argument>
3534
<argument>Symfony\Component\HttpKernel\Kernel</argument>
36-
<argument>Symfony\Component\ClassLoader\ClassCollectionLoader</argument>
3735
</argument>
36+
<deprecated>The "%service_id%" option is deprecated since version 3.3, to be removed in 4.0.</deprecated>
3837
</service>
3938

4039
<serviceid="cache_clearer"class="Symfony\Component\HttpKernel\CacheClearer\ChainCacheClearer">

‎src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/ClassCacheCacheWarmerTest.php‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
useSymfony\Bundle\FrameworkBundle\Tests\Fixtures\WarmedClass;
1717
useSymfony\Bundle\FrameworkBundle\Tests\TestCase;
1818

19+
/**
20+
* @group legacy
21+
*/
1922
class ClassCacheCacheWarmerTestextends TestCase
2023
{
2124
publicfunctiontestWithDeclaredClasses()

‎src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php‎

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -101,20 +101,22 @@ public function load(array $configs, ContainerBuilder $container)
101101
$this->aclLoad($config['acl'],$container);
102102
}
103103

104-
// add some required classes for compilation
105-
$this->addClassesToCompile(array(
106-
'Symfony\Component\Security\Http\Firewall',
107-
'Symfony\Component\Security\Core\User\UserProviderInterface',
108-
'Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager',
109-
'Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage',
110-
'Symfony\Component\Security\Core\Authorization\AccessDecisionManager',
111-
'Symfony\Component\Security\Core\Authorization\AuthorizationChecker',
112-
'Symfony\Component\Security\Core\Authorization\Voter\VoterInterface',
113-
'Symfony\Bundle\SecurityBundle\Security\FirewallConfig',
114-
'Symfony\Bundle\SecurityBundle\Security\FirewallMap',
115-
'Symfony\Bundle\SecurityBundle\Security\FirewallContext',
116-
'Symfony\Component\HttpFoundation\RequestMatcher',
117-
));
104+
if (PHP_VERSION_ID <70000) {
105+
// add some required classes for compilation
106+
$this->addClassesToCompile(array(
107+
'Symfony\Component\Security\Http\Firewall',
108+
'Symfony\Component\Security\Core\User\UserProviderInterface',
109+
'Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager',
110+
'Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage',
111+
'Symfony\Component\Security\Core\Authorization\AccessDecisionManager',
112+
'Symfony\Component\Security\Core\Authorization\AuthorizationChecker',
113+
'Symfony\Component\Security\Core\Authorization\Voter\VoterInterface',
114+
'Symfony\Bundle\SecurityBundle\Security\FirewallConfig',
115+
'Symfony\Bundle\SecurityBundle\Security\FirewallMap',
116+
'Symfony\Bundle\SecurityBundle\Security\FirewallContext',
117+
'Symfony\Component\HttpFoundation\RequestMatcher',
118+
));
119+
}
118120
}
119121

120122
privatefunctionaclLoad($config,ContainerBuilder$container)
@@ -191,9 +193,11 @@ private function createAuthorization($config, ContainerBuilder $container)
191193
return;
192194
}
193195

194-
$this->addClassesToCompile(array(
195-
'Symfony\\Component\\Security\\Http\\AccessMap',
196-
));
196+
if (PHP_VERSION_ID <70000) {
197+
$this->addClassesToCompile(array(
198+
'Symfony\\Component\\Security\\Http\\AccessMap',
199+
));
200+
}
197201

198202
foreach ($config['access_control']as$access) {
199203
$matcher =$this->createRequestMatcher(

‎src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php‎

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,16 +137,18 @@ public function load(array $configs, ContainerBuilder $container)
137137

138138
$container->getDefinition('twig')->replaceArgument(1,$config);
139139

140-
$this->addClassesToCompile(array(
141-
'Twig_Environment',
142-
'Twig_Extension',
143-
'Twig_Extension_Core',
144-
'Twig_Extension_Escaper',
145-
'Twig_Extension_Optimizer',
146-
'Twig_LoaderInterface',
147-
'Twig_Markup',
148-
'Twig_Template',
149-
));
140+
if (PHP_VERSION_ID <70000) {
141+
$this->addClassesToCompile(array(
142+
'Twig_Environment',
143+
'Twig_Extension',
144+
'Twig_Extension_Core',
145+
'Twig_Extension_Escaper',
146+
'Twig_Extension_Optimizer',
147+
'Twig_LoaderInterface',
148+
'Twig_Markup',
149+
'Twig_Template',
150+
));
151+
}
150152
}
151153

152154
privatefunctionaddTwigPath($twigFilesystemLoaderDefinition,$dir,$bundle)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp