Add a parameter to allow recompilation of templates that changed when not
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 1 Feb 2009 15:48:08 +0000 (16:48 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 1 Feb 2009 15:48:08 +0000 (16:48 +0100)
in debug mode.

Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
classes/plglobals.php
classes/plpage.php

index 5185836..9818db1 100644 (file)
@@ -64,6 +64,12 @@ class PlGlobals
                                // 'r'  => read/only
                                // ''   => site down
 
+    /** Tell smarty to check the timestamps of the templates to decide
+     * whether recompile the template or not. If this option is false and
+     * debug mode is not activate, templates won't be recompile if they changed.
+     */
+    public $smarty_autocompile = false;
+
     /** BaseURL of the site.
      * This is read from the HTTP headers if available but you MUST give a
      * default value for this field in you configuration file (because, this
index 234cdb1..cc932a6 100644 (file)
@@ -49,7 +49,7 @@ abstract class PlPage extends Smarty
                       $globals->spoolroot . '/plugins/');
         $this->config_dir    = $globals->spoolroot . '/configs/';
 
-        $this->compile_check = !empty($globals->debug);
+        $this->compile_check = !empty($globals->debug) || $globals->smarty_autocompile;
 
         $this->_errors    = array('errors' => array());
         $this->_jsonVars  = array();