Fix "Cannot open file" issue with XMLReader::open on Windows

This occurred when using relative paths. Using realpath() solves this issue.
This commit is contained in:
Adrien Loison committed 2015-10-15 09:19:47 -07:00
1 parent 45980195cd
commit 01cc8b3da0
5 files changed
+111 -13

No files matched your search

+3 -1
View File
@@ -72,7 +72,9 @@ abstract class AbstractReader implements ReaderInterface
}
try {
$this->openReader($filePath);
// Need to use realpath to fix "Can't open file" on some Windows setup
$fileRealPath = realpath($filePath);
$this->openReader($fileRealPath);
$this->isStreamOpened = true;
} catch (\Exception $exception) {
throw new IOException("Could not open $filePath for reading! ({$exception->getMessage()})");