Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Wont display cached version

 
Post new topic   Reply to topic    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
idxman01
Smarty Rookie


Joined: 10 Jun 2003
Posts: 14
Location: FL

PostPosted: Fri Jun 20, 2003 4:14 am    Post subject: Wont display cached version Reply with quote

...This has to be something simple I'm overlooking or an incompatibility between PHP versions.

I've been testing out Smarty and its caching with some of my programs at work and its great. So I cvsup and go to do some dev at home and it never shows the cached copy. Although if I look at the cached file after each view, I can see that its changing and that all the timestamps are correct. Any ideas?

Work: FreeBSD 4.7-RELEASE, Apache 1.3.27, PHP 4.2.3
Home: FreeBSD 4.4-STABLE, Apache 1.3.27_5, PHP 4.3.2

Smarty 2.5.0

Here's a simple example:

Code:

<?php

  require_once 'Smarty.class.php';

  $tpl = new Smarty;

  $tpl->template_dir = '.';
  $tpl->cache_dir    = './cache';
  $tpl->compile_dir  = './tpl_c';

  $tpl->caching      = 2;
  $tpl->cache_lifetime = 30;


  if (! $tpl->is_cached('1.tpl')) {
     $tpl->assign('foo', date('M d, Y -- H:i:s'));
  }

  $tpl->display('1.tpl');

?>


Code:
{$foo}



-r
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Fri Jun 20, 2003 4:53 am    Post subject: Reply with quote

does flushing the cache and template_c directories help?
Back to top
View user's profile Send private message
idxman01
Smarty Rookie


Joined: 10 Jun 2003
Posts: 14
Location: FL

PostPosted: Fri Jun 20, 2003 5:09 am    Post subject: Reply with quote

I wish it did help. I've flushed both directories a few dozen times tonight while testing.. Just makes no sense since the same code works at work. (maybe its trying to tell me to keep work at work Very Happy )

-r
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Fri Jun 20, 2003 11:19 pm    Post subject: Reply with quote

What errors are you getting? You also flushed your PHP accelerator cache?
Back to top
View user's profile Send private message
idxman01
Smarty Rookie


Joined: 10 Jun 2003
Posts: 14
Location: FL

PostPosted: Sun Jun 22, 2003 9:07 pm    Post subject: Reply with quote

Not using PHPA at home and I'll have to get back to you next week on the errors. (vacation w00t!)

It wont load the debug template and gives weird errors on basic items like a cycle statement...

-r
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP