mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 10:54:27 +02:00
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:
@@ -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
|
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.
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
|
@@ -1,5 +1,7 @@
|
|||||||
===== 3.1.22-dev ===== (xx.xx.2015)
|
===== 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 template processing by moving code into classes it better belongs to
|
||||||
- optimization restructure config file processing
|
- optimization restructure config file processing
|
||||||
|
|
||||||
|
@@ -94,7 +94,13 @@ class Smarty_Template_Compiled
|
|||||||
public function populateCompiledFilepath(Smarty_Internal_Template $_template)
|
public function populateCompiledFilepath(Smarty_Internal_Template $_template)
|
||||||
{
|
{
|
||||||
$_compile_id = isset($_template->compile_id) ? preg_replace('![^\w\|]+!', '_', $_template->compile_id) : null;
|
$_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 use_sub_dirs, break file into directories
|
||||||
if ($_template->smarty->use_sub_dirs) {
|
if ($_template->smarty->use_sub_dirs) {
|
||||||
$_filepath = substr($_filepath, 0, 2) . DS
|
$_filepath = substr($_filepath, 0, 2) . DS
|
||||||
|
Reference in New Issue
Block a user