Re: 0 byte compiled templates
| From: | Monte Ohrt | Date: | Fri, 28 Dec 2001 14:31:10 +0000 |
| Subject: | Re: 0 byte compiled templates | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-2403@lists.php.net to get a copy of this message | ||
Are you on a windows system? I've seen this problem where windows PHP
doesn't support file locking correctly and you get zero byte files.
Marc Logemann wrote:
>
> Hi,
>
> sometimes i have 0 bytes compiled templates in my templates_c
> directory. (not directly in templates_c of course...you know...)
>
> So when users request this template, smarty looks for the timestamp
> of the compiled template and if not changed return the compiled
> template to the user.
>
> The problem is, a 0 byte template results in a blank screen of course.
> The problem: i dont know why there are sometimes 0 byte files.
>
> Possible solution:
> it would be nice if smarty would recompile if there is a 0bytes file
> whether or not the timestamp is correct.
>
> Your code:
>
> function _fetch_compiled_template_timestamp($include_path)
> {
> // everything is in $compile_dir
> return filemtime($include_path);
> }
>
> what about something like this:
>
> function _fetch_compiled_template_timestamp($include_path)
> {
> // everything is in $compile_dir
>
> if(compiled_file != 0bytes)
> return filemtime($include_path);
> else
> return 0;
> }
>
> This way the template will recompile when it is 0 bytes.
>
> Its only a very quick workaround, i know it would be better
> to tackle the problem on its root (why there are 0 bytes files).
>
> ---
> You are currently subscribed to smarty as: monte@ispi.net
> To unsubscribe send a blank email to $subst('Email.Unsub')
> Visit Smarty's homepage at
> http://www.phpinsider.com/php/code/Smarty/
--
Monte Ohrt <monte@ispi.net>
http://www.ispi.net/