Closed
Description
Q | A |
---|---|
Bug report? | yes |
Feature request? | no |
BC Break report? | no |
RFC? | no |
Symfony version | 3.3.8 |
On Windows, when using a filesystem that is located on the network, the path doesn't begin with a drive (like in C:\some\path
) but with \\
(like in \\SOMEHOST\some\path
)
This can cause the following error crash during the dependency container generation:
InvalidArgumentException: [WARNING 1549] failed to load external entity "file:////HOST/WWW/perso/username/sf/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd" (in n/a - line 0, column 0)
For instance, in Component/DependencyInjection/Loader/XmlFileLoader.php
, replacing the following:
$drive = '\\' === DIRECTORY_SEPARATOR ? array_shift($parts).'/' : '';
$location = 'file:///'.$drive.implode('/', array_map('rawurlencode', $parts));
With:
if (0 !== stripos($location, '//')) {
$drive = '\\' === DIRECTORY_SEPARATOR ? array_shift($parts).'/' : '';
$location = 'file:///'.$drive.implode('/', array_map('rawurlencode', $parts));
}
Fixes this issue.
I can make a PR, but I'm not sure this is the good solution.