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:
1 parent
45980195cd
commit
01cc8b3da0
5 files changed
+111
-13
No files matched your search
@@ -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()})");
|
||||
|
||||
Reference in new issue
Block a user