mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
- correction of PHPDoc blocks
- minor code cleanup
This commit is contained in:
@@ -6,6 +6,8 @@
|
|||||||
as Smarty does no longer use error suppression like @filemtime().
|
as Smarty does no longer use error suppression like @filemtime().
|
||||||
for backward compatibility code is moved from Smarty class to an external class and still can be
|
for backward compatibility code is moved from Smarty class to an external class and still can be
|
||||||
called.
|
called.
|
||||||
|
- correction of PHPDoc blocks
|
||||||
|
- minor code cleanup
|
||||||
|
|
||||||
21.10.2017
|
21.10.2017
|
||||||
- bugfix custom delimiters could fail since modification of version 3.1.32-dev-23
|
- bugfix custom delimiters could fail since modification of version 3.1.32-dev-23
|
||||||
|
@@ -34,6 +34,9 @@
|
|||||||
* Sets SMARTY_DIR only if user application has not already defined it.
|
* Sets SMARTY_DIR only if user application has not already defined it.
|
||||||
*/
|
*/
|
||||||
if (!defined('SMARTY_DIR')) {
|
if (!defined('SMARTY_DIR')) {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
define('SMARTY_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR);
|
define('SMARTY_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -41,12 +44,21 @@ if (!defined('SMARTY_DIR')) {
|
|||||||
* Sets SMARTY_SYSPLUGINS_DIR only if user application has not already defined it.
|
* Sets SMARTY_SYSPLUGINS_DIR only if user application has not already defined it.
|
||||||
*/
|
*/
|
||||||
if (!defined('SMARTY_SYSPLUGINS_DIR')) {
|
if (!defined('SMARTY_SYSPLUGINS_DIR')) {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
define('SMARTY_SYSPLUGINS_DIR', SMARTY_DIR . 'sysplugins' . DIRECTORY_SEPARATOR);
|
define('SMARTY_SYSPLUGINS_DIR', SMARTY_DIR . 'sysplugins' . DIRECTORY_SEPARATOR);
|
||||||
}
|
}
|
||||||
if (!defined('SMARTY_PLUGINS_DIR')) {
|
if (!defined('SMARTY_PLUGINS_DIR')) {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
define('SMARTY_PLUGINS_DIR', SMARTY_DIR . 'plugins' . DIRECTORY_SEPARATOR);
|
define('SMARTY_PLUGINS_DIR', SMARTY_DIR . 'plugins' . DIRECTORY_SEPARATOR);
|
||||||
}
|
}
|
||||||
if (!defined('SMARTY_MBSTRING')) {
|
if (!defined('SMARTY_MBSTRING')) {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
define('SMARTY_MBSTRING', function_exists('mb_get_info'));
|
define('SMARTY_MBSTRING', function_exists('mb_get_info'));
|
||||||
}
|
}
|
||||||
if (!defined('SMARTY_RESOURCE_CHAR_SET')) {
|
if (!defined('SMARTY_RESOURCE_CHAR_SET')) {
|
||||||
@@ -100,7 +112,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
/**
|
/**
|
||||||
* smarty version
|
* smarty version
|
||||||
*/
|
*/
|
||||||
const SMARTY_VERSION = '3.1.32-dev-30';
|
const SMARTY_VERSION = '3.1.32-dev-31';
|
||||||
/**
|
/**
|
||||||
* define variable scopes
|
* define variable scopes
|
||||||
*/
|
*/
|
||||||
@@ -620,7 +632,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
/**
|
/**
|
||||||
* Enable error handler to mute expected messages
|
* Enable error handler to mute expected messages
|
||||||
*
|
*
|
||||||
* @return void
|
* @return boolean
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public static function muteExpectedErrors()
|
public static function muteExpectedErrors()
|
||||||
@@ -643,7 +655,8 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
*
|
*
|
||||||
* @param string $resource_name template name
|
* @param string $resource_name template name
|
||||||
*
|
*
|
||||||
* @return boolean status
|
* @return bool status
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function templateExists($resource_name)
|
public function templateExists($resource_name)
|
||||||
{
|
{
|
||||||
@@ -922,7 +935,8 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
* @param object $parent next higher level of Smarty variables
|
* @param object $parent next higher level of Smarty variables
|
||||||
* @param boolean $do_clone flag is Smarty object shall be cloned
|
* @param boolean $do_clone flag is Smarty object shall be cloned
|
||||||
*
|
*
|
||||||
* @return object template object
|
* @return object template object
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null, $do_clone = true)
|
public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null, $do_clone = true)
|
||||||
{
|
{
|
||||||
@@ -1002,6 +1016,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
* @param \Smarty_Internal_Template $template
|
* @param \Smarty_Internal_Template $template
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function _getTemplateId($template_name,
|
public function _getTemplateId($template_name,
|
||||||
$cache_id = null,
|
$cache_id = null,
|
||||||
@@ -1259,6 +1274,16 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
Smarty_Internal_TestInstall::testInstall($this, $errors);
|
Smarty_Internal_TestInstall::testInstall($this, $errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Smarty object
|
||||||
|
*
|
||||||
|
* @return Smarty
|
||||||
|
*/
|
||||||
|
public function _getSmartyObj()
|
||||||
|
{
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <<magic>> Generic getter.
|
* <<magic>> Generic getter.
|
||||||
* Calls the appropriate getter function.
|
* Calls the appropriate getter function.
|
||||||
|
@@ -100,6 +100,8 @@ class SmartyBC extends Smarty
|
|||||||
* @param string $function_impl the name of the PHP function to register
|
* @param string $function_impl the name of the PHP function to register
|
||||||
* @param bool $cacheable
|
* @param bool $cacheable
|
||||||
* @param mixed $cache_attrs
|
* @param mixed $cache_attrs
|
||||||
|
*
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function register_function($function, $function_impl, $cacheable = true, $cache_attrs = null)
|
public function register_function($function, $function_impl, $cacheable = true, $cache_attrs = null)
|
||||||
{
|
{
|
||||||
@@ -153,6 +155,8 @@ class SmartyBC extends Smarty
|
|||||||
* @param string $block_impl PHP function to register
|
* @param string $block_impl PHP function to register
|
||||||
* @param bool $cacheable
|
* @param bool $cacheable
|
||||||
* @param mixed $cache_attrs
|
* @param mixed $cache_attrs
|
||||||
|
*
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function register_block($block, $block_impl, $cacheable = true, $cache_attrs = null)
|
public function register_block($block, $block_impl, $cacheable = true, $cache_attrs = null)
|
||||||
{
|
{
|
||||||
@@ -175,6 +179,8 @@ class SmartyBC extends Smarty
|
|||||||
* @param string $function name of template function
|
* @param string $function name of template function
|
||||||
* @param string $function_impl name of PHP function to register
|
* @param string $function_impl name of PHP function to register
|
||||||
* @param bool $cacheable
|
* @param bool $cacheable
|
||||||
|
*
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function register_compiler_function($function, $function_impl, $cacheable = true)
|
public function register_compiler_function($function, $function_impl, $cacheable = true)
|
||||||
{
|
{
|
||||||
@@ -196,6 +202,8 @@ class SmartyBC extends Smarty
|
|||||||
*
|
*
|
||||||
* @param string $modifier name of template modifier
|
* @param string $modifier name of template modifier
|
||||||
* @param string $modifier_impl name of PHP function to register
|
* @param string $modifier_impl name of PHP function to register
|
||||||
|
*
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function register_modifier($modifier, $modifier_impl)
|
public function register_modifier($modifier, $modifier_impl)
|
||||||
{
|
{
|
||||||
@@ -238,6 +246,8 @@ class SmartyBC extends Smarty
|
|||||||
* to a template before compiling
|
* to a template before compiling
|
||||||
*
|
*
|
||||||
* @param callable $function
|
* @param callable $function
|
||||||
|
*
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function register_prefilter($function)
|
public function register_prefilter($function)
|
||||||
{
|
{
|
||||||
@@ -259,6 +269,8 @@ class SmartyBC extends Smarty
|
|||||||
* to a compiled template after compilation
|
* to a compiled template after compilation
|
||||||
*
|
*
|
||||||
* @param callable $function
|
* @param callable $function
|
||||||
|
*
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function register_postfilter($function)
|
public function register_postfilter($function)
|
||||||
{
|
{
|
||||||
@@ -280,6 +292,8 @@ class SmartyBC extends Smarty
|
|||||||
* to a template output
|
* to a template output
|
||||||
*
|
*
|
||||||
* @param callable $function
|
* @param callable $function
|
||||||
|
*
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function register_outputfilter($function)
|
public function register_outputfilter($function)
|
||||||
{
|
{
|
||||||
@@ -301,6 +315,8 @@ class SmartyBC extends Smarty
|
|||||||
*
|
*
|
||||||
* @param string $type filter type
|
* @param string $type filter type
|
||||||
* @param string $name filter name
|
* @param string $name filter name
|
||||||
|
*
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function load_filter($type, $name)
|
public function load_filter($type, $name)
|
||||||
{
|
{
|
||||||
@@ -341,7 +357,9 @@ class SmartyBC extends Smarty
|
|||||||
* @param string $cache_id
|
* @param string $cache_id
|
||||||
* @param string $compile_id
|
* @param string $compile_id
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return bool
|
||||||
|
* @throws \Exception
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function is_cached($tpl_file, $cache_id = null, $compile_id = null)
|
public function is_cached($tpl_file, $cache_id = null, $compile_id = null)
|
||||||
{
|
{
|
||||||
@@ -377,7 +395,8 @@ class SmartyBC extends Smarty
|
|||||||
*
|
*
|
||||||
* @param string $tpl_file
|
* @param string $tpl_file
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return bool
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function template_exists($tpl_file)
|
public function template_exists($tpl_file)
|
||||||
{
|
{
|
||||||
|
@@ -179,9 +179,21 @@ function smarty_function_html_checkboxes($params, $template)
|
|||||||
return implode("\n", $_html_result);
|
return implode("\n", $_html_result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @param $name
|
||||||
|
* @param $value
|
||||||
|
* @param $output
|
||||||
|
* @param $selected
|
||||||
|
* @param $extra
|
||||||
|
* @param $separator
|
||||||
|
* @param $labels
|
||||||
|
* @param $label_ids
|
||||||
|
* @param bool $escape
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels,
|
function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels,
|
||||||
$label_ids, $escape = true)
|
$label_ids, $escape = true)
|
||||||
{
|
{
|
||||||
$_output = '';
|
$_output = '';
|
||||||
|
|
||||||
|
@@ -157,7 +157,16 @@ function smarty_function_html_options($params, Smarty_Internal_Template $templat
|
|||||||
|
|
||||||
return $_html_result;
|
return $_html_result;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @param $key
|
||||||
|
* @param $value
|
||||||
|
* @param $selected
|
||||||
|
* @param $id
|
||||||
|
* @param $class
|
||||||
|
* @param $idx
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function smarty_function_html_options_optoutput($key, $value, $selected, $id, $class, &$idx)
|
function smarty_function_html_options_optoutput($key, $value, $selected, $id, $class, &$idx)
|
||||||
{
|
{
|
||||||
if (!is_array($value)) {
|
if (!is_array($value)) {
|
||||||
@@ -196,7 +205,16 @@ function smarty_function_html_options_optoutput($key, $value, $selected, $id, $c
|
|||||||
|
|
||||||
return $_html_result;
|
return $_html_result;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @param $key
|
||||||
|
* @param $values
|
||||||
|
* @param $selected
|
||||||
|
* @param $id
|
||||||
|
* @param $class
|
||||||
|
* @param $idx
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function smarty_function_html_options_optgroup($key, $values, $selected, $id, $class, &$idx)
|
function smarty_function_html_options_optgroup($key, $values, $selected, $id, $class, &$idx)
|
||||||
{
|
{
|
||||||
$optgroup_html = '<optgroup label="' . smarty_function_escape_special_chars($key) . '">' . "\n";
|
$optgroup_html = '<optgroup label="' . smarty_function_escape_special_chars($key) . '">' . "\n";
|
||||||
|
@@ -166,9 +166,21 @@ function smarty_function_html_radios($params, $template)
|
|||||||
return implode("\n", $_html_result);
|
return implode("\n", $_html_result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @param $name
|
||||||
|
* @param $value
|
||||||
|
* @param $output
|
||||||
|
* @param $selected
|
||||||
|
* @param $extra
|
||||||
|
* @param $separator
|
||||||
|
* @param $labels
|
||||||
|
* @param $label_ids
|
||||||
|
* @param $escape
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function smarty_function_html_radios_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids,
|
function smarty_function_html_radios_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids,
|
||||||
$escape)
|
$escape)
|
||||||
{
|
{
|
||||||
$_output = '';
|
$_output = '';
|
||||||
|
|
||||||
|
@@ -163,7 +163,13 @@ function smarty_function_html_table($params)
|
|||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @param $name
|
||||||
|
* @param $var
|
||||||
|
* @param $no
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function smarty_function_html_table_cycle($name, $var, $no)
|
function smarty_function_html_table_cycle($name, $var, $no)
|
||||||
{
|
{
|
||||||
if (!is_array($var)) {
|
if (!is_array($var)) {
|
||||||
|
@@ -80,21 +80,38 @@ function smarty_modifier_capitalize($string, $uc_digits = false, $lc_rest = fals
|
|||||||
*
|
*
|
||||||
* @author Kyle Renfrow
|
* @author Kyle Renfrow
|
||||||
*/
|
*/
|
||||||
|
/**
|
||||||
|
* @param $matches
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function smarty_mod_cap_mbconvert_cb($matches)
|
function smarty_mod_cap_mbconvert_cb($matches)
|
||||||
{
|
{
|
||||||
return stripslashes($matches[ 1 ]) . mb_convert_case(stripslashes($matches[ 2 ]), MB_CASE_UPPER, Smarty::$_CHARSET);
|
return stripslashes($matches[ 1 ]) . mb_convert_case(stripslashes($matches[ 2 ]), MB_CASE_UPPER, Smarty::$_CHARSET);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @param $matches
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function smarty_mod_cap_mbconvert2_cb($matches)
|
function smarty_mod_cap_mbconvert2_cb($matches)
|
||||||
{
|
{
|
||||||
return stripslashes($matches[ 1 ]) . mb_convert_case(stripslashes($matches[ 3 ]), MB_CASE_UPPER, Smarty::$_CHARSET);
|
return stripslashes($matches[ 1 ]) . mb_convert_case(stripslashes($matches[ 3 ]), MB_CASE_UPPER, Smarty::$_CHARSET);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @param $matches
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function smarty_mod_cap_ucfirst_cb($matches)
|
function smarty_mod_cap_ucfirst_cb($matches)
|
||||||
{
|
{
|
||||||
return stripslashes($matches[ 1 ]) . ucfirst(stripslashes($matches[ 2 ]));
|
return stripslashes($matches[ 1 ]) . ucfirst(stripslashes($matches[ 2 ]));
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @param $matches
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function smarty_mod_cap_ucfirst2_cb($matches)
|
function smarty_mod_cap_ucfirst2_cb($matches)
|
||||||
{
|
{
|
||||||
return stripslashes($matches[ 1 ]) . ucfirst(stripslashes($matches[ 3 ]));
|
return stripslashes($matches[ 1 ]) . ucfirst(stripslashes($matches[ 3 ]));
|
||||||
|
@@ -26,7 +26,6 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $
|
|||||||
{
|
{
|
||||||
static $_double_encode = null;
|
static $_double_encode = null;
|
||||||
static $is_loaded1 = false;
|
static $is_loaded1 = false;
|
||||||
static $is_loaded2 = false;
|
|
||||||
if ($_double_encode === null) {
|
if ($_double_encode === null) {
|
||||||
$_double_encode = version_compare(PHP_VERSION, '5.2.3', '>=');
|
$_double_encode = version_compare(PHP_VERSION, '5.2.3', '>=');
|
||||||
}
|
}
|
||||||
|
@@ -5,7 +5,6 @@
|
|||||||
* @package Smarty
|
* @package Smarty
|
||||||
* @subpackage PluginsModifierCompiler
|
* @subpackage PluginsModifierCompiler
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Smarty wordwrap modifier plugin
|
* Smarty wordwrap modifier plugin
|
||||||
* Type: modifier<br>
|
* Type: modifier<br>
|
||||||
@@ -15,10 +14,11 @@
|
|||||||
* @link http://smarty.php.net/manual/en/language.modifier.wordwrap.php wordwrap (Smarty online manual)
|
* @link http://smarty.php.net/manual/en/language.modifier.wordwrap.php wordwrap (Smarty online manual)
|
||||||
* @author Uwe Tews
|
* @author Uwe Tews
|
||||||
*
|
*
|
||||||
* @param array $params parameters
|
* @param array $params parameters
|
||||||
* @param $compiler
|
* @param \Smarty_Internal_TemplateCompilerBase $compiler
|
||||||
*
|
*
|
||||||
* @return string with compiled code
|
* @return string with compiled code
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
function smarty_modifiercompiler_wordwrap($params, Smarty_Internal_TemplateCompilerBase $compiler)
|
function smarty_modifiercompiler_wordwrap($params, Smarty_Internal_TemplateCompilerBase $compiler)
|
||||||
{
|
{
|
||||||
|
@@ -6,14 +6,13 @@
|
|||||||
* @subpackage PluginsShared
|
* @subpackage PluginsShared
|
||||||
*/
|
*/
|
||||||
if (!function_exists('smarty_mb_str_replace')) {
|
if (!function_exists('smarty_mb_str_replace')) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Multibyte string replace
|
* Multibyte string replace
|
||||||
*
|
*
|
||||||
* @param string $search the string to be searched
|
* @param string|string[] $search the string to be searched
|
||||||
* @param string $replace the replacement string
|
* @param string|string[] $replace the replacement string
|
||||||
* @param string $subject the source string
|
* @param string $subject the source string
|
||||||
* @param int &$count number of matches found
|
* @param int &$count number of matches found
|
||||||
*
|
*
|
||||||
* @return string replaced string
|
* @return string replaced string
|
||||||
* @author Rodney Rehm
|
* @author Rodney Rehm
|
||||||
@@ -29,7 +28,7 @@ if (!function_exists('smarty_mb_str_replace')) {
|
|||||||
$string = smarty_mb_str_replace($search, $replace, $string, $c);
|
$string = smarty_mb_str_replace($search, $replace, $string, $c);
|
||||||
$count += $c;
|
$count += $c;
|
||||||
}
|
}
|
||||||
} elseif (is_array($search)) {
|
} else if (is_array($search)) {
|
||||||
if (!is_array($replace)) {
|
if (!is_array($replace)) {
|
||||||
foreach ($search as &$string) {
|
foreach ($search as &$string) {
|
||||||
$subject = smarty_mb_str_replace($string, $replace, $subject, $c);
|
$subject = smarty_mb_str_replace($string, $replace, $subject, $c);
|
||||||
@@ -37,7 +36,7 @@ if (!function_exists('smarty_mb_str_replace')) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$n = max(count($search), count($replace));
|
$n = max(count($search), count($replace));
|
||||||
while ($n --) {
|
while ($n--) {
|
||||||
$subject = smarty_mb_str_replace(current($search), current($replace), $subject, $c);
|
$subject = smarty_mb_str_replace(current($search), current($replace), $subject, $c);
|
||||||
$count += $c;
|
$count += $c;
|
||||||
next($search);
|
next($search);
|
||||||
@@ -49,7 +48,6 @@ if (!function_exists('smarty_mb_str_replace')) {
|
|||||||
$count = count($parts) - 1;
|
$count = count($parts) - 1;
|
||||||
$subject = implode($replace, $parts);
|
$subject = implode($replace, $parts);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $subject;
|
return $subject;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -204,7 +204,8 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource
|
|||||||
* @param string $compile_id compile id
|
* @param string $compile_id compile id
|
||||||
* @param integer $exp_time expiration time (number of seconds, not timestamp)
|
* @param integer $exp_time expiration time (number of seconds, not timestamp)
|
||||||
*
|
*
|
||||||
* @return integer number of cache files deleted
|
* @return int number of cache files deleted
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)
|
public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)
|
||||||
{
|
{
|
||||||
|
@@ -180,7 +180,8 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource
|
|||||||
* @param string $compile_id compile id
|
* @param string $compile_id compile id
|
||||||
* @param integer $exp_time expiration time [being ignored]
|
* @param integer $exp_time expiration time [being ignored]
|
||||||
*
|
*
|
||||||
* @return integer number of cache files deleted [always -1]
|
* @return int number of cache files deleted [always -1]
|
||||||
|
* @throws \SmartyException
|
||||||
* @uses buildCachedFilepath() to generate the CacheID
|
* @uses buildCachedFilepath() to generate the CacheID
|
||||||
* @uses invalidate() to mark CacheIDs parent chain as outdated
|
* @uses invalidate() to mark CacheIDs parent chain as outdated
|
||||||
* @uses delete() to remove CacheID from cache
|
* @uses delete() to remove CacheID from cache
|
||||||
|
@@ -106,7 +106,8 @@ class Smarty_Internal_CacheResource_File extends Smarty_CacheResource
|
|||||||
* @param Smarty_Internal_Template $_template template object
|
* @param Smarty_Internal_Template $_template template object
|
||||||
* @param string $content content to cache
|
* @param string $content content to cache
|
||||||
*
|
*
|
||||||
* @return boolean success
|
* @return bool success
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function writeCachedContent(Smarty_Internal_Template $_template, $content)
|
public function writeCachedContent(Smarty_Internal_Template $_template, $content)
|
||||||
{
|
{
|
||||||
|
@@ -24,6 +24,7 @@ class Smarty_Internal_Compile_Append extends Smarty_Internal_Compile_Assign
|
|||||||
* @param array $parameter array with compilation parameter
|
* @param array $parameter array with compilation parameter
|
||||||
*
|
*
|
||||||
* @return string compiled code
|
* @return string compiled code
|
||||||
|
* @throws \SmartyCompilerException
|
||||||
*/
|
*/
|
||||||
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)
|
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)
|
||||||
{
|
{
|
||||||
|
@@ -57,13 +57,12 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_Compile_Shared_Inher
|
|||||||
/**
|
/**
|
||||||
* Compiles code for the {block} tag
|
* Compiles code for the {block} tag
|
||||||
*
|
*
|
||||||
* @param array $args array with attributes from parser
|
* @param array $args array with attributes from parser
|
||||||
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
|
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
|
||||||
* @param array $parameter array with compilation parameter
|
|
||||||
*
|
*
|
||||||
* @return string compiled code
|
* @return string compiled code
|
||||||
*/
|
*/
|
||||||
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)
|
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
|
||||||
{
|
{
|
||||||
if (!isset($compiler->_cache['blockNesting'])) {
|
if (!isset($compiler->_cache['blockNesting'])) {
|
||||||
$compiler->_cache['blockNesting'] = 0;
|
$compiler->_cache['blockNesting'] = 0;
|
||||||
@@ -151,13 +150,13 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_Compile_Shared_
|
|||||||
/**
|
/**
|
||||||
* Compiles code for the {/block} tag
|
* Compiles code for the {/block} tag
|
||||||
*
|
*
|
||||||
* @param array $args array with attributes from parser
|
* @param array $args array with attributes from parser
|
||||||
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
|
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
|
||||||
* @param array $parameter array with compilation parameter
|
|
||||||
*
|
*
|
||||||
* @return string compiled code
|
* @return string compiled code
|
||||||
|
* @internal param array $parameter array with compilation parameter
|
||||||
*/
|
*/
|
||||||
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)
|
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
|
||||||
{
|
{
|
||||||
list($_attr, $_nocache, $_buffer, $_has_nocache_code, $_caching) = $this->closeTag($compiler, array('block'));
|
list($_attr, $_nocache, $_buffer, $_has_nocache_code, $_caching) = $this->closeTag($compiler, array('block'));
|
||||||
// init block parameter
|
// init block parameter
|
||||||
|
@@ -35,13 +35,13 @@ class Smarty_Internal_Compile_Break extends Smarty_Internal_CompileBase
|
|||||||
/**
|
/**
|
||||||
* Compiles code for the {break} tag
|
* Compiles code for the {break} tag
|
||||||
*
|
*
|
||||||
* @param array $args array with attributes from parser
|
* @param array $args array with attributes from parser
|
||||||
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
|
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
|
||||||
* @param array $parameter array with compilation parameter
|
|
||||||
*
|
*
|
||||||
* @return string compiled code
|
* @return string compiled code
|
||||||
|
* @throws \SmartyCompilerException
|
||||||
*/
|
*/
|
||||||
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)
|
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
|
||||||
{
|
{
|
||||||
list($levels, $foreachLevels) = $this->checkLevels($args, $compiler);
|
list($levels, $foreachLevels) = $this->checkLevels($args, $compiler);
|
||||||
$output = "<?php\n";
|
$output = "<?php\n";
|
||||||
|
@@ -16,18 +16,17 @@
|
|||||||
*/
|
*/
|
||||||
class Smarty_Internal_Compile_Continue extends Smarty_Internal_Compile_Break
|
class Smarty_Internal_Compile_Continue extends Smarty_Internal_Compile_Break
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compiles code for the {continue} tag
|
* Compiles code for the {continue} tag
|
||||||
*
|
*
|
||||||
* @param array $args array with attributes from parser
|
* @param array $args array with attributes from parser
|
||||||
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
|
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
|
||||||
* @param array $parameter array with compilation parameter
|
|
||||||
*
|
*
|
||||||
* @return string compiled code
|
* @return string compiled code
|
||||||
* @throws \SmartyCompilerException
|
* @throws \SmartyCompilerException
|
||||||
|
* @internal param array $parameter array with compilation parameter
|
||||||
*/
|
*/
|
||||||
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)
|
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
|
||||||
{
|
{
|
||||||
list($levels, $foreachLevels) = $this->checkLevels($args, $compiler, 'continue');
|
list($levels, $foreachLevels) = $this->checkLevels($args, $compiler, 'continue');
|
||||||
$output = "<?php\n";
|
$output = "<?php\n";
|
||||||
|
@@ -95,6 +95,9 @@ class Smarty_Internal_Compile_Extends extends Smarty_Internal_Compile_Shared_Inh
|
|||||||
*
|
*
|
||||||
* @param \Smarty_Internal_TemplateCompilerBase $compiler
|
* @param \Smarty_Internal_TemplateCompilerBase $compiler
|
||||||
* @param null|string $template optional inheritance parent template
|
* @param null|string $template optional inheritance parent template
|
||||||
|
*
|
||||||
|
* @throws \SmartyCompilerException
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
private function compileEndChild(Smarty_Internal_TemplateCompilerBase $compiler, $template = null)
|
private function compileEndChild(Smarty_Internal_TemplateCompilerBase $compiler, $template = null)
|
||||||
{
|
{
|
||||||
@@ -117,6 +120,9 @@ class Smarty_Internal_Compile_Extends extends Smarty_Internal_Compile_Shared_Inh
|
|||||||
*
|
*
|
||||||
* @param \Smarty_Internal_TemplateCompilerBase $compiler
|
* @param \Smarty_Internal_TemplateCompilerBase $compiler
|
||||||
* @param string $template subtemplate name
|
* @param string $template subtemplate name
|
||||||
|
*
|
||||||
|
* @throws \SmartyCompilerException
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
private function compileInclude(Smarty_Internal_TemplateCompilerBase $compiler, $template)
|
private function compileInclude(Smarty_Internal_TemplateCompilerBase $compiler, $template)
|
||||||
{
|
{
|
||||||
|
@@ -78,14 +78,14 @@ class Smarty_Internal_Compile_Foreach extends Smarty_Internal_Compile_Private_Fo
|
|||||||
/**
|
/**
|
||||||
* Compiles code for the {foreach} tag
|
* Compiles code for the {foreach} tag
|
||||||
*
|
*
|
||||||
* @param array $args array with attributes from parser
|
* @param array $args array with attributes from parser
|
||||||
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
|
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
|
||||||
* @param array $parameter array with compilation parameter
|
|
||||||
*
|
*
|
||||||
* @return string compiled code
|
* @return string compiled code
|
||||||
* @throws \SmartyCompilerException
|
* @throws \SmartyCompilerException
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)
|
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
|
||||||
{
|
{
|
||||||
$compiler->loopNesting ++;
|
$compiler->loopNesting ++;
|
||||||
// init
|
// init
|
||||||
@@ -277,13 +277,12 @@ class Smarty_Internal_Compile_Foreachelse extends Smarty_Internal_CompileBase
|
|||||||
/**
|
/**
|
||||||
* Compiles code for the {foreachelse} tag
|
* Compiles code for the {foreachelse} tag
|
||||||
*
|
*
|
||||||
* @param array $args array with attributes from parser
|
* @param array $args array with attributes from parser
|
||||||
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
|
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
|
||||||
* @param array $parameter array with compilation parameter
|
|
||||||
*
|
*
|
||||||
* @return string compiled code
|
* @return string compiled code
|
||||||
*/
|
*/
|
||||||
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)
|
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
|
||||||
{
|
{
|
||||||
// check and get attributes
|
// check and get attributes
|
||||||
$_attr = $this->getAttributes($compiler, $args);
|
$_attr = $this->getAttributes($compiler, $args);
|
||||||
@@ -310,13 +309,13 @@ class Smarty_Internal_Compile_Foreachclose extends Smarty_Internal_CompileBase
|
|||||||
/**
|
/**
|
||||||
* Compiles code for the {/foreach} tag
|
* Compiles code for the {/foreach} tag
|
||||||
*
|
*
|
||||||
* @param array $args array with attributes from parser
|
* @param array $args array with attributes from parser
|
||||||
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
|
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
|
||||||
* @param array $parameter array with compilation parameter
|
|
||||||
*
|
*
|
||||||
* @return string compiled code
|
* @return string compiled code
|
||||||
*/
|
* @throws \SmartyCompilerException
|
||||||
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)
|
*/
|
||||||
|
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
|
||||||
{
|
{
|
||||||
$compiler->loopNesting --;
|
$compiler->loopNesting --;
|
||||||
// must endblock be nocache?
|
// must endblock be nocache?
|
||||||
|
@@ -44,14 +44,13 @@ class Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase
|
|||||||
/**
|
/**
|
||||||
* Compiles code for the {function} tag
|
* Compiles code for the {function} tag
|
||||||
*
|
*
|
||||||
* @param array $args array with attributes from parser
|
* @param array $args array with attributes from parser
|
||||||
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
|
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
|
||||||
* @param array $parameter array with compilation parameter
|
|
||||||
*
|
*
|
||||||
* @return bool true
|
* @return bool true
|
||||||
* @throws \SmartyCompilerException
|
* @throws \SmartyCompilerException
|
||||||
*/
|
*/
|
||||||
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)
|
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
|
||||||
{
|
{
|
||||||
// check and get attributes
|
// check and get attributes
|
||||||
$_attr = $this->getAttributes($compiler, $args);
|
$_attr = $this->getAttributes($compiler, $args);
|
||||||
@@ -91,13 +90,12 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase
|
|||||||
/**
|
/**
|
||||||
* Compiles code for the {/function} tag
|
* Compiles code for the {/function} tag
|
||||||
*
|
*
|
||||||
* @param array $args array with attributes from parser
|
* @param array $args array with attributes from parser
|
||||||
* @param object|\Smarty_Internal_TemplateCompilerBase $compiler compiler object
|
* @param object|\Smarty_Internal_TemplateCompilerBase $compiler compiler object
|
||||||
* @param array $parameter array with compilation parameter
|
|
||||||
*
|
*
|
||||||
* @return bool true
|
* @return bool true
|
||||||
*/
|
*/
|
||||||
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)
|
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
|
||||||
{
|
{
|
||||||
$this->compiler = $compiler;
|
$this->compiler = $compiler;
|
||||||
$saved_data = $this->closeTag($compiler, array('function'));
|
$saved_data = $this->closeTag($compiler, array('function'));
|
||||||
|
@@ -80,13 +80,12 @@ class Smarty_Internal_Compile_Else extends Smarty_Internal_CompileBase
|
|||||||
/**
|
/**
|
||||||
* Compiles code for the {else} tag
|
* Compiles code for the {else} tag
|
||||||
*
|
*
|
||||||
* @param array $args array with attributes from parser
|
* @param array $args array with attributes from parser
|
||||||
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
|
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
|
||||||
* @param array $parameter array with compilation parameter
|
|
||||||
*
|
*
|
||||||
* @return string compiled code
|
* @return string compiled code
|
||||||
*/
|
*/
|
||||||
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)
|
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
|
||||||
{
|
{
|
||||||
list($nesting, $compiler->tag_nocache) = $this->closeTag($compiler, array('if', 'elseif'));
|
list($nesting, $compiler->tag_nocache) = $this->closeTag($compiler, array('if', 'elseif'));
|
||||||
$this->openTag($compiler, 'else', array($nesting, $compiler->tag_nocache));
|
$this->openTag($compiler, 'else', array($nesting, $compiler->tag_nocache));
|
||||||
@@ -188,13 +187,12 @@ class Smarty_Internal_Compile_Ifclose extends Smarty_Internal_CompileBase
|
|||||||
/**
|
/**
|
||||||
* Compiles code for the {/if} tag
|
* Compiles code for the {/if} tag
|
||||||
*
|
*
|
||||||
* @param array $args array with attributes from parser
|
* @param array $args array with attributes from parser
|
||||||
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
|
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
|
||||||
* @param array $parameter array with compilation parameter
|
|
||||||
*
|
*
|
||||||
* @return string compiled code
|
* @return string compiled code
|
||||||
*/
|
*/
|
||||||
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)
|
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
|
||||||
{
|
{
|
||||||
// must endblock be nocache?
|
// must endblock be nocache?
|
||||||
if ($compiler->nocache) {
|
if ($compiler->nocache) {
|
||||||
|
@@ -59,14 +59,15 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase
|
|||||||
/**
|
/**
|
||||||
* Compiles code for the {include} tag
|
* Compiles code for the {include} tag
|
||||||
*
|
*
|
||||||
* @param array $args array with attributes from parser
|
* @param array $args array with attributes from parser
|
||||||
* @param Smarty_Internal_SmartyTemplateCompiler $compiler compiler object
|
* @param Smarty_Internal_SmartyTemplateCompiler $compiler compiler object
|
||||||
* @param array $parameter array with compilation parameter
|
|
||||||
*
|
*
|
||||||
* @throws SmartyCompilerException
|
* @return string
|
||||||
* @return string compiled code
|
* @throws \Exception
|
||||||
|
* @throws \SmartyCompilerException
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function compile($args, Smarty_Internal_SmartyTemplateCompiler $compiler, $parameter)
|
public function compile($args, Smarty_Internal_SmartyTemplateCompiler $compiler)
|
||||||
{
|
{
|
||||||
$uid = $t_hash = null;
|
$uid = $t_hash = null;
|
||||||
// check and get attributes
|
// check and get attributes
|
||||||
@@ -271,6 +272,8 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase
|
|||||||
* @param string $t_hash
|
* @param string $t_hash
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
|
* @throws \Exception
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function compileInlineTemplate(Smarty_Internal_SmartyTemplateCompiler $compiler,
|
public function compileInlineTemplate(Smarty_Internal_SmartyTemplateCompiler $compiler,
|
||||||
Smarty_Internal_Template $tpl,
|
Smarty_Internal_Template $tpl,
|
||||||
|
@@ -46,6 +46,7 @@ class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase
|
|||||||
*
|
*
|
||||||
* @return string compiled code
|
* @return string compiled code
|
||||||
* @throws \SmartyCompilerException
|
* @throws \SmartyCompilerException
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
|
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
|
||||||
{
|
{
|
||||||
|
@@ -41,14 +41,12 @@ class Smarty_Internal_Compile_Make_Nocache extends Smarty_Internal_CompileBase
|
|||||||
/**
|
/**
|
||||||
* Compiles code for the {make_nocache} tag
|
* Compiles code for the {make_nocache} tag
|
||||||
*
|
*
|
||||||
* @param array $args array with attributes from parser
|
* @param array $args array with attributes from parser
|
||||||
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
|
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
|
||||||
* @param array $parameter array with compilation parameter
|
|
||||||
*
|
*
|
||||||
* @return string compiled code
|
* @return string compiled code
|
||||||
* @throws \SmartyCompilerException
|
*/
|
||||||
*/
|
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
|
||||||
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)
|
|
||||||
{
|
{
|
||||||
// check and get attributes
|
// check and get attributes
|
||||||
$_attr = $this->getAttributes($compiler, $args);
|
$_attr = $this->getAttributes($compiler, $args);
|
||||||
|
@@ -41,6 +41,8 @@ class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_Compi
|
|||||||
* @param string $function PHP function name
|
* @param string $function PHP function name
|
||||||
*
|
*
|
||||||
* @return string compiled code
|
* @return string compiled code
|
||||||
|
* @throws \SmartyCompilerException
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter, $tag, $function = null)
|
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter, $tag, $function = null)
|
||||||
{
|
{
|
||||||
|
@@ -76,6 +76,8 @@ class Smarty_Internal_Compile_Private_ForeachSection extends Smarty_Internal_Com
|
|||||||
*
|
*
|
||||||
* @param array $attributes
|
* @param array $attributes
|
||||||
* @param \Smarty_Internal_TemplateCompilerBase $compiler
|
* @param \Smarty_Internal_TemplateCompilerBase $compiler
|
||||||
|
*
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function scanForProperties($attributes, Smarty_Internal_TemplateCompilerBase $compiler)
|
public function scanForProperties($attributes, Smarty_Internal_TemplateCompilerBase $compiler)
|
||||||
{
|
{
|
||||||
@@ -161,6 +163,8 @@ class Smarty_Internal_Compile_Private_ForeachSection extends Smarty_Internal_Com
|
|||||||
* Find matches in all parent template source
|
* Find matches in all parent template source
|
||||||
*
|
*
|
||||||
* @param \Smarty_Internal_TemplateCompilerBase $compiler
|
* @param \Smarty_Internal_TemplateCompilerBase $compiler
|
||||||
|
*
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function matchParentTemplateSource(Smarty_Internal_TemplateCompilerBase $compiler)
|
public function matchParentTemplateSource(Smarty_Internal_TemplateCompilerBase $compiler)
|
||||||
{
|
{
|
||||||
|
@@ -42,6 +42,8 @@ class Smarty_Internal_Compile_Private_Function_Plugin extends Smarty_Internal_Co
|
|||||||
* @param string $function PHP function name
|
* @param string $function PHP function name
|
||||||
*
|
*
|
||||||
* @return string compiled code
|
* @return string compiled code
|
||||||
|
* @throws \SmartyCompilerException
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter, $tag, $function)
|
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter, $tag, $function)
|
||||||
{
|
{
|
||||||
|
@@ -26,6 +26,7 @@ class Smarty_Internal_Compile_Private_Modifier extends Smarty_Internal_CompileBa
|
|||||||
*
|
*
|
||||||
* @return string compiled code
|
* @return string compiled code
|
||||||
* @throws \SmartyCompilerException
|
* @throws \SmartyCompilerException
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)
|
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)
|
||||||
{
|
{
|
||||||
@@ -34,6 +35,7 @@ class Smarty_Internal_Compile_Private_Modifier extends Smarty_Internal_CompileBa
|
|||||||
$output = $parameter[ 'value' ];
|
$output = $parameter[ 'value' ];
|
||||||
// loop over list of modifiers
|
// loop over list of modifiers
|
||||||
foreach ($parameter[ 'modifierlist' ] as $single_modifier) {
|
foreach ($parameter[ 'modifierlist' ] as $single_modifier) {
|
||||||
|
/* @var string $modifier */
|
||||||
$modifier = $single_modifier[ 0 ];
|
$modifier = $single_modifier[ 0 ];
|
||||||
$single_modifier[ 0 ] = $output;
|
$single_modifier[ 0 ] = $output;
|
||||||
$params = implode(',', $single_modifier);
|
$params = implode(',', $single_modifier);
|
||||||
|
@@ -34,6 +34,8 @@ class Smarty_Internal_Compile_Private_Object_Function extends Smarty_Internal_Co
|
|||||||
* @param string $method name of method to call
|
* @param string $method name of method to call
|
||||||
*
|
*
|
||||||
* @return string compiled code
|
* @return string compiled code
|
||||||
|
* @throws \SmartyCompilerException
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter, $tag, $method)
|
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter, $tag, $method)
|
||||||
{
|
{
|
||||||
|
@@ -107,9 +107,11 @@ class Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase
|
|||||||
*
|
*
|
||||||
* This code has been moved from lexer here fo easier debugging and maintenance
|
* This code has been moved from lexer here fo easier debugging and maintenance
|
||||||
*
|
*
|
||||||
* @param $lex
|
* @param Smarty_Internal_Templatelexer $lex
|
||||||
|
*
|
||||||
|
* @throws \SmartyCompilerException
|
||||||
*/
|
*/
|
||||||
public function parsePhp($lex)
|
public function parsePhp(Smarty_Internal_Templatelexer $lex)
|
||||||
{
|
{
|
||||||
$lex->token = Smarty_Internal_Templateparser::TP_PHP;
|
$lex->token = Smarty_Internal_Templateparser::TP_PHP;
|
||||||
$close = 0;
|
$close = 0;
|
||||||
|
@@ -134,6 +134,7 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C
|
|||||||
* @param string $output embedded output
|
* @param string $output embedded output
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
private function compile_output_filter(Smarty_Internal_TemplateCompilerBase $compiler, $name, $output)
|
private function compile_output_filter(Smarty_Internal_TemplateCompilerBase $compiler, $name, $output)
|
||||||
{
|
{
|
||||||
|
@@ -33,6 +33,8 @@ class Smarty_Internal_Compile_Private_Registered_Function extends Smarty_Interna
|
|||||||
* @param string $tag name of function
|
* @param string $tag name of function
|
||||||
*
|
*
|
||||||
* @return string compiled code
|
* @return string compiled code
|
||||||
|
* @throws \SmartyCompilerException
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter, $tag)
|
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter, $tag)
|
||||||
{
|
{
|
||||||
|
@@ -84,6 +84,7 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo
|
|||||||
*
|
*
|
||||||
* @return string compiled code
|
* @return string compiled code
|
||||||
* @throws \SmartyCompilerException
|
* @throws \SmartyCompilerException
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
|
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
|
||||||
{
|
{
|
||||||
|
@@ -97,6 +97,7 @@ class Smarty_Internal_Config_File_Compiler
|
|||||||
* @param Smarty_Internal_Template $template
|
* @param Smarty_Internal_Template $template
|
||||||
*
|
*
|
||||||
* @return bool true if compiling succeeded, false if it failed
|
* @return bool true if compiling succeeded, false if it failed
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function compileTemplate(Smarty_Internal_Template $template)
|
public function compileTemplate(Smarty_Internal_Template $template)
|
||||||
{
|
{
|
||||||
|
@@ -153,6 +153,9 @@ class Smarty_Internal_Configfilelexer
|
|||||||
$this->yyTracePrompt = '<br>';
|
$this->yyTracePrompt = '<br>';
|
||||||
} // end function
|
} // end function
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $state
|
||||||
|
*/
|
||||||
public function yybegin($state)
|
public function yybegin($state)
|
||||||
{
|
{
|
||||||
$this->_yy_state = $state;
|
$this->_yy_state = $state;
|
||||||
@@ -165,7 +168,11 @@ class Smarty_Internal_Configfilelexer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function yylex1()
|
/**
|
||||||
|
* @return bool
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
|
public function yylex1()
|
||||||
{
|
{
|
||||||
if (!isset($this->yy_global_pattern1)) {
|
if (!isset($this->yy_global_pattern1)) {
|
||||||
$this->yy_global_pattern1 =
|
$this->yy_global_pattern1 =
|
||||||
@@ -221,11 +228,19 @@ public function yylex1()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $input
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
public function replace($input)
|
public function replace($input)
|
||||||
{
|
{
|
||||||
return $input;
|
return $input;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
public function yylex()
|
public function yylex()
|
||||||
{
|
{
|
||||||
return $this->{'yylex' . $this->_yy_state}();
|
return $this->{'yylex' . $this->_yy_state}();
|
||||||
@@ -238,6 +253,9 @@ public function yylex1()
|
|||||||
$this->yypushstate(self::COMMENT);
|
$this->yypushstate(self::COMMENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $state
|
||||||
|
*/
|
||||||
public function yypushstate($state)
|
public function yypushstate($state)
|
||||||
{
|
{
|
||||||
if ($this->yyTraceFILE) {
|
if ($this->yyTraceFILE) {
|
||||||
@@ -278,6 +296,9 @@ public function yylex1()
|
|||||||
$this->yypushstate(self::VALUE);
|
$this->yypushstate(self::VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
function yy_r1_5()
|
function yy_r1_5()
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -302,7 +323,11 @@ public function yylex1()
|
|||||||
$this->token = Smarty_Internal_Configfileparser::TPC_OTHER;
|
$this->token = Smarty_Internal_Configfileparser::TPC_OTHER;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function yylex2()
|
/**
|
||||||
|
* @return bool
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
|
public function yylex2()
|
||||||
{
|
{
|
||||||
if (!isset($this->yy_global_pattern2)) {
|
if (!isset($this->yy_global_pattern2)) {
|
||||||
$this->yy_global_pattern2 =
|
$this->yy_global_pattern2 =
|
||||||
@@ -358,6 +383,9 @@ public function yylex2()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
function yy_r2_1()
|
function yy_r2_1()
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -419,6 +447,9 @@ public function yylex2()
|
|||||||
$this->yypopstate();
|
$this->yypopstate();
|
||||||
} // end function
|
} // end function
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
function yy_r2_7()
|
function yy_r2_7()
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -448,7 +479,11 @@ public function yylex2()
|
|||||||
$this->yypopstate();
|
$this->yypopstate();
|
||||||
} // end function
|
} // end function
|
||||||
|
|
||||||
public function yylex3()
|
/**
|
||||||
|
* @return bool
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
|
public function yylex3()
|
||||||
{
|
{
|
||||||
if (!isset($this->yy_global_pattern3)) {
|
if (!isset($this->yy_global_pattern3)) {
|
||||||
$this->yy_global_pattern3 = $this->replace("/\G([^\n]+?(?=[ \t\r]*\n))/isS");
|
$this->yy_global_pattern3 = $this->replace("/\G([^\n]+?(?=[ \t\r]*\n))/isS");
|
||||||
@@ -510,7 +545,11 @@ public function yylex3()
|
|||||||
$this->yypopstate();
|
$this->yypopstate();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function yylex4()
|
/**
|
||||||
|
* @return bool
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
|
public function yylex4()
|
||||||
{
|
{
|
||||||
if (!isset($this->yy_global_pattern4)) {
|
if (!isset($this->yy_global_pattern4)) {
|
||||||
$this->yy_global_pattern4 = $this->replace("/\G([ \t\r]+)|\G([^\n]+?(?=[ \t\r]*\n))|\G(\n)/isS");
|
$this->yy_global_pattern4 = $this->replace("/\G([ \t\r]+)|\G([^\n]+?(?=[ \t\r]*\n))|\G(\n)/isS");
|
||||||
@@ -565,6 +604,9 @@ public function yylex4()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
function yy_r4_1()
|
function yy_r4_1()
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -584,7 +626,11 @@ public function yylex4()
|
|||||||
$this->yypopstate();
|
$this->yypopstate();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function yylex5()
|
/**
|
||||||
|
* @return bool
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
|
public function yylex5()
|
||||||
{
|
{
|
||||||
if (!isset($this->yy_global_pattern5)) {
|
if (!isset($this->yy_global_pattern5)) {
|
||||||
$this->yy_global_pattern5 = $this->replace("/\G(\\.)|\G(.*?(?=[\.=[\]\r\n]))/isS");
|
$this->yy_global_pattern5 = $this->replace("/\G(\\.)|\G(.*?(?=[\.=[\]\r\n]))/isS");
|
||||||
@@ -652,7 +698,11 @@ public function yylex5()
|
|||||||
$this->yypopstate();
|
$this->yypopstate();
|
||||||
} // end function
|
} // end function
|
||||||
|
|
||||||
public function yylex6()
|
/**
|
||||||
|
* @return bool
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
|
public function yylex6()
|
||||||
{
|
{
|
||||||
if (!isset($this->yy_global_pattern6)) {
|
if (!isset($this->yy_global_pattern6)) {
|
||||||
$this->yy_global_pattern6 = $this->replace("/\G(\"\"\"(?=[ \t\r]*[\n#;]))|\G([\S\s])/isS");
|
$this->yy_global_pattern6 = $this->replace("/\G(\"\"\"(?=[ \t\r]*[\n#;]))|\G([\S\s])/isS");
|
||||||
|
@@ -1,10 +1,19 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class TPC_yyToken
|
||||||
|
*/
|
||||||
class TPC_yyToken implements ArrayAccess
|
class TPC_yyToken implements ArrayAccess
|
||||||
{
|
{
|
||||||
public $string = '';
|
public $string = '';
|
||||||
public $metadata = array();
|
public $metadata = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TPC_yyToken constructor.
|
||||||
|
*
|
||||||
|
* @param $s
|
||||||
|
* @param array $m
|
||||||
|
*/
|
||||||
public function __construct($s, $m = array())
|
public function __construct($s, $m = array())
|
||||||
{
|
{
|
||||||
if ($s instanceof TPC_yyToken) {
|
if ($s instanceof TPC_yyToken) {
|
||||||
@@ -20,21 +29,38 @@ class TPC_yyToken implements ArrayAccess
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
return $this->string;
|
return $this->string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param mixed $offset
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
public function offsetExists($offset)
|
public function offsetExists($offset)
|
||||||
{
|
{
|
||||||
return isset($this->metadata[ $offset ]);
|
return isset($this->metadata[ $offset ]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param mixed $offset
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
public function offsetGet($offset)
|
public function offsetGet($offset)
|
||||||
{
|
{
|
||||||
return $this->metadata[ $offset ];
|
return $this->metadata[ $offset ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param mixed $offset
|
||||||
|
* @param mixed $value
|
||||||
|
*/
|
||||||
public function offsetSet($offset, $value)
|
public function offsetSet($offset, $value)
|
||||||
{
|
{
|
||||||
if ($offset === null) {
|
if ($offset === null) {
|
||||||
@@ -58,12 +84,18 @@ class TPC_yyToken implements ArrayAccess
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param mixed $offset
|
||||||
|
*/
|
||||||
public function offsetUnset($offset)
|
public function offsetUnset($offset)
|
||||||
{
|
{
|
||||||
unset($this->metadata[ $offset ]);
|
unset($this->metadata[ $offset ]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class TPC_yyStackEntry
|
||||||
|
*/
|
||||||
class TPC_yyStackEntry
|
class TPC_yyStackEntry
|
||||||
{
|
{
|
||||||
public $stateno; /* The state-number */
|
public $stateno; /* The state-number */
|
||||||
@@ -247,6 +279,10 @@ public $yystack = array();
|
|||||||
$this->configReadHidden = $this->smarty->config_read_hidden;
|
$this->configReadHidden = $this->smarty->config_read_hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $TraceFILE
|
||||||
|
* @param $zTracePrompt
|
||||||
|
*/
|
||||||
public function Trace($TraceFILE, $zTracePrompt)
|
public function Trace($TraceFILE, $zTracePrompt)
|
||||||
{
|
{
|
||||||
if (!$TraceFILE) {
|
if (!$TraceFILE) {
|
||||||
@@ -263,7 +299,11 @@ public $yystack = array();
|
|||||||
$this->yyTraceFILE = fopen('php://output', 'w');
|
$this->yyTraceFILE = fopen('php://output', 'w');
|
||||||
$this->yyTracePrompt = '<br>';
|
$this->yyTracePrompt = '<br>';
|
||||||
} /* Index of top element in stack */
|
} /* Index of top element in stack */
|
||||||
|
/**
|
||||||
|
* @param $tokenType
|
||||||
|
*
|
||||||
|
* @return mixed|string
|
||||||
|
*/
|
||||||
public function tokenName($tokenType)
|
public function tokenName($tokenType)
|
||||||
{
|
{
|
||||||
if ($tokenType === 0) {
|
if ($tokenType === 0) {
|
||||||
@@ -303,6 +343,10 @@ public $yystack = array();
|
|||||||
return $yymajor;
|
return $yymajor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $yymajor
|
||||||
|
* @param $yypminor
|
||||||
|
*/
|
||||||
public static function yy_destructor($yymajor, $yypminor)
|
public static function yy_destructor($yymajor, $yypminor)
|
||||||
{
|
{
|
||||||
switch ($yymajor) {
|
switch ($yymajor) {
|
||||||
@@ -311,6 +355,11 @@ public $yystack = array();
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $token
|
||||||
|
*
|
||||||
|
* @return array|mixed
|
||||||
|
*/
|
||||||
public function yy_get_expected_tokens($token)
|
public function yy_get_expected_tokens($token)
|
||||||
{
|
{
|
||||||
static $res3 = array();
|
static $res3 = array();
|
||||||
@@ -395,6 +444,11 @@ public $yystack = array();
|
|||||||
return array_unique($expected);
|
return array_unique($expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $iLookAhead
|
||||||
|
*
|
||||||
|
* @return int|mixed
|
||||||
|
*/
|
||||||
public function yy_find_shift_action($iLookAhead)
|
public function yy_find_shift_action($iLookAhead)
|
||||||
{
|
{
|
||||||
$stateno = $this->yystack[ $this->yyidx ]->stateno;
|
$stateno = $this->yystack[ $this->yyidx ]->stateno;
|
||||||
@@ -430,6 +484,12 @@ public $yystack = array();
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $stateno
|
||||||
|
* @param $iLookAhead
|
||||||
|
*
|
||||||
|
* @return int|mixed
|
||||||
|
*/
|
||||||
public function yy_find_reduce_action($stateno, $iLookAhead)
|
public function yy_find_reduce_action($stateno, $iLookAhead)
|
||||||
{
|
{
|
||||||
/* $stateno = $this->yystack[$this->yyidx]->stateno; */
|
/* $stateno = $this->yystack[$this->yyidx]->stateno; */
|
||||||
@@ -692,6 +752,12 @@ public $yystack = array();
|
|||||||
|
|
||||||
#line 324 "../smarty/lexer/smarty_internal_configfileparser.y"
|
#line 324 "../smarty/lexer/smarty_internal_configfileparser.y"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $yymajor
|
||||||
|
* @param $yytokenvalue
|
||||||
|
*
|
||||||
|
* @throws \SmartyCompilerException
|
||||||
|
*/
|
||||||
public function doParse($yymajor, $yytokenvalue)
|
public function doParse($yymajor, $yytokenvalue)
|
||||||
{
|
{
|
||||||
$yyerrorhit = 0; /* True if yymajor has invoked an error */
|
$yyerrorhit = 0; /* True if yymajor has invoked an error */
|
||||||
@@ -784,6 +850,11 @@ public $yystack = array();
|
|||||||
} while ($yymajor != self::YYNOCODE && $this->yyidx >= 0);
|
} while ($yymajor != self::YYNOCODE && $this->yyidx >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $token
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
public function yy_is_expected_token($token)
|
public function yy_is_expected_token($token)
|
||||||
{
|
{
|
||||||
static $res = array();
|
static $res = array();
|
||||||
@@ -873,6 +944,13 @@ public $yystack = array();
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $yyNewState
|
||||||
|
* @param $yyMajor
|
||||||
|
* @param $yypMinor
|
||||||
|
*
|
||||||
|
* @throws \SmartyCompilerException
|
||||||
|
*/
|
||||||
public function yy_shift($yyNewState, $yyMajor, $yypMinor)
|
public function yy_shift($yyNewState, $yyMajor, $yypMinor)
|
||||||
{
|
{
|
||||||
$this->yyidx++;
|
$this->yyidx++;
|
||||||
@@ -911,6 +989,11 @@ public $yystack = array();
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $yyruleno
|
||||||
|
*
|
||||||
|
* @throws \SmartyCompilerException
|
||||||
|
*/
|
||||||
public function yy_reduce($yyruleno)
|
public function yy_reduce($yyruleno)
|
||||||
{
|
{
|
||||||
if ($this->yyTraceFILE && $yyruleno >= 0 && $yyruleno < count(self::$yyRuleName)) {
|
if ($this->yyTraceFILE && $yyruleno >= 0 && $yyruleno < count(self::$yyRuleName)) {
|
||||||
@@ -967,6 +1050,12 @@ public $yystack = array();
|
|||||||
$this->retvalue = $this->_retvalue;
|
$this->retvalue = $this->_retvalue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $yymajor
|
||||||
|
* @param $TOKEN
|
||||||
|
*
|
||||||
|
* @throws \SmartyCompilerException
|
||||||
|
*/
|
||||||
public function yy_syntax_error($yymajor, $TOKEN)
|
public function yy_syntax_error($yymajor, $TOKEN)
|
||||||
{
|
{
|
||||||
#line 232 "../smarty/lexer/smarty_internal_configfileparser.y"
|
#line 232 "../smarty/lexer/smarty_internal_configfileparser.y"
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* The following methods will be dynamically loaded by the extension handler when they are called.
|
* The following methods will be dynamically loaded by the extension handler when they are called.
|
||||||
* They are located in a corresponding Smarty_Internal_Method_xxxx class
|
* They are located in a corresponding Smarty_Internal_Method_xxxx class
|
||||||
*
|
*
|
||||||
|
* @method mixed _getConfigVariable(string $varName, bool $errorEnable = true)
|
||||||
* @method mixed getConfigVariable(string $varName, bool $errorEnable = true)
|
* @method mixed getConfigVariable(string $varName, bool $errorEnable = true)
|
||||||
* @method mixed getConfigVars(string $varName = null, bool $searchParents = true)
|
* @method mixed getConfigVars(string $varName = null, bool $searchParents = true)
|
||||||
* @method mixed getGlobal(string $varName = null)
|
* @method mixed getGlobal(string $varName = null)
|
||||||
@@ -266,7 +267,7 @@ class Smarty_Internal_Data
|
|||||||
*/
|
*/
|
||||||
public function _getSmartyObj()
|
public function _getSmartyObj()
|
||||||
{
|
{
|
||||||
return $this->_objType === 1 ? $this : $this->smarty;
|
return $this->smarty;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -193,6 +193,9 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data
|
|||||||
*
|
*
|
||||||
* @param Smarty_Internal_Template|Smarty $obj object to debug
|
* @param Smarty_Internal_Template|Smarty $obj object to debug
|
||||||
* @param bool $full
|
* @param bool $full
|
||||||
|
*
|
||||||
|
* @throws \Exception
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function display_debug($obj, $full = false)
|
public function display_debug($obj, $full = false)
|
||||||
{
|
{
|
||||||
|
@@ -25,7 +25,7 @@ class Smarty_Internal_ErrorHandler
|
|||||||
/**
|
/**
|
||||||
* Enable error handler to mute expected messages
|
* Enable error handler to mute expected messages
|
||||||
*
|
*
|
||||||
* @return void
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public static function muteExpectedErrors()
|
public static function muteExpectedErrors()
|
||||||
{
|
{
|
||||||
|
@@ -11,7 +11,6 @@
|
|||||||
*/
|
*/
|
||||||
class Smarty_Internal_Method_AddAutoloadFilters extends Smarty_Internal_Method_SetAutoloadFilters
|
class Smarty_Internal_Method_AddAutoloadFilters extends Smarty_Internal_Method_SetAutoloadFilters
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add autoload filters
|
* Add autoload filters
|
||||||
*
|
*
|
||||||
@@ -25,6 +24,7 @@ class Smarty_Internal_Method_AddAutoloadFilters extends Smarty_Internal_Method_S
|
|||||||
* the appropriate types
|
* the appropriate types
|
||||||
*
|
*
|
||||||
* @return \Smarty|\Smarty_Internal_Template
|
* @return \Smarty|\Smarty_Internal_Template
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function addAutoloadFilters(Smarty_Internal_TemplateBase $obj, $filters, $type = null)
|
public function addAutoloadFilters(Smarty_Internal_TemplateBase $obj, $filters, $type = null)
|
||||||
{
|
{
|
||||||
|
@@ -28,7 +28,8 @@ class Smarty_Internal_Method_ClearAllCache
|
|||||||
* @param integer $exp_time expiration time
|
* @param integer $exp_time expiration time
|
||||||
* @param string $type resource type
|
* @param string $type resource type
|
||||||
*
|
*
|
||||||
* @return integer number of cache files deleted
|
* @return int number of cache files deleted
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function clearAllCache(Smarty $smarty, $exp_time = null, $type = null)
|
public function clearAllCache(Smarty $smarty, $exp_time = null, $type = null)
|
||||||
{
|
{
|
||||||
|
@@ -31,7 +31,8 @@ class Smarty_Internal_Method_ClearCache
|
|||||||
* @param integer $exp_time expiration time
|
* @param integer $exp_time expiration time
|
||||||
* @param string $type resource type
|
* @param string $type resource type
|
||||||
*
|
*
|
||||||
* @return integer number of cache files deleted
|
* @return int number of cache files deleted
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function clearCache(Smarty $smarty, $template_name, $cache_id = null, $compile_id = null, $exp_time = null,
|
public function clearCache(Smarty $smarty, $template_name, $cache_id = null, $compile_id = null, $exp_time = null,
|
||||||
$type = null)
|
$type = null)
|
||||||
|
@@ -29,7 +29,8 @@ class Smarty_Internal_Method_ClearCompiledTemplate
|
|||||||
* @param string $compile_id compile id
|
* @param string $compile_id compile id
|
||||||
* @param integer $exp_time expiration time
|
* @param integer $exp_time expiration time
|
||||||
*
|
*
|
||||||
* @return integer number of template files deleted
|
* @return int number of template files deleted
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function clearCompiledTemplate(Smarty $smarty, $resource_name = null, $compile_id = null, $exp_time = null)
|
public function clearCompiledTemplate(Smarty $smarty, $resource_name = null, $compile_id = null, $exp_time = null)
|
||||||
{
|
{
|
||||||
|
@@ -30,7 +30,7 @@ class Smarty_Internal_Method_ConfigLoad
|
|||||||
* section or null
|
* section or null
|
||||||
*
|
*
|
||||||
* @return \Smarty|\Smarty_Internal_Data|\Smarty_Internal_Template
|
* @return \Smarty|\Smarty_Internal_Data|\Smarty_Internal_Template
|
||||||
* @throws \SmartyException
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function configLoad(Smarty_Internal_Data $data, $config_file, $sections = null)
|
public function configLoad(Smarty_Internal_Data $data, $config_file, $sections = null)
|
||||||
{
|
{
|
||||||
@@ -52,7 +52,7 @@ class Smarty_Internal_Method_ConfigLoad
|
|||||||
* shall be loaded
|
* shall be loaded
|
||||||
*
|
*
|
||||||
* @return \Smarty|\Smarty_Internal_Data|\Smarty_Internal_Template
|
* @return \Smarty|\Smarty_Internal_Data|\Smarty_Internal_Template
|
||||||
* @throws \SmartyException
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function _loadConfigFile(Smarty_Internal_Data $data, $config_file, $sections = null, $scope = 0)
|
public function _loadConfigFile(Smarty_Internal_Data $data, $config_file, $sections = null, $scope = 0)
|
||||||
{
|
{
|
||||||
@@ -94,6 +94,7 @@ class Smarty_Internal_Method_ConfigLoad
|
|||||||
$mergedScope = $tagScope | $tpl->scope;
|
$mergedScope = $tagScope | $tpl->scope;
|
||||||
if ($mergedScope) {
|
if ($mergedScope) {
|
||||||
// update scopes
|
// update scopes
|
||||||
|
/* @var \Smarty_Internal_Template|\Smarty|\Smarty_Internal_Data $ptr */
|
||||||
foreach ($tpl->smarty->ext->_updateScope->_getAffectedScopes($tpl->parent, $mergedScope) as $ptr) {
|
foreach ($tpl->smarty->ext->_updateScope->_getAffectedScopes($tpl->parent, $mergedScope) as $ptr) {
|
||||||
$this->_assignConfigVars($ptr->config_vars, $tpl, $new_config_vars);
|
$this->_assignConfigVars($ptr->config_vars, $tpl, $new_config_vars);
|
||||||
if ($tagScope && $ptr->_isTplObj() && isset($tpl->_cache[ 'varStack' ])) {
|
if ($tagScope && $ptr->_isTplObj() && isset($tpl->_cache[ 'varStack' ])) {
|
||||||
|
@@ -11,7 +11,6 @@
|
|||||||
*/
|
*/
|
||||||
class Smarty_Internal_Method_GetAutoloadFilters extends Smarty_Internal_Method_SetAutoloadFilters
|
class Smarty_Internal_Method_GetAutoloadFilters extends Smarty_Internal_Method_SetAutoloadFilters
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get autoload filters
|
* Get autoload filters
|
||||||
*
|
*
|
||||||
@@ -22,8 +21,9 @@ class Smarty_Internal_Method_GetAutoloadFilters extends Smarty_Internal_Method_S
|
|||||||
* for. Defaults to all autoload
|
* for. Defaults to all autoload
|
||||||
* filters
|
* filters
|
||||||
*
|
*
|
||||||
* @return array array( 'type1' => array( 'filter1', 'filter2', … ) ) or array( 'filter1', 'filter2', …) if $type
|
* @return array array( 'type1' => array( 'filter1', 'filter2', … ) ) or array( 'filter1', 'filter2', …) if $type
|
||||||
* was specified
|
* was specified
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function getAutoloadFilters(Smarty_Internal_TemplateBase $obj, $type = null)
|
public function getAutoloadFilters(Smarty_Internal_TemplateBase $obj, $type = null)
|
||||||
{
|
{
|
||||||
|
@@ -24,9 +24,9 @@ class Smarty_Internal_Method_GetGlobal
|
|||||||
* @api Smarty::getGlobal()
|
* @api Smarty::getGlobal()
|
||||||
*
|
*
|
||||||
* @param \Smarty_Internal_Data $data
|
* @param \Smarty_Internal_Data $data
|
||||||
* @param string $varName variable name or null
|
* @param string $varName variable name or null
|
||||||
*
|
*
|
||||||
* @return string variable value or or array of variables
|
* @return string|array variable value or or array of variables
|
||||||
*/
|
*/
|
||||||
public function getGlobal(Smarty_Internal_Data $data, $varName = null)
|
public function getGlobal(Smarty_Internal_Data $data, $varName = null)
|
||||||
{
|
{
|
||||||
|
@@ -28,6 +28,7 @@ class Smarty_Internal_Method_GetTags
|
|||||||
* @param null|string|Smarty_Internal_Template $template
|
* @param null|string|Smarty_Internal_Template $template
|
||||||
*
|
*
|
||||||
* @return array of tag/attributes
|
* @return array of tag/attributes
|
||||||
|
* @throws \Exception
|
||||||
* @throws \SmartyException
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function getTags(Smarty_Internal_TemplateBase $obj, $template = null)
|
public function getTags(Smarty_Internal_TemplateBase $obj, $template = null)
|
||||||
|
@@ -43,6 +43,7 @@ class Smarty_Internal_Method_Literals
|
|||||||
* to add
|
* to add
|
||||||
*
|
*
|
||||||
* @return \Smarty|\Smarty_Internal_Template
|
* @return \Smarty|\Smarty_Internal_Template
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function addLiterals(Smarty_Internal_TemplateBase $obj, $literals = null)
|
public function addLiterals(Smarty_Internal_TemplateBase $obj, $literals = null)
|
||||||
{
|
{
|
||||||
@@ -62,6 +63,7 @@ class Smarty_Internal_Method_Literals
|
|||||||
* to set
|
* to set
|
||||||
*
|
*
|
||||||
* @return \Smarty|\Smarty_Internal_Template
|
* @return \Smarty|\Smarty_Internal_Template
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function setLiterals(Smarty_Internal_TemplateBase $obj, $literals = null)
|
public function setLiterals(Smarty_Internal_TemplateBase $obj, $literals = null)
|
||||||
{
|
{
|
||||||
|
@@ -38,6 +38,7 @@ class Smarty_Internal_Method_SetAutoloadFilters
|
|||||||
* the appropriate types
|
* the appropriate types
|
||||||
*
|
*
|
||||||
* @return \Smarty|\Smarty_Internal_Template
|
* @return \Smarty|\Smarty_Internal_Template
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function setAutoloadFilters(Smarty_Internal_TemplateBase $obj, $filters, $type = null)
|
public function setAutoloadFilters(Smarty_Internal_TemplateBase $obj, $filters, $type = null)
|
||||||
{
|
{
|
||||||
|
@@ -22,7 +22,8 @@ class Smarty_Internal_Method_UnloadFilter extends Smarty_Internal_Method_LoadFil
|
|||||||
* @param string $type filter type
|
* @param string $type filter type
|
||||||
* @param string $name filter name
|
* @param string $name filter name
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return Smarty_Internal_TemplateBase
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function unloadFilter(Smarty_Internal_TemplateBase $obj, $type, $name)
|
public function unloadFilter(Smarty_Internal_TemplateBase $obj, $type, $name)
|
||||||
{
|
{
|
||||||
|
@@ -23,6 +23,7 @@ class Smarty_Internal_Method_UnregisterFilter extends Smarty_Internal_Method_Reg
|
|||||||
* @param callback|string $callback
|
* @param callback|string $callback
|
||||||
*
|
*
|
||||||
* @return \Smarty|\Smarty_Internal_Template
|
* @return \Smarty|\Smarty_Internal_Template
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function unregisterFilter(Smarty_Internal_TemplateBase $obj, $type, $callback)
|
public function unregisterFilter(Smarty_Internal_TemplateBase $obj, $type, $callback)
|
||||||
{
|
{
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Smarty Internal Plugin Templateparser Parsetrees
|
* Smarty Internal Plugin Templateparser Parsetree
|
||||||
* These are classes to build parsetrees in the template parser
|
* These are classes to build parsetree in the template parser
|
||||||
*
|
*
|
||||||
* @package Smarty
|
* @package Smarty
|
||||||
* @subpackage Compiler
|
* @subpackage Compiler
|
||||||
|
@@ -118,6 +118,9 @@ class Smarty_Internal_Resource_Extends extends Smarty_Resource
|
|||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
public function checkTimestamps()
|
public function checkTimestamps()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@@ -112,6 +112,8 @@ class Smarty_Internal_Resource_File extends Smarty_Resource
|
|||||||
*
|
*
|
||||||
* @param Smarty_Template_Source $source source object
|
* @param Smarty_Template_Source $source source object
|
||||||
* @param Smarty_Internal_Template $_template template object
|
* @param Smarty_Internal_Template $_template template object
|
||||||
|
*
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)
|
public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)
|
||||||
{
|
{
|
||||||
|
@@ -26,6 +26,7 @@ class Smarty_Internal_Resource_Stream extends Smarty_Resource_Recompiled
|
|||||||
* @param Smarty_Internal_Template $_template template object
|
* @param Smarty_Internal_Template $_template template object
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)
|
public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)
|
||||||
{
|
{
|
||||||
|
@@ -99,6 +99,9 @@ class Smarty_Internal_Resource_String extends Smarty_Resource
|
|||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
public function checkTimestamps()
|
public function checkTimestamps()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@@ -16,6 +16,9 @@ class Smarty_Internal_Runtime_CacheModify
|
|||||||
* @param \Smarty_Template_Cached $cached
|
* @param \Smarty_Template_Cached $cached
|
||||||
* @param \Smarty_Internal_Template $_template
|
* @param \Smarty_Internal_Template $_template
|
||||||
* @param string $content
|
* @param string $content
|
||||||
|
*
|
||||||
|
* @throws \Exception
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function cacheModifiedCheck(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template, $content)
|
public function cacheModifiedCheck(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template, $content)
|
||||||
{
|
{
|
||||||
|
@@ -41,7 +41,7 @@ class Smarty_Internal_Runtime_CodeFrame
|
|||||||
$properties[ 'cache_lifetime' ] = $_template->cache_lifetime;
|
$properties[ 'cache_lifetime' ] = $_template->cache_lifetime;
|
||||||
}
|
}
|
||||||
$output = "<?php\n";
|
$output = "<?php\n";
|
||||||
$output .= "/* Smarty version {Smarty::SMARTY_VERSION}, created on " . strftime("%Y-%m-%d %H:%M:%S") .
|
$output .= "/* Smarty version {$properties[ 'version' ]}, created on " . strftime("%Y-%m-%d %H:%M:%S") .
|
||||||
"\n from \"" . str_replace('*/','* /',$_template->source->filepath) . "\" */\n\n";
|
"\n from \"" . str_replace('*/','* /',$_template->source->filepath) . "\" */\n\n";
|
||||||
$output .= "/* @var Smarty_Internal_Template \$_smarty_tpl */\n";
|
$output .= "/* @var Smarty_Internal_Template \$_smarty_tpl */\n";
|
||||||
$dec = "\$_smarty_tpl->_decodeProperties(\$_smarty_tpl, " . var_export($properties, true) . ',' .
|
$dec = "\$_smarty_tpl->_decodeProperties(\$_smarty_tpl, " . var_export($properties, true) . ',' .
|
||||||
|
@@ -36,7 +36,7 @@ class Smarty_Internal_Runtime_GetIncludePath
|
|||||||
/**
|
/**
|
||||||
* stream cache
|
* stream cache
|
||||||
*
|
*
|
||||||
* @var string[]
|
* @var string[][]
|
||||||
*/
|
*/
|
||||||
public $isFile = array();
|
public $isFile = array();
|
||||||
/**
|
/**
|
||||||
|
@@ -103,6 +103,9 @@ class Smarty_Internal_Runtime_Inheritance
|
|||||||
* @param null|string $template optional name of inheritance parent template
|
* @param null|string $template optional name of inheritance parent template
|
||||||
* @param null|string $uid uid of inline template
|
* @param null|string $uid uid of inline template
|
||||||
* @param null|string $func function call name of inline template
|
* @param null|string $func function call name of inline template
|
||||||
|
*
|
||||||
|
* @throws \Exception
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function endChild(Smarty_Internal_Template $tpl, $template = null, $uid = null, $func = null)
|
public function endChild(Smarty_Internal_Template $tpl, $template = null, $uid = null, $func = null)
|
||||||
{
|
{
|
||||||
@@ -135,6 +138,8 @@ class Smarty_Internal_Runtime_Inheritance
|
|||||||
* @param $className
|
* @param $className
|
||||||
* @param string $name
|
* @param string $name
|
||||||
* @param int|null $tplIndex index of outer level {block} if nested
|
* @param int|null $tplIndex index of outer level {block} if nested
|
||||||
|
*
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function instanceBlock(Smarty_Internal_Template $tpl, $className, $name, $tplIndex = null)
|
public function instanceBlock(Smarty_Internal_Template $tpl, $className, $name, $tplIndex = null)
|
||||||
{
|
{
|
||||||
@@ -203,7 +208,8 @@ class Smarty_Internal_Runtime_Inheritance
|
|||||||
* @param \Smarty_Internal_Block $block
|
* @param \Smarty_Internal_Block $block
|
||||||
* @param boolean $returnContent flag if content shall be returned
|
* @param boolean $returnContent flag if content shall be returned
|
||||||
*
|
*
|
||||||
* @return null|string null or block content dependent on $returnContent
|
* @return null|string null or block content dependent on $returnContent
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function callChild(Smarty_Internal_Template $tpl, Smarty_Internal_Block $block, $returnContent = false)
|
public function callChild(Smarty_Internal_Template $tpl, Smarty_Internal_Block $block, $returnContent = false)
|
||||||
{
|
{
|
||||||
|
@@ -117,9 +117,11 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
|
|||||||
public static $isCacheTplObj = array();
|
public static $isCacheTplObj = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Subtemplate Info Cache
|
* Sub template Info Cache
|
||||||
|
* - index name
|
||||||
|
* - value use count
|
||||||
*
|
*
|
||||||
* @var string[]int[]
|
* @var int[]
|
||||||
*/
|
*/
|
||||||
public static $subTplInfo = array();
|
public static $subTplInfo = array();
|
||||||
|
|
||||||
@@ -170,6 +172,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
|
|||||||
* @param null|bool $display true: display, false: fetch null: sub-template
|
* @param null|bool $display true: display, false: fetch null: sub-template
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
|
* @throws \Exception
|
||||||
* @throws \SmartyException
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function render($no_output_filter = true, $display = null)
|
public function render($no_output_filter = true, $display = null)
|
||||||
@@ -269,6 +272,8 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
|
|||||||
* @param string $uid file dependency uid
|
* @param string $uid file dependency uid
|
||||||
* @param string $content_func function name
|
* @param string $content_func function name
|
||||||
*
|
*
|
||||||
|
* @throws \Exception
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function _subTemplateRender($template, $cache_id, $compile_id, $caching, $cache_lifetime, $data, $scope,
|
public function _subTemplateRender($template, $cache_id, $compile_id, $caching, $cache_lifetime, $data, $scope,
|
||||||
$forceTplCache, $uid = null, $content_func = null)
|
$forceTplCache, $uid = null, $content_func = null)
|
||||||
@@ -528,6 +533,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
|
|||||||
* Get unique template id
|
* Get unique template id
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function _getTemplateId()
|
public function _getTemplateId()
|
||||||
{
|
{
|
||||||
|
@@ -117,6 +117,9 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data
|
|||||||
* @param mixed $cache_id cache id to be used with this template
|
* @param mixed $cache_id cache id to be used with this template
|
||||||
* @param mixed $compile_id compile id to be used with this template
|
* @param mixed $compile_id compile id to be used with this template
|
||||||
* @param object $parent next higher level of Smarty variables
|
* @param object $parent next higher level of Smarty variables
|
||||||
|
*
|
||||||
|
* @throws \Exception
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function display($template = null, $cache_id = null, $compile_id = null, $parent = null)
|
public function display($template = null, $cache_id = null, $compile_id = null, $parent = null)
|
||||||
{
|
{
|
||||||
@@ -135,7 +138,9 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data
|
|||||||
* @param mixed $compile_id compile id to be used with this template
|
* @param mixed $compile_id compile id to be used with this template
|
||||||
* @param object $parent next higher level of Smarty variables
|
* @param object $parent next higher level of Smarty variables
|
||||||
*
|
*
|
||||||
* @return boolean cache status
|
* @return bool cache status
|
||||||
|
* @throws \Exception
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function isCached($template = null, $cache_id = null, $compile_id = null, $parent = null)
|
public function isCached($template = null, $cache_id = null, $compile_id = null, $parent = null)
|
||||||
{
|
{
|
||||||
|
@@ -534,6 +534,7 @@ abstract class Smarty_Internal_TemplateCompilerBase
|
|||||||
* @param array $parameter
|
* @param array $parameter
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
|
* @throws \SmartyCompilerException
|
||||||
*/
|
*/
|
||||||
public function compilePHPFunctionCall($name, $parameter)
|
public function compilePHPFunctionCall($name, $parameter)
|
||||||
{
|
{
|
||||||
@@ -662,7 +663,8 @@ abstract class Smarty_Internal_TemplateCompilerBase
|
|||||||
* @param mixed $param2 optional parameter
|
* @param mixed $param2 optional parameter
|
||||||
* @param mixed $param3 optional parameter
|
* @param mixed $param3 optional parameter
|
||||||
*
|
*
|
||||||
* @return string|bool compiled code or false
|
* @return bool|string compiled code or false
|
||||||
|
* @throws \SmartyCompilerException
|
||||||
*/
|
*/
|
||||||
public function callTagCompiler($tag, $args, $param1 = null, $param2 = null, $param3 = null)
|
public function callTagCompiler($tag, $args, $param1 = null, $param2 = null, $param3 = null)
|
||||||
{
|
{
|
||||||
@@ -680,7 +682,8 @@ abstract class Smarty_Internal_TemplateCompilerBase
|
|||||||
*
|
*
|
||||||
* @param string $tag tag name
|
* @param string $tag tag name
|
||||||
*
|
*
|
||||||
* @return Smarty_Internal_CompileBase|bool tag compiler object or false if not found
|
* @return bool|\Smarty_Internal_CompileBase tag compiler object or false if not found
|
||||||
|
* @throws \SmartyCompilerException
|
||||||
*/
|
*/
|
||||||
public function getTagCompiler($tag)
|
public function getTagCompiler($tag)
|
||||||
{
|
{
|
||||||
@@ -708,6 +711,7 @@ abstract class Smarty_Internal_TemplateCompilerBase
|
|||||||
* @param string $plugin_type type of plugin
|
* @param string $plugin_type type of plugin
|
||||||
*
|
*
|
||||||
* @return string call name of function
|
* @return string call name of function
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function getPlugin($plugin_name, $plugin_type)
|
public function getPlugin($plugin_name, $plugin_type)
|
||||||
{
|
{
|
||||||
@@ -772,7 +776,8 @@ abstract class Smarty_Internal_TemplateCompilerBase
|
|||||||
* @param string $tag name of tag
|
* @param string $tag name of tag
|
||||||
* @param string $plugin_type type of plugin
|
* @param string $plugin_type type of plugin
|
||||||
*
|
*
|
||||||
* @return boolean true if found
|
* @return bool true if found
|
||||||
|
* @throws \SmartyCompilerException
|
||||||
*/
|
*/
|
||||||
public function getPluginFromDefaultHandler($tag, $plugin_type)
|
public function getPluginFromDefaultHandler($tag, $plugin_type)
|
||||||
{
|
{
|
||||||
|
@@ -250,11 +250,17 @@ class Smarty_Internal_Templatelexer
|
|||||||
strpos(" \n\t\r", $this->value[ $this->compiler->getLdelLength() ]) !== false : false;
|
strpos(" \n\t\r", $this->value[ $this->compiler->getLdelLength() ]) !== false : false;
|
||||||
} // end function
|
} // end function
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
public function yylex()
|
public function yylex()
|
||||||
{
|
{
|
||||||
return $this->{'yylex' . $this->_yy_state}();
|
return $this->{'yylex' . $this->_yy_state}();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $state
|
||||||
|
*/
|
||||||
public function yypushstate($state)
|
public function yypushstate($state)
|
||||||
{
|
{
|
||||||
if ($this->yyTraceFILE) {
|
if ($this->yyTraceFILE) {
|
||||||
@@ -294,6 +300,9 @@ class Smarty_Internal_Templatelexer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $state
|
||||||
|
*/
|
||||||
public function yybegin($state)
|
public function yybegin($state)
|
||||||
{
|
{
|
||||||
$this->_yy_state = $state;
|
$this->_yy_state = $state;
|
||||||
@@ -306,6 +315,10 @@ class Smarty_Internal_Templatelexer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
public function yylex1()
|
public function yylex1()
|
||||||
{
|
{
|
||||||
if (!isset($this->yy_global_pattern1)) {
|
if (!isset($this->yy_global_pattern1)) {
|
||||||
@@ -366,6 +379,10 @@ class Smarty_Internal_Templatelexer
|
|||||||
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
|
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
* @throws \SmartyCompilerException
|
||||||
|
*/
|
||||||
function yy_r1_2()
|
function yy_r1_2()
|
||||||
{
|
{
|
||||||
preg_match("/[*]{$this->compiler->getRdelPreg()}/", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter);
|
preg_match("/[*]{$this->compiler->getRdelPreg()}/", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter);
|
||||||
@@ -400,6 +417,9 @@ class Smarty_Internal_Templatelexer
|
|||||||
$this->yypushstate(self::LITERAL);
|
$this->yypushstate(self::LITERAL);
|
||||||
} // end function
|
} // end function
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
function yy_r1_14()
|
function yy_r1_14()
|
||||||
{
|
{
|
||||||
$this->yypushstate(self::TAG);
|
$this->yypushstate(self::TAG);
|
||||||
@@ -416,6 +436,10 @@ class Smarty_Internal_Templatelexer
|
|||||||
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
|
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
public function yylex2()
|
public function yylex2()
|
||||||
{
|
{
|
||||||
if (!isset($this->yy_global_pattern2)) {
|
if (!isset($this->yy_global_pattern2)) {
|
||||||
@@ -548,6 +572,10 @@ class Smarty_Internal_Templatelexer
|
|||||||
$this->taglineno = $this->line;
|
$this->taglineno = $this->line;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
public function yylex3()
|
public function yylex3()
|
||||||
{
|
{
|
||||||
if (!isset($this->yy_global_pattern3)) {
|
if (!isset($this->yy_global_pattern3)) {
|
||||||
@@ -609,6 +637,9 @@ class Smarty_Internal_Templatelexer
|
|||||||
$this->yypopstate();
|
$this->yypopstate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
function yy_r3_2()
|
function yy_r3_2()
|
||||||
{
|
{
|
||||||
$this->yypushstate(self::TAG);
|
$this->yypushstate(self::TAG);
|
||||||
@@ -836,6 +867,10 @@ class Smarty_Internal_Templatelexer
|
|||||||
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
|
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
public function yylex4()
|
public function yylex4()
|
||||||
{
|
{
|
||||||
if (!isset($this->yy_global_pattern4)) {
|
if (!isset($this->yy_global_pattern4)) {
|
||||||
@@ -913,6 +948,10 @@ class Smarty_Internal_Templatelexer
|
|||||||
$this->token = Smarty_Internal_Templateparser::TP_LITERAL;
|
$this->token = Smarty_Internal_Templateparser::TP_LITERAL;
|
||||||
} // end function
|
} // end function
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
public function yylex5()
|
public function yylex5()
|
||||||
{
|
{
|
||||||
if (!isset($this->yy_global_pattern5)) {
|
if (!isset($this->yy_global_pattern5)) {
|
||||||
@@ -983,12 +1022,18 @@ class Smarty_Internal_Templatelexer
|
|||||||
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
|
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
function yy_r5_7()
|
function yy_r5_7()
|
||||||
{
|
{
|
||||||
$this->yypushstate(self::TAG);
|
$this->yypushstate(self::TAG);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
function yy_r5_9()
|
function yy_r5_9()
|
||||||
{
|
{
|
||||||
$this->yypushstate(self::TAG);
|
$this->yypushstate(self::TAG);
|
||||||
|
@@ -1,10 +1,19 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class TP_yyToken
|
||||||
|
*/
|
||||||
class TP_yyToken implements ArrayAccess
|
class TP_yyToken implements ArrayAccess
|
||||||
{
|
{
|
||||||
public $string = '';
|
public $string = '';
|
||||||
public $metadata = array();
|
public $metadata = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TP_yyToken constructor.
|
||||||
|
*
|
||||||
|
* @param $s
|
||||||
|
* @param array $m
|
||||||
|
*/
|
||||||
public function __construct($s, $m = array())
|
public function __construct($s, $m = array())
|
||||||
{
|
{
|
||||||
if ($s instanceof TP_yyToken) {
|
if ($s instanceof TP_yyToken) {
|
||||||
@@ -20,21 +29,38 @@ class TP_yyToken implements ArrayAccess
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
return $this->string;
|
return $this->string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param mixed $offset
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
public function offsetExists($offset)
|
public function offsetExists($offset)
|
||||||
{
|
{
|
||||||
return isset($this->metadata[ $offset ]);
|
return isset($this->metadata[ $offset ]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param mixed $offset
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
public function offsetGet($offset)
|
public function offsetGet($offset)
|
||||||
{
|
{
|
||||||
return $this->metadata[ $offset ];
|
return $this->metadata[ $offset ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param mixed $offset
|
||||||
|
* @param mixed $value
|
||||||
|
*/
|
||||||
public function offsetSet($offset, $value)
|
public function offsetSet($offset, $value)
|
||||||
{
|
{
|
||||||
if ($offset === null) {
|
if ($offset === null) {
|
||||||
@@ -58,12 +84,18 @@ class TP_yyToken implements ArrayAccess
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param mixed $offset
|
||||||
|
*/
|
||||||
public function offsetUnset($offset)
|
public function offsetUnset($offset)
|
||||||
{
|
{
|
||||||
unset($this->metadata[ $offset ]);
|
unset($this->metadata[ $offset ]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class TP_yyStackEntry
|
||||||
|
*/
|
||||||
class TP_yyStackEntry
|
class TP_yyStackEntry
|
||||||
{
|
{
|
||||||
public $stateno; /* The state-number */
|
public $stateno; /* The state-number */
|
||||||
@@ -1727,6 +1759,10 @@ class Smarty_Internal_Templateparser
|
|||||||
$this->security = isset($this->smarty->security_policy) ? $this->smarty->security_policy : false;
|
$this->security = isset($this->smarty->security_policy) ? $this->smarty->security_policy : false;
|
||||||
$this->current_buffer = $this->root_buffer = new Smarty_Internal_ParseTree_Template();
|
$this->current_buffer = $this->root_buffer = new Smarty_Internal_ParseTree_Template();
|
||||||
} /* The parser's stack */
|
} /* The parser's stack */
|
||||||
|
/**
|
||||||
|
* @param $yymajor
|
||||||
|
* @param $yypminor
|
||||||
|
*/
|
||||||
public static function yy_destructor($yymajor, $yypminor)
|
public static function yy_destructor($yymajor, $yypminor)
|
||||||
{
|
{
|
||||||
switch ($yymajor) {
|
switch ($yymajor) {
|
||||||
@@ -1777,6 +1813,10 @@ class Smarty_Internal_Templateparser
|
|||||||
return new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode($tmp, true));
|
return new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode($tmp, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $TraceFILE
|
||||||
|
* @param $zTracePrompt
|
||||||
|
*/
|
||||||
public function Trace($TraceFILE, $zTracePrompt)
|
public function Trace($TraceFILE, $zTracePrompt)
|
||||||
{
|
{
|
||||||
if (!$TraceFILE) {
|
if (!$TraceFILE) {
|
||||||
@@ -1794,6 +1834,11 @@ class Smarty_Internal_Templateparser
|
|||||||
$this->yyTracePrompt = '<br>';
|
$this->yyTracePrompt = '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $tokenType
|
||||||
|
*
|
||||||
|
* @return mixed|string
|
||||||
|
*/
|
||||||
public function tokenName($tokenType)
|
public function tokenName($tokenType)
|
||||||
{
|
{
|
||||||
if ($tokenType === 0) {
|
if ($tokenType === 0) {
|
||||||
@@ -1833,6 +1878,11 @@ class Smarty_Internal_Templateparser
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $token
|
||||||
|
*
|
||||||
|
* @return array|mixed
|
||||||
|
*/
|
||||||
public function yy_get_expected_tokens($token)
|
public function yy_get_expected_tokens($token)
|
||||||
{
|
{
|
||||||
static $res3 = array();
|
static $res3 = array();
|
||||||
@@ -1917,6 +1967,11 @@ class Smarty_Internal_Templateparser
|
|||||||
return array_unique($expected);
|
return array_unique($expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $token
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
public function yy_is_expected_token($token)
|
public function yy_is_expected_token($token)
|
||||||
{
|
{
|
||||||
static $res = array();
|
static $res = array();
|
||||||
@@ -2006,6 +2061,11 @@ class Smarty_Internal_Templateparser
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $iLookAhead
|
||||||
|
*
|
||||||
|
* @return int|mixed
|
||||||
|
*/
|
||||||
public function yy_find_shift_action($iLookAhead)
|
public function yy_find_shift_action($iLookAhead)
|
||||||
{
|
{
|
||||||
$stateno = $this->yystack[ $this->yyidx ]->stateno;
|
$stateno = $this->yystack[ $this->yyidx ]->stateno;
|
||||||
@@ -2040,6 +2100,12 @@ class Smarty_Internal_Templateparser
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $stateno
|
||||||
|
* @param $iLookAhead
|
||||||
|
*
|
||||||
|
* @return int|mixed
|
||||||
|
*/
|
||||||
public function yy_find_reduce_action($stateno, $iLookAhead)
|
public function yy_find_reduce_action($stateno, $iLookAhead)
|
||||||
{
|
{
|
||||||
/* $stateno = $this->yystack[$this->yyidx]->stateno; */
|
/* $stateno = $this->yystack[$this->yyidx]->stateno; */
|
||||||
@@ -2063,6 +2129,14 @@ class Smarty_Internal_Templateparser
|
|||||||
}
|
}
|
||||||
|
|
||||||
#line 234 "../smarty/lexer/smarty_internal_templateparser.y"
|
#line 234 "../smarty/lexer/smarty_internal_templateparser.y"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $yyNewState
|
||||||
|
* @param $yyMajor
|
||||||
|
* @param $yypMinor
|
||||||
|
*
|
||||||
|
* @throws \SmartyCompilerException
|
||||||
|
*/
|
||||||
public function yy_shift($yyNewState, $yyMajor, $yypMinor)
|
public function yy_shift($yyNewState, $yyMajor, $yypMinor)
|
||||||
{
|
{
|
||||||
$this->yyidx++;
|
$this->yyidx++;
|
||||||
@@ -3356,6 +3430,11 @@ class Smarty_Internal_Templateparser
|
|||||||
$this->_retvalue = new Smarty_Internal_ParseTree_DqContent($this->yystack[ $this->yyidx + 0 ]->minor);
|
$this->_retvalue = new Smarty_Internal_ParseTree_DqContent($this->yystack[ $this->yyidx + 0 ]->minor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $yyruleno
|
||||||
|
*
|
||||||
|
* @throws \SmartyCompilerException
|
||||||
|
*/
|
||||||
public function yy_reduce($yyruleno)
|
public function yy_reduce($yyruleno)
|
||||||
{
|
{
|
||||||
if ($this->yyTraceFILE && $yyruleno >= 0
|
if ($this->yyTraceFILE && $yyruleno >= 0
|
||||||
@@ -3407,6 +3486,12 @@ class Smarty_Internal_Templateparser
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $yymajor
|
||||||
|
* @param $TOKEN
|
||||||
|
*
|
||||||
|
* @throws \SmartyCompilerException
|
||||||
|
*/
|
||||||
public function yy_syntax_error($yymajor, $TOKEN)
|
public function yy_syntax_error($yymajor, $TOKEN)
|
||||||
{
|
{
|
||||||
#line 214 "../smarty/lexer/smarty_internal_templateparser.y"
|
#line 214 "../smarty/lexer/smarty_internal_templateparser.y"
|
||||||
@@ -3429,6 +3514,12 @@ class Smarty_Internal_Templateparser
|
|||||||
$this->retvalue = $this->_retvalue;
|
$this->retvalue = $this->_retvalue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $yymajor
|
||||||
|
* @param $yytokenvalue
|
||||||
|
*
|
||||||
|
* @throws \SmartyCompilerException
|
||||||
|
*/
|
||||||
public function doParse($yymajor, $yytokenvalue)
|
public function doParse($yymajor, $yytokenvalue)
|
||||||
{
|
{
|
||||||
$yyerrorhit = 0; /* True if yymajor has invoked an error */
|
$yyerrorhit = 0; /* True if yymajor has invoked an error */
|
||||||
|
@@ -133,6 +133,7 @@ abstract class Smarty_Resource
|
|||||||
* @param string $template_resource template_resource to extract resource handler and name of
|
* @param string $template_resource template_resource to extract resource handler and name of
|
||||||
*
|
*
|
||||||
* @return string unique resource name
|
* @return string unique resource name
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public static function getUniqueTemplateName($obj, $template_resource)
|
public static function getUniqueTemplateName($obj, $template_resource)
|
||||||
{
|
{
|
||||||
@@ -159,7 +160,8 @@ abstract class Smarty_Resource
|
|||||||
* @param Smarty $smarty smarty object
|
* @param Smarty $smarty smarty object
|
||||||
* @param string $template_resource resource identifier
|
* @param string $template_resource resource identifier
|
||||||
*
|
*
|
||||||
* @return Smarty_Template_Source Source Object
|
* @return \Smarty_Template_Source Source Object
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public static function source(Smarty_Internal_Template $_template = null,
|
public static function source(Smarty_Internal_Template $_template = null,
|
||||||
Smarty $smarty = null,
|
Smarty $smarty = null,
|
||||||
@@ -239,6 +241,9 @@ abstract class Smarty_Resource
|
|||||||
return basename(preg_replace('![^\w]+!', '_', $source->name));
|
return basename(preg_replace('![^\w]+!', '_', $source->name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
public function checkTimestamps()
|
public function checkTimestamps()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
@@ -85,6 +85,9 @@ abstract class Smarty_Resource_Recompiled extends Smarty_Resource
|
|||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
public function checkTimestamps()
|
public function checkTimestamps()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@@ -676,7 +676,7 @@ class Smarty_Security
|
|||||||
{
|
{
|
||||||
if ($security_class instanceof Smarty_Security) {
|
if ($security_class instanceof Smarty_Security) {
|
||||||
$smarty->security_policy = $security_class;
|
$smarty->security_policy = $security_class;
|
||||||
return;
|
return $smarty;
|
||||||
} elseif (is_object($security_class)) {
|
} elseif (is_object($security_class)) {
|
||||||
throw new SmartyException("Class '" . get_class($security_class) . "' must extend Smarty_Security.");
|
throw new SmartyException("Class '" . get_class($security_class) . "' must extend Smarty_Security.");
|
||||||
}
|
}
|
||||||
@@ -690,7 +690,7 @@ class Smarty_Security
|
|||||||
} else {
|
} else {
|
||||||
$smarty->security_policy = new $security_class($smarty);
|
$smarty->security_policy = new $security_class($smarty);
|
||||||
}
|
}
|
||||||
return;
|
return $smarty;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Start template processing
|
* Start template processing
|
||||||
|
@@ -83,6 +83,8 @@ class Smarty_Template_Cached extends Smarty_Template_Resource_Base
|
|||||||
* create Cached Object container
|
* create Cached Object container
|
||||||
*
|
*
|
||||||
* @param Smarty_Internal_Template $_template template object
|
* @param Smarty_Internal_Template $_template template object
|
||||||
|
*
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function __construct(Smarty_Internal_Template $_template)
|
public function __construct(Smarty_Internal_Template $_template)
|
||||||
{
|
{
|
||||||
|
@@ -201,7 +201,8 @@ class Smarty_Template_Compiled extends Smarty_Template_Resource_Base
|
|||||||
* @param Smarty_Internal_Template $_template template object
|
* @param Smarty_Internal_Template $_template template object
|
||||||
* @param string $code compiled code
|
* @param string $code compiled code
|
||||||
*
|
*
|
||||||
* @return boolean success
|
* @return bool success
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function write(Smarty_Internal_Template $_template, $code)
|
public function write(Smarty_Internal_Template $_template, $code)
|
||||||
{
|
{
|
||||||
|
@@ -80,9 +80,11 @@ abstract class Smarty_Template_Resource_Base
|
|||||||
public $required_plugins = array();
|
public $required_plugins = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Included subtemplates
|
* Included sub templates
|
||||||
|
* - index name
|
||||||
|
* - value use count
|
||||||
*
|
*
|
||||||
* @var array
|
* @var int[]
|
||||||
*/
|
*/
|
||||||
public $includes = array();
|
public $includes = array();
|
||||||
|
|
||||||
|
@@ -126,12 +126,13 @@ class Smarty_Template_Source
|
|||||||
/**
|
/**
|
||||||
* create Source Object container
|
* create Source Object container
|
||||||
*
|
*
|
||||||
* @param Smarty_Resource $handler Resource Handler this source object communicates with
|
* @param Smarty $smarty Smarty instance this source object belongs to
|
||||||
* @param Smarty $smarty Smarty instance this source object belongs to
|
* @param string $resource full template_resource
|
||||||
* @param string $resource full template_resource
|
* @param string $type type of resource
|
||||||
* @param string $type type of resource
|
* @param string $name resource name
|
||||||
* @param string $name resource name
|
|
||||||
*
|
*
|
||||||
|
* @throws \SmartyException
|
||||||
|
* @internal param \Smarty_Resource $handler Resource Handler this source object communicates with
|
||||||
*/
|
*/
|
||||||
public function __construct(Smarty $smarty, $resource, $type, $name)
|
public function __construct(Smarty $smarty, $resource, $type, $name)
|
||||||
{
|
{
|
||||||
@@ -202,6 +203,7 @@ class Smarty_Template_Source
|
|||||||
* Get source content
|
* Get source content
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function getContent()
|
public function getContent()
|
||||||
{
|
{
|
||||||
|
@@ -7,22 +7,18 @@
|
|||||||
* @package Smarty
|
* @package Smarty
|
||||||
* @subpackage Template
|
* @subpackage Template
|
||||||
*/
|
*/
|
||||||
class Smarty_Undefined_Variable
|
class Smarty_Undefined_Variable extends Smarty_Variable
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Returns FALSE for 'nocache' and NULL otherwise.
|
* Returns null for not existing properties
|
||||||
*
|
*
|
||||||
* @param string $name
|
* @param string $name
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function __get($name)
|
public function __get($name)
|
||||||
{
|
{
|
||||||
if ($name == 'nocache') {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
return null;
|
return null;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -7,6 +7,9 @@
|
|||||||
*/
|
*/
|
||||||
class SmartyCompilerException extends SmartyException
|
class SmartyCompilerException extends SmartyException
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
return ' --> Smarty Compiler: ' . $this->message . ' <-- ';
|
return ' --> Smarty Compiler: ' . $this->message . ' <-- ';
|
||||||
|
@@ -9,6 +9,9 @@ class SmartyException extends Exception
|
|||||||
{
|
{
|
||||||
public static $escape = false;
|
public static $escape = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
return ' --> Smarty: ' . (self::$escape ? htmlentities($this->message) : $this->message) . ' <-- ';
|
return ' --> Smarty: ' . (self::$escape ? htmlentities($this->message) : $this->message) . ' <-- ';
|
||||||
|
Reference in New Issue
Block a user