فهرست منبع

Revert "Merge remote branch 'kriswallsmith/dic/lazy-replace-ext-params'"

This reverts commit 32ac2e87091dac1dce1e2f1945d63764beaf0302, reversing
changes made to 6e81c28ca4689b5353d1d178232a224cb9865d2e.
Fabien Potencier 14 سال پیش
والد
کامیت
cedf588e98

+ 1 - 1
src/Symfony/Component/DependencyInjection/ContainerBuilder.php

@@ -148,7 +148,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
             $this->extensionConfigs[$namespace] = array();
         }
 
-        $this->extensionConfigs[$namespace][] = $values;
+        $this->extensionConfigs[$namespace][] = $this->getParameterBag()->resolveValue($values);
 
         return $this;
     }

+ 0 - 47
tests/Symfony/Tests/Component/DependencyInjection/CallableExtension.php

@@ -1,47 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Tests\Component\DependencyInjection;
-
-use Symfony\Component\DependencyInjection\ContainerBuilder;
-use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
-
-class CallableExtension implements ExtensionInterface
-{
-    private $callable;
-    private $alias;
-
-    public function __construct($callable, $alias)
-    {
-        $this->callable = $callable;
-        $this->alias = $alias;
-    }
-
-    public function load(array $configs, ContainerBuilder $container)
-    {
-        call_user_func($this->callable, $configs, $container);
-    }
-
-    public function getAlias()
-    {
-        return $this->alias;
-    }
-
-    public function getNamespace()
-    {
-        return false;
-    }
-
-    public function getXsdValidationBasePath()
-    {
-        return false;
-    }
-}

+ 0 - 19
tests/Symfony/Tests/Component/DependencyInjection/ContainerBuilderTest.php

@@ -514,25 +514,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
         $container->setDefinition('a', new Definition());
     }
 
-    public function testParamTokensPassedToExtensionAreReplacedLazily()
-    {
-        $load = function($configs, $container)
-        {
-            $container->setParameter('actual', $configs[0]['foo']);
-        };
-
-        $container = new ContainerBuilder();
-        $container->registerExtension(new CallableExtension($load, 'my_extension'));
-
-        $container->setParameter('foo', 'not_this_one');
-        $container->loadFromExtension('my_extension', array('foo' => '%foo%'));
-        $container->setParameter('foo', 'this_one');
-
-        $container->compile();
-
-        $this->assertEquals('this_one', $container->getParameter('actual'));
-    }
-
     /**
      * @param string $class
      * @param int $methodCallsCount