Kaynağa Gözat

Revert "merged branch stealth35/ini_bool (PR #2235)"

This reverts commit 363057b181ba9ebb7a72306c76fe3ff67bf3c649, reversing
changes made to 545cd4cd636b9ce084ce0b5768708b29d4a6b429.
Fabien Potencier 13 yıl önce
ebeveyn
işleme
49c585ebd2

+ 1 - 6
src/Symfony/Component/DependencyInjection/Loader/IniFileLoader.php

@@ -35,18 +35,13 @@ class IniFileLoader extends FileLoader
 
         $this->container->addResource(new FileResource($path));
 
-        $result = parse_ini_file($path, true, INI_SCANNER_RAW);
+        $result = parse_ini_file($path, true);
         if (false === $result || array() === $result) {
             throw new \InvalidArgumentException(sprintf('The "%s" file is not valid.', $file));
         }
 
         if (isset($result['parameters']) && is_array($result['parameters'])) {
             foreach ($result['parameters'] as $key => $value) {
-                switch (strtolower($value)) {
-                    case 'true' : $value = true ; break;
-                    case 'false': $value = false; break;
-                    case 'null' : $value = null ; break;
-                }
                 $this->container->setParameter($key, $value);
             }
         }

+ 0 - 4
tests/Symfony/Tests/Component/DependencyInjection/Fixtures/ini/boolean.ini

@@ -1,4 +0,0 @@
-[parameters]
-  foo = true
-  bar = False
-  boo = NULL

+ 0 - 5
tests/Symfony/Tests/Component/DependencyInjection/Loader/IniFileLoaderTest.php

@@ -35,11 +35,6 @@ class IniFileLoaderTest extends \PHPUnit_Framework_TestCase
         $loader->load('parameters.ini');
         $this->assertEquals(array('foo' => 'bar', 'bar' => '%foo%'), $container->getParameterBag()->all(), '->load() takes a single file name as its first argument');
 
-        $container = new ContainerBuilder();
-        $loader = new IniFileLoader($container, new FileLocator(self::$fixturesPath.'/ini'));
-        $loader->load('boolean.ini');
-        $this->assertEquals(array('foo' => true, 'bar' => false, 'boo' => null), $container->getParameterBag()->all());
-
         try {
             $loader->load('foo.ini');
             $this->fail('->load() throws an InvalidArgumentException if the loaded file does not exist');