Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4218aa3

Browse filesBrowse files
committed
bug #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
Copy full SHA for 4218aa3

File tree

1 file changed

+2
-2
lines changed
Filter options

1 file changed

+2
-2
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Config/Resource/GlobResource.php
+2-2Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.