| 148 |
lars |
1 |
\$compile\_check {#variable.compile.check}
|
|
|
2 |
================
|
|
|
3 |
|
|
|
4 |
Upon each invocation of the PHP application, Smarty tests to see if the
|
|
|
5 |
current template has changed (different timestamp) since the last time
|
|
|
6 |
it was compiled. If it has changed, it recompiles that template. If the
|
|
|
7 |
template has yet not been compiled at all, it will compile regardless of
|
|
|
8 |
this setting. By default this variable is set to TRUE.
|
|
|
9 |
|
|
|
10 |
Once an application is put into production (ie the templates won\'t be
|
|
|
11 |
changing), the compile check step is no longer needed. Be sure to set
|
|
|
12 |
`$compile_check` to FALSE for maximum performance. Note that if you
|
|
|
13 |
change this to FALSE and a template file is changed, you will \*not\*
|
|
|
14 |
see the change since the template will not get recompiled.
|
|
|
15 |
|
| 991 |
lars |
16 |
Note that up to Smarty 4.x, Smarty will check for the existence of
|
|
|
17 |
the source template even if `$compile_check` is disabled.
|
|
|
18 |
|
| 148 |
lars |
19 |
If [`$caching`](#variable.caching) is enabled and `$compile_check` is
|
|
|
20 |
enabled, then the cache files will get regenerated if an involved
|
|
|
21 |
template file or config file was updated.
|
|
|
22 |
|
|
|
23 |
As of Smarty 3.1 `$compile_check` can be set to the value
|
|
|
24 |
`Smarty::COMPILECHECK_CACHEMISS`. This enables Smarty to revalidate the
|
|
|
25 |
compiled template, once a cache file is regenerated. So if there was a
|
|
|
26 |
cached template, but it\'s expired, Smarty will run a single
|
|
|
27 |
compile\_check before regenerating the cache.
|
|
|
28 |
|
|
|
29 |
See [`$force_compile`](#variable.force.compile) and
|
|
|
30 |
[`clearCompiledTemplate()`](#api.clear.compiled.tpl).
|