config_load in template files causing is_cached() to always return false

From: Date: Thu, 23 May 2002 19:39:41 +0000
Subject: config_load in template files causing is_cached() to always return false
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-4387@lists.php.net to get a copy of this message
Hi all, Has anyone experienced that is_cache() always returns false if the template file has a config_load line in it? As far as I can tell, this problems only occurs if you don't use the default template directories (see below). For security reasons, I set the template, cache, config and compile directories to a location off the web server document root. See comments (*) Running on Windows2000, smarty 2.1.1 <<<<<<<<<<<<<<<<<<<<<<< test.tpl { config_load file=_test.conf } <HTML> {include file="header.tpl"} .. {include file="footer.tpl"} </HTML> <<<<<<<<<<<<<<<<<<<<<<< test.php $test = new Smarty(); $test->template_dir = "c:\\test\\template_dir\\"; $test->compile_dir = "c:\\test\\compile_dir\\"; $this->config_dir = "c:\\test\\config_dir\\"; $this->cache_dir = "c:\\test\\cache_dir\\"; $this->compile_check = true $this->caching = 1; $this->cache_lifetime = 4000; if (!$test->is_cached("test.tpl")) { (*) As stated, is_cached() will always return false. Note that if I remove the config_load line, is_cached behaves as expected, that is, only returns false when either test.tpl, header.tpl, footer.tpl are edited; once you call display(), is_cached() returns true. // data fetching from database $test->assign(.... } $test->display("test.tpl"); <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Many thanks to everyone involved in this wonderful engine!! Adios Ubaldo

« previous php.smarty.general (#4387) next »