<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
///
/**
- * 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
*/
///
/**
- * are we initialized and in a proper state
+ * Are we initialized and in a proper state
*
* @var string
*/
public $customPHPPathDir;
/**
- * the factory class used to instantiate our DB objects
+ * The factory class used to instantiate our DB objects
*
* @var string
*/
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
*/
* @return CRM_Core_Config
* @static
*/
- static function &singleton($loadFromDB = TRUE, $force = FALSE) {
+ public static function &singleton($loadFromDB = TRUE, $force = FALSE) {
if (self::$_singleton === NULL || $force) {
// goto a simple error handler
$GLOBALS['civicrm_default_error_scope'] = CRM_Core_TemporaryErrorScope::create(array('CRM_Core_Error', 'handle'));
}
/**
- * initialize the DataObject framework
+ * Initialize the DataObject framework
*
* @return void
- * @access private
*/
private function _initDAO() {
CRM_Core_DAO::init($this->dsn);
}
/**
- * returns the singleton logger for the application
+ * Returns the singleton logger for the application
*
* @param
- * @access private
*
* @return object
*/
}
/**
- * initialize the config variables
+ * Initialize the config variables
*
* @return void
- * @access private
*/
private function _initVariables() {
// retrieve serialised settings
* Retrieve a mailer to send any mail from the application
*
* @param boolean $persist open a persistent smtp connection, should speed up mailings
- * @access private
* @return object
*/
- static function &getMailer($persist = FALSE) {
+ public static function &getMailer($persist = FALSE) {
if (!isset(self::$_mail)) {
$mailingInfo = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
'mailing_backend'
}
/**
- * 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
*
* @return boolean
* @static
- * @access public
*/
- static function check(&$config, &$required) {
+ public static function check(&$config, &$required) {
foreach ($required as $name) {
if (CRM_Utils_System::isNull($config->$name)) {
return FALSE;
}
/**
- * reset the serialized array and recompute
+ * Reset the serialized array and recompute
* use with care
*/
- function reset() {
+ public function reset() {
$query = "UPDATE civicrm_domain SET config_backend = null";
CRM_Core_DAO::executeQuery($query);
}
// This method should initialize auth sources
- function initAuthSrc() {
+ public function initAuthSrc() {
$session = CRM_Core_Session::singleton();
if ($session->get('userID') && !$session->get('authSrc')) {
$session->set('authSrc', CRM_Core_Permission::AUTH_SRC_LOGIN);
}
/**
- * one function to get domain ID
+ * One function to get domain ID
*/
- static function domainID($domainID = NULL, $reset = FALSE) {
+ public static function domainID($domainID = NULL, $reset = FALSE) {
static $domain;
if ($domainID) {
$domain = $domainID;
}
/**
- * 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) {
+ public function cleanupCaches($sessionReset = TRUE) {
// cleanup templates_c directory
$this->cleanup(1, FALSE);
/**
* Do general cleanup of module permissions.
*/
- function cleanupPermissions() {
+ public function cleanupPermissions() {
$module_files = CRM_Extension_System::singleton()->getMapper()->getActiveModuleFiles();
if ($this->userPermissionClass->isModulePermissionSupported()) {
// Can store permissions -- so do it!
/**
* Flush information about loaded modules
*/
- function clearModuleList() {
+ public function clearModuleList() {
CRM_Extension_System::singleton()->getCache()->flush();
CRM_Utils_Hook::singleton(TRUE);
CRM_Core_PseudoConstant::getModuleExtensions(TRUE);
}
/**
- * clear db cache
+ * Clear db cache
*/
public static function clearDBCache() {
$queries = array(
}
/**
- * clear leftover temporary tables
+ * Clear leftover temporary tables
*/
public static function clearTempTables() {
// CRM-5645
}
/**
- * function to check if running in upgrade mode
+ * Check if running in upgrade mode
*/
- static function isUpgradeMode($path = NULL) {
+ public static function isUpgradeMode($path = NULL) {
if (defined('CIVICRM_UPGRADE_ACTIVE')) {
return TRUE;
}
/**
* Is back office credit card processing enabled for this site - ie are there any installed processors that support
- * on-site processing
+ * it?
* @return bool
*/
- static function isEnabledBackOfficeCreditCardPayments() {
- // restrict to type=1 (credit card) payment processor payment_types and only include billing mode types 1 and 3
- $processors = CRM_Core_PseudoConstant::paymentProcessor(FALSE, FALSE,
- "billing_mode IN ( 1, 3 ) AND payment_type = 1"
- );
- if (count($processors) > 0) {
- return TRUE;
- }
- return FALSE;
+ public static function isEnabledBackOfficeCreditCardPayments() {
+ return CRM_Financial_BAO_PaymentProcessor::hasPaymentProcessorSupporting(array('BackOffice'));
}
}
-// end CRM_Core_Config
-