create different compiled templates and config files

Smarty does now automatically detect a change of the $merge_compiled_includes and $escape_html
    property and create different compiled templates files depending on the setting.

    Same applies to config files and the $config_overwrite, $config_booleanize and
    $config_read_hidden properties.
This commit is contained in:
Uwe Tews
2015-01-03 07:36:07 +01:00
parent cfdd53c6b4
commit f236905fed
3 changed files with 18 additions and 2 deletions

View File

@@ -24,5 +24,13 @@ Smarty 3.1.22
The main template is level 1. The nesting level is checked at run time. When the maximum will be exceeded
an Exception will be thrown. The default setting is 0 which does disable this check.
Compiled Templates
==================
Smarty does now automatically detect a change of the $merge_compiled_includes and $escape_html
property and create different compiled templates files depending on the setting.
Same applies to config files and the $config_overwrite, $config_booleanize and
$config_read_hidden properties.

View File

@@ -1,8 +1,10 @@
 ===== 3.1.22-dev ===== (xx.xx.2015)
- improvement automatically create different versions of compiled templates and config files depending
on property settings.
- optimization restructure template processing by moving code into classes it better belongs to
- optimization restructure config file processing
31.12.2014
- bugfix use function_exists('mb_get_info') for setting Smarty::$_MBSTRING.
Function mb_split could be overloaded depending on php.ini mbstring.func_overload

View File

@@ -94,7 +94,13 @@ class Smarty_Template_Compiled
public function populateCompiledFilepath(Smarty_Internal_Template $_template)
{
$_compile_id = isset($_template->compile_id) ? preg_replace('![^\w\|]+!', '_', $_template->compile_id) : null;
$_filepath = $_template->source->uid;
if ($_template->source->isConfig) {
$_flag = '_' . ((int) $_template->smarty->config_read_hidden + (int) $_template->smarty->config_booleanize * 2
+ (int) $_template->smarty->config_overwrite * 4);
} else {
$_flag = '_' . ((int) $_template->smarty->merge_compiled_includes + (int) $_template->smarty->escape_html * 2);
}
$_filepath = $_template->source->uid . $_flag;
// if use_sub_dirs, break file into directories
if ($_template->smarty->use_sub_dirs) {
$_filepath = substr($_filepath, 0, 2) . DS