@@ -885,9 +885,11 @@ public function installDataFixtures(array $request = [])
885
885
$ setup = $ this ->dataSetupFactory ->create ();
886
886
$ this ->checkFilePermissionsForDbUpgrade ();
887
887
$ this ->log ->log ('Data install/update: ' );
888
- $ this ->updateCaches (false , $ frontendCaches , false );
888
+ $ this ->log ->log ('Disabling caches: ' );
889
+ $ this ->updateCaches (false , $ frontendCaches );
889
890
$ this ->handleDBSchemaData ($ setup , 'data ' , $ request );
890
- $ this ->updateCaches (true , $ frontendCaches , false );
891
+ $ this ->log ->log ('Enabling caches: ' );
892
+ $ this ->updateCaches (true , $ frontendCaches );
891
893
892
894
$ registry ->unregister ('setup-mode-enabled ' );
893
895
}
@@ -1266,25 +1268,31 @@ public function uninstall()
1266
1268
*
1267
1269
* @param bool $isEnabled
1268
1270
* @param array $types
1269
- * @param bool $logStatus
1270
1271
* @return void
1271
1272
*/
1272
- private function updateCaches ($ isEnabled , $ types = [], $ logStatus = true )
1273
+ private function updateCaches ($ isEnabled , $ types = [])
1273
1274
{
1274
1275
/** @var \Magento\Framework\App\Cache\Manager $cacheManager */
1275
1276
$ cacheManager = $ this ->objectManagerProvider ->get ()->create (\Magento \Framework \App \Cache \Manager::class);
1276
- $ types = empty ($ types ) ? $ cacheManager ->getAvailableTypes () : $ types ;
1277
1277
1278
+ $ types = empty ($ types ) ? $ cacheManager ->getAvailableTypes () : $ types ;
1278
1279
$ enabledTypes = $ cacheManager ->setEnabled ($ types , $ isEnabled );
1279
1280
if ($ isEnabled ){
1280
1281
$ cacheManager ->clean ($ enabledTypes );
1281
1282
}
1282
1283
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 ));
1288
1296
}
1289
1297
1290
1298
/**
0 commit comments