Skip to content

Commit 25886c2

Browse files
MC-30236: Upgrade from 2.3.x CE with SD to 2.3.x EE AreaCode Exception
- log cache status of only specific types
1 parent 96a2e17 commit 25886c2

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

setup/src/Magento/Setup/Model/Installer.php

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -885,9 +885,11 @@ public function installDataFixtures(array $request = [])
885885
$setup = $this->dataSetupFactory->create();
886886
$this->checkFilePermissionsForDbUpgrade();
887887
$this->log->log('Data install/update:');
888-
$this->updateCaches(false, $frontendCaches, false);
888+
$this->log->log('Disabling caches:');
889+
$this->updateCaches(false, $frontendCaches);
889890
$this->handleDBSchemaData($setup, 'data', $request);
890-
$this->updateCaches(true, $frontendCaches, false);
891+
$this->log->log('Enabling caches:');
892+
$this->updateCaches(true, $frontendCaches);
891893

892894
$registry->unregister('setup-mode-enabled');
893895
}
@@ -1266,25 +1268,31 @@ public function uninstall()
12661268
*
12671269
* @param bool $isEnabled
12681270
* @param array $types
1269-
* @param bool $logStatus
12701271
* @return void
12711272
*/
1272-
private function updateCaches($isEnabled, $types = [], $logStatus = true)
1273+
private function updateCaches($isEnabled, $types = [])
12731274
{
12741275
/** @var \Magento\Framework\App\Cache\Manager $cacheManager */
12751276
$cacheManager = $this->objectManagerProvider->get()->create(\Magento\Framework\App\Cache\Manager::class);
1276-
$types = empty($types) ? $cacheManager->getAvailableTypes() : $types;
12771277

1278+
$types = empty($types) ? $cacheManager->getAvailableTypes() : $types;
12781279
$enabledTypes = $cacheManager->setEnabled($types, $isEnabled);
12791280
if($isEnabled){
12801281
$cacheManager->clean($enabledTypes);
12811282
}
12821283

1283-
if ($logStatus) {
1284-
$this->log->log('Current status:');
1285-
// phpcs:ignore Magento2.Functions.DiscouragedFunction
1286-
$this->log->log(print_r($cacheManager->getStatus(), true));
1287-
}
1284+
// Only get statuses of specific cache types
1285+
$cacheStatus = array_filter(
1286+
$cacheManager->getStatus(),
1287+
function (string $key) use ($types) {
1288+
return in_array($key, $types);
1289+
},
1290+
ARRAY_FILTER_USE_KEY
1291+
);
1292+
1293+
$this->log->log('Current status:');
1294+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
1295+
$this->log->log(print_r($cacheStatus, true));
12881296
}
12891297

12901298
/**

0 commit comments

Comments
 (0)