namesco / ZTal

ZTal makes integrating the PHP templating system PHPTAL into Zend Framework easy.
Other
21 stars 3 forks source link

setCachePurgeMode #8

Closed kornelski closed 13 years ago

kornelski commented 13 years ago

Ztal_Tal_View::setCachePurgeMode seems to replicate PHPTAL's setForceReparse or cleanUpGarbage.

Is there a reason why you're not using PHPTAL's built-in methods?

far-blue commented 13 years ago

setForceReparse does not remove old templates but simply tells PHPTAL to ignore the compiled templates and compile new each time. cleanUpGarbage only clears out templates that are older than a specified number of days set by the cacheLifetime methods. In comparison, setCachePurgeMode cleans out all templates before then compiling and rendering the requested template (or set of templates). The new method provides an easy way during development to clear out all the old templates and yet also see the compilation results from a page hit without needing to change cache lifetimes and is most useful during Tale development.

kornelski commented 13 years ago

I see, but is cleaning all files, as opposed to just ignoring them, really important?

I'm wondering if PHPTAL should provide this "natively" if that makes significant difference from setForceReparse().