Skip to content

Commit da40a9f

Browse files
[Config] Disable default alphabet sorting in glob function due of unstable sort
1 parent 29cabf9 commit da40a9f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Symfony/Component/Config/Resource/GlobResource.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ public function getIterator()
100100
}
101101

102102
if (0 !== strpos($this->prefix, 'phar://') && false === strpos($this->pattern, '/**/') && (\defined('GLOB_BRACE') || false === strpos($this->pattern, '{'))) {
103-
foreach (glob($this->prefix.$this->pattern, \defined('GLOB_BRACE') ? GLOB_BRACE : 0) as $path) {
103+
$paths = glob($this->prefix.$this->pattern, \defined('GLOB_BRACE') ? GLOB_BRACE|GLOB_NOSORT : 0);
104+
sort($paths);
105+
foreach ($paths as $path) {
104106
if ($this->recursive && is_dir($path)) {
105107
$files = iterator_to_array(new \RecursiveIteratorIterator(
106108
new \RecursiveCallbackFilterIterator(

0 commit comments

Comments
 (0)