mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 10:24:26 +02:00
update ChangeLog, remove insert_tag_check parameter
This commit is contained in:
2
NEWS
2
NEWS
@@ -1,3 +1,5 @@
|
||||
- removed insert_tag_check, no longer needed (Monte)
|
||||
- optimize cache fetches by scanning for insert tags only if they exist (Monte)
|
||||
- fixed bugs in overlib (Monte, Duncan Forrest)
|
||||
- fixed a problem with compile_id usage. (Andrei)
|
||||
- fixed problem with using assigned vars with {include_php ...} filepath.
|
||||
|
@@ -94,12 +94,6 @@ class Smarty
|
||||
var $cache_dir = './cache'; // name of directory for template cache files
|
||||
var $cache_lifetime = 3600; // number of seconds cached content will persist.
|
||||
// 0 = never expires. default is one hour (3600)
|
||||
var $insert_tag_check = true; // if you have caching turned on and you
|
||||
// don't use {insert} tags anywhere
|
||||
// in your templates, set this to false.
|
||||
// this will tell Smarty not to look for
|
||||
// insert tags, thus speeding up cached page
|
||||
// fetches. true/false default true.
|
||||
var $cache_handler_func = null; // function used for cached content. this is
|
||||
// an alternative to using the built-in file
|
||||
// based caching.
|
||||
@@ -548,7 +542,7 @@ class Smarty
|
||||
$this->_cache_info[] = array('template', $_smarty_tpl_file);
|
||||
|
||||
if ($this->_read_cache_file($_smarty_tpl_file, $_smarty_cache_id, $_smarty_compile_id, $_smarty_results)) {
|
||||
if ($this->insert_tag_check) {
|
||||
if ( $this->_cache_info['insert_tags'] ) {
|
||||
$_smarty_results = $this->_process_cached_inserts($_smarty_results);
|
||||
}
|
||||
if ($_smarty_display) {
|
||||
@@ -1400,9 +1394,14 @@ function _run_insert_handler($args)
|
||||
\*======================================================================*/
|
||||
function _write_cache_file($tpl_file, $cache_id, $compile_id, $results)
|
||||
{
|
||||
// determine if insert tags are present
|
||||
if (strpos($results,$this->_smarty_md5.'{insert_cache')) {
|
||||
$this->_cache_info['insert_tags'] = true;
|
||||
}
|
||||
|
||||
// put timestamp in cache header
|
||||
$this->_cache_info['timestamp'] = time();
|
||||
|
||||
|
||||
// prepend the cache header info into cache file
|
||||
$results = 'SMARTY_CACHE_INFO_HEADER'.serialize($this->_cache_info)."\n".$results;
|
||||
|
||||
@@ -1462,8 +1461,8 @@ function _run_insert_handler($args)
|
||||
$cache_header = $cache_split[0];
|
||||
|
||||
if (substr($cache_header, 0, 24) == 'SMARTY_CACHE_INFO_HEADER') {
|
||||
$cache_info = unserialize(substr($cache_header, 24));
|
||||
$cache_timestamp = $cache_info['timestamp'];
|
||||
$this->_cache_info = unserialize(substr($cache_header, 24));
|
||||
$cache_timestamp = $this->_cache_info['timestamp'];
|
||||
|
||||
if (time() - $cache_timestamp > $this->cache_lifetime) {
|
||||
// cache expired, regenerate
|
||||
@@ -1471,7 +1470,7 @@ function _run_insert_handler($args)
|
||||
}
|
||||
|
||||
if ($this->compile_check) {
|
||||
foreach ($cache_info as $curr_cache_info) {
|
||||
foreach ($this->_cache_info as $curr_cache_info) {
|
||||
switch ($curr_cache_info[0]) {
|
||||
case 'template':
|
||||
$this->_fetch_template_info($curr_cache_info[1], $template_source, $template_timestamp, false);
|
||||
|
@@ -468,15 +468,6 @@ require_once(SMARTY_DIR."Smarty.class.php");
|
||||
Smarty 1.3.0)
|
||||
</para>
|
||||
</sect2>
|
||||
<sect2 id="setting.insert.tag.check">
|
||||
<title>$insert_tag_check</title>
|
||||
<para>
|
||||
If you have $caching enabled and you do not use the <link
|
||||
linkend="builtin.functions.insert">insert</link> tag anywhere in
|
||||
your templates, set this to false. This saves the insert tag
|
||||
search, speeding up cached page fetches.
|
||||
</para>
|
||||
</sect2>
|
||||
<sect2 id="setting.cache.handler.func">
|
||||
<title>$cache_handler_func</title>
|
||||
<para>
|
||||
|
@@ -94,12 +94,6 @@ class Smarty
|
||||
var $cache_dir = './cache'; // name of directory for template cache files
|
||||
var $cache_lifetime = 3600; // number of seconds cached content will persist.
|
||||
// 0 = never expires. default is one hour (3600)
|
||||
var $insert_tag_check = true; // if you have caching turned on and you
|
||||
// don't use {insert} tags anywhere
|
||||
// in your templates, set this to false.
|
||||
// this will tell Smarty not to look for
|
||||
// insert tags, thus speeding up cached page
|
||||
// fetches. true/false default true.
|
||||
var $cache_handler_func = null; // function used for cached content. this is
|
||||
// an alternative to using the built-in file
|
||||
// based caching.
|
||||
@@ -548,7 +542,7 @@ class Smarty
|
||||
$this->_cache_info[] = array('template', $_smarty_tpl_file);
|
||||
|
||||
if ($this->_read_cache_file($_smarty_tpl_file, $_smarty_cache_id, $_smarty_compile_id, $_smarty_results)) {
|
||||
if ($this->insert_tag_check) {
|
||||
if ( $this->_cache_info['insert_tags'] ) {
|
||||
$_smarty_results = $this->_process_cached_inserts($_smarty_results);
|
||||
}
|
||||
if ($_smarty_display) {
|
||||
@@ -1400,9 +1394,14 @@ function _run_insert_handler($args)
|
||||
\*======================================================================*/
|
||||
function _write_cache_file($tpl_file, $cache_id, $compile_id, $results)
|
||||
{
|
||||
// determine if insert tags are present
|
||||
if (strpos($results,$this->_smarty_md5.'{insert_cache')) {
|
||||
$this->_cache_info['insert_tags'] = true;
|
||||
}
|
||||
|
||||
// put timestamp in cache header
|
||||
$this->_cache_info['timestamp'] = time();
|
||||
|
||||
|
||||
// prepend the cache header info into cache file
|
||||
$results = 'SMARTY_CACHE_INFO_HEADER'.serialize($this->_cache_info)."\n".$results;
|
||||
|
||||
@@ -1462,8 +1461,8 @@ function _run_insert_handler($args)
|
||||
$cache_header = $cache_split[0];
|
||||
|
||||
if (substr($cache_header, 0, 24) == 'SMARTY_CACHE_INFO_HEADER') {
|
||||
$cache_info = unserialize(substr($cache_header, 24));
|
||||
$cache_timestamp = $cache_info['timestamp'];
|
||||
$this->_cache_info = unserialize(substr($cache_header, 24));
|
||||
$cache_timestamp = $this->_cache_info['timestamp'];
|
||||
|
||||
if (time() - $cache_timestamp > $this->cache_lifetime) {
|
||||
// cache expired, regenerate
|
||||
@@ -1471,7 +1470,7 @@ function _run_insert_handler($args)
|
||||
}
|
||||
|
||||
if ($this->compile_check) {
|
||||
foreach ($cache_info as $curr_cache_info) {
|
||||
foreach ($this->_cache_info as $curr_cache_info) {
|
||||
switch ($curr_cache_info[0]) {
|
||||
case 'template':
|
||||
$this->_fetch_template_info($curr_cache_info[1], $template_source, $template_timestamp, false);
|
||||
|
Reference in New Issue
Block a user