Re: How does compiling work?
| From: | Andrei Zmievski | Date: | Fri, 28 Dec 2001 22:16:10 +0000 |
| Subject: | Re: How does compiling work? | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-2421@lists.php.net to get a copy of this message | ||
On Fri, 28 Dec 2001, Brian E. Lozier wrote:
> How can a compiled system such as this work? Is it doing all my database calls twice? Is it
> rebuilding the
> compiled template on each invocation of the script?
>
> If I've got an index.php which contains something like:
>
> $tpl = new Smarty;
>
> $dbInfo = mysql_fetch_row();
> $tpl->assign('DBInfo', $dbInfo);
>
> $tpl->display('main.tpl');
>
> It doesn't seem like it has a chance to just use the compiled template BEFORE executing
> all the logic in the
> main script. So the question is, is it doing all the db calls first, then seeing the compiled
> 'main.tpl',
> deciding it doesn't need recompiling, then it's re-doing all the db calls in the
> compiled version, ignoring
> everything that happened previously?
Compiled templates don't have any DB calls. Your main scripts has them.
-Andrei
"In My Egotistical Opinion, most people's C programs should be indented
six feet downward and covered with dirt." -- Blair P. Houghton