@@ -875,6 +875,15 @@ public function installDataFixtures(array $request = [])
875
875
LayoutCache::TYPE_IDENTIFIER ,
876
876
];
877
877
878
+ $ cacheManager = $ this ->objectManagerProvider ->get ()->create (\Magento \Framework \App \Cache \Manager::class);
879
+ $ disabledCaches = array_filter (
880
+ $ cacheManager ->getStatus (),
881
+ function ($ value , string $ key ) use ($ frontendCaches ) {
882
+ return $ value == false && in_array ($ key , $ frontendCaches );
883
+ },
884
+ ARRAY_FILTER_USE_BOTH
885
+ );
886
+
878
887
/** @var \Magento\Framework\Registry $registry */
879
888
$ registry = $ this ->objectManagerProvider ->get ()->get (\Magento \Framework \Registry::class);
880
889
//For backward compatibility in install and upgrade scripts with enabled parallelization.
@@ -888,8 +897,10 @@ public function installDataFixtures(array $request = [])
888
897
$ this ->log ->log ('Disabling caches: ' );
889
898
$ this ->updateCaches (false , $ frontendCaches );
890
899
$ this ->handleDBSchemaData ($ setup , 'data ' , $ request );
891
- $ this ->log ->log ('Enabling caches : ' );
900
+ $ this ->log ->log ('Enabling Caches : ' );
892
901
$ this ->updateCaches (true , $ frontendCaches );
902
+ $ this ->log ->log ('Return Disabled Caches to their old state: ' );
903
+ $ this ->updateCaches (false , array_keys ($ disabledCaches ));
893
904
894
905
$ registry ->unregister ('setup-mode-enabled ' );
895
906
}
0 commit comments