Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
isCached method returning empty result
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
demo055
Smarty Rookie


Joined: 08 Apr 2013
Posts: 12

PostPosted: Mon Apr 29, 2013 2:25 pm    Post subject: Reply with quote

i agree it's very strange. I am using smarty 3.1.13. But same behaviour was also in older version of smarty.
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Mon Apr 29, 2013 6:11 pm    Post subject: Reply with quote

Do you perhaps extend the template class by setting $smarty->template_class and overload Smarty's isCache() method?

Otherwise I have currently no more idea's what went wrong in your system.
Back to top
View user's profile Send private message
demo055
Smarty Rookie


Joined: 08 Apr 2013
Posts: 12

PostPosted: Fri May 10, 2013 8:28 am    Post subject: Reply with quote

nope... just hypotetically is there some way isCached can return empty result? I swear i do not alternate your code...
Back to top
View user's profile Send private message
demo055
Smarty Rookie


Joined: 08 Apr 2013
Posts: 12

PostPosted: Fri May 10, 2013 8:43 am    Post subject: Reply with quote

ok i used ReflectionMethod to find out source code of isCached method... maybe helps...

Code:
public function isCached($template = null, $cache_id = null, $compile_id = null, $parent = null) { if ($template === null && $this instanceof $this->template_class) { return $this->cached->valid; } if (!($template instanceof $this->template_class)) { if ($parent === null) { $parent = $this; } $template = $this->smarty->createTemplate($template, $cache_id, $compile_id, $parent, false); } // return cache status of template return $template->cached->valid; }
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Fri May 10, 2013 9:12 am    Post subject: Reply with quote

Set your error_reporting level and that in smarty->error_reporting to E_ALL and see if you get notices...

Do you use the standard smarty_internal_cacheresource_file or some thing different? Have you a chance to use the debugger and see what object is loaded at $this->cached and there is a property ->valid?
Back to top
View user's profile Send private message
demo055
Smarty Rookie


Joined: 08 Apr 2013
Posts: 12

PostPosted: Sat May 11, 2013 7:44 pm    Post subject: Reply with quote

ok... this is very strange... i don't know what i did, but magically it's working... maybe deleting all the files in templates_c directory... maybe something else...
Back to top
View user's profile Send private message
demo055
Smarty Rookie


Joined: 08 Apr 2013
Posts: 12

PostPosted: Sat May 11, 2013 7:55 pm    Post subject: Reply with quote

the problem is, that i deleted templates_c before, but memcache was activated... when i turn it off and deleted that directory it started to work... but question is why memcache is not working... i must not specify the cache directory?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Bugs All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
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