X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FConfig.php;h=72553ed90eec137d449a46ea199fd880713da50e;hb=0ec03e9fabc23b802ac80cb68c44b5abaf7f8585;hp=7226d61ddf29de1523d059e0b623a74b75ccb42e;hpb=4d66768d9d0c55adf8ac10c503d229bdf3108b65;p=civicrm-core.git diff --git a/CRM/Core/Config.php b/CRM/Core/Config.php index 7226d61ddf..72553ed90e 100644 --- a/CRM/Core/Config.php +++ b/CRM/Core/Config.php @@ -1,9 +1,9 @@ _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 @@ -218,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; @@ -232,7 +249,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables { // set the callback at the very very end, to avoid an infinite loop // set the error callback - CRM_Core_Error::setCallback(); + unset($errorScope); // call the hook so other modules can add to the config // again doing this at the very very end @@ -255,7 +272,10 @@ class CRM_Core_Config extends CRM_Core_Config_Variables { return self::$_singleton; } - + /** + * @param string $userFramework + * One of 'Drupal', 'Joomla', etc. + */ private function _setUserFrameworkConfig($userFramework) { $this->userFrameworkClass = 'CRM_Utils_System_' . $userFramework; @@ -265,7 +285,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables { $class = $this->userFrameworkClass; // redundant with _initVariables - $userSystem = $this->userSystem = new $class(); + $this->userSystem = new $class(); if ($userFramework == 'Joomla') { $this->userFrameworkURLVar = 'task'; @@ -296,9 +316,10 @@ class CRM_Core_Config extends CRM_Core_Config_Variables { $this->cleanURL = 0; } - $this->userFrameworkVersion = $userSystem->getVersion(); + $this->userFrameworkVersion = $this->userSystem->getVersion(); if ($userFramework == 'Joomla') { + /** @var object|null $mainframe */ global $mainframe; $dbprefix = $mainframe ? $mainframe->getCfg('dbprefix') : 'jos_'; $this->userFrameworkUsersTableName = $dbprefix . 'users'; @@ -315,8 +336,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables { * Reads constants defined in civicrm.settings.php and * stores them in config properties. * - * @return void - * @access public + * @param bool $loadFromDB */ private function _initialize($loadFromDB = TRUE) { @@ -487,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']) && @@ -612,13 +632,11 @@ class CRM_Core_Config extends CRM_Core_Config_Variables { } /** - * delete the web server writable directories + * Deletes the web server writable directories * - * @param int $value 1 - clean templates_c, 2 - clean upload, 3 - clean both - * - * @access public - * - * @return void + * @param int $value + * 1: clean templates_c, 2: clean upload, 3: clean both + * @param bool $rmdir */ public function cleanup($value, $rmdir = TRUE) { $value = (int ) $value; @@ -636,7 +654,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables { // Whether we delete/create or simply preserve directories, we should // certainly make sure the restrictions are enforced. - foreach (array($this->templateCompileDir, $this->uploadDir, $this->configAndLogDir) as $dir) { + foreach (array($this->templateCompileDir, $this->uploadDir, $this->configAndLogDir, $this->customFileUploadDir) as $dir) { if ($dir && is_dir($dir)) { CRM_Utils_File::restrictAccess($dir); } @@ -841,6 +859,22 @@ AND $this->userFramework = $userFramework; $this->_setUserFrameworkConfig($userFramework); } + + /** + * Is back office credit card processing enabled for this site - ie are there any installed processors that support + * on-site processing + * @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; + } } // end CRM_Core_Config