Open Crell opened 2 months ago
OK, slight correction. This works for a root path, but it breaks a pattern like foo://bar.*
. It does, however, work for foo:///bar.*
. I'm not sure how to resolve that.
Hello @Crell , can you add a test case for foo://bar.*
?
If it currently works for foo:///bar.*
, I guess we need to ensure that it will continue to work as well...
Btw thanks for the report and the PR.
I've run into a bug where trying to glob a stream path on just the root fails. Specifically, in my app,
Glob::getBasePath('foo://');
returnsfoo:/
, rather thanfoo://
. That means when trying toGlob::glob('foo://*')
, the base path is wrong, so it cannot find any files. Moreover, since PHP doesn't recognizefoo:/
as a file stream, whatever stream wrapper is registered forfoo
gets ignored. (Specifically, theelseif (is_dir($basePath))
clause comes backfalse
, because there's no stream wrapper forfoo:/
, only forfoo://
.)I believe the attached PR fixes the issue, though I defer to the maintainers if they'd prefer to take a slightly different approach. I had to split the test cases up because presumably a path of
''
is not supposed to be supported as it's not absolute.I... do not understand why the tests are failing with a permission denied error on PHP 8.0 only. That feels spurious, but perhaps the maintainers have a better understanding of what gives.