From f944341b22c40f929639c739b805592ab6f24f10 Mon Sep 17 00:00:00 2001 From: Samir Rachidi Date: Tue, 9 Jun 2015 17:21:20 +0200 Subject: [PATCH] fixed deprecation error message using a filename to load a yaml file in YamlConfigDriver --- src/Igorw/Silex/YamlConfigDriver.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Igorw/Silex/YamlConfigDriver.php b/src/Igorw/Silex/YamlConfigDriver.php index 5b849a9..7f433a5 100644 --- a/src/Igorw/Silex/YamlConfigDriver.php +++ b/src/Igorw/Silex/YamlConfigDriver.php @@ -11,7 +11,10 @@ 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); + if(!file_exists($filename)){ + throw new \RuntimeException(sprintf('file not found: %s', $filename)); + } + $config = Yaml::parse(file_get_contents($filename)); return $config ?: array(); }