From 521feb7abc8b559b80c50bf98d0dab20988e64a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Tue, 13 Dec 2016 18:32:13 +0100 Subject: [PATCH] Revert "Add support for REDIS_URL environment variables." This reverts commit 4e6086f7db7b4f793e1acabb01fca091ab5b116a. --- .../Compiler/CachePoolPass.php | 4 +-- .../Fixtures/php/cache_env_var.php | 9 ------ .../Fixtures/xml/cache_env_var.xml | 17 ----------- .../Fixtures/yml/cache_env_var.yml | 6 ---- .../FrameworkExtensionTest.php | 28 ------------------- 5 files changed, 1 insertion(+), 63 deletions(-) delete mode 100644 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/cache_env_var.php delete mode 100644 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/cache_env_var.xml delete mode 100644 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/cache_env_var.yml diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolPass.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolPass.php index 43abc8e565730..e0be688fc83a6 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolPass.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolPass.php @@ -106,9 +106,7 @@ private function getNamespace($seed, $id) */ public static function getServiceProvider(ContainerBuilder $container, $name) { - $container->resolveEnvPlaceholders($name, null, $usedEnvs); - - if (0 === strpos($name, 'redis://') || $usedEnvs) { + if (0 === strpos($name, 'redis://')) { $dsn = $name; if (!$container->hasDefinition($name = md5($dsn))) { diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/cache_env_var.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/cache_env_var.php deleted file mode 100644 index b93ade8f4c816..0000000000000 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/cache_env_var.php +++ /dev/null @@ -1,9 +0,0 @@ -setParameter('env(REDIS_URL)', 'redis://paas.com'); - -$container->loadFromExtension('framework', array( - 'cache' => array( - 'default_redis_provider' => '%env(REDIS_URL)%', - ), -)); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/cache_env_var.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/cache_env_var.xml deleted file mode 100644 index 8f03cb1784b35..0000000000000 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/cache_env_var.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - redis://paas.com - - - - - %env(REDIS_URL)% - - - diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/cache_env_var.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/cache_env_var.yml deleted file mode 100644 index 1d9ce5f7f02f7..0000000000000 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/cache_env_var.yml +++ /dev/null @@ -1,6 +0,0 @@ -parameters: - env(REDIS_URL): redis://paas.com - -framework: - cache: - default_redis_provider: "%env(REDIS_URL)%" diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index 2b9eabb1ec943..666dd3c4053f0 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -697,34 +697,6 @@ public function testPropertyInfoEnabled() $this->assertTrue($container->has('property_info')); } - public function testCacheDefaultRedisProvider() - { - $container = $this->createContainerFromFile('cache'); - - $redisUrl = 'redis://localhost'; - $providerId = md5($redisUrl); - - $this->assertTrue($container->hasDefinition($providerId)); - - $url = $container->getDefinition($providerId)->getArgument(0); - - $this->assertSame($redisUrl, $url); - } - - public function testCacheDefaultRedisProviderWithEnvVar() - { - $container = $this->createContainerFromFile('cache_env_var'); - - $redisUrl = 'redis://paas.com'; - $providerId = md5($redisUrl); - - $this->assertTrue($container->hasDefinition($providerId)); - - $url = $container->getDefinition($providerId)->getArgument(0); - - $this->assertSame($redisUrl, $url); - } - public function testCachePoolServices() { $container = $this->createContainerFromFile('cache');