Skip to content

Commit

Permalink
Merge pull request #14706 from ixiam/dev-SmartyCompiled
Browse files Browse the repository at this point in the history
expose smarty's compile_check to be overridden in civicrm.settings.php
  • Loading branch information
eileenmcnaughton authored Jul 9, 2019
2 parents 2c53b6a + d938f49 commit bf6a7db
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
12 changes: 12 additions & 0 deletions CRM/Core/Smarty.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ private function initialize() {
$this->plugins_dir = [$smartyDir . 'plugins', $pluginsDir];
}

$this->compile_check = $this->isCheckSmartyIsCompiled();

// add the session and the config here
$session = CRM_Core_Session::singleton();

Expand Down Expand Up @@ -340,4 +342,14 @@ private function getLocale() {
return 'en_US';
}

/**
* Get the compile_check value.
*
* @return bool
*/
private function isCheckSmartyIsCompiled() {
// check for define in civicrm.settings.php as FALSE, otherwise returns TRUE
return CRM_Utils_Constant::value('CIVICRM_TEMPLATE_COMPILE_CHECK', TRUE);
}

}
15 changes: 15 additions & 0 deletions templates/CRM/common/civicrm.settings.php.template
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,21 @@ if (!defined('CIVICRM_TEMPLATE_COMPILEDIR')) {
define( 'CIVICRM_TEMPLATE_COMPILEDIR', '%%templateCompileDir%%');
}

/**
* SMARTY Compile Check:
*
* This tells Smarty whether to check for recompiling or not. Recompiling
* does not need to happen unless a template or config file is changed.
* Typically you enable this during development, and disable for production.
*
* Related issue:
* https://lab.civicrm.org/dev/core/issues/1073
*
*/
//if (!defined('CIVICRM_TEMPLATE_COMPILE_CHECK')) {
// define( 'CIVICRM_TEMPLATE_COMPILE_CHECK', FALSE);
//}

/**
* Site URLs:
*
Expand Down

0 comments on commit bf6a7db

Please sign in to comment.