Merge pull request #15558 from eileenmcnaughton/report_page519
[civicrm-core.git] / CRM / Core / Smarty.php
index 06b05313e3c301d78830dff102ef5a9f4b28ade9..bef5152c5770252d70a6d770d9e0591e5ae9a0a8 100644 (file)
@@ -73,7 +73,11 @@ class CRM_Core_Smarty extends Smarty {
   static private $_singleton = NULL;
 
   /**
-   * @var array (string $name => mixed $value) a list of variables ot save temporarily
+   * Backup frames.
+   *
+   * A list of variables ot save temporarily in format (string $name => mixed $value).
+   *
+   * @var array
    */
   private $backupFrames = [];
 
@@ -140,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();
 
@@ -336,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);
+  }
+
 }