Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

cache_handler_func

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
t3hAndy
Smarty Rookie


Joined: 10 Sep 2008
Posts: 12

PostPosted: Thu Nov 26, 2009 3:43 pm    Post subject: cache_handler_func Reply with quote

Hi,

I am missing the cache_handler_func
How could I find this functionality on smarty 3.0?
_________________
I developed a Webradio
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Fri Nov 27, 2009 12:02 am    Post subject: Reply with quote

A couple of Smarty3 caching features could not work with Smarty2's implementation of the cache_handler_func. Smarty3 does use resources for cache handling. Currently the default file cache resource is implemented. (smarty_cacheresource_file.php)

I will provide during the next couple of days an example for the implementation of other resources.
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Fri Nov 27, 2009 8:51 pm    Post subject: Reply with quote

I have added a cache resource plugin for MYSQL to the SVN.
The file name is cacheresource.myql.php.

It can be enabled with:
$smarty->caching_type = 'mysql';

This could be taken as example how to write custom cache resources.
Back to top
View user's profile Send private message
t3hAndy
Smarty Rookie


Joined: 10 Sep 2008
Posts: 12

PostPosted: Wed Jan 06, 2010 1:53 pm    Post subject: Reply with quote

Where could I download this file?
_________________
I developed a Webradio
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Wed Jan 06, 2010 3:36 pm    Post subject: Reply with quote

Currently you will find the example on our experimental wiki.

http://dev.smarty.net/wiki/index.php/Example_Code
Back to top
View user's profile Send private message
ezmil
Smarty Rookie


Joined: 06 Feb 2010
Posts: 6

PostPosted: Sat Feb 06, 2010 3:37 pm    Post subject: Reply with quote

I tried to save the wiki code as 'smarty_internal_cacheresource_mysql.php' in sysplugins directory, didn't work.

Can you tell where to put the wiki code and which name to use to save the file?
Do I need to do anything else? Some 'register' stuff maybe?

Thx, a lot
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sat Feb 06, 2010 4:27 pm    Post subject: Reply with quote

The code must be stored as cacheresource.mysql.php in the plugins folder.
Back to top
View user's profile Send private message
ezmil
Smarty Rookie


Joined: 06 Feb 2010
Posts: 6

PostPosted: Sat Feb 06, 2010 6:29 pm    Post subject: Reply with quote

thx,

works so far ... but a method is missing (102):

Code:

if (!$template->isEvaluated()) { ... }


isEvaluated - renamed or gone forever?
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sat Feb 06, 2010 6:39 pm    Post subject: Reply with quote

Due to some recent change it must be:

Code:
if (!$template->resource_object->isEvaluated) { ... }
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty 3 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