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 3bed024

Browse filesBrowse files
hurricane-voroninnicolas-grekas
authored andcommitted
[Config] Disable default alphabet sorting in glob function due of unstable sort
1 parent 29cabf9 commit 3bed024
Copy full SHA for 3bed024

File tree

4 files changed

+8
-4
lines changed
Filter options

4 files changed

+8
-4
lines changed

‎link

Copy file name to clipboardExpand all lines: link
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@ foreach (glob("$pathToProject/vendor/symfony/*", GLOB_ONLYDIR | GLOB_NOSORT) as
6464
echo "\"$package\" has been linked to \"$sfPackages[$package]\".".PHP_EOL;
6565
}
6666

67-
foreach (glob("$pathToProject/var/cache/*") as $cacheDir) {
67+
foreach (glob("$pathToProject/var/cache/*", GLOB_NOSORT) as $cacheDir) {
6868
$filesystem->remove($cacheDir);
6969
}

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Config/Resource/GlobResource.php
+3-1Lines 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(

‎src/Symfony/Component/Finder/Finder.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Finder/Finder.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,8 @@ public function in($dirs)
541541
foreach ((array) $dirs as $dir) {
542542
if (is_dir($dir)) {
543543
$resolvedDirs[] = $this->normalizeDir($dir);
544-
} elseif ($glob = glob($dir, (\defined('GLOB_BRACE') ? GLOB_BRACE : 0) | GLOB_ONLYDIR)) {
544+
} elseif ($glob = glob($dir, (\defined('GLOB_BRACE') ? GLOB_BRACE : 0) | GLOB_ONLYDIR | GLOB_NOSORT)) {
545+
sort($glob);
545546
$resolvedDirs = array_merge($resolvedDirs, array_map([$this, 'normalizeDir'], $glob));
546547
} else {
547548
throw new \InvalidArgumentException(sprintf('The "%s" directory does not exist.', $dir));

‎src/Symfony/Component/Translation/Resources/bin/translation-status.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Translation/Resources/bin/translation-status.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ function findTranslationFiles($originalFilePath, $localeToAnalyze)
8989
$originalFileName = basename($originalFilePath);
9090
$translationFileNamePattern = str_replace('.en.', '.*.', $originalFileName);
9191

92-
$translationFiles = glob($translationsDir.'/'.$translationFileNamePattern);
92+
$translationFiles = glob($translationsDir.'/'.$translationFileNamePattern, GLOB_NOSORT);
93+
sort($translationFiles);
9394
foreach ($translationFiles as $filePath) {
9495
$locale = extractLocaleFromFilePath($filePath);
9596

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.