caching problem
| From: | atu | Date: | Thu, 28 Feb 2002 22:46:23 +0000 |
| Subject: | caching problem | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-2898@lists.php.net to get a copy of this message | ||
Hi,
Befor 2 days, I posted some messages on a caching problem. After several tests I found out where was
the problem. In my project I have changed the directory structure like this:
cache
config
smarty
templates
templates_c
imdex.php
In the directory "smarty" I saved all the smarty core files.
Config_File.class.php
Smarty.addons.php
Smarty.class.php
Smarty_Compiler.class.php
In the Smarty.class.php file I changed the path to:
define('SMARTY_DIR', 'smarty/');
Every thing sems working fine but the cache produce only one single file even if the $request_uri
have changed in is_cached($tpl,$REQUEST_URI).
The following test code is the index.php file, and it should produce on every request an other cache
file. But it did not work. If I put the same code with the directory structure delivered with the
original smarty it works fine. Where is the problem???
<?php
require("smarty/Smarty.class.php");
$smarty = new Smarty;
$smarty->compile_check = true;
$smarty->debugging = true;
$smarty->caching = true;
$GLOBALS['REQUEST_URI'];
$tpl ="index.tpl";
mt_srand((double) microtime()*1000000);
$id = md5(str_replace(".","",$REMOTE_ADDR) + mt_rand(100000,999999));
if(!$smarty->is_cached($tpl,$REQUEST_URI)){
$smarty->assign("home", "<a href=\"index.php?id=$id\">click
me</a>");
}
$smarty->display($tpl,$REQUEST_URI);
?>