RE:RE caching problem
| From: | Monte Ohrt | Date: | Wed, 27 Feb 2002 22:21:45 +0000 |
| Subject: | RE:RE caching problem | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-2885@lists.php.net to get a copy of this message | ||
I'm not sure what is happening here, but if there is only one cache
file, then that means it thinks you are asking for the same cache each
time. I'd debug is_cached() and see what it is doing with the
$REQUEST_URI to make it think that it should check the same cache file
each time.
atu wrote:
>
> But, may the problem is here:
>
> Thats the really index.php file. You can see there is a function wich include some code
> depending of a variable.
>
> <?php
>
> function include_main_code(){
> global $link;
> if($link == "phparchive"){
> include("sitefiles/phparchive.htm");
> }
> else if($link == "forum"){
> include("../phorum-3.3/admin/settings/forums.php");
> }
> else{
> $link_db=1;
> include("phparchive/php_a_config.php");
> }
> }
>
> require("smarty/Smarty.class.php");
>
> $smarty = new Smarty;
>
> $smarty->caching=true;
> $smarty->compile_check = true;
> $smarty->debugging = false;
> $GLOBALS['REQUEST_URI'];
>
> $tpl ="index.tpl";
>
> echo $REQUEST_URI;//--test if request changed for differnt db calls
>
> if(!$smarty->is_cached($tpl,$REQUEST_URI)){
>
> if($link)
> $smarty->assign("home", "<a href=\"index.php\">
> Home</a>");
> else
> $smarty->assign("home", "Home");
>
> if($link != "phparchive")
> $smarty->assign("phparchive_project","<a
> href=\"$PHP_SELF?link=phparchive\">php_archive</a>");
> else
> $smarty->assign( "phparchive_project","<font
> color=\"#663366\"><b>php_archive</b></font>");
>
> if($link != "maketable")
> $smarty->assign("maketable","<a
> href=\"$PHP_SELF?link=maketable\">maketable</a>");
> else
> $smarty->assign( "maketable","<font
> color=\"#663366\"><b>maketable</b></font>");
>
> if($link != "addtag")
> $smarty->assign("addtag","<a
> href=\"$PHP_SELF?link=addtag\">addtag</a>");
> else
> $smarty->assign( "addtag","<font
> color=\"#663366\"><b>addtag</b></font>");
>
> if($link != "forum")
> $smarty->assign("forum","<a
> href=\"$PHP_SELF?link=forum\">forum</a>");
> else
> $smarty->assign( "forum","<font
> color=\"#663366\"><b>forum</b></font>");
>
> $smarty->register_function("include_main","include_main_code");
>
> $smarty->assign(
> "phpbuilder",implode("",(@file("include/phpbuilder.com.php"))));
> $smarty->assign(
> "xmlcom",implode("",(@file("include/xml.com.php"))));
> $smarty->assign(
> "w3org",implode("",(@file("include/w3.org.php"))));
> $smarty->assign(
> "wired",implode("",(@file("include/wired.com.php"))));
> $smarty->assign(
> "bbc",implode("",(@file("include/bbc.com.php"))));
>
> }
>
> $smarty->display($tpl,$REQUEST_URI);
>
> ?>
>
> ---
> You are currently subscribed to smarty as: monte@ispi.net
> To unsubscribe send a blank email to $subst('Email.Unsub')
> Visit Smarty's homepage at
> http://www.phpinsider.com/php/code/Smarty/
--
Monte Ohrt <monte@ispi.net>
Director of Technology, ispi Inc.