X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FConfig%2FRuntime.php;h=da2abcec7b759fb6adc68a4b1424de4dfec42f63;hb=6698aeacce6bf12e331128864cb47c581c924124;hp=a9c39f3e33901f7eec14de17ab763c843b7c017b;hpb=3bf2661bd263d718e867ad5170965d1bcb110df6;p=civicrm-core.git diff --git a/CRM/Core/Config/Runtime.php b/CRM/Core/Config/Runtime.php index a9c39f3e33..da2abcec7b 100644 --- a/CRM/Core/Config/Runtime.php +++ b/CRM/Core/Config/Runtime.php @@ -73,13 +73,6 @@ class CRM_Core_Config_Runtime extends CRM_Core_Config_MagicMerge { */ public $cleanURL; - /** - * @var string - */ - public $configAndLogDir; - - public $templateCompileDir; - /** * The root directory of our template tree. * @var string @@ -95,20 +88,6 @@ class CRM_Core_Config_Runtime extends CRM_Core_Config_MagicMerge { } $this->dsn = defined('CIVICRM_DSN') ? CIVICRM_DSN : NULL; - if (!defined('CIVICRM_TEMPLATE_COMPILEDIR') && $loadFromDB) { - $this->fatal('You need to define CIVICRM_TEMPLATE_COMPILEDIR in civicrm.settings.php'); - } - - if (defined('CIVICRM_TEMPLATE_COMPILEDIR')) { - $this->configAndLogDir = CRM_Utils_File::baseFilePath() . 'ConfigAndLog' . DIRECTORY_SEPARATOR; - CRM_Utils_File::createDir($this->configAndLogDir); - CRM_Utils_File::restrictAccess($this->configAndLogDir); - - $this->templateCompileDir = defined('CIVICRM_TEMPLATE_COMPILEDIR') ? CRM_Utils_File::addTrailingSlash(CIVICRM_TEMPLATE_COMPILEDIR) : NULL; - CRM_Utils_File::createDir($this->templateCompileDir); - CRM_Utils_File::restrictAccess($this->templateCompileDir); - } - if (!defined('CIVICRM_UF')) { $this->fatal('You need to define CIVICRM_UF in civicrm.settings.php'); } @@ -133,7 +112,7 @@ class CRM_Core_Config_Runtime extends CRM_Core_Config_MagicMerge { $this->cleanURL = 0; } - $this->templateDir = array(dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR); + $this->templateDir = [dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR]; $this->initialized = 1; } @@ -152,7 +131,7 @@ class CRM_Core_Config_Runtime extends CRM_Core_Config_MagicMerge { * Include custom PHP and template paths */ public function includeCustomPath() { - $customProprtyName = array('customPHPPathDir', 'customTemplateDir'); + $customProprtyName = ['customPHPPathDir', 'customTemplateDir']; foreach ($customProprtyName as $property) { $value = $this->getSettings()->get($property); if (!empty($value)) { @@ -173,14 +152,21 @@ class CRM_Core_Config_Runtime extends CRM_Core_Config_MagicMerge { */ public static function getId() { if (!isset(Civi::$statics[__CLASS__]['id'])) { - Civi::$statics[__CLASS__]['id'] = md5(implode(\CRM_Core_DAO::VALUE_SEPARATOR, array( - defined('CIVICRM_DOMAIN_ID') ? CIVICRM_DOMAIN_ID : 1, // e.g. one database, multi URL - parse_url(CIVICRM_DSN, PHP_URL_PATH), // e.g. one codebase, multi database - \CRM_Utils_Array::value('SCRIPT_FILENAME', $_SERVER, ''), // e.g. CMS vs extern vs installer - \CRM_Utils_Array::value('HTTP_HOST', $_SERVER, ''), // e.g. name-based vhosts - \CRM_Utils_Array::value('SERVER_PORT', $_SERVER, ''), // e.g. port-based vhosts + Civi::$statics[__CLASS__]['id'] = md5(implode(\CRM_Core_DAO::VALUE_SEPARATOR, [ + // e.g. one database, multi URL + defined('CIVICRM_DOMAIN_ID') ? CIVICRM_DOMAIN_ID : 1, + // e.g. one codebase, multi database + parse_url(CIVICRM_DSN, PHP_URL_PATH), + // e.g. CMS vs extern vs installer + \CRM_Utils_Array::value('SCRIPT_FILENAME', $_SERVER, ''), + // e.g. name-based vhosts + \CRM_Utils_Array::value('HTTP_HOST', $_SERVER, ''), + // e.g. port-based vhosts + \CRM_Utils_Array::value('SERVER_PORT', $_SERVER, ''), + // e.g. unit testing + defined('CIVICRM_TEST') ? 1 : 0, // Depending on deployment arch, these signals *could* be redundant, but who cares? - ))); + ])); } return Civi::$statics[__CLASS__]['id']; }