Re: [SMARTY-DEV] Templates not getting recompiled
| From: | sweatjejm at mchsi dot com | Date: | Tue, 29 Oct 2002 15:32:24 +0000 |
| Subject: | Re: [SMARTY-DEV] Templates not getting recompiled | ||
| Groups: | php.smarty.dev | ||
| Request: | Send a blank email to php-smarty-dev+get-305@lists.php.net to get a copy of this message | ||
Could the names for the compiled templates be changed to
include either the source file timestamp or some sort of
CRC on the source file?
> On Tue, 2002-10-29 at 09:22, Monte Ohrt wrote:
> > Does this behavior sound like it would be a problem for any situation?
>
> I don't think so, as this makes the test more accurate. Ideally, you
> would be put the mtime of the source file in the compiled file, but this
> means you have to stat the compiled file for existence, open it, and
> then read the source mtime, which is a very expensive procedure compared
> to stat(). When it comes right down to it, Smarty should not really
> care about when the template was compiled, what is should care about is
> whether the current template source is different from the source that
> the current compiled version represents.
>
> I think that this change should work in all cases. The only issue I can
> think of is that touch() might not work on some platform. I don't know
> of any platforms which don't support touch, so I don't think this will
> be a problem. Worst case, touch fails and you get the current behavior.
>
> Thanks.
> Peter
>
> > On Mon, 2002-10-28 at 22:42, Peter Bowen wrote:
> > > The attached patch fixes this by setting the mtime of the compiled
> > > version to the mtime of the original file.
>
>
>
> --
> Smarty Development Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>