Closed
Description
Symfony version(s) affected: 4 (dev envs)
Description
I'm not sure if it's a bug in symfony, but I've got the next behavior with
\Symfony\Component\Config\Resource\GlobResource::getIterator
witch loads files using glob
not it the stable sorting, e.g several files: doctrine.yml
and doctrine_mongodb.yaml
in config/packages
folder.
On requests these files come(randomly) in a different order, which leads to reinitialization of symfony kernel in dev environment. It's a little bit annoying and takes a lot of time in a common :(
How to reproduce
- Create several files like
doctrine.yaml
anddoctrine_mongodb.yaml
- Observe that files could be randomly fetched from directory
<?php // index.php
$files = glob('directory', GLOB_BRACE);
echo reset($files);
Possible Solution
I guess it's possible to add sorting. (Or probably use GLOB_NOSORT, as a native sorting is a little bit buggy).