merged branch makasim/yaml-throw-not-readable (PR #3105)

Commits
-------

7961014 [Yaml][Parser] changes according review
efce640 [Yaml][Parser] throw an exception if not readable

Discussion
----------

[Yaml][Parser] throw an exception if service file not readable.

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #3077
Todo: -

---------------------------------------------------------------------------

by makasim at 2012-01-13T15:49:49Z

 @fabpot done
This commit is contained in:
Fabien Potencier 2012-01-13 22:27:28 +01:00
commit 119a24f016

View File

@ -47,7 +47,11 @@ class Yaml
$file = '';
// if input is a file, process it
if (strpos($input, "\n") === false && is_file($input) && is_readable($input)) {
if (strpos($input, "\n") === false && is_file($input)) {
if (false === is_readable($input)) {
throw new ParseException(sprintf('Unable to parse "%s" as the file is not readable.', $input));
}
$file = $input;
ob_start();