[Yaml][Parser] throw an exception if not readable

This commit is contained in:
Maksim Kotlyar 2012-01-13 10:48:50 +02:00
parent 02a12b2c5c
commit efce640a5e

View File

@ -47,7 +47,14 @@ 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 \InvalidArgumentException(sprintf(
'The service file "%s" is not readable.',
$input
));
}
$file = $input;
ob_start();