]> git.andy128k.dev Git - ipf-template.git/commitdiff
configurable debug mode for filesystem environment
authorAndrey Kutejko <andy128k@gmail.com>
Tue, 30 Jul 2013 20:29:34 +0000 (23:29 +0300)
committerAndrey Kutejko <andy128k@gmail.com>
Tue, 30 Jul 2013 20:29:34 +0000 (23:29 +0300)
ipf/template/environment/filesystem.php

index 5f053ed3da0bbd7cdca1971ad0ff07fff67a9efa..42c3aa5b8f0c36a4750d6484d01474d2397b056c 100644 (file)
@@ -4,6 +4,7 @@ class IPF_Template_Environment_FileSystem extends IPF_Template_Environment
 {
     public $folders = array();
     public $cache = '';
+    public $debug = false;
 
     public function __construct($folders, $cache)
     {
@@ -29,7 +30,7 @@ class IPF_Template_Environment_FileSystem extends IPF_Template_Environment
     {
         $_tmp = var_export($this->folders, true);
         $filename = $this->cache.'/IPF_Template-'.md5($_tmp.(string)$template).'.phps';
-        if (IPF::get('debug') or !file_exists($filename)) {
+        if ($this->debug or !file_exists($filename)) {
             $this->write($filename, $template->compile());
         }
         return $filename;