Merge pull request #23045 from braders/chartenabled-var-expected
[civicrm-core.git] / CRM / Extension / System.php
index ed410333487f8ade1035b383a2f1a56906df30eb..e27d93fe1dc5b80762e3b0af5c1450d406b53243 100644 (file)
@@ -26,6 +26,7 @@ class CRM_Extension_System {
   private $manager = NULL;
   private $browser = NULL;
   private $downloader = NULL;
+  private $mixinLoader = NULL;
 
   /**
    * @var CRM_Extension_ClassLoader
@@ -243,25 +244,14 @@ class CRM_Extension_System {
     return $this->downloader;
   }
 
-  public function applyMixins($force = FALSE) {
-    $cache = $this->getCache();
-
-    $cachedScan = $force ? NULL : $cache->get('mixinScan');
-    $cachedBootData = $force ? NULL : $cache->get('mixinBoot');
-
-    [$funcFiles, $mixInfos] = $cachedScan ?: (new CRM_Extension_MixinScanner($this->mapper, $this->manager, TRUE))->build();
-    $bootData = $cachedBootData ?: new CRM_Extension_BootCache();
-
-    $mixinLoader = new CRM_Extension_MixinLoader();
-    $mixinLoader->run($bootData, $funcFiles, $mixInfos);
-
-    if ($cachedScan === NULL) {
-      $cache->set('mixinScan', [$funcFiles, $mixInfos], 24 * 60 * 60);
-    }
-    if ($cachedBootData === NULL) {
-      $bootData->lock();
-      $cache->set('mixinBoot', $bootData, 24 * 60 * 60);
+  /**
+   * @return CRM_Extension_MixinLoader;
+   */
+  public function getMixinLoader() {
+    if ($this->mixinLoader === NULL) {
+      $this->mixinLoader = new CRM_Extension_MixinLoader();
     }
+    return $this->mixinLoader;
   }
 
   /**