Skip to content

Commit 82f7df5

Browse files
hurricane-voroninnicolas-grekas
authored andcommitted
[Config] Disable default alphabet sorting in glob function due of unstable sort
1 parent 717ad66 commit 82f7df5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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, GLOB_NOSORT | (\defined('GLOB_BRACE') ? GLOB_BRACE : 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)