From 49d06a6cf5fb7a56f47f5a3a56468dac01359917 Mon Sep 17 00:00:00 2001 From: Denys Voronin Date: Wed, 16 Oct 2019 13:30:11 +0300 Subject: [PATCH] [Config] Disable default alphabet sorting in glob function due of unstable sort --- src/Symfony/Component/Config/Resource/GlobResource.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Config/Resource/GlobResource.php b/src/Symfony/Component/Config/Resource/GlobResource.php index 28ba0a6112bd0..13d2ee7d703d7 100644 --- a/src/Symfony/Component/Config/Resource/GlobResource.php +++ b/src/Symfony/Component/Config/Resource/GlobResource.php @@ -100,7 +100,9 @@ public function getIterator() } if (0 !== strpos($this->prefix, 'phar://') && false === strpos($this->pattern, '/**/') && (\defined('GLOB_BRACE') || false === strpos($this->pattern, '{'))) { - foreach (glob($this->prefix.$this->pattern, \defined('GLOB_BRACE') ? GLOB_BRACE : 0) as $path) { + $paths = glob($this->prefix.$this->pattern, GLOB_NOSORT | (\defined('GLOB_BRACE') ? GLOB_BRACE : 0)); + sort($paths); + foreach ($paths as $path) { if ($this->recursive && is_dir($path)) { $files = iterator_to_array(new \RecursiveIteratorIterator( new \RecursiveCallbackFilterIterator(