QA fixes
[civicrm-core.git] / CRM / Core / Config.php
index 8533d4be408716c4079228158211a15cf63fb1db..ffc6a9abd1c186cd7d8d3a1f3720c6f818f4d31e 100644 (file)
@@ -41,34 +41,37 @@ require_once 'Mail.php';
 
 require_once 'api/api.php';
 
+/**
+ * Class CRM_Core_Config
+ */
 class CRM_Core_Config extends CRM_Core_Config_Variables {
   ///
   /// BASE SYSTEM PROPERTIES (CIVICRM.SETTINGS.PHP)
   ///
 
   /**
-   * the dsn of the database connection
+   * The dsn of the database connection
    *
    * @var string
    */
   public $dsn;
 
   /**
-   * the name of user framework
+   * The name of user framework
    *
    * @var string
    */
   public $userFramework = 'Drupal';
 
   /**
-   * the name of user framework url variable name
+   * The name of user framework url variable name
    *
    * @var string
    */
   public $userFrameworkURLVar = 'q';
 
   /**
-   * the dsn of the database connection for user framework
+   * The dsn of the database connection for user framework
    *
    * @var string
    */
@@ -82,6 +85,11 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
    */
   public $userSystem = NULL;
 
+  /**
+   * @var CRM_Core_Permission_Base
+   */
+  public $userPermissionClass;
+
   /**
    * The root directory where Smarty should store compiled files
    *
@@ -101,7 +109,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
   ///
 
   /**
-   * are we initialized and in a proper state
+   * Are we initialized and in a proper state
    *
    * @var string
    */
@@ -113,7 +121,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
   public $customPHPPathDir;
 
   /**
-   * the factory class used to instantiate our DB objects
+   * The factory class used to instantiate our DB objects
    *
    * @var string
    */
@@ -126,7 +134,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
   private static $_log = NULL;
 
   /**
-   * the handle on the mail handler that we are using
+   * The handle on the mail handler that we are using
    *
    * @var object
    */
@@ -213,7 +221,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
 
           self::$_singleton->_initVariables();
 
-          // I dont think we need to do this twice
+          // I don't think we need to do this twice
           // however just keeping this commented for now in 4.4
           // in case we hit any issues - CRM-13064
           // We can safely delete this once we release 4.4.4
@@ -227,7 +235,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
 
         // CRM-9803, NYSS-4822
         // this causes various settings to be reset and hence we should
-        // only use the config object that we retrived from memcache
+        // only use the config object that we retrieved from memcache
       }
 
       self::$_singleton->initialized = 1;
@@ -393,7 +401,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
   }
 
   /**
-   * initialize the DataObject framework
+   * Initialize the DataObject framework
    *
    * @return void
    * @access private
@@ -410,7 +418,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
   }
 
   /**
-   * returns the singleton logger for the application
+   * Returns the singleton logger for the application
    *
    * @param
    * @access private
@@ -426,7 +434,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
   }
 
   /**
-   * initialize the config variables
+   * Initialize the config variables
    *
    * @return void
    * @access private
@@ -499,7 +507,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
         CRM_Utils_System::mapConfigToSSL();
       }
       $rrb = parse_url($this->userFrameworkResourceURL);
-      // dont use absolute path if resources are stored on a different server
+      // don't use absolute path if resources are stored on a different server
       // CRM-4642
       $this->resourceBase = $this->userFrameworkResourceURL;
       if (isset($_SERVER['HTTP_HOST']) &&
@@ -654,7 +662,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
   }
 
   /**
-   * verify that the needed parameters are not null in the config
+   * Verify that the needed parameters are not null in the config
    *
    * @param CRM_Core_Config (reference ) the system config object
    * @param array           (reference ) the parameters that need a value
@@ -673,7 +681,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
   }
 
   /**
-   * reset the serialized array and recompute
+   * Reset the serialized array and recompute
    * use with care
    */
   function reset() {
@@ -693,7 +701,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
   }
 
   /**
-   * one function to get domain ID
+   * One function to get domain ID
    */
   static function domainID($domainID = NULL, $reset = FALSE) {
     static $domain;
@@ -708,7 +716,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
   }
 
   /**
-   * do general cleanup of caches, temp directories and temp tables
+   * Do general cleanup of caches, temp directories and temp tables
    * CRM-8739
    */
   function cleanupCaches($sessionReset = TRUE) {
@@ -764,7 +772,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
   }
 
   /**
-   * clear db cache
+   * Clear db cache
    */
   public static function clearDBCache() {
     $queries = array(
@@ -788,7 +796,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
   }
 
   /**
-   * clear leftover temporary tables
+   * Clear leftover temporary tables
    */
   public static function clearTempTables() {
     // CRM-5645
@@ -819,7 +827,7 @@ AND
   }
 
   /**
-   * function to check if running in upgrade mode
+   * Check if running in upgrade mode
    */
   static function isUpgradeMode($path = NULL) {
     if (defined('CIVICRM_UPGRADE_ACTIVE')) {
@@ -851,6 +859,13 @@ AND
     $this->userFramework = $userFramework;
     $this->_setUserFrameworkConfig($userFramework);
   }
-}
-// end CRM_Core_Config
 
+  /**
+   * Is back office credit card processing enabled for this site - ie are there any installed processors that support
+   * it?
+   * @return bool
+   */
+  static function isEnabledBackOfficeCreditCardPayments() {
+    return CRM_Financial_BAO_PaymentProcessor::hasPaymentProcessorSupporting(array('BackOffice'));
+  }
+}