Merge pull request #5252 from JKingsnorth/CRM-10551
[civicrm-core.git] / CRM / Extension / System.php
index 1e09e10f02b3f4aebabb557d5909b621fa13cc74..7e5441f68a846424df25eef35c12faef03d6700c 100644 (file)
@@ -52,6 +52,13 @@ class CRM_Extension_System {
    */
   private $_repoUrl = NULL;
 
+  /**
+   * @var array
+   *   Construction parameters. These are primarily retained so
+   *   that they can influence the cache name.
+   */
+  protected $parameters;
+
   /**
    * @param bool $fresh
    *   TRUE to force creation of a new system.
@@ -102,6 +109,9 @@ class CRM_Extension_System {
     if (!array_key_exists('cmsRootPath', $parameters)) {
       $parameters['cmsRootPath'] = $config->userSystem->cmsRootPath();
     }
+    if (!array_key_exists('domain_id', $parameters)) {
+      $parameters['domain_id'] = CRM_Core_Config::domainID();
+    }
     ksort($parameters); // guaranteed ordering - useful for md5(serialize($parameters))
 
     $this->parameters = $parameters;