From f5d1f1afa1793e94432833757ddc0091979a45ad Mon Sep 17 00:00:00 2001 From: Ludovic Fleury Date: Wed, 4 Feb 2015 05:05:50 +0100 Subject: [PATCH 1/3] Update the Yaml driver As mentioned in the [symfony\yaml](https://github.com/symfony/Yaml/commit/a43656845f677a0f308f97667b2789410b67dc36) "Passing a file as an input is a deprecated feature and will be removed in 3.0." --- src/Igorw/Silex/YamlConfigDriver.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(); } From c68da8cbf57391bac72d5bb21157bc1448bd3a38 Mon Sep 17 00:00:00 2001 From: Ludovic Fleury Date: Wed, 4 Feb 2015 05:08:31 +0100 Subject: [PATCH 2/3] Update symfony/yaml dependency requirement --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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": { From 5bd36be61e67d8f63342afa3108d654d7240e57b Mon Sep 17 00:00:00 2001 From: Ludovic Fleury Date: Wed, 4 Feb 2015 05:11:36 +0100 Subject: [PATCH 3/3] Update the symfony/yaml version in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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