8000 bug #43591 [Config] Fix files sorting in GlobResource (lyrixx) · colinodell/symfony@4218aa3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4218aa3

Browse files
committed
bug symfony#43591 [Config] Fix files sorting in GlobResource (lyrixx)
This PR was merged into the 4.4 branch. Discussion ---------- [Config] Fix files sorting in GlobResource | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | It should be on path and not on info and it's a big perf boost: https://blackfire.io/profiles/compare/27f409a5-73c7-4285-9b58-e631abbdb325/graph ![image](https://user-images.githubusercontent.com/408368/137939653-6ad3cbc6-f61e-400b-ad72-212eb76c6e36.png) Commits ------- 2d2fe15 [Config] Fix files sorting in GlobResource
2 parents 2947bff + 2d2fe15 commit 4218aa3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function getIterator()
123123
}
124124

125125
if (null !== $paths) {
126-
sort($paths);
126+
natsort($paths);
127127
foreach ($paths as $path) {
128128
if ($this->excludedPrefixes) {
129129
$normalizedPath = str_replace('\\', '/', $path);
@@ -156,7 +156,7 @@ function (\SplFileInfo $file, $path) {
156156
),
157157
\RecursiveIteratorIterator::LEAVES_ONLY
158158
));
159-
uasort($files, 'strnatcmp');
159+
uksort($files, 'strnatcmp');
160160

161161
foreach ($files as $path => $info) {
162162
if ($info->isFile()) {

0 commit comments

Comments
 (0)
0