feulf / raintpl3

The easiest Template Engine for PHP
https://feulf.github.io/raintpl
258 stars 57 forks source link

Template checksum should include registered tags #110

Open okaresz opened 11 years ago

okaresz commented 11 years ago

The registered tags (and maybe plugins also) should be part of the checksum generating / checking process.

Now, as the checksum only contains the config array, If I draw the template with different set of registered tags, it will NOT be re-parsed.

okaresz commented 11 years ago

Also, Tpl::$conf['registered_tags'] is not used anywhere in the code. Deprecated?

feulf commented 11 years ago

that's right, we should do the checksum for both, and yes we can remove register tag: https://github.com/rainphp/raintpl3/blob/master/library/Rain/Tpl.php#L41

okaresz commented 11 years ago

The callback hashing is not trivial, but spl_object_hash is a solution (something like this ) I could propose a pull request, but I'm not so familiar with the very recent updates in the master branch..

feulf commented 11 years ago

Cool, I'll look at it and fix this soon!