many more phpdoc comment upgrades

This commit is contained in:
cellog
2003-02-16 05:09:19 +00:00
parent 43757d1c53
commit abc335673f
5 changed files with 591 additions and 620 deletions

View File

@@ -1,3 +1,10 @@
2003-02-15 Greg Beaver <cellog@sourceforge.net>
* Smarty.class.php
Smarty_Compiler.class.php
continue cleaning of phpdoc comments. All that is needed is the
addition of @return tags and perhaps a bit more verbose comments
and they are finished.
2003-02-14 Monte Ohrt <monte@ispi.net> 2003-02-14 Monte Ohrt <monte@ispi.net>
* NEWS * NEWS

View File

@@ -562,7 +562,7 @@ class Smarty
} }
/** /**
* assigns values to template variables * assigns values to template variables
* *
* @param array|string $tpl_var the template variable name(s) * @param array|string $tpl_var the template variable name(s)
@@ -582,7 +582,7 @@ class Smarty
} }
} }
/** /**
* assigns values to template variables by reference * assigns values to template variables by reference
* *
* @param string $tpl_var the template variable name * @param string $tpl_var the template variable name
@@ -594,7 +594,7 @@ class Smarty
$this->_tpl_vars[$tpl_var] = &$value; $this->_tpl_vars[$tpl_var] = &$value;
} }
/** /**
* appends values to template variables * appends values to template variables
* *
* @param array|string $tpl_var the template variable name(s) * @param array|string $tpl_var the template variable name(s)
@@ -621,7 +621,7 @@ class Smarty
} }
} }
/** /**
* appends values to template variables by reference * appends values to template variables by reference
* *
* @param string $tpl_var the template variable name * @param string $tpl_var the template variable name
@@ -638,7 +638,7 @@ class Smarty
} }
/** /**
* clear the given assigned template variable. * clear the given assigned template variable.
* *
* @param string $tpl_var the template variable to clear * @param string $tpl_var the template variable to clear
@@ -653,7 +653,7 @@ class Smarty
} }
/** /**
* Registers custom function to be used in templates * Registers custom function to be used in templates
* *
* @param string $function the name of the template function * @param string $function the name of the template function
@@ -665,7 +665,7 @@ class Smarty
array($function_impl, null, null, false); array($function_impl, null, null, false);
} }
/** /**
* Unregisters custom function * Unregisters custom function
* *
* @param string $function name of template function * @param string $function name of template function
@@ -675,7 +675,7 @@ class Smarty
unset($this->_plugins['function'][$function]); unset($this->_plugins['function'][$function]);
} }
/** /**
* Registers object to be used in templates * Registers object to be used in templates
* *
* @param string $object name of template object * @param string $object name of template object
@@ -691,7 +691,7 @@ class Smarty
array(&$object_impl, $allowed, $smarty_args); array(&$object_impl, $allowed, $smarty_args);
} }
/** /**
* Unregisters object * Unregisters object
* *
* @param string $object name of template object * @param string $object name of template object
@@ -702,7 +702,7 @@ class Smarty
} }
/** /**
* Registers block function to be used in templates * Registers block function to be used in templates
* *
* @param string $block name of template block * @param string $block name of template block
@@ -714,7 +714,7 @@ class Smarty
array($block_impl, null, null, false); array($block_impl, null, null, false);
} }
/** /**
* Unregisters block function * Unregisters block function
* *
* @param string $block name of template function * @param string $block name of template function
@@ -724,7 +724,7 @@ class Smarty
unset($this->_plugins['block'][$block]); unset($this->_plugins['block'][$block]);
} }
/** /**
* Registers compiler function * Registers compiler function
* *
* @param string $function name of template function * @param string $function name of template function
@@ -736,7 +736,7 @@ class Smarty
array($function_impl, null, null, false); array($function_impl, null, null, false);
} }
/** /**
* Unregisters compiler function * Unregisters compiler function
* *
* @param string $function name of template function * @param string $function name of template function
@@ -746,7 +746,7 @@ class Smarty
unset($this->_plugins['compiler'][$function]); unset($this->_plugins['compiler'][$function]);
} }
/** /**
* Registers modifier to be used in templates * Registers modifier to be used in templates
* *
* @param string $modifier name of template modifier * @param string $modifier name of template modifier
@@ -758,7 +758,7 @@ class Smarty
array($modifier_impl, null, null, false); array($modifier_impl, null, null, false);
} }
/** /**
* Unregisters modifier * Unregisters modifier
* *
* @param string $modifier name of template modifier * @param string $modifier name of template modifier
@@ -768,7 +768,7 @@ class Smarty
unset($this->_plugins['modifier'][$modifier]); unset($this->_plugins['modifier'][$modifier]);
} }
/** /**
* Registers a resource to fetch a template * Registers a resource to fetch a template
* *
* @param string $type name of resource * @param string $type name of resource
@@ -780,7 +780,7 @@ class Smarty
array((array)$functions, false); array((array)$functions, false);
} }
/** /**
* Unregisters a resource * Unregisters a resource
* *
* @param string $type name of resource * @param string $type name of resource
@@ -790,7 +790,7 @@ class Smarty
unset($this->_plugins['resource'][$type]); unset($this->_plugins['resource'][$type]);
} }
/** /**
* Registers a prefilter function to apply * Registers a prefilter function to apply
* to a template before compiling * to a template before compiling
* *
@@ -802,7 +802,7 @@ class Smarty
= array($function, null, null, false); = array($function, null, null, false);
} }
/** /**
* Unregisters a prefilter function * Unregisters a prefilter function
* *
* @param string $function name of PHP function * @param string $function name of PHP function
@@ -812,7 +812,7 @@ class Smarty
unset($this->_plugins['prefilter'][$function]); unset($this->_plugins['prefilter'][$function]);
} }
/** /**
* Registers a postfilter function to apply * Registers a postfilter function to apply
* to a compiled template after compilation * to a compiled template after compilation
* *
@@ -824,7 +824,7 @@ class Smarty
= array($function, null, null, false); = array($function, null, null, false);
} }
/** /**
* Unregisters a postfilter function * Unregisters a postfilter function
* *
* @param string $function name of PHP function * @param string $function name of PHP function
@@ -834,7 +834,7 @@ class Smarty
unset($this->_plugins['postfilter'][$function]); unset($this->_plugins['postfilter'][$function]);
} }
/** /**
* Registers an output filter function to apply * Registers an output filter function to apply
* to a template output * to a template output
* *
@@ -846,7 +846,7 @@ class Smarty
= array($function, null, null, false); = array($function, null, null, false);
} }
/** /**
* Unregisters an outputfilter function * Unregisters an outputfilter function
* *
* @param string $function name of PHP function * @param string $function name of PHP function
@@ -856,7 +856,7 @@ class Smarty
unset($this->_plugins['outputfilter'][$function]); unset($this->_plugins['outputfilter'][$function]);
} }
/** /**
* load a filter of specified type and name * load a filter of specified type and name
* *
* @param string $type filter type * @param string $type filter type
@@ -877,7 +877,7 @@ class Smarty
} }
} }
/** /**
* clear cached content for the given template and cache id * clear cached content for the given template and cache id
* *
* @param string $tpl_file name of template file * @param string $tpl_file name of template file
@@ -908,7 +908,7 @@ class Smarty
} }
/** /**
* clear the entire contents of cache (all templates) * clear the entire contents of cache (all templates)
* *
* @param string $exp_time expire time * @param string $exp_time expire time
@@ -924,12 +924,12 @@ class Smarty
} }
/** /**
* test to see if valid cache exists for this template * test to see if valid cache exists for this template
* *
* @param string $tpl_file name of template file * @param string $tpl_file name of template file
* @param $cache_id * @param string $cache_id
* @param $compile_id * @param string $compile_id
*/ */
function is_cached($tpl_file, $cache_id = null, $compile_id = null) function is_cached($tpl_file, $cache_id = null, $compile_id = null)
{ {
@@ -943,7 +943,7 @@ class Smarty
} }
/** /**
* clear all the assigned template variables. * clear all the assigned template variables.
* *
*/ */
@@ -952,14 +952,14 @@ class Smarty
$this->_tpl_vars = array(); $this->_tpl_vars = array();
} }
/** /**
* clears compiled version of specified template resource, * clears compiled version of specified template resource,
* or all compiled template files if one is not specified. * or all compiled template files if one is not specified.
* This function is for advanced use only, not normally needed. * This function is for advanced use only, not normally needed.
* *
* @param $tpl_file * @param string $tpl_file
* @param $compile_id * @param string $compile_id
* @param $exp_time * @param string $exp_time
*/ */
function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null) function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null)
{ {
@@ -968,19 +968,20 @@ class Smarty
return $this->_rm_auto($this->compile_dir, $tpl_file, $compile_id, $exp_time); return $this->_rm_auto($this->compile_dir, $tpl_file, $compile_id, $exp_time);
} }
/** /**
* Checks whether requested template exists. * Checks whether requested template exists.
* *
* @param $tpl_file * @param string $tpl_file
*/ */
function template_exists($tpl_file) function template_exists($tpl_file)
{ {
return $this->_fetch_template_info($tpl_file, $source, $timestamp, true, true); return $this->_fetch_template_info($tpl_file, $source, $timestamp, true, true);
} }
/** /**
* Returns an array containing template variables * Returns an array containing template variables
* *
* @return array
*/ */
function &get_template_vars() function &get_template_vars()
{ {
@@ -988,11 +989,11 @@ class Smarty
} }
/** /**
* trigger Smarty error * trigger Smarty error
* *
* @param $error_msg * @param string $error_msg
* @param $error_type * @param integer $error_type
*/ */
function trigger_error($error_msg, $error_type = E_USER_WARNING) function trigger_error($error_msg, $error_type = E_USER_WARNING)
{ {
@@ -1000,25 +1001,25 @@ class Smarty
} }
/** /**
* executes & displays the template results * executes & displays the template results
* *
* @param $tpl_file * @param string $tpl_file
* @param $cache_id * @param string $cache_id
* @param $compile_id * @param string $compile_id
*/ */
function display($tpl_file, $cache_id = null, $compile_id = null) function display($tpl_file, $cache_id = null, $compile_id = null)
{ {
$this->fetch($tpl_file, $cache_id, $compile_id, true); $this->fetch($tpl_file, $cache_id, $compile_id, true);
} }
/** /**
* executes & returns or displays the template results * executes & returns or displays the template results
* *
* @param $_smarty_tpl_file * @param string $_smarty_tpl_file
* @param $_smarty_cache_id * @param string $_smarty_cache_id
* @param $_smarty_compile_id * @param string $_smarty_compile_id
* @param $_smarty_display * @param boolean $_smarty_display
*/ */
function fetch($_smarty_tpl_file, $_smarty_cache_id = null, $_smarty_compile_id = null, $_smarty_display = false) function fetch($_smarty_tpl_file, $_smarty_cache_id = null, $_smarty_compile_id = null, $_smarty_display = false)
{ {
@@ -1150,10 +1151,8 @@ class Smarty
} }
/** /**
* assign $smarty interface variable * assign $smarty interface variable
*
* @access public
*/ */
function _assign_smarty_interface() function _assign_smarty_interface()
{ {
@@ -1179,10 +1178,10 @@ class Smarty
} }
/** /**
* generate debug output * generate debug output
* * @return string debug.tpl template output
* @access public * @uses $debug_tpl debug template, used to display debugging output
*/ */
function _generate_debug_output() function _generate_debug_output()
{ {
@@ -1225,13 +1224,12 @@ class Smarty
return $results; return $results;
} }
/** /**
* load configuration values * load configuration values
* *
* @access public * @param string $file
* @param $file * @param string $section
* @param $section * @param string $scope
* @param $scope
*/ */
function config_load($file, $section = null, $scope = 'global') function config_load($file, $section = null, $scope = 'global')
{ {
@@ -1320,14 +1318,14 @@ class Smarty
} }
/**#@+ /**#@+
* @access private * @access private
*/ */
/** /**
* determines if a resource is trusted or not * determines if a resource is trusted or not
* *
* @param $resource_type * @param string $resource_type
* @param $resource_name * @param string $resource_name
*/ */
function _is_trusted($resource_type, $resource_name) function _is_trusted($resource_type, $resource_name)
{ {
@@ -1358,11 +1356,11 @@ class Smarty
} }
/** /**
* determines if a resource is secure or not. * determines if a resource is secure or not.
* *
* @param $resource_type * @param string $resource_type
* @param $resource_name * @param string $resource_name
*/ */
function _is_secure($resource_type, $resource_name) function _is_secure($resource_type, $resource_name)
{ {
@@ -1392,11 +1390,12 @@ class Smarty
} }
/** /**
* Retrieves PHP script resource * Retrieves PHP script resource
* *
* @param $resource * sets $php_resource to the returned resource
* @param $resource_type * @param string $resource
* @param string $resource_type
* @param $php_resource * @param $php_resource
*/ */
function _get_php_resource($resource, &$resource_type, &$php_resource) function _get_php_resource($resource, &$resource_type, &$php_resource)
@@ -1454,11 +1453,11 @@ class Smarty
} }
/** /**
* umm... process the template * umm... process the template
* *
* @param $tpl_file * @param string $tpl_file
* @param $compile_path * @param string $compile_path
*/ */
function _process_template($tpl_file, $compile_path) function _process_template($tpl_file, $compile_path)
{ {
@@ -1495,11 +1494,10 @@ class Smarty
} }
} }
/** /**
* Get the compile path for this template file * Get the compile path for this template file
* *
* @access private * @param string $tpl_file
* @param $tpl_file
*/ */
function _get_compile_path($tpl_file) function _get_compile_path($tpl_file)
{ {
@@ -1510,9 +1508,10 @@ class Smarty
/** /**
* write the compiled template * write the compiled template
* *
* @param $compile_path * @param string $compile_path
* @param $template_compiled * @param string $template_compiled
* @param $template_timestamp * @param integer $template_timestamp
* @return true
*/ */
function _write_compiled_template($compile_path, $template_compiled, $template_timestamp) function _write_compiled_template($compile_path, $template_compiled, $template_timestamp)
{ {
@@ -1522,13 +1521,13 @@ class Smarty
return true; return true;
} }
/** /**
* parse out the type and name from the template resource * parse out the type and name from the template resource
* *
* @param $file_base_path * @param string $file_base_path
* @param $file_path * @param string $file_path
* @param $resource_type * @param string $resource_type
* @param $resource_name * @param string $resource_name
*/ */
function _parse_file_path($file_base_path, $file_path, &$resource_type, &$resource_name) function _parse_file_path($file_base_path, $file_path, &$resource_type, &$resource_name)
{ {
@@ -1572,15 +1571,17 @@ class Smarty
} }
/** /**
* fetch the template info. Gets timestamp, and source * fetch the template info. Gets timestamp, and source
* if get_source is true * if get_source is true
* *
* @param $tpl_path * sets $template_source to the source of the template, and
* @param $template_source * $template_timestamp to its time stamp
* @param $template_timestamp * @param string $tpl_path
* @param $get_source * @param string $template_source
* @param $quiet * @param integer $template_timestamp
* @param boolean $get_source
* @param boolean $quiet
*/ */
function _fetch_template_info($tpl_path, &$template_source, &$template_timestamp, $get_source = true, $quiet = false) function _fetch_template_info($tpl_path, &$template_source, &$template_timestamp, $get_source = true, $quiet = false)
{ {
@@ -1638,12 +1639,13 @@ class Smarty
} }
/** /**
* called to compile the templates * called to compile the templates
* *
* @param $tpl_file * sets $template_compiled to the compiled template
* @param $template_source * @param string $tpl_file
* @param $template_compiled * @param string $template_source
* @param string $template_compiled
*/ */
function _compile_template($tpl_file, $template_source, &$template_compiled) function _compile_template($tpl_file, $template_source, &$template_compiled)
{ {
@@ -1683,11 +1685,11 @@ class Smarty
} }
} }
/** /**
* called for included templates * called for included templates
* *
* @param $_smarty_include_tpl_file * @param string $_smarty_include_tpl_file
* @param $_smarty_include_vars * @param string $_smarty_include_vars
*/ */
function _smarty_include($_smarty_include_tpl_file, $_smarty_include_vars) function _smarty_include($_smarty_include_tpl_file, $_smarty_include_vars)
{ {
@@ -1726,12 +1728,15 @@ class Smarty
} }
} }
/** /**
* called for included templates * called for included templates
* *
* @param $_smarty_include_php_file * @param string $_smarty_include_php_file
* @param $_smarty_assign * @param string $_smarty_assign variable to assign the included template's
* @param $_smarty_once * output into
* @param boolean $_smarty_once uses include_once if this is true
* @param array $_smarty_include_vars associative array of vars from
* {include file="blah" var=$var}
*/ */
function _smarty_include_php($_smarty_include_php_file, $_smarty_assign, $_smarty_once, $_smarty_include_vars) function _smarty_include_php($_smarty_include_php_file, $_smarty_assign, $_smarty_once, $_smarty_include_vars)
{ {
@@ -1767,10 +1772,10 @@ class Smarty
} }
/** /**
* clear configuration values * clear configuration values
* *
* @param $var * @param string $var
*/ */
function clear_config($var = null) function clear_config($var = null)
{ {
@@ -1784,11 +1789,11 @@ class Smarty
} }
/** /**
* Replace cached inserts with the actual results * Replace cached inserts with the actual results
* *
* @param $results * @param string $results
*/ */
function _process_cached_inserts($results) function _process_cached_inserts($results)
{ {
preg_match_all('!'.$this->_smarty_md5.'{insert_cache (.*)}'.$this->_smarty_md5.'!Uis', preg_match_all('!'.$this->_smarty_md5.'{insert_cache (.*)}'.$this->_smarty_md5.'!Uis',
@@ -1834,64 +1839,64 @@ class Smarty
} }
/** /**
* Handle insert tags * Handle insert tags
* *
* @param $args * @param array $args
*/ */
function _run_insert_handler($args) function _run_insert_handler($args)
{ {
if ($this->debugging) {
$debug_start_time = $this->_get_microtime();
}
if ($this->caching) {
$arg_string = serialize($args);
$name = $args['name'];
if (!isset($this->_cache_info['insert_tags'][$name])) {
$this->_cache_info['insert_tags'][$name] = array('insert',
$name,
$this->_plugins['insert'][$name][1],
$this->_plugins['insert'][$name][2],
!empty($args['script']) ? true : false);
}
return $this->_smarty_md5."{insert_cache $arg_string}".$this->_smarty_md5;
} else {
if (isset($args['script'])) {
if (!$this->_get_php_resource($this->_dequote($args['script']), $resource_type, $php_resource)) {
return false;
}
if ($resource_type == 'file') {
include_once($php_resource);
} else {
eval($php_resource);
}
unset($args['script']);
}
$function_name = $this->_plugins['insert'][$args['name']][0];
$content = $function_name($args, $this);
if ($this->debugging) { if ($this->debugging) {
$this->_smarty_debug_info[] = array('type' => 'insert', $debug_start_time = $this->_get_microtime();
'filename' => 'insert_'.$args['name'],
'depth' => $this->_inclusion_depth,
'exec_time' => $this->_get_microtime() - $debug_start_time);
} }
if (!empty($args["assign"])) { if ($this->caching) {
$this->assign($args["assign"], $content); $arg_string = serialize($args);
$name = $args['name'];
if (!isset($this->_cache_info['insert_tags'][$name])) {
$this->_cache_info['insert_tags'][$name] = array('insert',
$name,
$this->_plugins['insert'][$name][1],
$this->_plugins['insert'][$name][2],
!empty($args['script']) ? true : false);
}
return $this->_smarty_md5."{insert_cache $arg_string}".$this->_smarty_md5;
} else { } else {
return $content; if (isset($args['script'])) {
if (!$this->_get_php_resource($this->_dequote($args['script']), $resource_type, $php_resource)) {
return false;
}
if ($resource_type == 'file') {
include_once($php_resource);
} else {
eval($php_resource);
}
unset($args['script']);
}
$function_name = $this->_plugins['insert'][$args['name']][0];
$content = $function_name($args, $this);
if ($this->debugging) {
$this->_smarty_debug_info[] = array('type' => 'insert',
'filename' => 'insert_'.$args['name'],
'depth' => $this->_inclusion_depth,
'exec_time' => $this->_get_microtime() - $debug_start_time);
}
if (!empty($args["assign"])) {
$this->assign($args["assign"], $content);
} else {
return $content;
}
} }
} }
}
/** /**
* Handle modifiers * Handle modifiers
* *
*/ */
function _run_mod_handler() function _run_mod_handler()
{ {
$args = func_get_args(); $args = func_get_args();
@@ -1912,11 +1917,10 @@ function _run_insert_handler($args)
} }
/** /**
* Remove starting and ending quotes from the string * Remove starting and ending quotes from the string
* *
* @access private * @param string $string
* @param $string
*/ */
function _dequote($string) function _dequote($string)
{ {
@@ -1928,13 +1932,13 @@ function _run_insert_handler($args)
} }
/** /**
* read in a file from line $start for $lines. * read in a file from line $start for $lines.
* read the entire file if $start and $lines are null. * read the entire file if $start and $lines are null.
* *
* @param $filename * @param string $filename
* @param $start * @param integer $start
* @param $lines * @param integer $lines
*/ */
function _read_file($filename, $start=null, $lines=null) function _read_file($filename, $start=null, $lines=null)
{ {
@@ -1971,12 +1975,12 @@ function _run_insert_handler($args)
return $contents; return $contents;
} }
/** /**
* write out a file to disk * write out a file to disk
* *
* @param $filename * @param string $filename
* @param $contents * @param string $contents
* @param $create_dirs * @param boolean $create_dirs
*/ */
function _write_file($filename, $contents, $create_dirs = false) function _write_file($filename, $contents, $create_dirs = false)
{ {
@@ -2000,12 +2004,12 @@ function _run_insert_handler($args)
return true; return true;
} }
/** /**
* get a concrete filename for automagically created content * get a concrete filename for automagically created content
* *
* @param $auto_base * @param string $auto_base
* @param $auto_source * @param string $auto_source
* @param $auto_id * @param string $auto_id
*/ */
function _get_auto_filename($auto_base, $auto_source = null, $auto_id = null) function _get_auto_filename($auto_base, $auto_source = null, $auto_id = null)
{ {
@@ -2054,13 +2058,13 @@ function _run_insert_handler($args)
return $res; return $res;
} }
/** /**
* delete an automagically created file by name and id * delete an automagically created file by name and id
* *
* @param $auto_base * @param string $auto_base
* @param $auto_source * @param string $auto_source
* @param $auto_id * @param string $auto_id
* @param $exp_time * @param integer $exp_time
*/ */
function _rm_auto($auto_base, $auto_source = null, $auto_id = null, $exp_time = null) function _rm_auto($auto_base, $auto_source = null, $auto_id = null, $exp_time = null)
{ {
@@ -2092,13 +2096,13 @@ function _run_insert_handler($args)
return $res; return $res;
} }
/** /**
* delete a dir recursively (level=0 -> keep root) * delete a dir recursively (level=0 -> keep root)
* WARNING: no tests, it will try to remove what you tell it! * WARNING: no tests, it will try to remove what you tell it!
* *
* @param $dirname * @param string $dirname
* @param $level * @param integer $level
* @param $exp_time * @param integer $exp_time
*/ */
function _rmdir($dirname, $level = 1, $exp_time = null) function _rmdir($dirname, $level = 1, $exp_time = null)
{ {
@@ -2128,11 +2132,11 @@ function _run_insert_handler($args)
} }
} }
/** /**
* unlink a file, possibly using expiration time * unlink a file, possibly using expiration time
* *
* @param $resource * @param string $resource
* @param $exp_time * @param integer $exp_time
*/ */
function _unlink($resource, $exp_time = null) function _unlink($resource, $exp_time = null)
{ {
@@ -2145,10 +2149,10 @@ function _run_insert_handler($args)
} }
} }
/** /**
* create full directory structure * create full directory structure
* *
* @param $dir * @param string $dir
*/ */
function _create_dir_structure($dir) function _create_dir_structure($dir)
{ {
@@ -2190,14 +2194,14 @@ function _run_insert_handler($args)
} }
} }
/** /**
* Prepend the cache information to the cache file * Prepend the cache information to the cache file
* and write it * and write it
* *
* @param $tpl_file * @param string $tpl_file
* @param $cache_id * @param string $cache_id
* @param $compile_id * @param string $compile_id
* @param $results * @param string $results
*/ */
function _write_cache_file($tpl_file, $cache_id, $compile_id, $results) function _write_cache_file($tpl_file, $cache_id, $compile_id, $results)
{ {
@@ -2233,15 +2237,15 @@ function _run_insert_handler($args)
} }
} }
/** /**
* read a cache file, determine if it needs to be * read a cache file, determine if it needs to be
* regenerated or not * regenerated or not
* *
* @param string $tpl_file * @param string $tpl_file
* @param $cache_id * @param string $cache_id
* @param $compile_id * @param string $compile_id
* @param $results * @param string $results
*/ */
function _read_cache_file($tpl_file, $cache_id, $compile_id, &$results) function _read_cache_file($tpl_file, $cache_id, $compile_id, &$results)
{ {
static $content_cache = array(); static $content_cache = array();
@@ -2322,11 +2326,11 @@ function _run_insert_handler($args)
return true; return true;
} }
/** /**
* get filepath of requested plugin * get filepath of requested plugin
* *
* @param $type * @param string $type
* @param $name * @param string $name
*/ */
function _get_plugin_filepath($type, $name) function _get_plugin_filepath($type, $name)
{ {
@@ -2366,10 +2370,10 @@ function _run_insert_handler($args)
return false; return false;
} }
/** /**
* Load requested plugins * Load requested plugins
* *
* @param $plugins * @param array $plugins
*/ */
function _load_plugins($plugins) function _load_plugins($plugins)
{ {
@@ -2477,10 +2481,10 @@ function _run_insert_handler($args)
} }
} }
/** /**
* load a resource plugin * load a resource plugin
* *
* @param $type * @param string $type
*/ */
function _load_resource_plugin($type) function _load_resource_plugin($type)
{ {
@@ -2538,10 +2542,9 @@ function _run_insert_handler($args)
} }
} }
/** /**
* automatically load a set of filters * automatically load a set of filters
* */
*/
function _autoload_filters() function _autoload_filters()
{ {
foreach ($this->autoload_filters as $filter_type => $filters) { foreach ($this->autoload_filters as $filter_type => $filters) {
@@ -2551,23 +2554,26 @@ function _run_insert_handler($args)
} }
} }
/** /**
* Quote subpattern references * Quote subpattern references
* *
* @param $string * @param string $string
*/ */
function quote_replace($string) function quote_replace($string)
{ {
return preg_replace('![\\$]\d!', '\\\\\\0', $string); return preg_replace('![\\$]\d!', '\\\\\\0', $string);
} }
/** /**
* trigger Smarty plugin error * trigger Smarty plugin error
* *
* @param $error_msg * @param string $error_msg
* @param $tpl_file * @param string $tpl_file
* @param $tpl_line * @param integer $tpl_line
* @param string $file
* @param integer $line
* @param integer $error_type
*/ */
function _trigger_fatal_error($error_msg, $tpl_file = null, $tpl_line = null, function _trigger_fatal_error($error_msg, $tpl_file = null, $tpl_line = null,
$file = null, $line = null, $error_type = E_USER_ERROR) $file = null, $line = null, $error_type = E_USER_ERROR)
@@ -2585,9 +2591,9 @@ function _run_insert_handler($args)
} }
} }
/** /**
* Get seconds and microseconds * Get seconds and microseconds
* * @return double
*/ */
function _get_microtime() function _get_microtime()
{ {
@@ -2597,11 +2603,11 @@ function _run_insert_handler($args)
return ($mtime); return ($mtime);
} }
/** /**
* Get path to file from include_path * Get path to file from include_path
* *
* @param $file_path * @param string $file_path
* @param $new_file_path * @param string $new_file_path
*/ */
function _get_include_path($file_path, &$new_file_path) function _get_include_path($file_path, &$new_file_path)
{ {

View File

@@ -3,11 +3,6 @@
/** /**
* Project: Smarty: the PHP compiling template engine * Project: Smarty: the PHP compiling template engine
* File: Smarty_Compiler.class.php * File: Smarty_Compiler.class.php
* Author: Monte Ohrt <monte@ispi.net>
* Andrei Zmievski <andrei@php.net>
*
* Version: 2.4.2
* Copyright: 2001,2002 ispi of Lincoln, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@@ -35,12 +30,20 @@
* *
* The latest version of Smarty can be obtained from: * The latest version of Smarty can be obtained from:
* http://www.phpinsider.com/ * http://www.phpinsider.com/
* * @link http://www.phpinsider.com/
* @author Monte Ohrt <monte@ispi.net>
* @author Andrei Zmievski <andrei@php.net>
* @version 2.4.2
* @copyright 2001,2002 ispi of Lincoln, Inc.
* @package Smarty
*/ */
class Smarty_Compiler extends Smarty { class Smarty_Compiler extends Smarty {
// internal vars // internal vars
/**#@+
* @access private
*/
var $_sectionelse_stack = array(); // keeps track of whether section had 'else' part var $_sectionelse_stack = array(); // keeps track of whether section had 'else' part
var $_foreachelse_stack = array(); // keeps track of whether foreach had 'else' part var $_foreachelse_stack = array(); // keeps track of whether foreach had 'else' part
var $_literal_blocks = array(); // keeps literal template blocks var $_literal_blocks = array(); // keeps literal template blocks
@@ -69,11 +72,9 @@ class Smarty_Compiler extends Smarty {
var $_obj_start_regexp = null; var $_obj_start_regexp = null;
var $_obj_params_regexp = null; var $_obj_params_regexp = null;
var $_obj_call_regexp = null; var $_obj_call_regexp = null;
/**#@-*/
/** /**
* The class constructor. * The class constructor.
*
* @access public
*/ */
function Smarty_Compiler() function Smarty_Compiler()
{ {
@@ -198,10 +199,10 @@ class Smarty_Compiler extends Smarty {
/** /**
* compile a template file * compile a template file
* *
* @access public * sets $template_compiled to the compiled source
* @param $tpl_file * @param string $tpl_file
* @param $template_source * @param string $template_source
* @param $template_compiled * @param string $template_compiled
*/ */
function _compile_file($tpl_file, $template_source, &$template_compiled) function _compile_file($tpl_file, $template_source, &$template_compiled)
{ {
@@ -362,8 +363,7 @@ class Smarty_Compiler extends Smarty {
/** /**
* Compile a template tag * Compile a template tag
* *
* @access public * @param string $template_tag
* @param $template_tag
*/ */
function _compile_tag($template_tag) function _compile_tag($template_tag)
{ {
@@ -499,10 +499,10 @@ class Smarty_Compiler extends Smarty {
/** /**
* compile the custom compiler tag * compile the custom compiler tag
* *
* @access public * sets $output to the compiled custom compiler tag
* @param $tag_command * @param string $tag_command
* @param $tag_args * @param string $tag_args
* @param $output * @param string $output
*/ */
function _compile_compiler_tag($tag_command, $tag_args, &$output) function _compile_compiler_tag($tag_command, $tag_args, &$output)
{ {
@@ -561,11 +561,11 @@ class Smarty_Compiler extends Smarty {
/** /**
* compile block function tag * compile block function tag
* *
* @access public * sets $output to compiled block function tag
* @param $tag_command * @param string $tag_command
* @param $tag_args * @param string $tag_args
* @param $tag_modifier * @param string $tag_modifier
* @param $output * @param string $output
*/ */
function _compile_block_tag($tag_command, $tag_args, $tag_modifier, &$output) function _compile_block_tag($tag_command, $tag_args, $tag_modifier, &$output)
{ {
@@ -649,10 +649,9 @@ class Smarty_Compiler extends Smarty {
/** /**
* compile custom function tag * compile custom function tag
* *
* @access public * @param string $tag_command
* @param $tag_command * @param string $tag_args
* @param $tag_args * @param string $tag_modifier
* @param $tag_modifier
*/ */
function _compile_custom_tag($tag_command, $tag_args, $tag_modifier) function _compile_custom_tag($tag_command, $tag_args, $tag_modifier)
{ {
@@ -678,10 +677,9 @@ class Smarty_Compiler extends Smarty {
/** /**
* compile a registered object tag * compile a registered object tag
* *
* @access public * @param string $tag_command
* @param $tag_command * @param array $attrs
* @param $attrs * @param string $tag_modifier
* @param $tag_modifier
*/ */
function _compile_registered_object_tag($tag_command, $attrs, $tag_modifier) function _compile_registered_object_tag($tag_command, $attrs, $tag_modifier)
{ {
@@ -736,8 +734,7 @@ class Smarty_Compiler extends Smarty {
/** /**
* Compile {insert ...} tag * Compile {insert ...} tag
* *
* @access public * @param string $tag_args
* @param $tag_args
*/ */
function _compile_insert_tag($tag_args) function _compile_insert_tag($tag_args)
{ {
@@ -769,8 +766,7 @@ class Smarty_Compiler extends Smarty {
/** /**
* Compile {config_load ...} tag * Compile {config_load ...} tag
* *
* @access public * @param string $tag_args
* @param $tag_args
*/ */
function _compile_config_load_tag($tag_args) function _compile_config_load_tag($tag_args)
{ {
@@ -805,8 +801,7 @@ class Smarty_Compiler extends Smarty {
/** /**
* Compile {include ...} tag * Compile {include ...} tag
* *
* @access public * $param string $tag_args
* $param $tag_args
*/ */
function _compile_include_tag($tag_args) function _compile_include_tag($tag_args)
{ {
@@ -855,8 +850,7 @@ class Smarty_Compiler extends Smarty {
/** /**
* Compile {include ...} tag * Compile {include ...} tag
* *
* @access public * @param string $tag_args
* @param $tag_args
*/ */
function _compile_include_php_tag($tag_args) function _compile_include_php_tag($tag_args)
{ {
@@ -889,8 +883,7 @@ class Smarty_Compiler extends Smarty {
/** /**
* Compile {section ...} tag * Compile {section ...} tag
* *
* @access public * @param string $tag_args
* @param $tag_args
*/ */
function _compile_section_start($tag_args) function _compile_section_start($tag_args)
{ {
@@ -994,8 +987,7 @@ class Smarty_Compiler extends Smarty {
/** /**
* Compile {foreach ...} tag. * Compile {foreach ...} tag.
* *
* @access public * @param string $tag_args
* @param $tag_args
*/ */
function _compile_foreach_start($tag_args) function _compile_foreach_start($tag_args)
{ {
@@ -1058,9 +1050,8 @@ class Smarty_Compiler extends Smarty {
/** /**
* Compile {capture} .. {/capture} tags * Compile {capture} .. {/capture} tags
* *
* @access public * @param boolean $start true if this is the {capture} tag
* @param $start * @param string $tag_args
* @param $tag_args
*/ */
function _compile_capture_tag($start, $tag_args = '') function _compile_capture_tag($start, $tag_args = '')
{ {
@@ -1085,9 +1076,8 @@ class Smarty_Compiler extends Smarty {
/** /**
* Compile {if ...} tag * Compile {if ...} tag
* *
* @access public * @param string $tag_args
* @param $tag_args * @param boolean $elseif if true, uses elseif instead of if
* @param $elseif
*/ */
function _compile_if_tag($tag_args, $elseif = false) function _compile_if_tag($tag_args, $elseif = false)
{ {
@@ -1245,9 +1235,8 @@ class Smarty_Compiler extends Smarty {
/** /**
* Parse is expression * Parse is expression
* *
* @access public * @param string $is_arg
* @param $is_arg * @param array $tokens
* @param $tokens
*/ */
function _parse_is_expr($is_arg, $tokens) function _parse_is_expr($is_arg, $tokens)
{ {
@@ -1307,9 +1296,8 @@ class Smarty_Compiler extends Smarty {
/** /**
* Parse attribute string * Parse attribute string
* *
* @access public * @param string $tag_args
* @param $tag_args * @param true $quote unused?
* @param $quote
*/ */
function _parse_attrs($tag_args, $quote = true) function _parse_attrs($tag_args, $quote = true)
{ {
@@ -1392,8 +1380,7 @@ class Smarty_Compiler extends Smarty {
* compile multiple variables and section properties tokens into * compile multiple variables and section properties tokens into
* PHP code * PHP code
* *
* @access public * @param array $tokens
* @param $tokens
*/ */
function _parse_vars_props(&$tokens) function _parse_vars_props(&$tokens)
{ {
@@ -1406,9 +1393,8 @@ class Smarty_Compiler extends Smarty {
* compile single variable and section properties token into * compile single variable and section properties token into
* PHP code * PHP code
* *
* @access public * @param string $val
* @param $val * @param string $tag_attrs
* @param $tag_attrs
*/ */
function _parse_var_props($val, $tag_attrs = null) function _parse_var_props($val, $tag_attrs = null)
{ {
@@ -1454,8 +1440,7 @@ class Smarty_Compiler extends Smarty {
/** /**
* expand quoted text with embedded variables * expand quoted text with embedded variables
* *
* @access public * @param string $var_expr
* @param $var_expr
*/ */
function _expand_quoted_text($var_expr) function _expand_quoted_text($var_expr)
{ {
@@ -1475,8 +1460,7 @@ class Smarty_Compiler extends Smarty {
/** /**
* parse variable expression into PHP code * parse variable expression into PHP code
* *
* @access public * @param string $var_expr
* @param $var_expr
*/ */
function _parse_var($var_expr) function _parse_var($var_expr)
{ {
@@ -1572,8 +1556,7 @@ class Smarty_Compiler extends Smarty {
/** /**
* parse arguments in function call parenthesis * parse arguments in function call parenthesis
* *
* @access public * @param string $parenth_args
* @param $parenth_args
*/ */
function _parse_parenth_args($parenth_args) function _parse_parenth_args($parenth_args)
{ {
@@ -1589,8 +1572,7 @@ class Smarty_Compiler extends Smarty {
/** /**
* parse configuration variable expression into PHP code * parse configuration variable expression into PHP code
* *
* @access public * @param string $conf_var_expr
* @param $conf_var_expr
*/ */
function _parse_conf_var($conf_var_expr) function _parse_conf_var($conf_var_expr)
{ {
@@ -1611,8 +1593,7 @@ class Smarty_Compiler extends Smarty {
/** /**
* parse section property expression into PHP code * parse section property expression into PHP code
* *
* @access public * @param string $section_prop_expr
* @param $section_prop_expr
*/ */
function _parse_section_prop($section_prop_expr) function _parse_section_prop($section_prop_expr)
{ {
@@ -1635,9 +1616,9 @@ class Smarty_Compiler extends Smarty {
/** /**
* parse modifier chain into PHP code * parse modifier chain into PHP code
* *
* @access public * sets $output to parsed modified chain
* @param $output * @param string $output
* @param $modifier_string * @param string $modifier_string
*/ */
function _parse_modifiers(&$output, $modifier_string) function _parse_modifiers(&$output, $modifier_string)
{ {
@@ -1679,10 +1660,9 @@ class Smarty_Compiler extends Smarty {
/** /**
* add plugin * add plugin
* *
* @access public * @param string $type
* @param $type * @param string $name
* @param $name * @param boolean? $delayed_loading
* @param $delayed_loading
*/ */
function _add_plugin($type, $name, $delayed_loading = null) function _add_plugin($type, $name, $delayed_loading = null)
{ {
@@ -1700,8 +1680,7 @@ class Smarty_Compiler extends Smarty {
/** /**
* Compiles references of type $smarty.foo * Compiles references of type $smarty.foo
* *
* @access public * @param string $indexes
* @param $indexes
*/ */
function _compile_smarty_ref(&$indexes) function _compile_smarty_ref(&$indexes)
{ {
@@ -1814,8 +1793,6 @@ class Smarty_Compiler extends Smarty {
/** /**
* load pre- and post-filters * load pre- and post-filters
*
* @access public
*/ */
function _load_filters() function _load_filters()
{ {
@@ -1841,11 +1818,10 @@ class Smarty_Compiler extends Smarty {
/** /**
* display Smarty syntax error * display Smarty syntax error
* *
* @access public * @param string $error_msg
* @param $error_msg * @param integer $error_type
* @param $error_type * @param string $file
* @param $file * @param integer $line
* @param $line
*/ */
function _syntax_error($error_msg, $error_type = E_USER_ERROR, $file=null, $line=null) function _syntax_error($error_msg, $error_type = E_USER_ERROR, $file=null, $line=null)
{ {
@@ -1863,8 +1839,8 @@ class Smarty_Compiler extends Smarty {
* compare to values by their string length * compare to values by their string length
* *
* @access private * @access private
* @param $a * @param string $a
* @param $b * @param string $b
*/ */
function _smarty_sort_length($a, $b) function _smarty_sort_length($a, $b)
{ {

View File

@@ -562,7 +562,7 @@ class Smarty
} }
/** /**
* assigns values to template variables * assigns values to template variables
* *
* @param array|string $tpl_var the template variable name(s) * @param array|string $tpl_var the template variable name(s)
@@ -582,7 +582,7 @@ class Smarty
} }
} }
/** /**
* assigns values to template variables by reference * assigns values to template variables by reference
* *
* @param string $tpl_var the template variable name * @param string $tpl_var the template variable name
@@ -594,7 +594,7 @@ class Smarty
$this->_tpl_vars[$tpl_var] = &$value; $this->_tpl_vars[$tpl_var] = &$value;
} }
/** /**
* appends values to template variables * appends values to template variables
* *
* @param array|string $tpl_var the template variable name(s) * @param array|string $tpl_var the template variable name(s)
@@ -621,7 +621,7 @@ class Smarty
} }
} }
/** /**
* appends values to template variables by reference * appends values to template variables by reference
* *
* @param string $tpl_var the template variable name * @param string $tpl_var the template variable name
@@ -638,7 +638,7 @@ class Smarty
} }
/** /**
* clear the given assigned template variable. * clear the given assigned template variable.
* *
* @param string $tpl_var the template variable to clear * @param string $tpl_var the template variable to clear
@@ -653,7 +653,7 @@ class Smarty
} }
/** /**
* Registers custom function to be used in templates * Registers custom function to be used in templates
* *
* @param string $function the name of the template function * @param string $function the name of the template function
@@ -665,7 +665,7 @@ class Smarty
array($function_impl, null, null, false); array($function_impl, null, null, false);
} }
/** /**
* Unregisters custom function * Unregisters custom function
* *
* @param string $function name of template function * @param string $function name of template function
@@ -675,7 +675,7 @@ class Smarty
unset($this->_plugins['function'][$function]); unset($this->_plugins['function'][$function]);
} }
/** /**
* Registers object to be used in templates * Registers object to be used in templates
* *
* @param string $object name of template object * @param string $object name of template object
@@ -691,7 +691,7 @@ class Smarty
array(&$object_impl, $allowed, $smarty_args); array(&$object_impl, $allowed, $smarty_args);
} }
/** /**
* Unregisters object * Unregisters object
* *
* @param string $object name of template object * @param string $object name of template object
@@ -702,7 +702,7 @@ class Smarty
} }
/** /**
* Registers block function to be used in templates * Registers block function to be used in templates
* *
* @param string $block name of template block * @param string $block name of template block
@@ -714,7 +714,7 @@ class Smarty
array($block_impl, null, null, false); array($block_impl, null, null, false);
} }
/** /**
* Unregisters block function * Unregisters block function
* *
* @param string $block name of template function * @param string $block name of template function
@@ -724,7 +724,7 @@ class Smarty
unset($this->_plugins['block'][$block]); unset($this->_plugins['block'][$block]);
} }
/** /**
* Registers compiler function * Registers compiler function
* *
* @param string $function name of template function * @param string $function name of template function
@@ -736,7 +736,7 @@ class Smarty
array($function_impl, null, null, false); array($function_impl, null, null, false);
} }
/** /**
* Unregisters compiler function * Unregisters compiler function
* *
* @param string $function name of template function * @param string $function name of template function
@@ -746,7 +746,7 @@ class Smarty
unset($this->_plugins['compiler'][$function]); unset($this->_plugins['compiler'][$function]);
} }
/** /**
* Registers modifier to be used in templates * Registers modifier to be used in templates
* *
* @param string $modifier name of template modifier * @param string $modifier name of template modifier
@@ -758,7 +758,7 @@ class Smarty
array($modifier_impl, null, null, false); array($modifier_impl, null, null, false);
} }
/** /**
* Unregisters modifier * Unregisters modifier
* *
* @param string $modifier name of template modifier * @param string $modifier name of template modifier
@@ -768,7 +768,7 @@ class Smarty
unset($this->_plugins['modifier'][$modifier]); unset($this->_plugins['modifier'][$modifier]);
} }
/** /**
* Registers a resource to fetch a template * Registers a resource to fetch a template
* *
* @param string $type name of resource * @param string $type name of resource
@@ -780,7 +780,7 @@ class Smarty
array((array)$functions, false); array((array)$functions, false);
} }
/** /**
* Unregisters a resource * Unregisters a resource
* *
* @param string $type name of resource * @param string $type name of resource
@@ -790,7 +790,7 @@ class Smarty
unset($this->_plugins['resource'][$type]); unset($this->_plugins['resource'][$type]);
} }
/** /**
* Registers a prefilter function to apply * Registers a prefilter function to apply
* to a template before compiling * to a template before compiling
* *
@@ -802,7 +802,7 @@ class Smarty
= array($function, null, null, false); = array($function, null, null, false);
} }
/** /**
* Unregisters a prefilter function * Unregisters a prefilter function
* *
* @param string $function name of PHP function * @param string $function name of PHP function
@@ -812,7 +812,7 @@ class Smarty
unset($this->_plugins['prefilter'][$function]); unset($this->_plugins['prefilter'][$function]);
} }
/** /**
* Registers a postfilter function to apply * Registers a postfilter function to apply
* to a compiled template after compilation * to a compiled template after compilation
* *
@@ -824,7 +824,7 @@ class Smarty
= array($function, null, null, false); = array($function, null, null, false);
} }
/** /**
* Unregisters a postfilter function * Unregisters a postfilter function
* *
* @param string $function name of PHP function * @param string $function name of PHP function
@@ -834,7 +834,7 @@ class Smarty
unset($this->_plugins['postfilter'][$function]); unset($this->_plugins['postfilter'][$function]);
} }
/** /**
* Registers an output filter function to apply * Registers an output filter function to apply
* to a template output * to a template output
* *
@@ -846,7 +846,7 @@ class Smarty
= array($function, null, null, false); = array($function, null, null, false);
} }
/** /**
* Unregisters an outputfilter function * Unregisters an outputfilter function
* *
* @param string $function name of PHP function * @param string $function name of PHP function
@@ -856,7 +856,7 @@ class Smarty
unset($this->_plugins['outputfilter'][$function]); unset($this->_plugins['outputfilter'][$function]);
} }
/** /**
* load a filter of specified type and name * load a filter of specified type and name
* *
* @param string $type filter type * @param string $type filter type
@@ -877,7 +877,7 @@ class Smarty
} }
} }
/** /**
* clear cached content for the given template and cache id * clear cached content for the given template and cache id
* *
* @param string $tpl_file name of template file * @param string $tpl_file name of template file
@@ -908,7 +908,7 @@ class Smarty
} }
/** /**
* clear the entire contents of cache (all templates) * clear the entire contents of cache (all templates)
* *
* @param string $exp_time expire time * @param string $exp_time expire time
@@ -924,12 +924,12 @@ class Smarty
} }
/** /**
* test to see if valid cache exists for this template * test to see if valid cache exists for this template
* *
* @param string $tpl_file name of template file * @param string $tpl_file name of template file
* @param $cache_id * @param string $cache_id
* @param $compile_id * @param string $compile_id
*/ */
function is_cached($tpl_file, $cache_id = null, $compile_id = null) function is_cached($tpl_file, $cache_id = null, $compile_id = null)
{ {
@@ -943,7 +943,7 @@ class Smarty
} }
/** /**
* clear all the assigned template variables. * clear all the assigned template variables.
* *
*/ */
@@ -952,14 +952,14 @@ class Smarty
$this->_tpl_vars = array(); $this->_tpl_vars = array();
} }
/** /**
* clears compiled version of specified template resource, * clears compiled version of specified template resource,
* or all compiled template files if one is not specified. * or all compiled template files if one is not specified.
* This function is for advanced use only, not normally needed. * This function is for advanced use only, not normally needed.
* *
* @param $tpl_file * @param string $tpl_file
* @param $compile_id * @param string $compile_id
* @param $exp_time * @param string $exp_time
*/ */
function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null) function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null)
{ {
@@ -968,19 +968,20 @@ class Smarty
return $this->_rm_auto($this->compile_dir, $tpl_file, $compile_id, $exp_time); return $this->_rm_auto($this->compile_dir, $tpl_file, $compile_id, $exp_time);
} }
/** /**
* Checks whether requested template exists. * Checks whether requested template exists.
* *
* @param $tpl_file * @param string $tpl_file
*/ */
function template_exists($tpl_file) function template_exists($tpl_file)
{ {
return $this->_fetch_template_info($tpl_file, $source, $timestamp, true, true); return $this->_fetch_template_info($tpl_file, $source, $timestamp, true, true);
} }
/** /**
* Returns an array containing template variables * Returns an array containing template variables
* *
* @return array
*/ */
function &get_template_vars() function &get_template_vars()
{ {
@@ -988,11 +989,11 @@ class Smarty
} }
/** /**
* trigger Smarty error * trigger Smarty error
* *
* @param $error_msg * @param string $error_msg
* @param $error_type * @param integer $error_type
*/ */
function trigger_error($error_msg, $error_type = E_USER_WARNING) function trigger_error($error_msg, $error_type = E_USER_WARNING)
{ {
@@ -1000,25 +1001,25 @@ class Smarty
} }
/** /**
* executes & displays the template results * executes & displays the template results
* *
* @param $tpl_file * @param string $tpl_file
* @param $cache_id * @param string $cache_id
* @param $compile_id * @param string $compile_id
*/ */
function display($tpl_file, $cache_id = null, $compile_id = null) function display($tpl_file, $cache_id = null, $compile_id = null)
{ {
$this->fetch($tpl_file, $cache_id, $compile_id, true); $this->fetch($tpl_file, $cache_id, $compile_id, true);
} }
/** /**
* executes & returns or displays the template results * executes & returns or displays the template results
* *
* @param $_smarty_tpl_file * @param string $_smarty_tpl_file
* @param $_smarty_cache_id * @param string $_smarty_cache_id
* @param $_smarty_compile_id * @param string $_smarty_compile_id
* @param $_smarty_display * @param boolean $_smarty_display
*/ */
function fetch($_smarty_tpl_file, $_smarty_cache_id = null, $_smarty_compile_id = null, $_smarty_display = false) function fetch($_smarty_tpl_file, $_smarty_cache_id = null, $_smarty_compile_id = null, $_smarty_display = false)
{ {
@@ -1150,10 +1151,8 @@ class Smarty
} }
/** /**
* assign $smarty interface variable * assign $smarty interface variable
*
* @access public
*/ */
function _assign_smarty_interface() function _assign_smarty_interface()
{ {
@@ -1179,10 +1178,10 @@ class Smarty
} }
/** /**
* generate debug output * generate debug output
* * @return string debug.tpl template output
* @access public * @uses $debug_tpl debug template, used to display debugging output
*/ */
function _generate_debug_output() function _generate_debug_output()
{ {
@@ -1225,13 +1224,12 @@ class Smarty
return $results; return $results;
} }
/** /**
* load configuration values * load configuration values
* *
* @access public * @param string $file
* @param $file * @param string $section
* @param $section * @param string $scope
* @param $scope
*/ */
function config_load($file, $section = null, $scope = 'global') function config_load($file, $section = null, $scope = 'global')
{ {
@@ -1320,14 +1318,14 @@ class Smarty
} }
/**#@+ /**#@+
* @access private * @access private
*/ */
/** /**
* determines if a resource is trusted or not * determines if a resource is trusted or not
* *
* @param $resource_type * @param string $resource_type
* @param $resource_name * @param string $resource_name
*/ */
function _is_trusted($resource_type, $resource_name) function _is_trusted($resource_type, $resource_name)
{ {
@@ -1358,11 +1356,11 @@ class Smarty
} }
/** /**
* determines if a resource is secure or not. * determines if a resource is secure or not.
* *
* @param $resource_type * @param string $resource_type
* @param $resource_name * @param string $resource_name
*/ */
function _is_secure($resource_type, $resource_name) function _is_secure($resource_type, $resource_name)
{ {
@@ -1392,11 +1390,12 @@ class Smarty
} }
/** /**
* Retrieves PHP script resource * Retrieves PHP script resource
* *
* @param $resource * sets $php_resource to the returned resource
* @param $resource_type * @param string $resource
* @param string $resource_type
* @param $php_resource * @param $php_resource
*/ */
function _get_php_resource($resource, &$resource_type, &$php_resource) function _get_php_resource($resource, &$resource_type, &$php_resource)
@@ -1454,11 +1453,11 @@ class Smarty
} }
/** /**
* umm... process the template * umm... process the template
* *
* @param $tpl_file * @param string $tpl_file
* @param $compile_path * @param string $compile_path
*/ */
function _process_template($tpl_file, $compile_path) function _process_template($tpl_file, $compile_path)
{ {
@@ -1495,11 +1494,10 @@ class Smarty
} }
} }
/** /**
* Get the compile path for this template file * Get the compile path for this template file
* *
* @access private * @param string $tpl_file
* @param $tpl_file
*/ */
function _get_compile_path($tpl_file) function _get_compile_path($tpl_file)
{ {
@@ -1510,9 +1508,10 @@ class Smarty
/** /**
* write the compiled template * write the compiled template
* *
* @param $compile_path * @param string $compile_path
* @param $template_compiled * @param string $template_compiled
* @param $template_timestamp * @param integer $template_timestamp
* @return true
*/ */
function _write_compiled_template($compile_path, $template_compiled, $template_timestamp) function _write_compiled_template($compile_path, $template_compiled, $template_timestamp)
{ {
@@ -1522,13 +1521,13 @@ class Smarty
return true; return true;
} }
/** /**
* parse out the type and name from the template resource * parse out the type and name from the template resource
* *
* @param $file_base_path * @param string $file_base_path
* @param $file_path * @param string $file_path
* @param $resource_type * @param string $resource_type
* @param $resource_name * @param string $resource_name
*/ */
function _parse_file_path($file_base_path, $file_path, &$resource_type, &$resource_name) function _parse_file_path($file_base_path, $file_path, &$resource_type, &$resource_name)
{ {
@@ -1572,15 +1571,17 @@ class Smarty
} }
/** /**
* fetch the template info. Gets timestamp, and source * fetch the template info. Gets timestamp, and source
* if get_source is true * if get_source is true
* *
* @param $tpl_path * sets $template_source to the source of the template, and
* @param $template_source * $template_timestamp to its time stamp
* @param $template_timestamp * @param string $tpl_path
* @param $get_source * @param string $template_source
* @param $quiet * @param integer $template_timestamp
* @param boolean $get_source
* @param boolean $quiet
*/ */
function _fetch_template_info($tpl_path, &$template_source, &$template_timestamp, $get_source = true, $quiet = false) function _fetch_template_info($tpl_path, &$template_source, &$template_timestamp, $get_source = true, $quiet = false)
{ {
@@ -1638,12 +1639,13 @@ class Smarty
} }
/** /**
* called to compile the templates * called to compile the templates
* *
* @param $tpl_file * sets $template_compiled to the compiled template
* @param $template_source * @param string $tpl_file
* @param $template_compiled * @param string $template_source
* @param string $template_compiled
*/ */
function _compile_template($tpl_file, $template_source, &$template_compiled) function _compile_template($tpl_file, $template_source, &$template_compiled)
{ {
@@ -1683,11 +1685,11 @@ class Smarty
} }
} }
/** /**
* called for included templates * called for included templates
* *
* @param $_smarty_include_tpl_file * @param string $_smarty_include_tpl_file
* @param $_smarty_include_vars * @param string $_smarty_include_vars
*/ */
function _smarty_include($_smarty_include_tpl_file, $_smarty_include_vars) function _smarty_include($_smarty_include_tpl_file, $_smarty_include_vars)
{ {
@@ -1726,12 +1728,15 @@ class Smarty
} }
} }
/** /**
* called for included templates * called for included templates
* *
* @param $_smarty_include_php_file * @param string $_smarty_include_php_file
* @param $_smarty_assign * @param string $_smarty_assign variable to assign the included template's
* @param $_smarty_once * output into
* @param boolean $_smarty_once uses include_once if this is true
* @param array $_smarty_include_vars associative array of vars from
* {include file="blah" var=$var}
*/ */
function _smarty_include_php($_smarty_include_php_file, $_smarty_assign, $_smarty_once, $_smarty_include_vars) function _smarty_include_php($_smarty_include_php_file, $_smarty_assign, $_smarty_once, $_smarty_include_vars)
{ {
@@ -1767,10 +1772,10 @@ class Smarty
} }
/** /**
* clear configuration values * clear configuration values
* *
* @param $var * @param string $var
*/ */
function clear_config($var = null) function clear_config($var = null)
{ {
@@ -1784,11 +1789,11 @@ class Smarty
} }
/** /**
* Replace cached inserts with the actual results * Replace cached inserts with the actual results
* *
* @param $results * @param string $results
*/ */
function _process_cached_inserts($results) function _process_cached_inserts($results)
{ {
preg_match_all('!'.$this->_smarty_md5.'{insert_cache (.*)}'.$this->_smarty_md5.'!Uis', preg_match_all('!'.$this->_smarty_md5.'{insert_cache (.*)}'.$this->_smarty_md5.'!Uis',
@@ -1834,64 +1839,64 @@ class Smarty
} }
/** /**
* Handle insert tags * Handle insert tags
* *
* @param $args * @param array $args
*/ */
function _run_insert_handler($args) function _run_insert_handler($args)
{ {
if ($this->debugging) {
$debug_start_time = $this->_get_microtime();
}
if ($this->caching) {
$arg_string = serialize($args);
$name = $args['name'];
if (!isset($this->_cache_info['insert_tags'][$name])) {
$this->_cache_info['insert_tags'][$name] = array('insert',
$name,
$this->_plugins['insert'][$name][1],
$this->_plugins['insert'][$name][2],
!empty($args['script']) ? true : false);
}
return $this->_smarty_md5."{insert_cache $arg_string}".$this->_smarty_md5;
} else {
if (isset($args['script'])) {
if (!$this->_get_php_resource($this->_dequote($args['script']), $resource_type, $php_resource)) {
return false;
}
if ($resource_type == 'file') {
include_once($php_resource);
} else {
eval($php_resource);
}
unset($args['script']);
}
$function_name = $this->_plugins['insert'][$args['name']][0];
$content = $function_name($args, $this);
if ($this->debugging) { if ($this->debugging) {
$this->_smarty_debug_info[] = array('type' => 'insert', $debug_start_time = $this->_get_microtime();
'filename' => 'insert_'.$args['name'],
'depth' => $this->_inclusion_depth,
'exec_time' => $this->_get_microtime() - $debug_start_time);
} }
if (!empty($args["assign"])) { if ($this->caching) {
$this->assign($args["assign"], $content); $arg_string = serialize($args);
$name = $args['name'];
if (!isset($this->_cache_info['insert_tags'][$name])) {
$this->_cache_info['insert_tags'][$name] = array('insert',
$name,
$this->_plugins['insert'][$name][1],
$this->_plugins['insert'][$name][2],
!empty($args['script']) ? true : false);
}
return $this->_smarty_md5."{insert_cache $arg_string}".$this->_smarty_md5;
} else { } else {
return $content; if (isset($args['script'])) {
if (!$this->_get_php_resource($this->_dequote($args['script']), $resource_type, $php_resource)) {
return false;
}
if ($resource_type == 'file') {
include_once($php_resource);
} else {
eval($php_resource);
}
unset($args['script']);
}
$function_name = $this->_plugins['insert'][$args['name']][0];
$content = $function_name($args, $this);
if ($this->debugging) {
$this->_smarty_debug_info[] = array('type' => 'insert',
'filename' => 'insert_'.$args['name'],
'depth' => $this->_inclusion_depth,
'exec_time' => $this->_get_microtime() - $debug_start_time);
}
if (!empty($args["assign"])) {
$this->assign($args["assign"], $content);
} else {
return $content;
}
} }
} }
}
/** /**
* Handle modifiers * Handle modifiers
* *
*/ */
function _run_mod_handler() function _run_mod_handler()
{ {
$args = func_get_args(); $args = func_get_args();
@@ -1912,11 +1917,10 @@ function _run_insert_handler($args)
} }
/** /**
* Remove starting and ending quotes from the string * Remove starting and ending quotes from the string
* *
* @access private * @param string $string
* @param $string
*/ */
function _dequote($string) function _dequote($string)
{ {
@@ -1928,13 +1932,13 @@ function _run_insert_handler($args)
} }
/** /**
* read in a file from line $start for $lines. * read in a file from line $start for $lines.
* read the entire file if $start and $lines are null. * read the entire file if $start and $lines are null.
* *
* @param $filename * @param string $filename
* @param $start * @param integer $start
* @param $lines * @param integer $lines
*/ */
function _read_file($filename, $start=null, $lines=null) function _read_file($filename, $start=null, $lines=null)
{ {
@@ -1971,12 +1975,12 @@ function _run_insert_handler($args)
return $contents; return $contents;
} }
/** /**
* write out a file to disk * write out a file to disk
* *
* @param $filename * @param string $filename
* @param $contents * @param string $contents
* @param $create_dirs * @param boolean $create_dirs
*/ */
function _write_file($filename, $contents, $create_dirs = false) function _write_file($filename, $contents, $create_dirs = false)
{ {
@@ -2000,12 +2004,12 @@ function _run_insert_handler($args)
return true; return true;
} }
/** /**
* get a concrete filename for automagically created content * get a concrete filename for automagically created content
* *
* @param $auto_base * @param string $auto_base
* @param $auto_source * @param string $auto_source
* @param $auto_id * @param string $auto_id
*/ */
function _get_auto_filename($auto_base, $auto_source = null, $auto_id = null) function _get_auto_filename($auto_base, $auto_source = null, $auto_id = null)
{ {
@@ -2054,13 +2058,13 @@ function _run_insert_handler($args)
return $res; return $res;
} }
/** /**
* delete an automagically created file by name and id * delete an automagically created file by name and id
* *
* @param $auto_base * @param string $auto_base
* @param $auto_source * @param string $auto_source
* @param $auto_id * @param string $auto_id
* @param $exp_time * @param integer $exp_time
*/ */
function _rm_auto($auto_base, $auto_source = null, $auto_id = null, $exp_time = null) function _rm_auto($auto_base, $auto_source = null, $auto_id = null, $exp_time = null)
{ {
@@ -2092,13 +2096,13 @@ function _run_insert_handler($args)
return $res; return $res;
} }
/** /**
* delete a dir recursively (level=0 -> keep root) * delete a dir recursively (level=0 -> keep root)
* WARNING: no tests, it will try to remove what you tell it! * WARNING: no tests, it will try to remove what you tell it!
* *
* @param $dirname * @param string $dirname
* @param $level * @param integer $level
* @param $exp_time * @param integer $exp_time
*/ */
function _rmdir($dirname, $level = 1, $exp_time = null) function _rmdir($dirname, $level = 1, $exp_time = null)
{ {
@@ -2128,11 +2132,11 @@ function _run_insert_handler($args)
} }
} }
/** /**
* unlink a file, possibly using expiration time * unlink a file, possibly using expiration time
* *
* @param $resource * @param string $resource
* @param $exp_time * @param integer $exp_time
*/ */
function _unlink($resource, $exp_time = null) function _unlink($resource, $exp_time = null)
{ {
@@ -2145,10 +2149,10 @@ function _run_insert_handler($args)
} }
} }
/** /**
* create full directory structure * create full directory structure
* *
* @param $dir * @param string $dir
*/ */
function _create_dir_structure($dir) function _create_dir_structure($dir)
{ {
@@ -2190,14 +2194,14 @@ function _run_insert_handler($args)
} }
} }
/** /**
* Prepend the cache information to the cache file * Prepend the cache information to the cache file
* and write it * and write it
* *
* @param $tpl_file * @param string $tpl_file
* @param $cache_id * @param string $cache_id
* @param $compile_id * @param string $compile_id
* @param $results * @param string $results
*/ */
function _write_cache_file($tpl_file, $cache_id, $compile_id, $results) function _write_cache_file($tpl_file, $cache_id, $compile_id, $results)
{ {
@@ -2233,15 +2237,15 @@ function _run_insert_handler($args)
} }
} }
/** /**
* read a cache file, determine if it needs to be * read a cache file, determine if it needs to be
* regenerated or not * regenerated or not
* *
* @param string $tpl_file * @param string $tpl_file
* @param $cache_id * @param string $cache_id
* @param $compile_id * @param string $compile_id
* @param $results * @param string $results
*/ */
function _read_cache_file($tpl_file, $cache_id, $compile_id, &$results) function _read_cache_file($tpl_file, $cache_id, $compile_id, &$results)
{ {
static $content_cache = array(); static $content_cache = array();
@@ -2322,11 +2326,11 @@ function _run_insert_handler($args)
return true; return true;
} }
/** /**
* get filepath of requested plugin * get filepath of requested plugin
* *
* @param $type * @param string $type
* @param $name * @param string $name
*/ */
function _get_plugin_filepath($type, $name) function _get_plugin_filepath($type, $name)
{ {
@@ -2366,10 +2370,10 @@ function _run_insert_handler($args)
return false; return false;
} }
/** /**
* Load requested plugins * Load requested plugins
* *
* @param $plugins * @param array $plugins
*/ */
function _load_plugins($plugins) function _load_plugins($plugins)
{ {
@@ -2477,10 +2481,10 @@ function _run_insert_handler($args)
} }
} }
/** /**
* load a resource plugin * load a resource plugin
* *
* @param $type * @param string $type
*/ */
function _load_resource_plugin($type) function _load_resource_plugin($type)
{ {
@@ -2538,10 +2542,9 @@ function _run_insert_handler($args)
} }
} }
/** /**
* automatically load a set of filters * automatically load a set of filters
* */
*/
function _autoload_filters() function _autoload_filters()
{ {
foreach ($this->autoload_filters as $filter_type => $filters) { foreach ($this->autoload_filters as $filter_type => $filters) {
@@ -2551,23 +2554,26 @@ function _run_insert_handler($args)
} }
} }
/** /**
* Quote subpattern references * Quote subpattern references
* *
* @param $string * @param string $string
*/ */
function quote_replace($string) function quote_replace($string)
{ {
return preg_replace('![\\$]\d!', '\\\\\\0', $string); return preg_replace('![\\$]\d!', '\\\\\\0', $string);
} }
/** /**
* trigger Smarty plugin error * trigger Smarty plugin error
* *
* @param $error_msg * @param string $error_msg
* @param $tpl_file * @param string $tpl_file
* @param $tpl_line * @param integer $tpl_line
* @param string $file
* @param integer $line
* @param integer $error_type
*/ */
function _trigger_fatal_error($error_msg, $tpl_file = null, $tpl_line = null, function _trigger_fatal_error($error_msg, $tpl_file = null, $tpl_line = null,
$file = null, $line = null, $error_type = E_USER_ERROR) $file = null, $line = null, $error_type = E_USER_ERROR)
@@ -2585,9 +2591,9 @@ function _run_insert_handler($args)
} }
} }
/** /**
* Get seconds and microseconds * Get seconds and microseconds
* * @return double
*/ */
function _get_microtime() function _get_microtime()
{ {
@@ -2597,11 +2603,11 @@ function _run_insert_handler($args)
return ($mtime); return ($mtime);
} }
/** /**
* Get path to file from include_path * Get path to file from include_path
* *
* @param $file_path * @param string $file_path
* @param $new_file_path * @param string $new_file_path
*/ */
function _get_include_path($file_path, &$new_file_path) function _get_include_path($file_path, &$new_file_path)
{ {

View File

@@ -3,11 +3,6 @@
/** /**
* Project: Smarty: the PHP compiling template engine * Project: Smarty: the PHP compiling template engine
* File: Smarty_Compiler.class.php * File: Smarty_Compiler.class.php
* Author: Monte Ohrt <monte@ispi.net>
* Andrei Zmievski <andrei@php.net>
*
* Version: 2.4.2
* Copyright: 2001,2002 ispi of Lincoln, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@@ -35,12 +30,20 @@
* *
* The latest version of Smarty can be obtained from: * The latest version of Smarty can be obtained from:
* http://www.phpinsider.com/ * http://www.phpinsider.com/
* * @link http://www.phpinsider.com/
* @author Monte Ohrt <monte@ispi.net>
* @author Andrei Zmievski <andrei@php.net>
* @version 2.4.2
* @copyright 2001,2002 ispi of Lincoln, Inc.
* @package Smarty
*/ */
class Smarty_Compiler extends Smarty { class Smarty_Compiler extends Smarty {
// internal vars // internal vars
/**#@+
* @access private
*/
var $_sectionelse_stack = array(); // keeps track of whether section had 'else' part var $_sectionelse_stack = array(); // keeps track of whether section had 'else' part
var $_foreachelse_stack = array(); // keeps track of whether foreach had 'else' part var $_foreachelse_stack = array(); // keeps track of whether foreach had 'else' part
var $_literal_blocks = array(); // keeps literal template blocks var $_literal_blocks = array(); // keeps literal template blocks
@@ -69,11 +72,9 @@ class Smarty_Compiler extends Smarty {
var $_obj_start_regexp = null; var $_obj_start_regexp = null;
var $_obj_params_regexp = null; var $_obj_params_regexp = null;
var $_obj_call_regexp = null; var $_obj_call_regexp = null;
/**#@-*/
/** /**
* The class constructor. * The class constructor.
*
* @access public
*/ */
function Smarty_Compiler() function Smarty_Compiler()
{ {
@@ -198,10 +199,10 @@ class Smarty_Compiler extends Smarty {
/** /**
* compile a template file * compile a template file
* *
* @access public * sets $template_compiled to the compiled source
* @param $tpl_file * @param string $tpl_file
* @param $template_source * @param string $template_source
* @param $template_compiled * @param string $template_compiled
*/ */
function _compile_file($tpl_file, $template_source, &$template_compiled) function _compile_file($tpl_file, $template_source, &$template_compiled)
{ {
@@ -362,8 +363,7 @@ class Smarty_Compiler extends Smarty {
/** /**
* Compile a template tag * Compile a template tag
* *
* @access public * @param string $template_tag
* @param $template_tag
*/ */
function _compile_tag($template_tag) function _compile_tag($template_tag)
{ {
@@ -499,10 +499,10 @@ class Smarty_Compiler extends Smarty {
/** /**
* compile the custom compiler tag * compile the custom compiler tag
* *
* @access public * sets $output to the compiled custom compiler tag
* @param $tag_command * @param string $tag_command
* @param $tag_args * @param string $tag_args
* @param $output * @param string $output
*/ */
function _compile_compiler_tag($tag_command, $tag_args, &$output) function _compile_compiler_tag($tag_command, $tag_args, &$output)
{ {
@@ -561,11 +561,11 @@ class Smarty_Compiler extends Smarty {
/** /**
* compile block function tag * compile block function tag
* *
* @access public * sets $output to compiled block function tag
* @param $tag_command * @param string $tag_command
* @param $tag_args * @param string $tag_args
* @param $tag_modifier * @param string $tag_modifier
* @param $output * @param string $output
*/ */
function _compile_block_tag($tag_command, $tag_args, $tag_modifier, &$output) function _compile_block_tag($tag_command, $tag_args, $tag_modifier, &$output)
{ {
@@ -649,10 +649,9 @@ class Smarty_Compiler extends Smarty {
/** /**
* compile custom function tag * compile custom function tag
* *
* @access public * @param string $tag_command
* @param $tag_command * @param string $tag_args
* @param $tag_args * @param string $tag_modifier
* @param $tag_modifier
*/ */
function _compile_custom_tag($tag_command, $tag_args, $tag_modifier) function _compile_custom_tag($tag_command, $tag_args, $tag_modifier)
{ {
@@ -678,10 +677,9 @@ class Smarty_Compiler extends Smarty {
/** /**
* compile a registered object tag * compile a registered object tag
* *
* @access public * @param string $tag_command
* @param $tag_command * @param array $attrs
* @param $attrs * @param string $tag_modifier
* @param $tag_modifier
*/ */
function _compile_registered_object_tag($tag_command, $attrs, $tag_modifier) function _compile_registered_object_tag($tag_command, $attrs, $tag_modifier)
{ {
@@ -736,8 +734,7 @@ class Smarty_Compiler extends Smarty {
/** /**
* Compile {insert ...} tag * Compile {insert ...} tag
* *
* @access public * @param string $tag_args
* @param $tag_args
*/ */
function _compile_insert_tag($tag_args) function _compile_insert_tag($tag_args)
{ {
@@ -769,8 +766,7 @@ class Smarty_Compiler extends Smarty {
/** /**
* Compile {config_load ...} tag * Compile {config_load ...} tag
* *
* @access public * @param string $tag_args
* @param $tag_args
*/ */
function _compile_config_load_tag($tag_args) function _compile_config_load_tag($tag_args)
{ {
@@ -805,8 +801,7 @@ class Smarty_Compiler extends Smarty {
/** /**
* Compile {include ...} tag * Compile {include ...} tag
* *
* @access public * $param string $tag_args
* $param $tag_args
*/ */
function _compile_include_tag($tag_args) function _compile_include_tag($tag_args)
{ {
@@ -855,8 +850,7 @@ class Smarty_Compiler extends Smarty {
/** /**
* Compile {include ...} tag * Compile {include ...} tag
* *
* @access public * @param string $tag_args
* @param $tag_args
*/ */
function _compile_include_php_tag($tag_args) function _compile_include_php_tag($tag_args)
{ {
@@ -889,8 +883,7 @@ class Smarty_Compiler extends Smarty {
/** /**
* Compile {section ...} tag * Compile {section ...} tag
* *
* @access public * @param string $tag_args
* @param $tag_args
*/ */
function _compile_section_start($tag_args) function _compile_section_start($tag_args)
{ {
@@ -994,8 +987,7 @@ class Smarty_Compiler extends Smarty {
/** /**
* Compile {foreach ...} tag. * Compile {foreach ...} tag.
* *
* @access public * @param string $tag_args
* @param $tag_args
*/ */
function _compile_foreach_start($tag_args) function _compile_foreach_start($tag_args)
{ {
@@ -1058,9 +1050,8 @@ class Smarty_Compiler extends Smarty {
/** /**
* Compile {capture} .. {/capture} tags * Compile {capture} .. {/capture} tags
* *
* @access public * @param boolean $start true if this is the {capture} tag
* @param $start * @param string $tag_args
* @param $tag_args
*/ */
function _compile_capture_tag($start, $tag_args = '') function _compile_capture_tag($start, $tag_args = '')
{ {
@@ -1085,9 +1076,8 @@ class Smarty_Compiler extends Smarty {
/** /**
* Compile {if ...} tag * Compile {if ...} tag
* *
* @access public * @param string $tag_args
* @param $tag_args * @param boolean $elseif if true, uses elseif instead of if
* @param $elseif
*/ */
function _compile_if_tag($tag_args, $elseif = false) function _compile_if_tag($tag_args, $elseif = false)
{ {
@@ -1245,9 +1235,8 @@ class Smarty_Compiler extends Smarty {
/** /**
* Parse is expression * Parse is expression
* *
* @access public * @param string $is_arg
* @param $is_arg * @param array $tokens
* @param $tokens
*/ */
function _parse_is_expr($is_arg, $tokens) function _parse_is_expr($is_arg, $tokens)
{ {
@@ -1307,9 +1296,8 @@ class Smarty_Compiler extends Smarty {
/** /**
* Parse attribute string * Parse attribute string
* *
* @access public * @param string $tag_args
* @param $tag_args * @param true $quote unused?
* @param $quote
*/ */
function _parse_attrs($tag_args, $quote = true) function _parse_attrs($tag_args, $quote = true)
{ {
@@ -1392,8 +1380,7 @@ class Smarty_Compiler extends Smarty {
* compile multiple variables and section properties tokens into * compile multiple variables and section properties tokens into
* PHP code * PHP code
* *
* @access public * @param array $tokens
* @param $tokens
*/ */
function _parse_vars_props(&$tokens) function _parse_vars_props(&$tokens)
{ {
@@ -1406,9 +1393,8 @@ class Smarty_Compiler extends Smarty {
* compile single variable and section properties token into * compile single variable and section properties token into
* PHP code * PHP code
* *
* @access public * @param string $val
* @param $val * @param string $tag_attrs
* @param $tag_attrs
*/ */
function _parse_var_props($val, $tag_attrs = null) function _parse_var_props($val, $tag_attrs = null)
{ {
@@ -1454,8 +1440,7 @@ class Smarty_Compiler extends Smarty {
/** /**
* expand quoted text with embedded variables * expand quoted text with embedded variables
* *
* @access public * @param string $var_expr
* @param $var_expr
*/ */
function _expand_quoted_text($var_expr) function _expand_quoted_text($var_expr)
{ {
@@ -1475,8 +1460,7 @@ class Smarty_Compiler extends Smarty {
/** /**
* parse variable expression into PHP code * parse variable expression into PHP code
* *
* @access public * @param string $var_expr
* @param $var_expr
*/ */
function _parse_var($var_expr) function _parse_var($var_expr)
{ {
@@ -1572,8 +1556,7 @@ class Smarty_Compiler extends Smarty {
/** /**
* parse arguments in function call parenthesis * parse arguments in function call parenthesis
* *
* @access public * @param string $parenth_args
* @param $parenth_args
*/ */
function _parse_parenth_args($parenth_args) function _parse_parenth_args($parenth_args)
{ {
@@ -1589,8 +1572,7 @@ class Smarty_Compiler extends Smarty {
/** /**
* parse configuration variable expression into PHP code * parse configuration variable expression into PHP code
* *
* @access public * @param string $conf_var_expr
* @param $conf_var_expr
*/ */
function _parse_conf_var($conf_var_expr) function _parse_conf_var($conf_var_expr)
{ {
@@ -1611,8 +1593,7 @@ class Smarty_Compiler extends Smarty {
/** /**
* parse section property expression into PHP code * parse section property expression into PHP code
* *
* @access public * @param string $section_prop_expr
* @param $section_prop_expr
*/ */
function _parse_section_prop($section_prop_expr) function _parse_section_prop($section_prop_expr)
{ {
@@ -1635,9 +1616,9 @@ class Smarty_Compiler extends Smarty {
/** /**
* parse modifier chain into PHP code * parse modifier chain into PHP code
* *
* @access public * sets $output to parsed modified chain
* @param $output * @param string $output
* @param $modifier_string * @param string $modifier_string
*/ */
function _parse_modifiers(&$output, $modifier_string) function _parse_modifiers(&$output, $modifier_string)
{ {
@@ -1679,10 +1660,9 @@ class Smarty_Compiler extends Smarty {
/** /**
* add plugin * add plugin
* *
* @access public * @param string $type
* @param $type * @param string $name
* @param $name * @param boolean? $delayed_loading
* @param $delayed_loading
*/ */
function _add_plugin($type, $name, $delayed_loading = null) function _add_plugin($type, $name, $delayed_loading = null)
{ {
@@ -1700,8 +1680,7 @@ class Smarty_Compiler extends Smarty {
/** /**
* Compiles references of type $smarty.foo * Compiles references of type $smarty.foo
* *
* @access public * @param string $indexes
* @param $indexes
*/ */
function _compile_smarty_ref(&$indexes) function _compile_smarty_ref(&$indexes)
{ {
@@ -1814,8 +1793,6 @@ class Smarty_Compiler extends Smarty {
/** /**
* load pre- and post-filters * load pre- and post-filters
*
* @access public
*/ */
function _load_filters() function _load_filters()
{ {
@@ -1841,11 +1818,10 @@ class Smarty_Compiler extends Smarty {
/** /**
* display Smarty syntax error * display Smarty syntax error
* *
* @access public * @param string $error_msg
* @param $error_msg * @param integer $error_type
* @param $error_type * @param string $file
* @param $file * @param integer $line
* @param $line
*/ */
function _syntax_error($error_msg, $error_type = E_USER_ERROR, $file=null, $line=null) function _syntax_error($error_msg, $error_type = E_USER_ERROR, $file=null, $line=null)
{ {
@@ -1863,8 +1839,8 @@ class Smarty_Compiler extends Smarty {
* compare to values by their string length * compare to values by their string length
* *
* @access private * @access private
* @param $a * @param string $a
* @param $b * @param string $b
*/ */
function _smarty_sort_length($a, $b) function _smarty_sort_length($a, $b)
{ {