Merge pull request #5552 from totten/master-extcache-domain
[civicrm-core.git] / CRM / Extension / System.php
index 581761ba7045c7715ae8216c6cae73107d996613..7e5441f68a846424df25eef35c12faef03d6700c 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -30,7 +30,7 @@
  * system.
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
  * $Id$
  *
  */
@@ -46,12 +46,19 @@ class CRM_Extension_System {
   private $downloader = NULL;
 
   /**
-   * The URL of the remote extensions repository
+   * The URL of the remote extensions repository.
    *
    * @var string|FALSE
    */
   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,13 +109,16 @@ 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;
   }
 
   /**
-   * Get a container which represents all available extensions
+   * Get a container which represents all available extensions.
    *
    * @return CRM_Extension_Container_Interface
    */
@@ -151,7 +161,7 @@ class CRM_Extension_System {
   }
 
   /**
-   * Get the container to which new extensions are installed
+   * Get the container to which new extensions are installed.
    *
    * This container should be a particular, writeable directory.
    *
@@ -170,7 +180,7 @@ class CRM_Extension_System {
   }
 
   /**
-   * Get the service which provides runtime information about extensions
+   * Get the service which provides runtime information about extensions.
    *
    * @return CRM_Extension_Mapper
    */
@@ -182,7 +192,7 @@ class CRM_Extension_System {
   }
 
   /**
-   * Get the service for enabling and disabling extensions
+   * Get the service for enabling and disabling extensions.
    *
    * @return CRM_Extension_Manager
    */
@@ -252,7 +262,7 @@ class CRM_Extension_System {
   }
 
   /**
-   * Determine the URL which provides a feed of available extensions
+   * Determine the URL which provides a feed of available extensions.
    *
    * @return string|FALSE
    */