Merge pull request #15558 from eileenmcnaughton/report_page519
[civicrm-core.git] / CRM / Core / Smarty.php
index bea2363ddd05309656741de04921dd048919951b..bef5152c5770252d70a6d770d9e0591e5ae9a0a8 100644 (file)
@@ -144,6 +144,8 @@ class CRM_Core_Smarty extends Smarty {
       $this->plugins_dir = [$smartyDir . 'plugins', $pluginsDir];
     }
 
+    $this->compile_check = $this->isCheckSmartyIsCompiled();
+
     // add the session and the config here
     $session = CRM_Core_Session::singleton();
 
@@ -340,4 +342,14 @@ class CRM_Core_Smarty extends Smarty {
     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);
+  }
+
 }