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

Commit4964ffc

Browse files
[HttpKernel] fix kernel.name deprecation
1 parent97c8fac commit4964ffc

File tree

13 files changed

+23
-46
lines changed

13 files changed

+23
-46
lines changed

‎src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ protected function loadCacheDriver($cacheName, $objectManagerName, array $cacheD
367367
}else {
368368
$seed ='_'.$container->getParameter('kernel.project_dir');
369369
}
370-
$seed .='.'.$container->getParameter('kernel.container_class').'.'.$container->getParameter('kernel.environment').'.'.$container->getParameter('kernel.debug');
370+
$seed .='.'.$container->getParameter('kernel.container_class');
371371
$namespace ='sf_'.$this->getMappingResourceExtension().'_'.$objectManagerName.'_'.ContainerBuilder::hash($seed);
372372

373373
$cacheDriver['namespace'] =$namespace;

‎src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,6 @@ protected function createContainer(array $data = array())
269269
returnnewContainerBuilder(newParameterBag(array_merge(array(
270270
'kernel.bundles' =>array('FrameworkBundle' =>'Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle'),
271271
'kernel.cache_dir' =>__DIR__,
272-
'kernel.debug' =>false,
273-
'kernel.environment' =>'test',
274272
'kernel.container_class' =>'kernel',
275273
'kernel.project_dir' =>__DIR__,
276274
),$data)));

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
<serviceid="data_collector.config"class="Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector">
1111
<tagname="data_collector"template="@WebProfiler/Collector/config.html.twig"id="config"priority="-255" />
1212
<callmethod="setKernel"><argumenttype="service"id="kernel"on-invalid="ignore" /></call>
13+
<argumenttype="service">
14+
<serviceclass="string">
15+
<factoryfunction="basename" />
16+
<argument>%kernel.project_dir%</argument>
17+
</service>
18+
</argument>
1319
</service>
1420

1521
<serviceid="data_collector.request"class="Symfony\Component\HttpKernel\DataCollector\RequestDataCollector">

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/CachePoolClearerPassTest.php‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ class CachePoolClearerPassTest extends TestCase
2929
publicfunctiontestPoolRefsAreWeak()
3030
{
3131
$container =newContainerBuilder();
32-
$container->setParameter('kernel.debug',false);
3332
$container->setParameter('kernel.container_class','app');
34-
$container->setParameter('kernel.environment','prod');
3533
$container->setParameter('kernel.project_dir','foo');
3634

3735
$globalClearer =newDefinition(Psr6CacheClearer::class);

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/CachePoolPassTest.php‎

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ protected function setUp()
3434
publicfunctiontestNamespaceArgumentIsReplaced()
3535
{
3636
$container =newContainerBuilder();
37-
$container->setParameter('kernel.debug',false);
3837
$container->setParameter('kernel.container_class','app');
39-
$container->setParameter('kernel.environment','prod');
4038
$container->setParameter('kernel.project_dir','foo');
4139
$adapter =newDefinition();
4240
$adapter->setAbstract(true);
@@ -50,13 +48,12 @@ public function testNamespaceArgumentIsReplaced()
5048

5149
$this->cachePoolPass->process($container);
5250

53-
$this->assertSame('D07rhFx97S',$cachePool->getArgument(0));
51+
$this->assertSame('z3X945Jbf5',$cachePool->getArgument(0));
5452
}
5553

5654
publicfunctiontestNamespaceArgumentIsNotReplacedIfArrayAdapterIsUsed()
5755
{
5856
$container =newContainerBuilder();
59-
$container->setParameter('kernel.environment','prod');
6057
$container->setParameter('kernel.container_class','app');
6158
$container->setParameter('kernel.project_dir','foo');
6259

@@ -74,9 +71,7 @@ public function testNamespaceArgumentIsNotReplacedIfArrayAdapterIsUsed()
7471
publicfunctiontestArgsAreReplaced()
7572
{
7673
$container =newContainerBuilder();
77-
$container->setParameter('kernel.debug',false);
7874
$container->setParameter('kernel.container_class','app');
79-
$container->setParameter('kernel.environment','prod');
8075
$container->setParameter('cache.prefix.seed','foo');
8176
$cachePool =newDefinition();
8277
$cachePool->addTag('cache.pool',array(
@@ -92,16 +87,14 @@ public function testArgsAreReplaced()
9287

9388
$this->assertInstanceOf(Reference::class,$cachePool->getArgument(0));
9489
$this->assertSame('foobar', (string)$cachePool->getArgument(0));
95-
$this->assertSame('itantF+pIq',$cachePool->getArgument(1));
90+
$this->assertSame('tQNhcV-8xa',$cachePool->getArgument(1));
9691
$this->assertSame(3,$cachePool->getArgument(2));
9792
}
9893

9994
publicfunctiontestWithNameAttribute()
10095
{
10196
$container =newContainerBuilder();
102-
$container->setParameter('kernel.debug',false);
10397
$container->setParameter('kernel.container_class','app');
104-
$container->setParameter('kernel.environment','prod');
10598
$container->setParameter('cache.prefix.seed','foo');
10699
$cachePool =newDefinition();
107100
$cachePool->addTag('cache.pool',array(
@@ -115,7 +108,7 @@ public function testWithNameAttribute()
115108

116109
$this->cachePoolPass->process($container);
117110

118-
$this->assertSame('9HvPgAayyh',$cachePool->getArgument(1));
111+
$this->assertSame('+naTpPa4Sm',$cachePool->getArgument(1));
119112
}
120113

121114
/**
@@ -125,9 +118,7 @@ public function testWithNameAttribute()
125118
publicfunctiontestThrowsExceptionWhenCachePoolTagHasUnknownAttributes()
126119
{
127120
$container =newContainerBuilder();
128-
$container->setParameter('kernel.debug',false);
129121
$container->setParameter('kernel.container_class','app');
130-
$container->setParameter('kernel.environment','prod');
131122
$container->setParameter('kernel.project_dir','foo');
132123
$adapter =newDefinition();
133124
$adapter->setAbstract(true);

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,6 @@
154154
<spanclass="label">Symfony version</span>
155155
</div>
156156

157-
{%if'n/a'!=collector.appname %}
158-
<divclass="metric">
159-
<spanclass="value">{{collector.appname }}</span>
160-
<spanclass="label">Application name</span>
161-
</div>
162-
{%endif %}
163-
164157
{%if'n/a'!=collector.env %}
165158
<divclass="metric">
166159
<spanclass="value">{{collector.env }}</span>

‎src/Symfony/Component/Cache/DependencyInjection/CachePoolPass.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function process(ContainerBuilder $container)
5252
}else {
5353
$seed ='_'.$container->getParameter('kernel.project_dir');
5454
}
55-
$seed .='.'.$container->getParameter('kernel.container_class').'.'.$container->getParameter('kernel.environment');
55+
$seed .='.'.$container->getParameter('kernel.container_class');
5656

5757
$pools =array();
5858
$clearers =array();

‎src/Symfony/Component/Cache/Tests/DependencyInjection/CachePoolClearerPassTest.php‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ class CachePoolClearerPassTest extends TestCase
2626
publicfunctiontestPoolRefsAreWeak()
2727
{
2828
$container =newContainerBuilder();
29-
$container->setParameter('kernel.debug',false);
3029
$container->setParameter('kernel.container_class','app');
31-
$container->setParameter('kernel.environment','prod');
3230
$container->setParameter('kernel.project_dir','foo');
3331

3432
$globalClearer =newDefinition(Psr6CacheClearer::class);

‎src/Symfony/Component/Cache/Tests/DependencyInjection/CachePoolPassTest.php‎

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ protected function setUp()
3131
publicfunctiontestNamespaceArgumentIsReplaced()
3232
{
3333
$container =newContainerBuilder();
34-
$container->setParameter('kernel.debug',false);
3534
$container->setParameter('kernel.container_class','app');
36-
$container->setParameter('kernel.environment','prod');
3735
$container->setParameter('kernel.project_dir','foo');
3836
$adapter =newDefinition();
3937
$adapter->setAbstract(true);
@@ -47,13 +45,12 @@ public function testNamespaceArgumentIsReplaced()
4745

4846
$this->cachePoolPass->process($container);
4947

50-
$this->assertSame('D07rhFx97S',$cachePool->getArgument(0));
48+
$this->assertSame('z3X945Jbf5',$cachePool->getArgument(0));
5149
}
5250

5351
publicfunctiontestNamespaceArgumentIsNotReplacedIfArrayAdapterIsUsed()
5452
{
5553
$container =newContainerBuilder();
56-
$container->setParameter('kernel.environment','prod');
5754
$container->setParameter('kernel.container_class','app');
5855
$container->setParameter('kernel.project_dir','foo');
5956

@@ -71,9 +68,7 @@ public function testNamespaceArgumentIsNotReplacedIfArrayAdapterIsUsed()
7168
publicfunctiontestArgsAreReplaced()
7269
{
7370
$container =newContainerBuilder();
74-
$container->setParameter('kernel.debug',false);
7571
$container->setParameter('kernel.container_class','app');
76-
$container->setParameter('kernel.environment','prod');
7772
$container->setParameter('cache.prefix.seed','foo');
7873
$cachePool =newDefinition();
7974
$cachePool->addTag('cache.pool',array(
@@ -89,16 +84,14 @@ public function testArgsAreReplaced()
8984

9085
$this->assertInstanceOf(Reference::class,$cachePool->getArgument(0));
9186
$this->assertSame('foobar', (string)$cachePool->getArgument(0));
92-
$this->assertSame('itantF+pIq',$cachePool->getArgument(1));
87+
$this->assertSame('tQNhcV-8xa',$cachePool->getArgument(1));
9388
$this->assertSame(3,$cachePool->getArgument(2));
9489
}
9590

9691
publicfunctiontestWithNameAttribute()
9792
{
9893
$container =newContainerBuilder();
99-
$container->setParameter('kernel.debug',false);
10094
$container->setParameter('kernel.container_class','app');
101-
$container->setParameter('kernel.environment','prod');
10295
$container->setParameter('cache.prefix.seed','foo');
10396
$cachePool =newDefinition();
10497
$cachePool->addTag('cache.pool',array(
@@ -112,7 +105,7 @@ public function testWithNameAttribute()
112105

113106
$this->cachePoolPass->process($container);
114107

115-
$this->assertSame('9HvPgAayyh',$cachePool->getArgument(1));
108+
$this->assertSame('+naTpPa4Sm',$cachePool->getArgument(1));
116109
}
117110

118111
/**
@@ -122,9 +115,7 @@ public function testWithNameAttribute()
122115
publicfunctiontestThrowsExceptionWhenCachePoolTagHasUnknownAttributes()
123116
{
124117
$container =newContainerBuilder();
125-
$container->setParameter('kernel.debug',false);
126118
$container->setParameter('kernel.container_class','app');
127-
$container->setParameter('kernel.environment','prod');
128119
$container->setParameter('kernel.project_dir','foo');
129120
$adapter =newDefinition();
130121
$adapter->setAbstract(true);

‎src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ public function collect(Request $request, Response $response, \Exception $except
6060
'token' =>$response->headers->get('X-Debug-Token'),
6161
'symfony_version' => Kernel::VERSION,
6262
'symfony_state' =>'unknown',
63-
'name' =>'n/a',
6463
'env' =>isset($this->kernel) ?$this->kernel->getEnvironment() :'n/a',
6564
'debug' =>isset($this->kernel) ?$this->kernel->isDebug() :'n/a',
6665
'php_version' =>PHP_VERSION,
@@ -232,7 +231,9 @@ public function getPhpTimezone()
232231
*/
233232
publicfunctiongetAppName()
234233
{
235-
return$this->data['name'];
234+
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2.',__METHOD__),E_USER_DEPRECATED);
235+
236+
return'n/a';
236237
}
237238

238239
/**

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp