[Config] fixed 'scheme://' not detected as absolute path

This also allows the use of configuration files stored in phar files.
This commit is contained in:
Oscar Cubo Medina 2011-12-08 13:11:32 +01:00
parent 4730f4303b
commit b50ac5be36
2 changed files with 3 additions and 0 deletions

View File

@ -89,6 +89,7 @@ class FileLocator implements FileLocatorInterface
&& $file[1] == ':'
&& ($file[2] == '\\' || $file[2] == '/')
)
|| null !== parse_url($file, PHP_URL_SCHEME)
) {
return true;
}

View File

@ -35,6 +35,8 @@ class FileLocatorTest extends \PHPUnit_Framework_TestCase
array('c:\\\\foo.xml'),
array('c:/foo.xml'),
array('\\server\\foo.xml'),
array('https://server/foo.xml'),
array('phar://server/foo.xml'),
);
}