Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/code/Magento/Catalog/etc/db_schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1646,7 +1646,11 @@
<column name="product_id"/>
<column name="store_id"/>
</constraint>
<<<<<<< HEAD
<index referenceId="CAT_CTGR_PRD_IDX_TMP_PRD_ID_CTGR_ID_STORE_ID" indexType="hash">
=======
<index name="CAT_CTGR_PRD_IDX_TMP_PRD_ID_CTGR_ID_STORE_ID" indexType="btree">
>>>>>>> parent of 8fc4480... MAGETWO-89402: Make 'db:status' command works properly
<column name="product_id"/>
<column name="category_id"/>
<column name="store_id"/>
Expand Down
9 changes: 2 additions & 7 deletions app/etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1591,14 +1591,9 @@
<argument name="schemaPatchReader" xsi:type="object">\Magento\Framework\Setup\Patch\SchemaPatchReader</argument>
</arguments>
</type>
<type name="Magento\Framework\Setup\Patch\UpToDateData">
<type name="Magento\Framework\Setup\Declaration\Schema\Db\SchemaBuilder">
<arguments>
<argument name="dataPatchReader" xsi:type="object">\Magento\Framework\Setup\Patch\DataPatchReader</argument>
</arguments>
</type>
<type name="Magento\Framework\Setup\Patch\UpToDateSchema">
<arguments>
<argument name="schemaReader" xsi:type="object">\Magento\Framework\Setup\Patch\SchemaPatchReader</argument>
<argument name="logger" xsi:type="object">\Magento\Framework\Setup\Patch\DataPatchReader</argument>
</arguments>
</type>
<type name="Magento\Framework\MessageQueue\Config\CompositeReader">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private function getElementClass(array $fields)
{
$path = $this->path . str_replace(' ', '', $fields['code']) . '.php';
$path = str_replace('\\', DIRECTORY_SEPARATOR, MTF_TESTS_PATH . $path);
$paths = glob($path);
$paths = glob($path, GLOB_NOSORT);
$path = str_replace([MTF_TESTS_PATH, '.php'], '', $paths[0]);

return str_replace('/', '\\', $path);
Expand Down
2 changes: 1 addition & 1 deletion dev/tests/functional/utils/generate.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function deleteDirectory($dir)
if (!is_dir($dir)) {
return unlink($dir);
}
foreach (scandir($dir) as $item) {
foreach (scandir($dir, SCANDIR_SORT_NONE) as $item) {
if ($item == '.' || $item == '..') {
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion dev/tests/functional/utils/locales.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
if (isset($_GET['type']) && $_GET['type'] == 'deployed') {
$themePath = isset($_GET['theme_path']) ? $_GET['theme_path'] : 'adminhtml/Magento/backend';
$directory = __DIR__ . '/../../../../pub/static/' . $themePath;
$locales = array_diff(scandir($directory), ['..', '.']);
$locales = array_diff(scandir($directory, SCANDIR_SORT_NONE), ['..', '.']);
} else {
require_once __DIR__ . DIRECTORY_SEPARATOR . 'bootstrap.php';
$localeConfig = $magentoObjectManager->create(\Magento\Framework\Locale\Config::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function testRouteConfigsValidation()
$files = [];
foreach ($componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleDir) {
$mask = $moduleDir . '/etc/*/routes.xml';
$files = array_merge($files, glob($mask));
$files = array_merge($files, glob($mask, GLOB_NOSORT));
}
$mergedConfig = new \Magento\Framework\Config\Dom(
'<config><router/></config>',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
);

//collect test modules dirs name
$testModuleNames = array_diff(scandir($pathToCommittedTestModules), ['..', '.']);
$testModuleNames = array_diff(scandir($pathToCommittedTestModules, SCANDIR_SORT_NONE), ['..', '.']);

//remove test modules from magento codebase
foreach ($testModuleNames as $name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static function setUpBeforeClass()
public static function getBlacklist(string $pattern)
{
$blacklist = [];
foreach (glob($pattern) as $list) {
foreach (glob($pattern, GLOB_NOSORT) as $list) {
$blacklist = array_merge($blacklist, file($list, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES));
}
return $blacklist;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ protected static function _initRules()
{
$replaceFilePattern = str_replace('\\', '/', realpath(__DIR__)) . '/_files/dependency_test/*.php';
$dbRuleTables = [];
foreach (glob($replaceFilePattern) as $fileName) {
foreach (glob($replaceFilePattern, GLOB_NOSORT) as $fileName) {
$dbRuleTables = array_merge($dbRuleTables, @include $fileName);
}
self::$_rulesInstances = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private function getPluginBlacklist(): array
realpath(__DIR__) . '/../_files/blacklist/compiler_plugins*.txt'
);
$blacklistItems = [];
foreach (glob($blacklistFiles) as $fileName) {
foreach (glob($blacklistFiles, GLOB_NOSORT) as $fileName) {
$blacklistItems = array_merge(
$blacklistItems,
file($fileName, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected function setUp()
{
$whitelistedClasses = [];
$path = sprintf('%s/_files/controller_acl_test_whitelist_*.txt', __DIR__);
foreach (glob($path) as $listFile) {
foreach (glob($path, GLOB_NOSORT) as $listFile) {
$whitelistedClasses = array_merge(
$whitelistedClasses,
file($listFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ protected static function getObserverClasses($fileNamePattern, $xpath)

$blacklistFiles = str_replace('\\', '/', realpath(__DIR__)) . '/_files/blacklist/observers*.txt';
$blacklistExceptions = [];
foreach (glob($blacklistFiles) as $fileName) {
foreach (glob($blacklistFiles, GLOB_NOSORT) as $fileName) {
$blacklistExceptions = array_merge(
$blacklistExceptions,
file($fileName, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private function getWhitelist(): array
realpath(__DIR__) . '/_files/whitelist/public_code*.txt'
);
$whiteListItems = [];
foreach (glob($whiteListFiles) as $fileName) {
foreach (glob($whiteListFiles, GLOB_NOSORT) as $fileName) {
$whiteListItems = array_merge(
$whiteListItems,
file($fileName, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ private static function getFilesFromListFile($listsBaseDir, $listFilePattern, $n

$globFilesListPattern = ($listsBaseDir ?: self::getChangedFilesBaseDir())
. '/_files/' . $listFilePattern;
$listFiles = glob($globFilesListPattern);
$listFiles = glob($globFilesListPattern, GLOB_NOSORT);
if (count($listFiles)) {
foreach ($listFiles as $listFile) {
$filesDefinedInList = array_merge(
Expand Down
2 changes: 1 addition & 1 deletion dev/tools/UpgradeScripts/pre_composer_update_2.3.php
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ function deleteFilepath($path) {
return;
}
if (is_dir($path)) {
$files = array_diff(scandir($path), array('..', '.'));
$files = array_diff(scandir($path, SCANDIR_SORT_NONE), array('..', '.'));
foreach ($files as $file) {
deleteFilepath("$path/$file");
}
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/Magento/Framework/App/Utility/Files.php
Original file line number Diff line number Diff line change
Expand Up @@ -1564,7 +1564,7 @@ public function getComposerFiles($componentType, $asDataSet = true)
public function readLists($globPattern)
{
$patterns = [];
foreach (glob($globPattern) as $list) {
foreach (glob($globPattern, GLOB_NOSORT) as $list) {
$patterns = array_merge($patterns, file($list, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES));
}

Expand Down
24 changes: 8 additions & 16 deletions lib/internal/Magento/Framework/Module/DbVersionInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ class DbVersionInfo
*/
private $moduleResource;

/**
* @var array
*/
private $dbVersionErrorsCache = null;

/**
* @param ModuleListInterface $moduleList
* @param ResourceInterface $moduleResource
Expand Down Expand Up @@ -97,19 +92,16 @@ private function getSchemaInfo($moduleName)
*/
public function getDbVersionErrors()
{
if ($this->dbVersionErrorsCache === null) {
$this->dbVersionErrorsCache = [];
foreach ($this->moduleList->getNames() as $moduleName) {
if (!$this->isSchemaUpToDate($moduleName)) {
$this->dbVersionErrorsCache[] = $this->getSchemaInfo($moduleName);
}
if (!$this->isDataUpToDate($moduleName)) {
$this->dbVersionErrorsCache[] = $this->getDataInfo($moduleName);
}
$errors = [];
foreach ($this->moduleList->getNames() as $moduleName) {
if (!$this->isSchemaUpToDate($moduleName)) {
$errors[] = $this->getSchemaInfo($moduleName);
}
if (!$this->isDataUpToDate($moduleName)) {
$errors[] = $this->getDataInfo($moduleName);
}
}

return $this->dbVersionErrorsCache;
return $errors;
}

/**
Expand Down

This file was deleted.

Loading