CRM_Extension_System - Make it a little easier to skim.
authorTim Otten <totten@civicrm.org>
Thu, 10 Sep 2015 23:34:05 +0000 (16:34 -0700)
committerTim Otten <totten@civicrm.org>
Thu, 17 Sep 2015 22:49:29 +0000 (15:49 -0700)
CRM/Extension/System.php

index 35062c2350ce3308397b8c8f1f2224a895c91293..e453bc167f45362ff07049ea87c07a4b6dbd94fa 100644 (file)
@@ -92,17 +92,10 @@ class CRM_Extension_System {
    */
   public function __construct($parameters = array()) {
     $config = CRM_Core_Config::singleton();
-    $configKeys = array(
-      'extensionsDir',
-      'extensionsURL',
-      'resourceBase',
-      'userFrameworkBaseURL',
-    );
-    foreach ($configKeys as $key) {
-      if (!array_key_exists($key, $parameters)) {
-        $parameters[$key] = $config->{$key};
-      }
-    }
+    $parameters['extensionsDir'] = CRM_Utils_Array::value('extensionsDir', $parameters, $config->extensionsDir);
+    $parameters['extensionsURL'] = CRM_Utils_Array::value('extensionsURL', $parameters, $config->extensionsURL);
+    $parameters['resourceBase'] = CRM_Utils_Array::value('resourceBase', $parameters, $config->resourceBase);
+    $parameters['userFrameworkBaseURL'] = CRM_Utils_Array::value('userFrameworkBaseURL', $parameters, $config->userFrameworkBaseURL);
     if (!array_key_exists('civicrm_root', $parameters)) {
       $parameters['civicrm_root'] = $GLOBALS['civicrm_root'];
     }