CRM-16373 - CRM_Core_Config_Variables should be strictly about data
[civicrm-core.git] / CRM / Core / Config / Variables.php
index 1bd9d6d7b6e29bd76021e18fe1305849450b4029..56d4e282c82018006f5d87373e3ba5bacdd47272 100644 (file)
  */
 class CRM_Core_Config_Variables extends CRM_Core_Config_Defaults {
 
+  ///
+  /// BASE SYSTEM PROPERTIES (CIVICRM.SETTINGS.PHP)
+  ///
+
   /**
-   * The debug level for civicrm.
-   * @var int
+   * The dsn of the database connection
+   *
+   * @var string
    */
-  public $debug = 0;
-  public $backtrace = 0;
+  public $dsn;
+
+  /**
+   * The name of user framework
+   *
+   * @var string
+   */
+  public $userFramework = 'Drupal';
+
+  /**
+   * The name of user framework url variable name
+   *
+   * @var string
+   */
+  public $userFrameworkURLVar = 'q';
+
+  /**
+   * The dsn of the database connection for user framework
+   *
+   * @var string
+   */
+  public $userFrameworkDSN = NULL;
+
+  /**
+   * The connector module for the CMS/UF
+   * @todo Introduce an interface.
+   *
+   * @var CRM_Utils_System_Base
+   */
+  public $userSystem = NULL;
 
   /**
-   * The directory where Smarty and plugins are installed.
+   * The root directory where Smarty should store compiled files.
+   *
    * @var string
    */
-  public $smartyDir = NULL;
-  public $pluginsDir = NULL;
+  public $templateCompileDir;
+
+  /**
+   * @var string
+   */
+  public $configAndLogDir = NULL;
+
+  // END: BASE SYSTEM PROPERTIES (CIVICRM.SETTINGS.PHP)
+
+
+  /**
+   * determine whether the call is from cms or civicrm
+   *
+   * @var bool
+   *   TRUE, if the call is CiviCRM.
+   *   FALSE, if the call is from the CMS.
+   */
+  public $inCiviCRM = FALSE;
+
+  ///
+  /// END: RUNTIME SET CLASS PROPERTIES
+  ///
+
+  /**
+   * @var string
+   */
+  public $recaptchaPublicKey;
+
+  ///
+  /// BEGIN HELPER CLASS PROPERTIES
+  ///
+
+  /**
+   * Are we initialized and in a proper state
+   *
+   * @var string
+   */
+  public $initialized = 0;
+
+  /**
+   * @var string
+   */
+  public $customPHPPathDir;
+
+  /**
+   * The debug level for civicrm.
+   * @var int
+   */
+  public $debug = 0;
+  public $backtrace = 0;
 
   /**
    * The root directory of our template tree.
@@ -228,29 +310,9 @@ class CRM_Core_Config_Variables extends CRM_Core_Config_Defaults {
    */
   public $monetaryThousandSeparator = ',';
 
-  /**
-   * Default encoding of strings returned by gettext
-   * @var string
-   */
-  public $gettextCodeset = 'utf-8';
-
-  /**
-   * Default name for gettext domain.
-   * @var string
-   */
-  public $gettextDomain = 'civicrm';
-
-  /**
-   * Default location of gettext resource files.
-   */
-  public $gettextResourceDir = './l10n/';
-
   /**
    * Default user framework. This basically makes Drupal 7 the default
    */
-  public $userFramework = 'Drupal';
-  public $userFrameworkVersion = 'Unknown';
-  public $userFrameworkUsersTableName = 'users';
   public $userFrameworkClass = 'CRM_Utils_System_Drupal';
   public $userHookClass = 'CRM_Utils_Hook_Drupal';
 
@@ -264,27 +326,13 @@ class CRM_Core_Config_Variables extends CRM_Core_Config_Defaults {
    */
   public $userPermissionTemp = NULL;
 
-  public $userFrameworkURLVar = 'q';
-  public $userFrameworkDSN = NULL;
   public $userFrameworkBaseURL = NULL;
   public $userFrameworkResourceURL = NULL;
   public $userFrameworkFrontend = FALSE;
   public $userFrameworkLogging = FALSE;
 
-  /**
-   * The handle for import file size
-   * @var int
-   */
-  public $maxImportFileSize = 1048576;
   public $maxFileSize = 2;
 
-  /**
-   * The custom locale strings. Note that these locale strings are stored
-   * in a separate column in civicrm_domain
-   * @var array
-   */
-  public $localeCustomStrings = NULL;
-
   /**
    * Map Provider
    *
@@ -320,14 +368,6 @@ class CRM_Core_Config_Variables extends CRM_Core_Config_Defaults {
    */
   public $geocodeMethod = '';
 
-  /**
-   *
-   *
-   * @var boolean
-   */
-  public $mapGeoCoding = 1;
-
-
   /**
    * Whether database-level logging should be performed
    * @var boolean
@@ -354,7 +394,6 @@ class CRM_Core_Config_Variables extends CRM_Core_Config_Defaults {
     'CiviMail',
     'CiviReport',
   );
-  public $enableComponentIDs = array(1, 6, 2, 3, 4, 8);
 
   /**
    * Should payments be accepted only via SSL?
@@ -384,27 +423,6 @@ class CRM_Core_Config_Variables extends CRM_Core_Config_Defaults {
    */
   public $fieldSeparator = ',';
 
-  /**
-   * Max location blocks in address
-   *
-   * @var integer
-   */
-  public $maxLocationBlocks = 2;
-
-  /**
-   * The font path where captcha fonts are stored
-   *
-   * @var string
-   */
-  public $captchaFontPath = '/usr/X11R6/lib/X11/fonts/';
-
-  /**
-   * The font to use for captcha
-   *
-   * @var string
-   */
-  public $captchaFont = 'HelveticaBold.ttf';
-
   /**
    * Some search settings
    */
@@ -431,24 +449,6 @@ class CRM_Core_Config_Variables extends CRM_Core_Config_Defaults {
    */
   public $includeAlphabeticalPager = 1;
   public $includeOrderByClause = 1;
-  public $oldInputStyle = 1;
-
-  /**
-   * Should we disable key generation for forms
-   *
-   * @var boolean
-   */
-  public $formKeyDisable = FALSE;
-
-  /**
-   * determine whether the call is from cms or civicrm
-   */
-  public $inCiviCRM = FALSE;
-
-  /**
-   * Component registry object (of CRM_Core_Component type)
-   */
-  public $componentRegistry = NULL;
 
   /**
    * PDF receipt as attachment is disabled by default (CRM-8350)
@@ -471,142 +471,9 @@ class CRM_Core_Config_Variables extends CRM_Core_Config_Defaults {
    */
   public $wpBasePage = NULL;
 
-  /**
-   * Provide addressSequence.
-   *
-   * @param
-   *
-   * @return string
-   */
-  public function addressSequence() {
-    $addressFormat = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
-      'address_format'
-    );
+  public $verpSeparator = '.', $mailThrottleTime = 0, $mailerJobsMax = 0, $mailerJobSize = 0, $mailerBatchLimit = 0;
 
-    return CRM_Utils_Address::sequence($addressFormat);
-  }
-
-  /**
-   * Provide cached default currency symbol.
-   *
-   * @param
-   *
-   * @return string
-   */
-  public function defaultCurrencySymbol($defaultCurrency = NULL) {
-    static $cachedSymbol = NULL;
-    if (!$cachedSymbol || $defaultCurrency) {
-      if ($this->defaultCurrency || $defaultCurrency) {
-        $this->currencySymbols = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'currency', array(
-          'labelColumn' => 'symbol',
-          'orderColumn' => TRUE,
-        ));
-        $currency = $defaultCurrency ? $defaultCurrency : $this->defaultCurrency;
-        $cachedSymbol = CRM_Utils_Array::value($currency, $this->currencySymbols, '');
-      }
-      else {
-        $cachedSymbol = '$';
-      }
-    }
-    return $cachedSymbol;
-  }
-
-  /**
-   * Provide cached default currency symbol.
-   *
-   * @param
-   *
-   * @return string
-   */
-  public function defaultContactCountry() {
-    static $cachedContactCountry = NULL;
-
-    if (!empty($this->defaultContactCountry) &&
-      !$cachedContactCountry
-    ) {
-      $countryIsoCodes = CRM_Core_PseudoConstant::countryIsoCode();
-      $cachedContactCountry = CRM_Utils_Array::value($this->defaultContactCountry,
-        $countryIsoCodes
-      );
-    }
-    return $cachedContactCountry;
-  }
-
-  /**
-   * Provide cached default country name.
-   *
-   * @param
-   *
-   * @return string
-   */
-  public function defaultContactCountryName() {
-    static $cachedContactCountryName = NULL;
-    if (!$cachedContactCountryName && $this->defaultContactCountry) {
-      $countryCodes = CRM_Core_PseudoConstant::country();
-      $cachedContactCountryName = $countryCodes[$this->defaultContactCountry];
-    }
-    return $cachedContactCountryName;
-  }
-
-  /**
-   * Provide cached country limit translated to names.
-   *
-   * @param
-   *
-   * @return array
-   */
-  public function countryLimit() {
-    static $cachedCountryLimit = NULL;
-    if (!$cachedCountryLimit) {
-      $countryIsoCodes = CRM_Core_PseudoConstant::countryIsoCode();
-      $country = array();
-      if (is_array($this->countryLimit)) {
-        foreach ($this->countryLimit as $val) {
-          // CRM-12007
-          // some countries have disappeared and hence they might be in country limit
-          // but not in the country table
-          if (isset($countryIsoCodes[$val])) {
-            $country[] = $countryIsoCodes[$val];
-          }
-        }
-      }
-      else {
-        $country[] = $countryIsoCodes[$this->countryLimit];
-      }
-      $cachedCountryLimit = $country;
-    }
-    return $cachedCountryLimit;
-  }
-
-  /**
-   * Provide cached province limit translated to names.
-   *
-   * @param
-   *
-   * @return array
-   */
-  public function provinceLimit() {
-    static $cachedProvinceLimit = NULL;
-    if (!$cachedProvinceLimit) {
-      $countryIsoCodes = CRM_Core_PseudoConstant::countryIsoCode();
-      $country = array();
-      if (is_array($this->provinceLimit)) {
-        foreach ($this->provinceLimit as $val) {
-          // CRM-12007
-          // some countries have disappeared and hence they might be in country limit
-          // but not in the country table
-          if (isset($countryIsoCodes[$val])) {
-            $country[] = $countryIsoCodes[$val];
-          }
-        }
-      }
-      else {
-        $country[] = $countryIsoCodes[$this->provinceLimit];
-      }
-      $cachedProvinceLimit = $country;
-    }
-    return $cachedProvinceLimit;
-  }
+  public $inheritLocale = 0;
 
 }
 // end CRM_Core_Config