Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 05beadd

Browse files
feature #24067 [HttpKernel] Dont register env parameter resource (ro0NL)
This PR was merged into the 4.0-dev branch. Discussion ---------- [HttpKernel] Dont register env parameter resource | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #... <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | symfony/symfony-docs#... <!--highly recommended for new features--> Think this was forgotten in #22886 Not sure about `EnvParametersResource` in the http-kernel component. Core doesnt use it anymore, so we could deprecate it (and while doing so move it to config component to keep the feature if wanted). Kept as is for now. Commits ------- 36d2a45 [HttpKernel] Dont register env parameter resource
2 parents 1cad469 + 36d2a45 commit 05beadd

File tree

4 files changed

+0
-246
lines changed

4 files changed

+0
-246
lines changed

src/Symfony/Component/HttpKernel/Config/EnvParametersResource.php

Lines changed: 0 additions & 97 deletions
This file was deleted.

src/Symfony/Component/HttpKernel/Kernel.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
use Symfony\Component\HttpFoundation\Request;
2727
use Symfony\Component\HttpFoundation\Response;
2828
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
29-
use Symfony\Component\HttpKernel\Config\EnvParametersResource;
3029
use Symfony\Component\HttpKernel\Config\FileLocator;
3130
use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass;
3231
use Symfony\Component\HttpKernel\DependencyInjection\AddAnnotatedClassesToCachePass;
@@ -625,7 +624,6 @@ protected function buildContainer()
625624
}
626625

627626
$container->addCompilerPass(new AddAnnotatedClassesToCachePass($this));
628-
$container->addResource(new EnvParametersResource('SYMFONY__'));
629627

630628
return $container;
631629
}

src/Symfony/Component/HttpKernel/Tests/Config/EnvParametersResourceTest.php

Lines changed: 0 additions & 110 deletions
This file was deleted.

src/Symfony/Component/HttpKernel/Tests/KernelTest.php

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Symfony\Component\DependencyInjection\ContainerBuilder;
1717
use Symfony\Component\Filesystem\Filesystem;
1818
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
19-
use Symfony\Component\HttpKernel\Config\EnvParametersResource;
2019
use Symfony\Component\HttpKernel\Kernel;
2120
use Symfony\Component\HttpKernel\HttpKernelInterface;
2221
use Symfony\Component\HttpFoundation\Request;
@@ -104,42 +103,6 @@ public function testClassCacheIsNotLoadedByDefault()
104103
$kernel->boot();
105104
}
106105

107-
public function testEnvParametersResourceIsAdded()
108-
{
109-
$container = new ContainerBuilder();
110-
$kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\Tests\Fixtures\KernelForTest')
111-
->disableOriginalConstructor()
112-
->setMethods(array('getContainerBuilder', 'prepareContainer', 'getCacheDir', 'getLogDir'))
113-
->getMock();
114-
$kernel->expects($this->any())
115-
->method('getContainerBuilder')
116-
->will($this->returnValue($container));
117-
$kernel->expects($this->any())
118-
->method('prepareContainer')
119-
->will($this->returnValue(null));
120-
$kernel->expects($this->any())
121-
->method('getCacheDir')
122-
->will($this->returnValue(sys_get_temp_dir()));
123-
$kernel->expects($this->any())
124-
->method('getLogDir')
125-
->will($this->returnValue(sys_get_temp_dir()));
126-
127-
$reflection = new \ReflectionClass(get_class($kernel));
128-
$method = $reflection->getMethod('buildContainer');
129-
$method->setAccessible(true);
130-
$method->invoke($kernel);
131-
132-
$found = false;
133-
foreach ($container->getResources() as $resource) {
134-
if ($resource instanceof EnvParametersResource) {
135-
$found = true;
136-
break;
137-
}
138-
}
139-
140-
$this->assertTrue($found);
141-
}
142-
143106
public function testBootKernelSeveralTimesOnlyInitializesBundlesOnce()
144107
{
145108
$kernel = $this->getKernel(array('initializeBundles', 'initializeContainer'));

0 commit comments

Comments
 (0)