| 1 | <?php |
| 2 | /* |
| 3 | +--------------------------------------------------------------------+ |
| 4 | | Copyright CiviCRM LLC. All rights reserved. | |
| 5 | | | |
| 6 | | This work is published under the GNU AGPLv3 license with some | |
| 7 | | permitted exceptions and without any warranty. For full license | |
| 8 | | and copyright information, see https://civicrm.org/licensing | |
| 9 | +--------------------------------------------------------------------+ |
| 10 | */ |
| 11 | |
| 12 | /** |
| 13 | * Config handles all the run time configuration changes that the system needs to deal with. |
| 14 | * |
| 15 | * Typically we'll have different values for a user's sandbox, a qa sandbox and a production area. |
| 16 | * The default values in general, should reflect production values (minimizes chances of screwing up) |
| 17 | * |
| 18 | * @package CRM |
| 19 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
| 20 | */ |
| 21 | |
| 22 | require_once 'Log.php'; |
| 23 | require_once 'Mail.php'; |
| 24 | |
| 25 | require_once 'api/api.php'; |
| 26 | |
| 27 | /** |
| 28 | * Class CRM_Core_Config |
| 29 | * |
| 30 | * @property CRM_Utils_System_Base $userSystem |
| 31 | * @property CRM_Core_Permission_Base $userPermissionClass |
| 32 | * @property array $enableComponents |
| 33 | * @property array $languageLimit |
| 34 | * @property bool $debug |
| 35 | * @property bool $doNotResetCache |
| 36 | * @property string $maxFileSize |
| 37 | * @property string $defaultCurrency |
| 38 | * @property string $defaultCurrencySymbol |
| 39 | * @property string $lcMessages |
| 40 | * @property string $fieldSeparator |
| 41 | * @property string $userFramework |
| 42 | * @property string $verpSeparator |
| 43 | * @property string $dateFormatFull |
| 44 | * @property string $resourceBase |
| 45 | * @property string $dsn |
| 46 | * @property string $customTemplateDir |
| 47 | * @property string $defaultContactCountry |
| 48 | * @property string $defaultContactStateProvince |
| 49 | * @property string $monetaryDecimalPoint |
| 50 | * @property string $monetaryThousandSeparator |
| 51 | * @property array fiscalYearStart |
| 52 | */ |
| 53 | class CRM_Core_Config extends CRM_Core_Config_MagicMerge { |
| 54 | |
| 55 | /** |
| 56 | * The handle to the log that we are using |
| 57 | * @var object |
| 58 | */ |
| 59 | private static $_log = NULL; |
| 60 | |
| 61 | /** |
| 62 | * We only need one instance of this object. So we use the singleton |
| 63 | * pattern and cache the instance in this variable |
| 64 | * |
| 65 | * @var CRM_Core_Config |
| 66 | */ |
| 67 | private static $_singleton = NULL; |
| 68 | |
| 69 | /** |
| 70 | * The constructor. Sets domain id if defined, otherwise assumes |
| 71 | * single instance installation. |
| 72 | */ |
| 73 | public function __construct() { |
| 74 | parent::__construct(); |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * Singleton function used to manage this object. |
| 79 | * |
| 80 | * @param bool $loadFromDB |
| 81 | * whether to load from the database. |
| 82 | * @param bool $force |
| 83 | * whether to force a reconstruction. |
| 84 | * |
| 85 | * @return CRM_Core_Config |
| 86 | */ |
| 87 | public static function &singleton($loadFromDB = TRUE, $force = FALSE) { |
| 88 | if (self::$_singleton === NULL || $force) { |
| 89 | $GLOBALS['civicrm_default_error_scope'] = CRM_Core_TemporaryErrorScope::create(['CRM_Core_Error', 'handle']); |
| 90 | $errorScope = CRM_Core_TemporaryErrorScope::create(['CRM_Core_Error', 'simpleHandler']); |
| 91 | |
| 92 | if (defined('E_DEPRECATED')) { |
| 93 | error_reporting(error_reporting() & ~E_DEPRECATED); |
| 94 | } |
| 95 | |
| 96 | self::$_singleton = new CRM_Core_Config(); |
| 97 | \Civi\Core\Container::boot($loadFromDB); |
| 98 | if ($loadFromDB && self::$_singleton->dsn) { |
| 99 | $domain = \CRM_Core_BAO_Domain::getDomain(); |
| 100 | \CRM_Core_BAO_ConfigSetting::applyLocale(\Civi::settings($domain->id), $domain->locales); |
| 101 | |
| 102 | unset($errorScope); |
| 103 | |
| 104 | CRM_Utils_Hook::config(self::$_singleton); |
| 105 | self::$_singleton->authenticate(); |
| 106 | |
| 107 | // Extreme backward compat: $config binds to active domain at moment of setup. |
| 108 | self::$_singleton->getSettings(); |
| 109 | |
| 110 | Civi::service('settings_manager')->useDefaults(); |
| 111 | |
| 112 | self::$_singleton->handleFirstRun(); |
| 113 | } |
| 114 | } |
| 115 | return self::$_singleton; |
| 116 | } |
| 117 | |
| 118 | /** |
| 119 | * Returns the singleton logger for the application. |
| 120 | * |
| 121 | * @deprecated |
| 122 | * @return object |
| 123 | * @see Civi::log() |
| 124 | */ |
| 125 | public static function &getLog() { |
| 126 | if (!isset(self::$_log)) { |
| 127 | self::$_log = Log::singleton('display'); |
| 128 | } |
| 129 | |
| 130 | return self::$_log; |
| 131 | } |
| 132 | |
| 133 | /** |
| 134 | * Retrieve a mailer to send any mail from the application. |
| 135 | * |
| 136 | * @return Mail |
| 137 | * @deprecated |
| 138 | * @see Civi::service() |
| 139 | */ |
| 140 | public static function getMailer() { |
| 141 | return Civi::service('pear_mail'); |
| 142 | } |
| 143 | |
| 144 | /** |
| 145 | * Deletes the web server writable directories. |
| 146 | * |
| 147 | * @param int $value |
| 148 | * 1: clean templates_c, 2: clean upload, 3: clean both |
| 149 | * @param bool $rmdir |
| 150 | */ |
| 151 | public function cleanup($value, $rmdir = TRUE) { |
| 152 | $value = (int ) $value; |
| 153 | |
| 154 | if ($value & 1) { |
| 155 | // clean templates_c |
| 156 | CRM_Utils_File::cleanDir($this->templateCompileDir, $rmdir); |
| 157 | CRM_Utils_File::createDir($this->templateCompileDir); |
| 158 | } |
| 159 | if ($value & 2) { |
| 160 | // clean upload dir |
| 161 | CRM_Utils_File::cleanDir($this->uploadDir); |
| 162 | CRM_Utils_File::createDir($this->uploadDir); |
| 163 | } |
| 164 | |
| 165 | // Whether we delete/create or simply preserve directories, we should |
| 166 | // certainly make sure the restrictions are enforced. |
| 167 | foreach ([ |
| 168 | $this->templateCompileDir, |
| 169 | $this->uploadDir, |
| 170 | $this->configAndLogDir, |
| 171 | $this->customFileUploadDir, |
| 172 | ] as $dir) { |
| 173 | if ($dir && is_dir($dir)) { |
| 174 | CRM_Utils_File::restrictAccess($dir); |
| 175 | } |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | /** |
| 180 | * Verify that the needed parameters are not null in the config. |
| 181 | * |
| 182 | * @param CRM_Core_Config $config (reference) the system config object |
| 183 | * @param array $required (reference) the parameters that need a value |
| 184 | * |
| 185 | * @return bool |
| 186 | */ |
| 187 | public static function check(&$config, &$required) { |
| 188 | foreach ($required as $name) { |
| 189 | if (CRM_Utils_System::isNull($config->$name)) { |
| 190 | return FALSE; |
| 191 | } |
| 192 | } |
| 193 | return TRUE; |
| 194 | } |
| 195 | |
| 196 | /** |
| 197 | * Reset the serialized array and recompute. |
| 198 | * use with care |
| 199 | * |
| 200 | * @deprecated |
| 201 | */ |
| 202 | public function reset() { |
| 203 | // This is what it used to do. However, it hasn't meant anything since 4.6. |
| 204 | // $query = "UPDATE civicrm_domain SET config_backend = null"; |
| 205 | // CRM_Core_DAO::executeQuery($query); |
| 206 | } |
| 207 | |
| 208 | /** |
| 209 | * This method should initialize auth sources. |
| 210 | */ |
| 211 | public function authenticate() { |
| 212 | // make sure session is always initialised |
| 213 | $session = CRM_Core_Session::singleton(); |
| 214 | |
| 215 | // for logging purposes, pass the userID to the db |
| 216 | $userID = $session->get('userID'); |
| 217 | if ($userID) { |
| 218 | CRM_Core_DAO::executeQuery('SET @civicrm_user_id = %1', |
| 219 | [1 => [$userID, 'Integer']] |
| 220 | ); |
| 221 | } |
| 222 | |
| 223 | if ($session->get('userID') && !$session->get('authSrc')) { |
| 224 | $session->set('authSrc', CRM_Core_Permission::AUTH_SRC_LOGIN); |
| 225 | } |
| 226 | |
| 227 | // checksum source |
| 228 | CRM_Contact_BAO_Contact_Permission::initChecksumAuthSrc(); |
| 229 | } |
| 230 | |
| 231 | /** |
| 232 | * One function to get domain ID. |
| 233 | * |
| 234 | * @param int $domainID |
| 235 | * @param bool $reset |
| 236 | * |
| 237 | * @return int|null |
| 238 | */ |
| 239 | public static function domainID($domainID = NULL, $reset = FALSE) { |
| 240 | static $domain; |
| 241 | if ($domainID) { |
| 242 | $domain = $domainID; |
| 243 | } |
| 244 | if ($reset || empty($domain)) { |
| 245 | $domain = defined('CIVICRM_DOMAIN_ID') ? CIVICRM_DOMAIN_ID : 1; |
| 246 | } |
| 247 | |
| 248 | return (int) $domain; |
| 249 | } |
| 250 | |
| 251 | /** |
| 252 | * Function to get environment. |
| 253 | * |
| 254 | * @param string $env |
| 255 | * @param bool $reset |
| 256 | * |
| 257 | * @return string |
| 258 | */ |
| 259 | public static function environment($env = NULL, $reset = FALSE) { |
| 260 | if ($env) { |
| 261 | $environment = $env; |
| 262 | } |
| 263 | if ($reset || empty($environment)) { |
| 264 | $environment = Civi::settings()->get('environment'); |
| 265 | } |
| 266 | if (!$environment) { |
| 267 | $environment = 'Production'; |
| 268 | } |
| 269 | return $environment; |
| 270 | } |
| 271 | |
| 272 | /** |
| 273 | * Do general cleanup of caches, temp directories and temp tables |
| 274 | * @see https://issues.civicrm.org/jira/browse/CRM-8739 |
| 275 | * |
| 276 | * @param bool $sessionReset |
| 277 | */ |
| 278 | public function cleanupCaches($sessionReset = TRUE) { |
| 279 | // cleanup templates_c directory |
| 280 | $this->cleanup(1, FALSE); |
| 281 | |
| 282 | // clear all caches |
| 283 | self::clearDBCache(); |
| 284 | Civi::cache('session')->clear(); |
| 285 | CRM_Utils_System::flushCache(); |
| 286 | |
| 287 | if ($sessionReset) { |
| 288 | $session = CRM_Core_Session::singleton(); |
| 289 | $session->reset(2); |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | /** |
| 294 | * Do general cleanup of module permissions. |
| 295 | */ |
| 296 | public function cleanupPermissions() { |
| 297 | $module_files = CRM_Extension_System::singleton()->getMapper()->getActiveModuleFiles(); |
| 298 | if ($this->userPermissionClass->isModulePermissionSupported()) { |
| 299 | // Can store permissions -- so do it! |
| 300 | $this->userPermissionClass->upgradePermissions( |
| 301 | CRM_Core_Permission::basicPermissions() |
| 302 | ); |
| 303 | } |
| 304 | else { |
| 305 | // Cannot store permissions -- warn if any modules require them |
| 306 | $modules_with_perms = []; |
| 307 | foreach ($module_files as $module_file) { |
| 308 | $perms = $this->userPermissionClass->getModulePermissions($module_file['prefix']); |
| 309 | if (!empty($perms)) { |
| 310 | $modules_with_perms[] = $module_file['prefix']; |
| 311 | } |
| 312 | } |
| 313 | if (!empty($modules_with_perms)) { |
| 314 | CRM_Core_Session::setStatus( |
| 315 | ts('Some modules define permissions, but the CMS cannot store them: %1', [1 => implode(', ', $modules_with_perms)]), |
| 316 | ts('Permission Error'), |
| 317 | 'error' |
| 318 | ); |
| 319 | } |
| 320 | } |
| 321 | } |
| 322 | |
| 323 | /** |
| 324 | * Flush information about loaded modules. |
| 325 | */ |
| 326 | public function clearModuleList() { |
| 327 | CRM_Extension_System::singleton()->getCache()->flush(); |
| 328 | CRM_Utils_Hook::singleton(TRUE); |
| 329 | CRM_Core_PseudoConstant::getModuleExtensions(TRUE); |
| 330 | CRM_Core_Module::getAll(TRUE); |
| 331 | } |
| 332 | |
| 333 | /** |
| 334 | * Clear db cache. |
| 335 | */ |
| 336 | public static function clearDBCache() { |
| 337 | $queries = [ |
| 338 | 'TRUNCATE TABLE civicrm_acl_cache', |
| 339 | 'TRUNCATE TABLE civicrm_acl_contact_cache', |
| 340 | 'TRUNCATE TABLE civicrm_cache', |
| 341 | 'TRUNCATE TABLE civicrm_prevnext_cache', |
| 342 | 'UPDATE civicrm_group SET cache_date = NULL', |
| 343 | 'TRUNCATE TABLE civicrm_group_contact_cache', |
| 344 | 'TRUNCATE TABLE civicrm_menu', |
| 345 | 'UPDATE civicrm_setting SET value = NULL WHERE name="navigation" AND contact_id IS NOT NULL', |
| 346 | ]; |
| 347 | |
| 348 | foreach ($queries as $query) { |
| 349 | CRM_Core_DAO::executeQuery($query); |
| 350 | } |
| 351 | |
| 352 | // also delete all the import and export temp tables |
| 353 | self::clearTempTables(); |
| 354 | } |
| 355 | |
| 356 | /** |
| 357 | * Clear leftover temporary tables. |
| 358 | * |
| 359 | * This is called on upgrade, during tests and site move, from the cron and via clear caches in the UI. |
| 360 | * |
| 361 | * Currently the UI clear caches does not pass a time interval - which may need review as it does risk |
| 362 | * ripping the tables out from underneath a current action. This was considered but |
| 363 | * out-of-scope for CRM-16167 |
| 364 | * |
| 365 | * @param string|bool $timeInterval |
| 366 | * Optional time interval for mysql date function.g '2 day'. This can be used to prevent |
| 367 | * tables created recently from being deleted. |
| 368 | */ |
| 369 | public static function clearTempTables($timeInterval = FALSE) { |
| 370 | |
| 371 | $dao = new CRM_Core_DAO(); |
| 372 | $query = " |
| 373 | SELECT TABLE_NAME as tableName |
| 374 | FROM INFORMATION_SCHEMA.TABLES |
| 375 | WHERE TABLE_SCHEMA = %1 |
| 376 | AND ( |
| 377 | TABLE_NAME LIKE 'civicrm_import_job_%' |
| 378 | OR TABLE_NAME LIKE 'civicrm_report_temp%' |
| 379 | OR TABLE_NAME LIKE 'civicrm_tmp_d%' |
| 380 | ) |
| 381 | "; |
| 382 | // NOTE: Cannot find use-cases where "civicrm_report_temp" would be durable. Could probably remove. |
| 383 | |
| 384 | if ($timeInterval) { |
| 385 | $query .= " AND CREATE_TIME < DATE_SUB(NOW(), INTERVAL {$timeInterval})"; |
| 386 | } |
| 387 | |
| 388 | $tableDAO = CRM_Core_DAO::executeQuery($query, [1 => [$dao->database(), 'String']]); |
| 389 | $tables = []; |
| 390 | while ($tableDAO->fetch()) { |
| 391 | $tables[] = $tableDAO->tableName; |
| 392 | } |
| 393 | if (!empty($tables)) { |
| 394 | $table = implode(',', $tables); |
| 395 | // drop leftover temporary tables |
| 396 | CRM_Core_DAO::executeQuery("DROP TABLE $table"); |
| 397 | } |
| 398 | } |
| 399 | |
| 400 | /** |
| 401 | * Check if running in upgrade mode. |
| 402 | * |
| 403 | * @param string $path |
| 404 | * |
| 405 | * @return bool |
| 406 | */ |
| 407 | public static function isUpgradeMode($path = NULL) { |
| 408 | if (defined('CIVICRM_UPGRADE_ACTIVE')) { |
| 409 | return TRUE; |
| 410 | } |
| 411 | |
| 412 | if (!$path) { |
| 413 | // note: do not re-initialize config here, since this function is part of |
| 414 | // config initialization itself |
| 415 | $urlVar = 'q'; |
| 416 | if (defined('CIVICRM_UF') && CIVICRM_UF == 'Joomla') { |
| 417 | $urlVar = 'task'; |
| 418 | } |
| 419 | |
| 420 | $path = $_GET[$urlVar] ?? NULL; |
| 421 | } |
| 422 | |
| 423 | if ($path && preg_match('/^civicrm\/upgrade(\/.*)?$/', $path)) { |
| 424 | return TRUE; |
| 425 | } |
| 426 | |
| 427 | if ($path && preg_match('/^civicrm\/ajax\/l10n-js/', $path) |
| 428 | && !empty($_SERVER['HTTP_REFERER']) |
| 429 | ) { |
| 430 | $ref = parse_url($_SERVER['HTTP_REFERER']); |
| 431 | if ( |
| 432 | (!empty($ref['path']) && preg_match('/civicrm\/upgrade/', $ref['path'])) || |
| 433 | (!empty($ref['query']) && preg_match('/civicrm\/upgrade/', urldecode($ref['query']))) |
| 434 | ) { |
| 435 | return TRUE; |
| 436 | } |
| 437 | } |
| 438 | |
| 439 | return FALSE; |
| 440 | } |
| 441 | |
| 442 | /** |
| 443 | * Is back office credit card processing enabled for this site - ie are there any installed processors that support |
| 444 | * it? |
| 445 | * This function is used for determining whether to show the submit credit card link, not for determining which processors to show, hence |
| 446 | * it is a config var |
| 447 | * @return bool |
| 448 | */ |
| 449 | public static function isEnabledBackOfficeCreditCardPayments() { |
| 450 | return CRM_Financial_BAO_PaymentProcessor::hasPaymentProcessorSupporting(['BackOffice']); |
| 451 | } |
| 452 | |
| 453 | /** |
| 454 | * @deprecated |
| 455 | */ |
| 456 | public function addressSequence() { |
| 457 | CRM_Core_Error::deprecatedFunctionWarning('CRM_Utils_Address::sequence(Civi::settings()->get(\'address_format\')'); |
| 458 | return CRM_Utils_Address::sequence(Civi::settings()->get('address_format')); |
| 459 | } |
| 460 | |
| 461 | /** |
| 462 | * @deprecated |
| 463 | */ |
| 464 | public function defaultContactCountry() { |
| 465 | CRM_Core_Error::deprecatedFunctionWarning('CRM_Core_BAO_Country::defaultContactCountry'); |
| 466 | return CRM_Core_BAO_Country::defaultContactCountry(); |
| 467 | } |
| 468 | |
| 469 | /** |
| 470 | * @deprecated |
| 471 | */ |
| 472 | public function defaultContactCountryName() { |
| 473 | CRM_Core_Error::deprecatedFunctionWarning('CRM_Core_BAO_Country::defaultContactCountryName'); |
| 474 | return CRM_Core_BAO_Country::defaultContactCountryName(); |
| 475 | } |
| 476 | |
| 477 | /** |
| 478 | * @deprecated |
| 479 | * |
| 480 | * @param string $defaultCurrency |
| 481 | * |
| 482 | * @return string |
| 483 | */ |
| 484 | public function defaultCurrencySymbol($defaultCurrency = NULL) { |
| 485 | CRM_Core_Error::deprecatedFunctionWarning('CRM_Core_BAO_Country::defaultCurrencySymbol'); |
| 486 | return CRM_Core_BAO_Country::defaultCurrencySymbol($defaultCurrency); |
| 487 | } |
| 488 | |
| 489 | /** |
| 490 | * Resets the singleton, so that the next call to CRM_Core_Config::singleton() |
| 491 | * reloads completely. |
| 492 | * |
| 493 | * While normally we could call the singleton function with $force = TRUE, |
| 494 | * this function addresses a very specific use-case in the CiviCRM installer, |
| 495 | * where we cannot yet force a reload, but we want to make sure that the next |
| 496 | * call to this object gets a fresh start (ex: to initialize the DAO). |
| 497 | */ |
| 498 | public function free() { |
| 499 | self::$_singleton = NULL; |
| 500 | } |
| 501 | |
| 502 | /** |
| 503 | * Conditionally fire an event during the first page run. |
| 504 | * |
| 505 | * The install system is currently implemented several times, so it's hard to add |
| 506 | * new installation logic. We use a makeshift method to detect the first run. |
| 507 | * |
| 508 | * Situations to test: |
| 509 | * - New installation |
| 510 | * - Upgrade from an old version (predating first-run tracker) |
| 511 | * - Upgrade from an old version (with first-run tracking) |
| 512 | */ |
| 513 | public function handleFirstRun() { |
| 514 | // Ordinarily, we prefetch settings en masse and find that the system is already installed. |
| 515 | // No extra SQL queries required. |
| 516 | if (Civi::settings()->get('installed')) { |
| 517 | return; |
| 518 | } |
| 519 | |
| 520 | // Q: How should this behave during testing? |
| 521 | if (defined('CIVICRM_TEST')) { |
| 522 | return; |
| 523 | } |
| 524 | |
| 525 | // If schema hasn't been loaded yet, then do nothing. Don't want to interfere |
| 526 | // with the existing installers. NOTE: If we change the installer pageflow, |
| 527 | // then we may want to modify this behavior. |
| 528 | if (!CRM_Core_DAO::checkTableExists('civicrm_domain')) { |
| 529 | return; |
| 530 | } |
| 531 | |
| 532 | // If we're handling an upgrade, then the system has already been used, so this |
| 533 | // is not the first run. |
| 534 | if (CRM_Core_Config::isUpgradeMode()) { |
| 535 | return; |
| 536 | } |
| 537 | $dao = CRM_Core_DAO::executeQuery('SELECT version FROM civicrm_domain'); |
| 538 | while ($dao->fetch()) { |
| 539 | if ($dao->version && version_compare($dao->version, CRM_Utils_System::version(), '<')) { |
| 540 | return; |
| 541 | } |
| 542 | } |
| 543 | |
| 544 | // The installation flag is stored in civicrm_setting, which is domain-aware. The |
| 545 | // flag could have been stored under a different domain. |
| 546 | $dao = CRM_Core_DAO::executeQuery(' |
| 547 | SELECT domain_id, value FROM civicrm_setting |
| 548 | WHERE is_domain = 1 AND name = "installed" |
| 549 | '); |
| 550 | while ($dao->fetch()) { |
| 551 | $value = CRM_Utils_String::unserialize($dao->value); |
| 552 | if (!empty($value)) { |
| 553 | Civi::settings()->set('installed', 1); |
| 554 | return; |
| 555 | } |
| 556 | } |
| 557 | |
| 558 | // OK, this looks new. |
| 559 | Civi::dispatcher()->dispatch('civi.core.install', new \Civi\Core\Event\SystemInstallEvent()); |
| 560 | Civi::settings()->set('installed', 1); |
| 561 | } |
| 562 | |
| 563 | /** |
| 564 | * Is the system permitted to flush caches at the moment. |
| 565 | */ |
| 566 | public static function isPermitCacheFlushMode() { |
| 567 | return !CRM_Core_Config::singleton()->doNotResetCache; |
| 568 | } |
| 569 | |
| 570 | /** |
| 571 | * Set cache clearing to enabled or disabled. |
| 572 | * |
| 573 | * This might be enabled at the start of a long running process |
| 574 | * such as an import in order to delay clearing caches until the end. |
| 575 | * |
| 576 | * @param bool $enabled |
| 577 | * If true then caches can be cleared at this time. |
| 578 | */ |
| 579 | public static function setPermitCacheFlushMode($enabled) { |
| 580 | CRM_Core_Config::singleton()->doNotResetCache = $enabled ? 0 : 1; |
| 581 | } |
| 582 | |
| 583 | } |