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

Is it possible to get cache mtime?

 
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 -> General
View previous topic :: View next topic  
Author Message
orao
Smarty Rookie


Joined: 23 Dec 2009
Posts: 20

PostPosted: Wed Feb 11, 2015 4:06 pm    Post subject: Is it possible to get cache mtime? Reply with quote

Hi,
Is it possible to get file_mtime of cached template?

example:
I need to find out know when the cache file for "index.tpl" with cache_id "123" was created?

Thanks
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Wed Feb 11, 2015 6:09 pm    Post subject: Reply with quote

You don't need to know it. Please. Don't create more issues than what you can solve.
All you need to know, is if there's valid cache for given template/cacheId/compileId (means, Smarty::isCached()), nothing more.
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Wed Feb 11, 2015 9:43 pm    Post subject: Reply with quote

To answer the original question

Code:
$tpl = $smarty->createTemplate('index.tpl','123');
$mtime = $tpl->cached->timestamp;
Back to top
View user's profile Send private message
orao
Smarty Rookie


Joined: 23 Dec 2009
Posts: 20

PostPosted: Fri Apr 03, 2015 3:29 pm    Post subject: Reply with quote

Thank you, U.Tews
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 -> 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