Re: [SMARTY-DEV] smarty recompiling with op-code accelerators

[email protected] ("Jan Rosier")
Newsgroups php.smarty.dev
Message-ID <005d01c46592$7e954980$8f00a8c0@victoria>
Monte Ohrt wrote:
> Robert Amos wrote:
>
>>
>>>> IMHO, the compiled Smarty files should get a new timestamp, not
>>>> the same one as the originating template file. If you dump
>>>> template files from another server, it should be operational
>>>> procedure to touch them to be sure Smarty picks up the changes.
>>>
>>> this would mean we should remove the touch()-call in
>>> core.wrtie_file.php?  i have no problem with that.
>>
>>
>> I'll agree with that, if the template is changed its mtime will still
>> be more recent than the compiled version, so it will recompile.
>>
>> That should fix the accelerator problem also right? since the
>> compiled template assumes the compiled time, it will be different
>> than the templates you just cleared..
>>
>> -bok
>
>
> Yes that would clear up the problem. The only issue it introduces is
> if you are someone that dumps your template files (via RPM , tarball,
> etc.) from a developer server and expect the files to recompile if the
> timestamp has changed whatsoever (newer or older)

I assume they have shell access to dump the template files. Running the
following command after dumping the template files will make sure that the
files recompile

find /path/to/templates -name '*\.tpl' -type f -exec touch {} \;

or in php: $smarty->clear_compiled_tpl();

Anyway I think that is less a pain, than clearing the accelerator opcode
cache and/or restarting the webserver what must users can't do on a
production server and have to ask from the sysadmin.

So +1 for removing the touch()-call in core.wrtie_file.php

Greetings,
Jan Rosier

* Frisbeetarianism: The belief that when you die, your soul goes up on
the roof and gets stuck. *
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.