diff --git a/README.md b/README.md index 1950a9a..c8c0585 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ To use Yaml instead of JSON, just pass a file that ends on `.yml`: $app->register(new Igorw\Silex\ConfigServiceProvider(__DIR__."/../config/services.yml")); -Note, you will have to require the `~2.1` of the `symfony/yaml` package. +Note, you will have to require the `~2.2` of the `symfony/yaml` package. ### Using TOML diff --git a/composer.json b/composer.json index a20436a..69a3bb9 100644 --- a/composer.json +++ b/composer.json @@ -17,11 +17,11 @@ "silex/silex": "~1.0" }, "require-dev": { - "symfony/yaml": "~2.1", + "symfony/yaml": "~2.2", "jamesmoss/toml": "~0.1" }, "suggest": { - "symfony/yaml": "~2.1", + "symfony/yaml": "~2.2", "jamesmoss/toml": "~0.1" }, "autoload": { diff --git a/src/Igorw/Silex/YamlConfigDriver.php b/src/Igorw/Silex/YamlConfigDriver.php index 5b849a9..8a36b51 100644 --- a/src/Igorw/Silex/YamlConfigDriver.php +++ b/src/Igorw/Silex/YamlConfigDriver.php @@ -11,7 +11,9 @@ public function load($filename) if (!class_exists('Symfony\\Component\\Yaml\\Yaml')) { throw new \RuntimeException('Unable to read yaml as the Symfony Yaml Component is not installed.'); } - $config = Yaml::parse($filename); + + $input = file_get_contents($filename); + $config = Yaml::parse($input); return $config ?: array(); }