diff --git a/dev/tests/static/framework/Magento/TestFramework/Utility/ChangedFiles.php b/dev/tests/static/framework/Magento/TestFramework/Utility/ChangedFiles.php index 6470bc0c22086..3d7f5f2604d7a 100644 --- a/dev/tests/static/framework/Magento/TestFramework/Utility/ChangedFiles.php +++ b/dev/tests/static/framework/Magento/TestFramework/Utility/ChangedFiles.php @@ -32,7 +32,7 @@ public static function getPhpFiles($changedFilesList, $fileTypes = 0) $fileUtilities = Files::init(); if (isset($_ENV['INCREMENTAL_BUILD'])) { $phpFiles = []; - foreach (glob($changedFilesList) as $listFile) { + foreach (glob($changedFilesList, GLOB_NOSORT) as $listFile) { $phpFiles = array_merge($phpFiles, file($listFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES)); } array_walk( diff --git a/lib/internal/Magento/Framework/App/Utility/Files.php b/lib/internal/Magento/Framework/App/Utility/Files.php index 7e8d79eead7e1..b0dfc50e9f972 100644 --- a/lib/internal/Magento/Framework/App/Utility/Files.php +++ b/lib/internal/Magento/Framework/App/Utility/Files.php @@ -392,7 +392,7 @@ public function getMainConfigFiles($asDataSet = true) $configXmlPaths = array_merge($globPaths, $configXmlPaths); $files = []; foreach ($configXmlPaths as $xmlPath) { - $files = array_merge($files, glob($xmlPath)); + $files = array_merge($files, glob($xmlPath, GLOB_NOSORT)); } self::$_cache[$cacheKey] = $files; } diff --git a/lib/internal/Magento/Framework/Archive/Tar.php b/lib/internal/Magento/Framework/Archive/Tar.php index ccf9838d6649f..e2a070503f61f 100644 --- a/lib/internal/Magento/Framework/Archive/Tar.php +++ b/lib/internal/Magento/Framework/Archive/Tar.php @@ -252,7 +252,7 @@ protected function _createTar($skipRoot = false, $finalize = false) $file = $this->_getCurrentFile(); if (is_dir($file)) { - $dirFiles = scandir($file); + $dirFiles = scandir($file, SCANDIR_SORT_NONE); if (false === $dirFiles) { throw new \Magento\Framework\Exception\LocalizedException( diff --git a/lib/internal/Magento/Framework/Backup/Test/Unit/_files/app_dirs_rollback.php b/lib/internal/Magento/Framework/Backup/Test/Unit/_files/app_dirs_rollback.php index 7a9814bcd6932..5d4f18037d023 100644 --- a/lib/internal/Magento/Framework/Backup/Test/Unit/_files/app_dirs_rollback.php +++ b/lib/internal/Magento/Framework/Backup/Test/Unit/_files/app_dirs_rollback.php @@ -15,7 +15,7 @@ } } -$files = glob(TESTS_TEMP_DIR . '/Magento/Backup/data/*'); +$files = glob(TESTS_TEMP_DIR . '/Magento/Backup/data/*', GLOB_NOSORT); foreach ($files as $file) { unlink($file); } diff --git a/lib/internal/Magento/Framework/Data/Collection/Filesystem.php b/lib/internal/Magento/Framework/Data/Collection/Filesystem.php index 67d2a020864dd..330ff4e975e8a 100644 --- a/lib/internal/Magento/Framework/Data/Collection/Filesystem.php +++ b/lib/internal/Magento/Framework/Data/Collection/Filesystem.php @@ -243,7 +243,7 @@ protected function _collectRecursive($dir) $dir = [$dir]; } foreach ($dir as $folder) { - if ($nodes = glob($folder . '/*')) { + if ($nodes = glob($folder . '/*', GLOB_NOSORT)) { foreach ($nodes as $node) { $collectedResult[] = $node; } diff --git a/lib/internal/Magento/Framework/Filesystem/Io/File.php b/lib/internal/Magento/Framework/Filesystem/Io/File.php index 7849fdf31031f..c1cfebc7a0ac1 100644 --- a/lib/internal/Magento/Framework/Filesystem/Io/File.php +++ b/lib/internal/Magento/Framework/Filesystem/Io/File.php @@ -366,7 +366,7 @@ protected static function _recursiveCallback($dir, array $fileCallback, array $d $dirCallback = $fileCallback; } if (is_dir($dir)) { - foreach (scandir($dir) as $item) { + foreach (scandir($dir, SCANDIR_SORT_NONE) as $item) { if (!strcmp($item, '.') || !strcmp($item, '..')) { continue; } diff --git a/lib/internal/Magento/Framework/Validator/Test/Unit/ConfigTest.php b/lib/internal/Magento/Framework/Validator/Test/Unit/ConfigTest.php index 213a71c0087ea..6717095376625 100644 --- a/lib/internal/Magento/Framework/Validator/Test/Unit/ConfigTest.php +++ b/lib/internal/Magento/Framework/Validator/Test/Unit/ConfigTest.php @@ -51,7 +51,7 @@ public function testConstructException() protected function _initConfig(array $files = null) { if (null === $files) { - $files = glob(__DIR__ . '/_files/validation/positive/*/validation.xml'); + $files = glob(__DIR__ . '/_files/validation/positive/*/validation.xml', GLOB_NOSORT); } $configFiles = []; foreach ($files as $path) { diff --git a/setup/src/Magento/Setup/Fixtures/FixtureModel.php b/setup/src/Magento/Setup/Fixtures/FixtureModel.php index 104c9cb343216..99237e48748fb 100644 --- a/setup/src/Magento/Setup/Fixtures/FixtureModel.php +++ b/setup/src/Magento/Setup/Fixtures/FixtureModel.php @@ -105,7 +105,7 @@ public function reindex(OutputInterface $output) */ public function loadFixtures() { - $files = glob(__DIR__ . DIRECTORY_SEPARATOR . self::FIXTURE_PATTERN); + $files = glob(__DIR__ . DIRECTORY_SEPARATOR . self::FIXTURE_PATTERN, GLOB_NOSORT); foreach ($files as $file) { $file = basename($file, '.php');