Re: [SMARTY-DEV] Clear templates and cache

[email protected] ("Mark Rogers")
Newsgroups php.smarty.dev
Organization Quarella Ltd
Message-ID <03e001c465aa$a7248290$b4cefea9@mark>
pete M writes:

> Following on from the opcode posting....
>
> One of the little niggles in upgrading Smarty is having to clear the
> templates_c and cache directories.
>
> The following postings by boots and Jan Rosier seem to resolve the
> problem. Could this not go in the official Smarty ??

This first (to my recollection) came up on the general list just over a year
ago (I posted some code to do this on the 27th March 2003). I have been
using this method ever since.

The argument against adding it to Smarty as a default action is that it
requires an extra filesystem call on each page load. This has never been a
problem to me, and the code has been extremely helpful. (Also, each project
on my server has a local copy of Smarty which is a symlink into an archive
of various versions of Smarty, so to change from one version to another I
simply replace the symlink and everything else is automatic, although I do
now need to investigate the op-code caching issues Monte raised.) Being able
to quickly delete the complete compiled file cache simply by deleting the
version check file is somthing else I find very hand on occassion (this is a
useful side effect of the way the code works).

My personal view is that the default install should do this, but with an
easy (documented) way to turn it off. Anyone planning to use Smarty in a
serious environment (ie where the overhead of an extra filesystem call per
page is significant) would be a fool if they did so without reading the
documentation! On the other hand, I can well understand that new users do
not read and digest everything when they first dip their toe into Smarty
waters, and this kind of problem helps to limit the accessibility of Smarty
to new users (which I think to be a bad thing).

-- 
Mark Rogers,
More Solutions Ltd :: Tel: 0845 45 89 555
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.