mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 10:24:26 +02:00
update default function args, fix cached insert debug timing
This commit is contained in:
1
NEWS
1
NEWS
@@ -1,3 +1,4 @@
|
|||||||
|
- fixed bug with cached insert debug timing (Monte)
|
||||||
- added 'script' attribute to {insert..} which specifies the script that
|
- added 'script' attribute to {insert..} which specifies the script that
|
||||||
the insert function can be found in. (Andrei)
|
the insert function can be found in. (Andrei)
|
||||||
- added default template function handler. (Monte)
|
- added default template function handler. (Monte)
|
||||||
|
@@ -935,7 +935,7 @@ function _is_trusted($resource_type, $resource_name)
|
|||||||
$_return = false;
|
$_return = false;
|
||||||
}
|
}
|
||||||
$funcname = $this->default_template_handler_func;
|
$funcname = $this->default_template_handler_func;
|
||||||
$_return = $funcname($tpl_path, $template_source, $template_timestamp, $this);
|
$_return = $funcname($resource_type, $resource_name, $template_source, $template_timestamp, $this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1100,15 +1100,15 @@ function _is_trusted($resource_type, $resource_name)
|
|||||||
\*======================================================================*/
|
\*======================================================================*/
|
||||||
function _process_cached_inserts($results)
|
function _process_cached_inserts($results)
|
||||||
{
|
{
|
||||||
if ($this->debugging) {
|
|
||||||
$debug_start_time = $this->_get_microtime();
|
|
||||||
}
|
|
||||||
|
|
||||||
preg_match_all('!'.$this->_smarty_md5.'{insert_cache (.*)}'.$this->_smarty_md5.'!Uis',
|
preg_match_all('!'.$this->_smarty_md5.'{insert_cache (.*)}'.$this->_smarty_md5.'!Uis',
|
||||||
$results, $match);
|
$results, $match);
|
||||||
list($cached_inserts, $insert_args) = $match;
|
list($cached_inserts, $insert_args) = $match;
|
||||||
|
|
||||||
for ($i = 0; $i < count($cached_inserts); $i++) {
|
for ($i = 0; $i < count($cached_inserts); $i++) {
|
||||||
|
if ($this->debugging) {
|
||||||
|
$debug_start_time = $this->_get_microtime();
|
||||||
|
}
|
||||||
|
|
||||||
$args = unserialize($insert_args[$i]);
|
$args = unserialize($insert_args[$i]);
|
||||||
|
|
||||||
|
@@ -1602,7 +1602,7 @@ $smarty->display("index.tpl");
|
|||||||
argument is the action, which will be one of 'read', 'write' and
|
argument is the action, which will be one of 'read', 'write' and
|
||||||
'clear'. The second parameter is the smarty object. The third
|
'clear'. The second parameter is the smarty object. The third
|
||||||
parameter is the cached content. Upon a write, Smarty passed th
|
parameter is the cached content. Upon a write, Smarty passed th
|
||||||
cached content in this paramters. Upon a 'read', Smarty expects
|
cached content in this parameters. Upon a 'read', Smarty expects
|
||||||
your function to pass this by reference and populate it with the
|
your function to pass this by reference and populate it with the
|
||||||
cached data. Upon a 'clear', pass a dummy variable here since it is
|
cached data. Upon a 'clear', pass a dummy variable here since it is
|
||||||
not used. The fourth parameter is the name of the template file
|
not used. The fourth parameter is the name of the template file
|
||||||
@@ -4456,7 +4456,7 @@ OUTPUT:
|
|||||||
6
|
6
|
||||||
|
|
||||||
|
|
||||||
{* you can supply a format paramter in sprintf format *}
|
{* you can supply a format parameter in sprintf format *}
|
||||||
|
|
||||||
{math equation="x + y" x=4.4444 y=5.0000 format="%.2f"}
|
{math equation="x + y" x=4.4444 y=5.0000 format="%.2f"}
|
||||||
|
|
||||||
|
@@ -935,7 +935,7 @@ function _is_trusted($resource_type, $resource_name)
|
|||||||
$_return = false;
|
$_return = false;
|
||||||
}
|
}
|
||||||
$funcname = $this->default_template_handler_func;
|
$funcname = $this->default_template_handler_func;
|
||||||
$_return = $funcname($tpl_path, $template_source, $template_timestamp, $this);
|
$_return = $funcname($resource_type, $resource_name, $template_source, $template_timestamp, $this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1100,15 +1100,15 @@ function _is_trusted($resource_type, $resource_name)
|
|||||||
\*======================================================================*/
|
\*======================================================================*/
|
||||||
function _process_cached_inserts($results)
|
function _process_cached_inserts($results)
|
||||||
{
|
{
|
||||||
if ($this->debugging) {
|
|
||||||
$debug_start_time = $this->_get_microtime();
|
|
||||||
}
|
|
||||||
|
|
||||||
preg_match_all('!'.$this->_smarty_md5.'{insert_cache (.*)}'.$this->_smarty_md5.'!Uis',
|
preg_match_all('!'.$this->_smarty_md5.'{insert_cache (.*)}'.$this->_smarty_md5.'!Uis',
|
||||||
$results, $match);
|
$results, $match);
|
||||||
list($cached_inserts, $insert_args) = $match;
|
list($cached_inserts, $insert_args) = $match;
|
||||||
|
|
||||||
for ($i = 0; $i < count($cached_inserts); $i++) {
|
for ($i = 0; $i < count($cached_inserts); $i++) {
|
||||||
|
if ($this->debugging) {
|
||||||
|
$debug_start_time = $this->_get_microtime();
|
||||||
|
}
|
||||||
|
|
||||||
$args = unserialize($insert_args[$i]);
|
$args = unserialize($insert_args[$i]);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user