> String conversion
- *
- * @return string
- */
- public function __toString()
- {
- return (string) $this->value;
- }
-
-}
-
-/**
- * class for undefined variable object
- *
- * This class defines an object for undefined variable handling
- *
- * @package Smarty
- * @subpackage Template
- */
-class Undefined_Smarty_Variable {
-
- /**
- * Returns FALSE for 'nocache' and NULL otherwise.
- *
- * @param string $name
- * @return bool
- */
- public function __get($name)
- {
- if ($name == 'nocache') {
- return false;
- } else {
- return null;
- }
- }
-
- /**
- * Always returns an empty string.
- *
- * @return string
- */
- public function __toString()
- {
- return "";
- }
-
-}
-
-?>
\ No newline at end of file
diff --git a/tools/smarty/sysplugins/smarty_internal_debug.php b/tools/smarty/sysplugins/smarty_internal_debug.php
deleted file mode 100755
index 2aea13f30..000000000
--- a/tools/smarty/sysplugins/smarty_internal_debug.php
+++ /dev/null
@@ -1,206 +0,0 @@
-smarty;
- }
- $_assigned_vars = $ptr->tpl_vars;
- ksort($_assigned_vars);
- $_config_vars = $ptr->config_vars;
- ksort($_config_vars);
- $smarty->registered_filters = array();
- $smarty->autoload_filters = array();
- $smarty->default_modifiers = array();
- $smarty->force_compile = false;
- $smarty->left_delimiter = '{';
- $smarty->right_delimiter = '}';
- $smarty->debugging = false;
- $smarty->force_compile = false;
- $_template = new Smarty_Internal_Template($smarty->debug_tpl, $smarty);
- $_template->caching = false;
- $_template->disableSecurity();
- $_template->cache_id = null;
- $_template->compile_id = null;
- if ($obj instanceof Smarty_Internal_Template) {
- $_template->assign('template_name', $obj->source->type . ':' . $obj->source->name);
- }
- if ($obj instanceof Smarty) {
- $_template->assign('template_data', self::$template_data);
- } else {
- $_template->assign('template_data', null);
- }
- $_template->assign('assigned_vars', $_assigned_vars);
- $_template->assign('config_vars', $_config_vars);
- $_template->assign('execution_time', microtime(true) - $smarty->start_time);
- echo $_template->fetch();
- }
-
- /**
- * Recursively gets variables from all template/data scopes
- *
- * @param Smarty_Internal_Template|Smarty_Data $obj object to debug
- * @return StdClass
- */
- public static function get_debug_vars($obj)
- {
- $config_vars = $obj->config_vars;
- $tpl_vars = array();
- foreach ($obj->tpl_vars as $key => $var) {
- $tpl_vars[$key] = clone $var;
- if ($obj instanceof Smarty_Internal_Template) {
- $tpl_vars[$key]->scope = $obj->source->type . ':' . $obj->source->name;
- } elseif ($obj instanceof Smarty_Data) {
- $tpl_vars[$key]->scope = 'Data object';
- } else {
- $tpl_vars[$key]->scope = 'Smarty root';
- }
- }
-
- if (isset($obj->parent)) {
- $parent = self::get_debug_vars($obj->parent);
- $tpl_vars = array_merge($parent->tpl_vars, $tpl_vars);
- $config_vars = array_merge($parent->config_vars, $config_vars);
- } else {
- foreach (Smarty::$global_tpl_vars as $name => $var) {
- if (!array_key_exists($name, $tpl_vars)) {
- $clone = clone $var;
- $clone->scope = 'Global';
- $tpl_vars[$name] = $clone;
- }
- }
- }
- return (object) array('tpl_vars' => $tpl_vars, 'config_vars' => $config_vars);
- }
-
- /**
- * Return key into $template_data for template
- *
- * @param object $template template object
- * @return string key into $template_data
- */
- private static function get_key($template)
- {
- static $_is_stringy = array('string' => true, 'eval' => true);
- // calculate Uid if not already done
- if ($template->source->uid == '') {
- $template->source->filepath;
- }
- $key = $template->source->uid;
- if (isset(self::$template_data[$key])) {
- return $key;
- } else {
- if (isset($_is_stringy[$template->source->type])) {
- self::$template_data[$key]['name'] = '\''.substr($template->source->name,0,25).'...\'';
- } else {
- self::$template_data[$key]['name'] = $template->source->filepath;
- }
- self::$template_data[$key]['compile_time'] = 0;
- self::$template_data[$key]['render_time'] = 0;
- self::$template_data[$key]['cache_time'] = 0;
- return $key;
- }
- }
-
-}
-
-?>
\ No newline at end of file
diff --git a/tools/smarty/sysplugins/smarty_internal_filter_handler.php b/tools/smarty/sysplugins/smarty_internal_filter_handler.php
deleted file mode 100755
index c9370e1ac..000000000
--- a/tools/smarty/sysplugins/smarty_internal_filter_handler.php
+++ /dev/null
@@ -1,70 +0,0 @@
-smarty->autoload_filters[$type])) {
- foreach ((array)$template->smarty->autoload_filters[$type] as $name) {
- $plugin_name = "Smarty_{$type}filter_{$name}";
- if ($template->smarty->loadPlugin($plugin_name)) {
- if (function_exists($plugin_name)) {
- // use loaded Smarty2 style plugin
- $output = $plugin_name($output, $template);
- } elseif (class_exists($plugin_name, false)) {
- // loaded class of filter plugin
- $output = call_user_func(array($plugin_name, 'execute'), $output, $template);
- }
- } else {
- // nothing found, throw exception
- throw new SmartyException("Unable to load filter {$plugin_name}");
- }
- }
- }
- // loop over registerd filters of specified type
- if (!empty($template->smarty->registered_filters[$type])) {
- foreach ($template->smarty->registered_filters[$type] as $key => $name) {
- if (is_array($template->smarty->registered_filters[$type][$key])) {
- $output = call_user_func($template->smarty->registered_filters[$type][$key], $output, $template);
- } else {
- $output = $template->smarty->registered_filters[$type][$key]($output, $template);
- }
- }
- }
- // return filtered output
- return $output;
- }
-
-}
-
-?>
\ No newline at end of file
diff --git a/tools/smarty/sysplugins/smarty_internal_function_call_handler.php b/tools/smarty/sysplugins/smarty_internal_function_call_handler.php
deleted file mode 100755
index 010d63592..000000000
--- a/tools/smarty/sysplugins/smarty_internal_function_call_handler.php
+++ /dev/null
@@ -1,55 +0,0 @@
-tpl_vars;
- foreach (\$_smarty_tpl->smarty->template_functions['{$_name}']['parameter'] as \$key => \$value) {\$_smarty_tpl->tpl_vars[\$key] = new Smarty_variable(\$value);};
- foreach (\$params as \$key => \$value) {\$_smarty_tpl->tpl_vars[\$key] = new Smarty_variable(\$value);}?>";
- if ($_nocache) {
- $_code .= preg_replace(array("!<\?php echo \\'/\*%%SmartyNocache:{$_template->smarty->template_functions[$_name]['nocache_hash']}%%\*/|/\*/%%SmartyNocache:{$_template->smarty->template_functions[$_name]['nocache_hash']}%%\*/\\';\?>!",
- "!\\\'!"), array('', "'"), $_template->smarty->template_functions[$_name]['compiled']);
- $_template->smarty->template_functions[$_name]['called_nocache'] = true;
- } else {
- $_code .= preg_replace("/{$_template->smarty->template_functions[$_name]['nocache_hash']}/", $_template->properties['nocache_hash'], $_template->smarty->template_functions[$_name]['compiled']);
- }
- $_code .= "tpl_vars = \$saved_tpl_vars;}";
- eval($_code);
- }
- $_function($_template, $_params);
- }
-
-}
-
-?>
diff --git a/tools/smarty/sysplugins/smarty_internal_get_include_path.php b/tools/smarty/sysplugins/smarty_internal_get_include_path.php
deleted file mode 100755
index 7a9739e92..000000000
--- a/tools/smarty/sysplugins/smarty_internal_get_include_path.php
+++ /dev/null
@@ -1,43 +0,0 @@
-
\ No newline at end of file
diff --git a/tools/smarty/sysplugins/smarty_internal_nocache_insert.php b/tools/smarty/sysplugins/smarty_internal_nocache_insert.php
deleted file mode 100755
index faae49af6..000000000
--- a/tools/smarty/sysplugins/smarty_internal_nocache_insert.php
+++ /dev/null
@@ -1,53 +0,0 @@
-assign('{$_assign}' , {$_function} (" . var_export($_attr, true) . ",\$_smarty_tpl), true);?>";
- } else {
- $_output .= "echo {$_function}(" . var_export($_attr, true) . ",\$_smarty_tpl);?>";
- }
- $_tpl = $_template;
- while ($_tpl->parent instanceof Smarty_Internal_Template) {
- $_tpl = $_tpl->parent;
- }
- return "/*%%SmartyNocache:{$_tpl->properties['nocache_hash']}%%*/" . $_output . "/*/%%SmartyNocache:{$_tpl->properties['nocache_hash']}%%*/";
- }
-
-}
-
-?>
diff --git a/tools/smarty/sysplugins/smarty_internal_parsetree.php b/tools/smarty/sysplugins/smarty_internal_parsetree.php
deleted file mode 100755
index c9fb1f762..000000000
--- a/tools/smarty/sysplugins/smarty_internal_parsetree.php
+++ /dev/null
@@ -1,395 +0,0 @@
-parser = $parser;
- $this->data = $data;
- $this->saved_block_nesting = $parser->block_nesting_level;
- }
-
- /**
- * Return buffer content
- *
- * @return string content
- */
- public function to_smarty_php()
- {
- return $this->data;
- }
-
- /**
- * Return complied code that loads the evaluated outout of buffer content into a temporary variable
- *
- * @return string template code
- */
- public function assign_to_var()
- {
- $var = sprintf('$_tmp%d', ++$this->parser->prefix_number);
- $this->parser->compiler->prefix_code[] = sprintf('%s', $this->data, $var);
- return $var;
- }
-
-}
-
-/**
- * Code fragment inside a tag.
- *
- * @package Smarty
- * @subpackage Compiler
- * @ignore
- */
-class _smarty_code extends _smarty_parsetree {
-
-
- /**
- * Create parse tree buffer for code fragment
- *
- * @param object $parser parser object
- * @param string $data content
- */
- public function __construct($parser, $data)
- {
- $this->parser = $parser;
- $this->data = $data;
- }
-
- /**
- * Return buffer content in parentheses
- *
- * @return string content
- */
- public function to_smarty_php()
- {
- return sprintf("(%s)", $this->data);
- }
-
-}
-
-/**
- * Double quoted string inside a tag.
- *
- * @package Smarty
- * @subpackage Compiler
- * @ignore
- */
-class _smarty_doublequoted extends _smarty_parsetree {
-
- /**
- * Create parse tree buffer for double quoted string subtrees
- *
- * @param object $parser parser object
- * @param _smarty_parsetree $subtree parsetree buffer
- */
- public function __construct($parser, _smarty_parsetree $subtree)
- {
- $this->parser = $parser;
- $this->subtrees[] = $subtree;
- if ($subtree instanceof _smarty_tag) {
- $this->parser->block_nesting_level = count($this->parser->compiler->_tag_stack);
- }
- }
-
- /**
- * Append buffer to subtree
- *
- * @param _smarty_parsetree $subtree parsetree buffer
- */
- public function append_subtree(_smarty_parsetree $subtree)
- {
- $last_subtree = count($this->subtrees) - 1;
- if ($last_subtree >= 0 && $this->subtrees[$last_subtree] instanceof _smarty_tag && $this->subtrees[$last_subtree]->saved_block_nesting < $this->parser->block_nesting_level) {
- if ($subtree instanceof _smarty_code) {
- $this->subtrees[$last_subtree]->data .= 'data . ';?>';
- } elseif ($subtree instanceof _smarty_dq_content) {
- $this->subtrees[$last_subtree]->data .= 'data . '";?>';
- } else {
- $this->subtrees[$last_subtree]->data .= $subtree->data;
- }
- } else {
- $this->subtrees[] = $subtree;
- }
- if ($subtree instanceof _smarty_tag) {
- $this->parser->block_nesting_level = count($this->parser->compiler->_tag_stack);
- }
- }
-
- /**
- * Merge subtree buffer content together
- *
- * @return string compiled template code
- */
- public function to_smarty_php()
- {
- $code = '';
- foreach ($this->subtrees as $subtree) {
- if ($code !== "") {
- $code .= ".";
- }
- if ($subtree instanceof _smarty_tag) {
- $more_php = $subtree->assign_to_var();
- } else {
- $more_php = $subtree->to_smarty_php();
- }
-
- $code .= $more_php;
-
- if (!$subtree instanceof _smarty_dq_content) {
- $this->parser->compiler->has_variable_string = true;
- }
- }
- return $code;
- }
-
-}
-
-/**
- * Raw chars as part of a double quoted string.
- *
- * @package Smarty
- * @subpackage Compiler
- * @ignore
- */
-class _smarty_dq_content extends _smarty_parsetree {
-
-
- /**
- * Create parse tree buffer with string content
- *
- * @param object $parser parser object
- * @param string $data string section
- */
- public function __construct($parser, $data)
- {
- $this->parser = $parser;
- $this->data = $data;
- }
-
- /**
- * Return content as double quoted string
- *
- * @return string doubled quoted string
- */
- public function to_smarty_php()
- {
- return '"' . $this->data . '"';
- }
-
-}
-
-/**
- * Template element
- *
- * @package Smarty
- * @subpackage Compiler
- * @ignore
- */
-class _smarty_template_buffer extends _smarty_parsetree {
-
- /**
- * Array of template elements
- *
- * @var array
- */
- public $subtrees = Array();
-
- /**
- * Create root of parse tree for template elements
- *
- * @param object $parser parse object
- */
- public function __construct($parser)
- {
- $this->parser = $parser;
- }
-
- /**
- * Append buffer to subtree
- *
- * @param _smarty_parsetree $subtree
- */
- public function append_subtree(_smarty_parsetree $subtree)
- {
- $this->subtrees[] = $subtree;
- }
-
- /**
- * Sanitize and merge subtree buffers together
- *
- * @return string template code content
- */
- public function to_smarty_php()
- {
- $code = '';
- for ($key = 0, $cnt = count($this->subtrees); $key < $cnt; $key++) {
- if ($key + 2 < $cnt) {
- if ($this->subtrees[$key] instanceof _smarty_linebreak && $this->subtrees[$key + 1] instanceof _smarty_tag && $this->subtrees[$key + 1]->data == '' && $this->subtrees[$key + 2] instanceof _smarty_linebreak) {
- $key = $key + 1;
- continue;
- }
- if (substr($this->subtrees[$key]->data, -1) == '<' && $this->subtrees[$key + 1]->data == '' && substr($this->subtrees[$key + 2]->data, -1) == '?') {
- $key = $key + 2;
- continue;
- }
- }
- if (substr($code, -1) == '<') {
- $subtree = $this->subtrees[$key]->to_smarty_php();
- if (substr($subtree, 0, 1) == '?') {
- $code = substr($code, 0, strlen($code) - 1) . '<?' . substr($subtree, 1);
- } elseif ($this->parser->asp_tags && substr($subtree, 0, 1) == '%') {
- $code = substr($code, 0, strlen($code) - 1) . '<%' . substr($subtree, 1);
- } else {
- $code .= $subtree;
- }
- continue;
- }
- if ($this->parser->asp_tags && substr($code, -1) == '%') {
- $subtree = $this->subtrees[$key]->to_smarty_php();
- if (substr($subtree, 0, 1) == '>') {
- $code = substr($code, 0, strlen($code) - 1) . '%>' . substr($subtree, 1);
- } else {
- $code .= $subtree;
- }
- continue;
- }
- if (substr($code, -1) == '?') {
- $subtree = $this->subtrees[$key]->to_smarty_php();
- if (substr($subtree, 0, 1) == '>') {
- $code = substr($code, 0, strlen($code) - 1) . '?>' . substr($subtree, 1);
- } else {
- $code .= $subtree;
- }
- continue;
- }
- $code .= $this->subtrees[$key]->to_smarty_php();
- }
- return $code;
- }
-
-}
-
-/**
- * template text
- *
- * @package Smarty
- * @subpackage Compiler
- * @ignore
- */
-class _smarty_text extends _smarty_parsetree {
-
-
- /**
- * Create template text buffer
- *
- * @param object $parser parser object
- * @param string $data text
- */
- public function __construct($parser, $data)
- {
- $this->parser = $parser;
- $this->data = $data;
- }
-
- /**
- * Return buffer content
- *
- * @return strint text
- */
- public function to_smarty_php()
- {
- return $this->data;
- }
-
-}
-
-/**
- * template linebreaks
- *
- * @package Smarty
- * @subpackage Compiler
- * @ignore
- */
-class _smarty_linebreak extends _smarty_parsetree {
-
- /**
- * Create buffer with linebreak content
- *
- * @param object $parser parser object
- * @param string $data linebreak string
- */
- public function __construct($parser, $data)
- {
- $this->parser = $parser;
- $this->data = $data;
- }
-
- /**
- * Return linebrak
- *
- * @return string linebreak
- */
- public function to_smarty_php()
- {
- return $this->data;
- }
-
-}
-
-?>
\ No newline at end of file
diff --git a/tools/smarty/sysplugins/smarty_internal_resource_eval.php b/tools/smarty/sysplugins/smarty_internal_resource_eval.php
deleted file mode 100755
index cf2ec3e1c..000000000
--- a/tools/smarty/sysplugins/smarty_internal_resource_eval.php
+++ /dev/null
@@ -1,94 +0,0 @@
-uid = $source->filepath = sha1($source->name);
- $source->timestamp = false;
- $source->exists = true;
- }
-
- /**
- * Load template's source from $resource_name into current template object
- *
- * @uses decode() to decode base64 and urlencoded template_resources
- * @param Smarty_Template_Source $source source object
- * @return string template source
- */
- public function getContent(Smarty_Template_Source $source)
- {
- return $this->decode($source->name);
- }
-
- /**
- * decode base64 and urlencode
- *
- * @param string $string template_resource to decode
- * @return string decoded template_resource
- */
- protected function decode($string)
- {
- // decode if specified
- if (($pos = strpos($string, ':')) !== false) {
- if (!strncmp($string, 'base64', 6)) {
- return base64_decode(substr($string, 7));
- } elseif (!strncmp($string, 'urlencode', 9)) {
- return urldecode(substr($string, 10));
- }
- }
-
- return $string;
- }
-
- /**
- * modify resource_name according to resource handlers specifications
- *
- * @param Smarty $smarty Smarty instance
- * @param string $resource_name resource_name to make unique
- * @return string unique resource name
- */
- protected function buildUniqueResourceName(Smarty $smarty, $resource_name)
- {
- return get_class($this) . '#' .$this->decode($resource_name);
- }
-
- /**
- * Determine basename for compiled filename
- *
- * @param Smarty_Template_Source $source source object
- * @return string resource's basename
- */
- protected function getBasename(Smarty_Template_Source $source)
- {
- return '';
- }
-
-}
-
-?>
\ No newline at end of file
diff --git a/tools/smarty/sysplugins/smarty_internal_resource_extends.php b/tools/smarty/sysplugins/smarty_internal_resource_extends.php
deleted file mode 100755
index 53ea3ebcf..000000000
--- a/tools/smarty/sysplugins/smarty_internal_resource_extends.php
+++ /dev/null
@@ -1,148 +0,0 @@
-name);
- $exists = true;
- foreach ($components as $component) {
- $s = Smarty_Resource::source(null, $source->smarty, $component);
- if ($s->type == 'php') {
- throw new SmartyException("Resource type {$s->type} cannot be used with the extends resource type");
- }
- $sources[$s->uid] = $s;
- $uid .= $s->filepath;
- if ($_template && $_template->smarty->compile_check) {
- $exists == $exists && $s->exists;
- }
- }
- $source->components = $sources;
- $source->filepath = $s->filepath;
- $source->uid = sha1($uid);
- if ($_template && $_template->smarty->compile_check) {
- $source->timestamp = $s->timestamp;
- $source->exists = $exists;
- }
- // need the template at getContent()
- $source->template = $_template;
- }
-
- /**
- * populate Source Object with timestamp and exists from Resource
- *
- * @param Smarty_Template_Source $source source object
- */
- public function populateTimestamp(Smarty_Template_Source $source)
- {
- $source->exists = true;
- foreach ($source->components as $s) {
- $source->exists == $source->exists && $s->exists;
- }
- $source->timestamp = $s->timestamp;
- }
-
- /**
- * Load template's source from files into current template object
- *
- * @param Smarty_Template_Source $source source object
- * @return string template source
- * @throws SmartyException if source cannot be loaded
- */
- public function getContent(Smarty_Template_Source $source)
- {
- if (!$source->exists) {
- throw new SmartyException("Unable to read template {$source->type} '{$source->name}'");
- }
-
- $_rdl = preg_quote($source->smarty->right_delimiter);
- $_ldl = preg_quote($source->smarty->left_delimiter);
- $_components = array_reverse($source->components);
- $_first = reset($_components);
- $_last = end($_components);
-
- foreach ($_components as $_component) {
- // register dependency
- if ($_component != $_first) {
- $source->template->properties['file_dependency'][$_component->uid] = array($_component->filepath, $_component->timestamp, $_component->type);
- }
-
- // read content
- $source->filepath = $_component->filepath;
- $_content = $_component->content;
-
- // extend sources
- if ($_component != $_last) {
- if (preg_match_all("!({$_ldl}block\s(.+?){$_rdl})!", $_content, $_open) !=
- preg_match_all("!({$_ldl}/block{$_rdl})!", $_content, $_close)) {
- throw new SmartyException("unmatched {block} {/block} pairs in template {$_component->type} '{$_component->name}'");
- }
- preg_match_all("!{$_ldl}block\s(.+?){$_rdl}|{$_ldl}/block{$_rdl}|{$_ldl}\*([\S\s]*?)\*{$_rdl}!", $_content, $_result, PREG_OFFSET_CAPTURE);
- $_result_count = count($_result[0]);
- $_start = 0;
- while ($_start+1 < $_result_count) {
- $_end = 0;
- $_level = 1;
- if (substr($_result[0][$_start][0],0,strlen($source->smarty->left_delimiter)+1) == $source->smarty->left_delimiter.'*') {
- $_start++;
- continue;
- }
- while ($_level != 0) {
- $_end++;
- if (substr($_result[0][$_start + $_end][0],0,strlen($source->smarty->left_delimiter)+1) == $source->smarty->left_delimiter.'*') {
- continue;
- }
- if (!strpos($_result[0][$_start + $_end][0], '/')) {
- $_level++;
- } else {
- $_level--;
- }
- }
- $_block_content = str_replace($source->smarty->left_delimiter . '$smarty.block.parent' . $source->smarty->right_delimiter, '%%%%SMARTY_PARENT%%%%', substr($_content, $_result[0][$_start][1] + strlen($_result[0][$_start][0]), $_result[0][$_start + $_end][1] - $_result[0][$_start][1] - + strlen($_result[0][$_start][0])));
- Smarty_Internal_Compile_Block::saveBlockData($_block_content, $_result[0][$_start][0], $source->template, $_component->filepath);
- $_start = $_start + $_end + 1;
- }
- } else {
- return $_content;
- }
- }
- }
-
- /**
- * Determine basename for compiled filename
- *
- * @param Smarty_Template_Source $source source object
- * @return string resource's basename
- */
- public function getBasename(Smarty_Template_Source $source)
- {
- return str_replace(':', '.', basename($source->filepath));
- }
-
-}
-
-?>
\ No newline at end of file
diff --git a/tools/smarty/sysplugins/smarty_internal_resource_file.php b/tools/smarty/sysplugins/smarty_internal_resource_file.php
deleted file mode 100755
index 48b391d20..000000000
--- a/tools/smarty/sysplugins/smarty_internal_resource_file.php
+++ /dev/null
@@ -1,90 +0,0 @@
-filepath = $this->buildFilepath($source, $_template);
-
- if ($source->filepath !== false) {
- if (is_object($source->smarty->security_policy)) {
- $source->smarty->security_policy->isTrustedResourceDir($source->filepath);
- }
-
- $source->uid = sha1($source->filepath);
- if ($source->smarty->compile_check && !isset($source->timestamp)) {
- $source->timestamp = @filemtime($source->filepath);
- $source->exists = !!$source->timestamp;
- }
- }
- }
-
- /**
- * populate Source Object with timestamp and exists from Resource
- *
- * @param Smarty_Template_Source $source source object
- */
- public function populateTimestamp(Smarty_Template_Source $source)
- {
- $source->timestamp = @filemtime($source->filepath);
- $source->exists = !!$source->timestamp;
- }
-
- /**
- * Load template's source from file into current template object
- *
- * @param Smarty_Template_Source $source source object
- * @return string template source
- * @throws SmartyException if source cannot be loaded
- */
- public function getContent(Smarty_Template_Source $source)
- {
- if ($source->timestamp) {
- return file_get_contents($source->filepath);
- }
- if ($source instanceof Smarty_Config_Source) {
- throw new SmartyException("Unable to read config {$source->type} '{$source->name}'");
- }
- throw new SmartyException("Unable to read template {$source->type} '{$source->name}'");
- }
-
- /**
- * Determine basename for compiled filename
- *
- * @param Smarty_Template_Source $source source object
- * @return string resource's basename
- */
- public function getBasename(Smarty_Template_Source $source)
- {
- $_file = $source->name;
- if (($_pos = strpos($_file, ']')) !== false) {
- $_file = substr($_file, $_pos + 1);
- }
- return basename($_file);
- }
-
-}
-
-?>
\ No newline at end of file
diff --git a/tools/smarty/sysplugins/smarty_internal_resource_php.php b/tools/smarty/sysplugins/smarty_internal_resource_php.php
deleted file mode 100755
index 7cd8baeec..000000000
--- a/tools/smarty/sysplugins/smarty_internal_resource_php.php
+++ /dev/null
@@ -1,114 +0,0 @@
-short_open_tag = ini_get( 'short_open_tag' );
- }
-
- /**
- * populate Source Object with meta data from Resource
- *
- * @param Smarty_Template_Source $source source object
- * @param Smarty_Internal_Template $_template template object
- * @return void
- */
- public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null)
- {
- $source->filepath = $this->buildFilepath($source, $_template);
-
- if ($source->filepath !== false) {
- if (is_object($source->smarty->security_policy)) {
- $source->smarty->security_policy->isTrustedResourceDir($source->filepath);
- }
-
- $source->uid = sha1($source->filepath);
- if ($source->smarty->compile_check) {
- $source->timestamp = @filemtime($source->filepath);
- $source->exists = !!$source->timestamp;
- }
- }
- }
-
- /**
- * populate Source Object with timestamp and exists from Resource
- *
- * @param Smarty_Template_Source $source source object
- * @return void
- */
- public function populateTimestamp(Smarty_Template_Source $source)
- {
- $source->timestamp = @filemtime($source->filepath);
- $source->exists = !!$source->timestamp;
- }
-
- /**
- * Load template's source from file into current template object
- *
- * @param Smarty_Template_Source $source source object
- * @return string template source
- * @throws SmartyException if source cannot be loaded
- */
- public function getContent(Smarty_Template_Source $source)
- {
- if ($source->timestamp) {
- return '';
- }
- throw new SmartyException("Unable to read template {$source->type} '{$source->name}'");
- }
-
- /**
- * Render and output the template (without using the compiler)
- *
- * @param Smarty_Template_Source $source source object
- * @param Smarty_Internal_Template $_template template object
- * @return void
- * @throws SmartyException if template cannot be loaded or allow_php_templates is disabled
- */
- public function renderUncompiled(Smarty_Template_Source $source, Smarty_Internal_Template $_template)
- {
- $_smarty_template = $_template;
-
- if (!$source->smarty->allow_php_templates) {
- throw new SmartyException("PHP templates are disabled");
- }
- if (!$source->exists) {
- if ($_template->parent instanceof Smarty_Internal_Template) {
- $parent_resource = " in '{$_template->parent->template_resource}'";
- } else {
- $parent_resource = '';
- }
- throw new SmartyException("Unable to load template {$source->type} '{$source->name}'{$parent_resource}");
- }
-
- // prepare variables
- extract($_template->getTemplateVars());
-
- // include PHP template with short open tags enabled
- ini_set( 'short_open_tag', '1' );
- include($source->filepath);
- ini_set( 'short_open_tag', $this->short_open_tag );
- }
-}
-
-?>
\ No newline at end of file
diff --git a/tools/smarty/sysplugins/smarty_internal_resource_registered.php b/tools/smarty/sysplugins/smarty_internal_resource_registered.php
deleted file mode 100755
index 44497b922..000000000
--- a/tools/smarty/sysplugins/smarty_internal_resource_registered.php
+++ /dev/null
@@ -1,95 +0,0 @@
-filepath = $source->type . ':' . $source->name;
- $source->uid = sha1($source->filepath);
- if ($source->smarty->compile_check) {
- $source->timestamp = $this->getTemplateTimestamp($source);
- $source->exists = !!$source->timestamp;
- }
- }
-
- /**
- * populate Source Object with timestamp and exists from Resource
- *
- * @param Smarty_Template_Source $source source object
- * @return void
- */
- public function populateTimestamp(Smarty_Template_Source $source)
- {
- $source->timestamp = $this->getTemplateTimestamp($source);
- $source->exists = !!$source->timestamp;
- }
-
- /**
- * Get timestamp (epoch) the template source was modified
- *
- * @param Smarty_Template_Source $source source object
- * @return integer|boolean timestamp (epoch) the template was modified, false if resources has no timestamp
- */
- public function getTemplateTimestamp(Smarty_Template_Source $source)
- {
- // return timestamp
- $time_stamp = false;
- call_user_func_array($source->smarty->registered_resources[$source->type][0][1], array($source->name, &$time_stamp, $source->smarty));
- return is_numeric($time_stamp) ? (int) $time_stamp : $time_stamp;
- }
-
- /**
- * Load template's source by invoking the registered callback into current template object
- *
- * @param Smarty_Template_Source $source source object
- * @return string template source
- * @throws SmartyException if source cannot be loaded
- */
- public function getContent(Smarty_Template_Source $source)
- {
- // return template string
- $t = call_user_func_array($source->smarty->registered_resources[$source->type][0][0], array($source->name, &$source->content, $source->smarty));
- if (is_bool($t) && !$t) {
- throw new SmartyException("Unable to read template {$source->type} '{$source->name}'");
- }
- return $source->content;
- }
-
- /**
- * Determine basename for compiled filename
- *
- * @param Smarty_Template_Source $source source object
- * @return string resource's basename
- */
- protected function getBasename(Smarty_Template_Source $source)
- {
- return basename($source->name);
- }
-
-}
-
-?>
\ No newline at end of file
diff --git a/tools/smarty/sysplugins/smarty_internal_resource_stream.php b/tools/smarty/sysplugins/smarty_internal_resource_stream.php
deleted file mode 100755
index 85698c232..000000000
--- a/tools/smarty/sysplugins/smarty_internal_resource_stream.php
+++ /dev/null
@@ -1,76 +0,0 @@
-filepath = str_replace(':', '://', $source->resource);
- $source->uid = false;
- $source->content = $this->getContent($source);
- $source->timestamp = false;
- $source->exists = !!$source->content;
- }
-
- /**
- * Load template's source from stream into current template object
- *
- * @param Smarty_Template_Source $source source object
- * @return string template source
- * @throws SmartyException if source cannot be loaded
- */
- public function getContent(Smarty_Template_Source $source)
- {
- $t = '';
- // the availability of the stream has already been checked in Smarty_Resource::fetch()
- $fp = fopen($source->filepath, 'r+');
- if ($fp) {
- while (!feof($fp) && ($current_line = fgets($fp)) !== false) {
- $t .= $current_line;
- }
- fclose($fp);
- return $t;
- } else {
- return false;
- }
- }
-
- /**
- * modify resource_name according to resource handlers specifications
- *
- * @param Smarty $smarty Smarty instance
- * @param string $resource_name resource_name to make unique
- * @return string unique resource name
- */
- protected function buildUniqueResourceName(Smarty $smarty, $resource_name)
- {
- return get_class($this) . '#' . $resource_name;
- }
-}
-
-?>
\ No newline at end of file
diff --git a/tools/smarty/sysplugins/smarty_internal_resource_string.php b/tools/smarty/sysplugins/smarty_internal_resource_string.php
deleted file mode 100755
index 9571337b0..000000000
--- a/tools/smarty/sysplugins/smarty_internal_resource_string.php
+++ /dev/null
@@ -1,96 +0,0 @@
-uid = $source->filepath = sha1($source->name);
- $source->timestamp = 0;
- $source->exists = true;
- }
-
- /**
- * Load template's source from $resource_name into current template object
- *
- * @uses decode() to decode base64 and urlencoded template_resources
- * @param Smarty_Template_Source $source source object
- * @return string template source
- */
- public function getContent(Smarty_Template_Source $source)
- {
- return $this->decode($source->name);
- }
-
- /**
- * decode base64 and urlencode
- *
- * @param string $string template_resource to decode
- * @return string decoded template_resource
- */
- protected function decode($string)
- {
- // decode if specified
- if (($pos = strpos($string, ':')) !== false) {
- if (!strncmp($string, 'base64', 6)) {
- return base64_decode(substr($string, 7));
- } elseif (!strncmp($string, 'urlencode', 9)) {
- return urldecode(substr($string, 10));
- }
- }
-
- return $string;
- }
-
- /**
- * modify resource_name according to resource handlers specifications
- *
- * @param Smarty $smarty Smarty instance
- * @param string $resource_name resource_name to make unique
- * @return string unique resource name
- */
- protected function buildUniqueResourceName(Smarty $smarty, $resource_name)
- {
- return get_class($this) . '#' .$this->decode($resource_name);
- }
-
- /**
- * Determine basename for compiled filename
- *
- * Always returns an empty string.
- *
- * @param Smarty_Template_Source $source source object
- * @return string resource's basename
- */
- protected function getBasename(Smarty_Template_Source $source)
- {
- return '';
- }
-
-}
-
-?>
\ No newline at end of file
diff --git a/tools/smarty/sysplugins/smarty_internal_smartytemplatecompiler.php b/tools/smarty/sysplugins/smarty_internal_smartytemplatecompiler.php
deleted file mode 100755
index 1ec1aa430..000000000
--- a/tools/smarty/sysplugins/smarty_internal_smartytemplatecompiler.php
+++ /dev/null
@@ -1,127 +0,0 @@
-smarty = $smarty;
- parent::__construct();
- // get required plugins
- $this->lexer_class = $lexer_class;
- $this->parser_class = $parser_class;
- }
-
- /**
- * Methode to compile a Smarty template
- *
- * @param mixed $_content template source
- * @return bool true if compiling succeeded, false if it failed
- */
- protected function doCompile($_content)
- {
- /* here is where the compiling takes place. Smarty
- tags in the templates are replaces with PHP code,
- then written to compiled files. */
- // init the lexer/parser to compile the template
- $this->lex = new $this->lexer_class($_content, $this);
- $this->parser = new $this->parser_class($this->lex, $this);
- if ($this->smarty->_parserdebug)
- $this->parser->PrintTrace();
- // get tokens from lexer and parse them
- while ($this->lex->yylex() && !$this->abort_and_recompile) {
- if ($this->smarty->_parserdebug) {
- echo "Line {$this->lex->line} Parsing {$this->parser->yyTokenName[$this->lex->token]} Token " .
- htmlentities($this->lex->value) . "";
- }
- $this->parser->doParse($this->lex->token, $this->lex->value);
- }
-
- if ($this->abort_and_recompile) {
- // exit here on abort
- return false;
- }
- // finish parsing process
- $this->parser->doParse(0, 0);
- // check for unclosed tags
- if (count($this->_tag_stack) > 0) {
- // get stacked info
- list($openTag, $_data) = array_pop($this->_tag_stack);
- $this->trigger_template_error("unclosed {" . $openTag . "} tag");
- }
- // return compiled code
- // return str_replace(array("? >\nparser->retvalue);
- return $this->parser->retvalue;
- }
-
-}
-
-?>
\ No newline at end of file
diff --git a/tools/smarty/sysplugins/smarty_internal_template.php b/tools/smarty/sysplugins/smarty_internal_template.php
deleted file mode 100755
index 6367c0d13..000000000
--- a/tools/smarty/sysplugins/smarty_internal_template.php
+++ /dev/null
@@ -1,684 +0,0 @@
- array(),
- 'nocache_hash' => '',
- 'function' => array());
- /**
- * required plugins
- * @var array
- */
- public $required_plugins = array('compiled' => array(), 'nocache' => array());
- /**
- * Global smarty instance
- * @var Smarty
- */
- public $smarty = null;
- /**
- * blocks for template inheritance
- * @var array
- */
- public $block_data = array();
- /**
- * variable filters
- * @var array
- */
- public $variable_filters = array();
- /**
- * optional log of tag/attributes
- * @var array
- */
- public $used_tags = array();
- /**
- * internal flag to allow relative path in child template blocks
- * @var bool
- */
- public $allow_relative_path = false;
- /**
- * internal capture runtime stack
- * @var array
- */
- public $_capture_stack = array();
-
- /**
- * Create template data object
- *
- * Some of the global Smarty settings copied to template scope
- * It load the required template resources and cacher plugins
- *
- * @param string $template_resource template resource string
- * @param Smarty $smarty Smarty instance
- * @param Smarty_Internal_Template $_parent back pointer to parent object with variables or null
- * @param mixed $_cache_id cache id or null
- * @param mixed $_compile_id compile id or null
- * @param bool $_caching use caching?
- * @param int $_cache_lifetime cache life-time in seconds
- */
- public function __construct($template_resource, $smarty, $_parent = null, $_cache_id = null, $_compile_id = null, $_caching = null, $_cache_lifetime = null)
- {
- $this->smarty = &$smarty;
- // Smarty parameter
- $this->cache_id = $_cache_id === null ? $this->smarty->cache_id : $_cache_id;
- $this->compile_id = $_compile_id === null ? $this->smarty->compile_id : $_compile_id;
- $this->caching = $_caching === null ? $this->smarty->caching : $_caching;
- if ($this->caching === true)
- $this->caching = Smarty::CACHING_LIFETIME_CURRENT;
- $this->cache_lifetime = $_cache_lifetime === null ? $this->smarty->cache_lifetime : $_cache_lifetime;
- $this->parent = $_parent;
- // Template resource
- $this->template_resource = $template_resource;
- // copy block data of template inheritance
- if ($this->parent instanceof Smarty_Internal_Template) {
- $this->block_data = $this->parent->block_data;
- }
- }
-
- /**
- * Returns if the current template must be compiled by the Smarty compiler
- *
- * It does compare the timestamps of template source and the compiled templates and checks the force compile configuration
- *
- * @return boolean true if the template must be compiled
- */
- public function mustCompile()
- {
- if (!$this->source->exists) {
- if ($this->parent instanceof Smarty_Internal_Template) {
- $parent_resource = " in '$this->parent->template_resource}'";
- } else {
- $parent_resource = '';
- }
- throw new SmartyException("Unable to load template {$this->source->type} '{$this->source->name}'{$parent_resource}");
- }
- if ($this->mustCompile === null) {
- $this->mustCompile = (!$this->source->uncompiled && ($this->smarty->force_compile || $this->source->recompiled || $this->compiled->timestamp === false ||
- ($this->smarty->compile_check && $this->compiled->timestamp < $this->source->timestamp)));
- }
- return $this->mustCompile;
- }
-
- /**
- * Compiles the template
- *
- * If the template is not evaluated the compiled template is saved on disk
- */
- public function compileTemplateSource()
- {
- if (!$this->source->recompiled) {
- $this->properties['file_dependency'] = array();
- if ($this->source->components) {
- // uses real resource for file dependency
- $source = end($this->source->components);
- $this->properties['file_dependency'][$this->source->uid] = array($this->source->filepath, $this->source->timestamp, $source->type);
- } else {
- $this->properties['file_dependency'][$this->source->uid] = array($this->source->filepath, $this->source->timestamp, $this->source->type);
- }
- }
- if ($this->smarty->debugging) {
- Smarty_Internal_Debug::start_compile($this);
- }
- // compile locking
- if ($this->smarty->compile_locking && !$this->source->recompiled) {
- if ($saved_timestamp = $this->compiled->timestamp) {
- touch($this->compiled->filepath);
- }
- }
- // call compiler
- try {
- $code = $this->compiler->compileTemplate($this);
- } catch (Exception $e) {
- // restore old timestamp in case of error
- if ($this->smarty->compile_locking && !$this->source->recompiled && $saved_timestamp) {
- touch($this->compiled->filepath, $saved_timestamp);
- }
- throw $e;
- }
- // compiling succeded
- if (!$this->source->recompiled && $this->compiler->write_compiled_code) {
- // write compiled template
- $_filepath = $this->compiled->filepath;
- if ($_filepath === false)
- throw new SmartyException('getCompiledFilepath() did not return a destination to save the compiled template to');
- Smarty_Internal_Write_File::writeFile($_filepath, $code, $this->smarty);
- $this->compiled->exists = true;
- $this->compiled->isCompiled = true;
- }
- if ($this->smarty->debugging) {
- Smarty_Internal_Debug::end_compile($this);
- }
- // release compiler object to free memory
- unset($this->compiler);
- }
-
- /**
- * Writes the cached template output
- *
- * @return bool
- */
- public function writeCachedContent($content)
- {
- if ($this->source->recompiled || !($this->caching == Smarty::CACHING_LIFETIME_CURRENT || $this->caching == Smarty::CACHING_LIFETIME_SAVED)) {
- // don't write cache file
- return false;
- }
- $this->properties['cache_lifetime'] = $this->cache_lifetime;
- $this->properties['unifunc'] = 'content_' . uniqid('', false);
- $content = $this->createTemplateCodeFrame($content, true);
- $_smarty_tpl = $this;
- eval("?>" . $content);
- $this->cached->valid = true;
- $this->cached->processed = true;
- return $this->cached->write($this, $content);
- }
-
- /**
- * Template code runtime function to get subtemplate content
- *
- * @param string $template the resource handle of the template file
- * @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 integer $caching cache mode
- * @param integer $cache_lifetime life time of cache data
- * @param array $vars optional variables to assign
- * @param int $parent_scope scope in which {include} should execute
- * @returns string template content
- */
- public function getSubTemplate($template, $cache_id, $compile_id, $caching, $cache_lifetime, $data, $parent_scope)
- {
- // already in template cache?
- if ($this->smarty->allow_ambiguous_resources) {
- $_templateId = Smarty_Resource::getUniqueTemplateName($this->smarty, $template) . $cache_id . $compile_id;
- } else {
- $_templateId = $this->smarty->joined_template_dir . '#' . $template . $cache_id . $compile_id;
- }
-
- if (isset($_templateId[150])) {
- $_templateId = sha1($_templateId);
- }
- if (isset($this->smarty->template_objects[$_templateId])) {
- // clone cached template object because of possible recursive call
- $tpl = clone $this->smarty->template_objects[$_templateId];
- $tpl->parent = $this;
- $tpl->caching = $caching;
- $tpl->cache_lifetime = $cache_lifetime;
- } else {
- $tpl = new $this->smarty->template_class($template, $this->smarty, $this, $cache_id, $compile_id, $caching, $cache_lifetime);
- }
- // get variables from calling scope
- if ($parent_scope == Smarty::SCOPE_LOCAL) {
- $tpl->tpl_vars = $this->tpl_vars;
- } elseif ($parent_scope == Smarty::SCOPE_PARENT) {
- $tpl->tpl_vars = &$this->tpl_vars;
- } elseif ($parent_scope == Smarty::SCOPE_GLOBAL) {
- $tpl->tpl_vars = &Smarty::$global_tpl_vars;
- } elseif (($scope_ptr = $this->getScopePointer($parent_scope)) == null) {
- $tpl->tpl_vars = &$this->tpl_vars;
- } else {
- $tpl->tpl_vars = &$scope_ptr->tpl_vars;
- }
- $tpl->config_vars = $this->config_vars;
- if (!empty($data)) {
- // set up variable values
- foreach ($data as $_key => $_val) {
- $tpl->tpl_vars[$_key] = new Smarty_variable($_val);
- }
- }
- return $tpl->fetch(null, null, null, null, false, false, true);
- }
-
- /**
- * Template code runtime function to set up an inline subtemplate
- *
- * @param string $template the resource handle of the template file
- * @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 integer $caching cache mode
- * @param integer $cache_lifetime life time of cache data
- * @param array $vars optional variables to assign
- * @param int $parent_scope scope in which {include} should execute
- * @param string $hash nocache hash code
- * @returns string template content
- */
- public function setupInlineSubTemplate($template, $cache_id, $compile_id, $caching, $cache_lifetime, $data, $parent_scope, $hash)
- {
- $tpl = new $this->smarty->template_class($template, $this->smarty, $this, $cache_id, $compile_id, $caching, $cache_lifetime);
- $tpl->properties['nocache_hash'] = $hash;
- // get variables from calling scope
- if ($parent_scope == Smarty::SCOPE_LOCAL ) {
- $tpl->tpl_vars = $this->tpl_vars;
- } elseif ($parent_scope == Smarty::SCOPE_PARENT) {
- $tpl->tpl_vars = &$this->tpl_vars;
- } elseif ($parent_scope == Smarty::SCOPE_GLOBAL) {
- $tpl->tpl_vars = &Smarty::$global_tpl_vars;
- } elseif (($scope_ptr = $this->getScopePointer($parent_scope)) == null) {
- $tpl->tpl_vars = &$this->tpl_vars;
- } else {
- $tpl->tpl_vars = &$scope_ptr->tpl_vars;
- }
- $tpl->config_vars = $this->config_vars;
- if (!empty($data)) {
- // set up variable values
- foreach ($data as $_key => $_val) {
- $tpl->tpl_vars[$_key] = new Smarty_variable($_val);
- }
- }
- return $tpl;
- }
-
-
- /**
- * Create code frame for compiled and cached templates
- *
- * @param string $content optional template content
- * @param bool $cache flag for cache file
- * @return string
- */
- public function createTemplateCodeFrame($content = '', $cache = false)
- {
- $plugins_string = '';
- // include code for plugins
- if (!$cache) {
- if (!empty($this->required_plugins['compiled'])) {
- $plugins_string = 'required_plugins['compiled'] as $tmp) {
- foreach ($tmp as $data) {
- $file = addslashes($data['file']);
- $plugins_string .= "if (!is_callable('{$data['function']}')) include '{$file}';\n";
- }
- }
- $plugins_string .= '?>';
- }
- if (!empty($this->required_plugins['nocache'])) {
- $this->has_nocache_code = true;
- $plugins_string .= "properties['nocache_hash']}%%*/smarty; ";
- foreach ($this->required_plugins['nocache'] as $tmp) {
- foreach ($tmp as $data) {
- $file = addslashes($data['file']);
- $plugins_string .= addslashes("if (!is_callable('{$data['function']}')) include '{$file}';\n");
- }
- }
- $plugins_string .= "?>/*/%%SmartyNocache:{$this->properties['nocache_hash']}%%*/';?>\n";
- }
- }
- // build property code
- $this->properties['has_nocache_code'] = $this->has_nocache_code;
- $output = '';
- if (!$this->source->recompiled) {
- $output = "properties['nocache_hash']}%%*/";
- if ($this->smarty->direct_access_security) {
- $output .= "if(!defined('SMARTY_DIR')) exit('no direct access allowed');\n";
- }
- }
- if ($cache) {
- // remove compiled code of{function} definition
- unset($this->properties['function']);
- if (!empty($this->smarty->template_functions)) {
- // copy code of {function} tags called in nocache mode
- foreach ($this->smarty->template_functions as $name => $function_data) {
- if (isset($function_data['called_nocache'])) {
- foreach ($function_data['called_functions'] as $func_name) {
- $this->smarty->template_functions[$func_name]['called_nocache'] = true;
- }
- }
- }
- foreach ($this->smarty->template_functions as $name => $function_data) {
- if (isset($function_data['called_nocache'])) {
- unset($function_data['called_nocache'], $function_data['called_functions'], $this->smarty->template_functions[$name]['called_nocache']);
- $this->properties['function'][$name] = $function_data;
- }
- }
- }
- }
- $this->properties['version'] = Smarty::SMARTY_VERSION;
- if (!isset($this->properties['unifunc'])) {
- $this->properties['unifunc'] = 'content_' . uniqid('', false);
- }
- if (!$this->source->recompiled) {
- $output .= "\$_valid = \$_smarty_tpl->decodeProperties(" . var_export($this->properties, true) . ',' . ($cache ? 'true' : 'false') . "); /*/%%SmartyHeaderCode%%*/?>\n";
- }
- if (!$this->source->recompiled) {
- $output .= 'properties['unifunc'] . '\')) {function ' . $this->properties['unifunc'] . '($_smarty_tpl) {?>';
- }
- $output .= $plugins_string;
- $output .= $content;
- if (!$this->source->recompiled) {
- $output .= '';
- }
- return $output;
- }
-
- /**
- * This function is executed automatically when a compiled or cached template file is included
- *
- * - Decode saved properties from compiled template and cache files
- * - Check if compiled or cache file is valid
- *
- * @param array $properties special template properties
- * @param bool $cache flag if called from cache file
- * @return bool flag if compiled or cache file is valid
- */
- public function decodeProperties($properties, $cache = false)
- {
- $this->has_nocache_code = $properties['has_nocache_code'];
- $this->properties['nocache_hash'] = $properties['nocache_hash'];
- if (isset($properties['cache_lifetime'])) {
- $this->properties['cache_lifetime'] = $properties['cache_lifetime'];
- }
- if (isset($properties['file_dependency'])) {
- $this->properties['file_dependency'] = array_merge($this->properties['file_dependency'], $properties['file_dependency']);
- }
- if (!empty($properties['function'])) {
- $this->properties['function'] = array_merge($this->properties['function'], $properties['function']);
- $this->smarty->template_functions = array_merge($this->smarty->template_functions, $properties['function']);
- }
- $this->properties['version'] = (isset($properties['version'])) ? $properties['version'] : '';
- $this->properties['unifunc'] = $properties['unifunc'];
- // check file dependencies at compiled code
- $is_valid = true;
- if ($this->properties['version'] != Smarty::SMARTY_VERSION) {
- $is_valid = false;
- } else if (((!$cache && $this->smarty->compile_check && empty($this->compiled->_properties) && !$this->compiled->isCompiled) || $cache && ($this->smarty->compile_check === true || $this->smarty->compile_check === Smarty::COMPILECHECK_ON)) && !empty($this->properties['file_dependency'])) {
- foreach ($this->properties['file_dependency'] as $_file_to_check) {
- if ($_file_to_check[2] == 'file' || $_file_to_check[2] == 'php') {
- if ($this->source->filepath == $_file_to_check[0] && isset($this->source->timestamp)) {
- // do not recheck current template
- $mtime = $this->source->timestamp;
- } else {
- // file and php types can be checked without loading the respective resource handlers
- $mtime = filemtime($_file_to_check[0]);
- }
- } elseif ($_file_to_check[2] == 'string') {
- continue;
- } else {
- $source = Smarty_Resource::source(null, $this->smarty, $_file_to_check[0]);
- $mtime = $source->timestamp;
- }
- if ($mtime > $_file_to_check[1]) {
- $is_valid = false;
- break;
- }
- }
- }
- if ($cache) {
- $this->cached->valid = $is_valid;
- } else {
- $this->mustCompile = !$is_valid;
- }
- // store data in reusable Smarty_Template_Compiled
- if (!$cache) {
- $this->compiled->_properties = $properties;
- }
- return $is_valid;
- }
-
- /**
- * Template code runtime function to create a local Smarty variable for array assignments
- *
- * @param string $tpl_var tempate variable name
- * @param bool $nocache cache mode of variable
- * @param int $scope scope of variable
- */
- public function createLocalArrayVariable($tpl_var, $nocache = false, $scope = Smarty::SCOPE_LOCAL)
- {
- if (!isset($this->tpl_vars[$tpl_var])) {
- $this->tpl_vars[$tpl_var] = new Smarty_variable(array(), $nocache, $scope);
- } else {
- $this->tpl_vars[$tpl_var] = clone $this->tpl_vars[$tpl_var];
- if ($scope != Smarty::SCOPE_LOCAL) {
- $this->tpl_vars[$tpl_var]->scope = $scope;
- }
- if (!(is_array($this->tpl_vars[$tpl_var]->value) || $this->tpl_vars[$tpl_var]->value instanceof ArrayAccess)) {
- settype($this->tpl_vars[$tpl_var]->value, 'array');
- }
- }
- }
-
- /**
- * Template code runtime function to get pointer to template variable array of requested scope
- *
- * @param int $scope requested variable scope
- * @return array array of template variables
- */
- public function &getScope($scope)
- {
- if ($scope == Smarty::SCOPE_PARENT && !empty($this->parent)) {
- return $this->parent->tpl_vars;
- } elseif ($scope == Smarty::SCOPE_ROOT && !empty($this->parent)) {
- $ptr = $this->parent;
- while (!empty($ptr->parent)) {
- $ptr = $ptr->parent;
- }
- return $ptr->tpl_vars;
- } elseif ($scope == Smarty::SCOPE_GLOBAL) {
- return Smarty::$global_tpl_vars;
- }
- $null = null;
- return $null;
- }
-
- /**
- * Get parent or root of template parent chain
- *
- * @param int $scope pqrent or root scope
- * @return mixed object
- */
- public function getScopePointer($scope)
- {
- if ($scope == Smarty::SCOPE_PARENT && !empty($this->parent)) {
- return $this->parent;
- } elseif ($scope == Smarty::SCOPE_ROOT && !empty($this->parent)) {
- $ptr = $this->parent;
- while (!empty($ptr->parent)) {
- $ptr = $ptr->parent;
- }
- return $ptr;
- }
- return null;
- }
-
- /**
- * [util function] counts an array, arrayaccess/traversable or PDOStatement object
- *
- * @param mixed $value
- * @return int the count for arrays and objects that implement countable, 1 for other objects that don't, and 0 for empty elements
- */
- public function _count($value)
- {
- if (is_array($value) === true || $value instanceof Countable) {
- return count($value);
- } elseif ($value instanceof IteratorAggregate) {
- // Note: getIterator() returns a Traversable, not an Iterator
- // thus rewind() and valid() methods may not be present
- return iterator_count($value->getIterator());
- } elseif ($value instanceof Iterator) {
- return iterator_count($value);
- } elseif ($value instanceof PDOStatement) {
- return $value->rowCount();
- } elseif ($value instanceof Traversable) {
- return iterator_count($value);
- } elseif ($value instanceof ArrayAccess) {
- if ($value->offsetExists(0)) {
- return 1;
- }
- } elseif (is_object($value)) {
- return count($value);
- }
- return 0;
- }
-
- /**
- * runtime error not matching capture tags
- *
- */
- public function capture_error()
- {
- throw new SmartyException("Not matching {capture} open/close in \"{$this->template_resource}\"");
- }
-
- /**
- * Empty cache for this template
- *
- * @param integer $exp_time expiration time
- * @return integer number of cache files deleted
- */
- public function clearCache($exp_time=null)
- {
- Smarty_CacheResource::invalidLoadedCache($this->smarty);
- return $this->cached->handler->clear($this->smarty, $this->template_name, $this->cache_id, $this->compile_id, $exp_time);
- }
-
- /**
- * set Smarty property in template context
- *
- * @param string $property_name property name
- * @param mixed $value value
- */
- public function __set($property_name, $value)
- {
- switch ($property_name) {
- case 'source':
- case 'compiled':
- case 'cached':
- case 'compiler':
- $this->$property_name = $value;
- return;
-
- // FIXME: routing of template -> smarty attributes
- default:
- if (property_exists($this->smarty, $property_name)) {
- $this->smarty->$property_name = $value;
- return;
- }
- }
-
- throw new SmartyException("invalid template property '$property_name'.");
- }
-
- /**
- * get Smarty property in template context
- *
- * @param string $property_name property name
- */
- public function __get($property_name)
- {
- switch ($property_name) {
- case 'source':
- if (empty($this->template_resource)) {
- throw new SmartyException("Unable to parse resource name \"{$this->template_resource}\"");
- }
- $this->source = Smarty_Resource::source($this);
- // cache template object under a unique ID
- // do not cache eval resources
- if ($this->source->type != 'eval') {
- if ($this->smarty->allow_ambiguous_resources) {
- $_templateId = $this->source->unique_resource . $this->cache_id . $this->compile_id;
- } else {
- $_templateId = $this->smarty->joined_template_dir . '#' . $this->template_resource . $this->cache_id . $this->compile_id;
- }
-
- if (isset($_templateId[150])) {
- $_templateId = sha1($_templateId);
- }
- $this->smarty->template_objects[$_templateId] = $this;
- }
- return $this->source;
-
- case 'compiled':
- $this->compiled = $this->source->getCompiled($this);
- return $this->compiled;
-
- case 'cached':
- if (!class_exists('Smarty_Template_Cached')) {
- include SMARTY_SYSPLUGINS_DIR . 'smarty_cacheresource.php';
- }
- $this->cached = new Smarty_Template_Cached($this);
- return $this->cached;
-
- case 'compiler':
- $this->smarty->loadPlugin($this->source->compiler_class);
- $this->compiler = new $this->source->compiler_class($this->source->template_lexer_class, $this->source->template_parser_class, $this->smarty);
- return $this->compiler;
-
- // FIXME: routing of template -> smarty attributes
- default:
- if (property_exists($this->smarty, $property_name)) {
- return $this->smarty->$property_name;
- }
- }
-
- throw new SmartyException("template property '$property_name' does not exist.");
- }
-
- /**
- * Template data object destrutor
- *
- */
- public function __destruct()
- {
- if ($this->smarty->cache_locking && isset($this->cached) && $this->cached->is_locked) {
- $this->cached->handler->releaseLock($this->smarty, $this->cached);
- }
- }
-
-}
-
-?>
\ No newline at end of file
diff --git a/tools/smarty/sysplugins/smarty_internal_templatebase.php b/tools/smarty/sysplugins/smarty_internal_templatebase.php
deleted file mode 100755
index 65f502248..000000000
--- a/tools/smarty/sysplugins/smarty_internal_templatebase.php
+++ /dev/null
@@ -1,763 +0,0 @@
-template_class) {
- $template = $this;
- }
- if (!empty($cache_id) && is_object($cache_id)) {
- $parent = $cache_id;
- $cache_id = null;
- }
- if ($parent === null && ($this instanceof Smarty || is_string($template))) {
- $parent = $this;
- }
- // create template object if necessary
- $_template = ($template instanceof $this->template_class)
- ? $template
- : $this->smarty->createTemplate($template, $cache_id, $compile_id, $parent, false);
- // if called by Smarty object make sure we use current caching status
- if ($this instanceof Smarty) {
- $_template->caching = $this->caching;
- }
- // merge all variable scopes into template
- if ($merge_tpl_vars) {
- // save local variables
- $save_tpl_vars = $_template->tpl_vars;
- $save_config_vars = $_template->config_vars;
- $ptr_array = array($_template);
- $ptr = $_template;
- while (isset($ptr->parent)) {
- $ptr_array[] = $ptr = $ptr->parent;
- }
- $ptr_array = array_reverse($ptr_array);
- $parent_ptr = reset($ptr_array);
- $tpl_vars = $parent_ptr->tpl_vars;
- $config_vars = $parent_ptr->config_vars;
- while ($parent_ptr = next($ptr_array)) {
- if (!empty($parent_ptr->tpl_vars)) {
- $tpl_vars = array_merge($tpl_vars, $parent_ptr->tpl_vars);
- }
- if (!empty($parent_ptr->config_vars)) {
- $config_vars = array_merge($config_vars, $parent_ptr->config_vars);
- }
- }
- if (!empty(Smarty::$global_tpl_vars)) {
- $tpl_vars = array_merge(Smarty::$global_tpl_vars, $tpl_vars);
- }
- $_template->tpl_vars = $tpl_vars;
- $_template->config_vars = $config_vars;
- }
- // dummy local smarty variable
- if (!isset($_template->tpl_vars['smarty'])) {
- $_template->tpl_vars['smarty'] = new Smarty_Variable;
- }
- if (isset($this->smarty->error_reporting)) {
- $_smarty_old_error_level = error_reporting($this->smarty->error_reporting);
- }
- // check URL debugging control
- if (!$this->smarty->debugging && $this->smarty->debugging_ctrl == 'URL') {
- if (isset($_SERVER['QUERY_STRING'])) {
- $_query_string = $_SERVER['QUERY_STRING'];
- } else {
- $_query_string = '';
- }
- if (false !== strpos($_query_string, $this->smarty->smarty_debug_id)) {
- if (false !== strpos($_query_string, $this->smarty->smarty_debug_id . '=on')) {
- // enable debugging for this browser session
- setcookie('SMARTY_DEBUG', true);
- $this->smarty->debugging = true;
- } elseif (false !== strpos($_query_string, $this->smarty->smarty_debug_id . '=off')) {
- // disable debugging for this browser session
- setcookie('SMARTY_DEBUG', false);
- $this->smarty->debugging = false;
- } else {
- // enable debugging for this page
- $this->smarty->debugging = true;
- }
- } else {
- if (isset($_COOKIE['SMARTY_DEBUG'])) {
- $this->smarty->debugging = true;
- }
- }
- }
- // must reset merge template date
- $_template->smarty->merged_templates_func = array();
- // get rendered template
- // disable caching for evaluated code
- if ($_template->source->recompiled) {
- $_template->caching = false;
- }
- // checks if template exists
- if (!$_template->source->exists) {
- if ($_template->parent instanceof Smarty_Internal_Template) {
- $parent_resource = " in '{$_template->parent->template_resource}'";
- } else {
- $parent_resource = '';
- }
- throw new SmartyException("Unable to load template {$_template->source->type} '{$_template->source->name}'{$parent_resource}");
- }
- // read from cache or render
- if (!($_template->caching == Smarty::CACHING_LIFETIME_CURRENT || $_template->caching == Smarty::CACHING_LIFETIME_SAVED) || !$_template->cached->valid) {
- // render template (not loaded and not in cache)
- if (!$_template->source->uncompiled) {
- $_smarty_tpl = $_template;
- if ($_template->source->recompiled) {
- if ($this->smarty->debugging) {
- Smarty_Internal_Debug::start_compile($_template);
- }
- $code = $_template->compiler->compileTemplate($_template);
- if ($this->smarty->debugging) {
- Smarty_Internal_Debug::end_compile($_template);
- }
- if ($this->smarty->debugging) {
- Smarty_Internal_Debug::start_render($_template);
- }
- try {
- ob_start();
- eval("?>" . $code);
- unset($code);
- } catch (Exception $e) {
- ob_get_clean();
- throw $e;
- }
- } else {
- if (!$_template->compiled->exists || ($_template->smarty->force_compile && !$_template->compiled->isCompiled)) {
- $_template->compileTemplateSource();
- }
- if ($this->smarty->debugging) {
- Smarty_Internal_Debug::start_render($_template);
- }
- if (!$_template->compiled->loaded) {
- include($_template->compiled->filepath);
- if ($_template->mustCompile) {
- // recompile and load again
- $_template->compileTemplateSource();
- include($_template->compiled->filepath);
- }
- $_template->compiled->loaded = true;
- } else {
- $_template->decodeProperties($_template->compiled->_properties, false);
- }
- try {
- ob_start();
- if (empty($_template->properties['unifunc']) || !is_callable($_template->properties['unifunc'])) {
- throw new SmartyException("Invalid compiled template for '{$_template->template_resource}'");
- }
- $_template->properties['unifunc']($_template);
- if (isset($_template->_capture_stack[0])) {
- $_template->capture_error();
- }
- } catch (Exception $e) {
- ob_get_clean();
- throw $e;
- }
- }
- } else {
- if ($_template->source->uncompiled) {
- if ($this->smarty->debugging) {
- Smarty_Internal_Debug::start_render($_template);
- }
- try {
- ob_start();
- $_template->source->renderUncompiled($_template);
- } catch (Exception $e) {
- ob_get_clean();
- throw $e;
- }
- } else {
- throw new SmartyException("Resource '$_template->source->type' must have 'renderUncompiled' method");
- }
- }
- $_output = ob_get_clean();
- if (!$_template->source->recompiled && empty($_template->properties['file_dependency'][$_template->source->uid])) {
- $_template->properties['file_dependency'][$_template->source->uid] = array($_template->source->filepath, $_template->source->timestamp, $_template->source->type);
- }
- if ($_template->parent instanceof Smarty_Internal_Template) {
- $_template->parent->properties['file_dependency'] = array_merge($_template->parent->properties['file_dependency'], $_template->properties['file_dependency']);
- foreach ($_template->required_plugins as $code => $tmp1) {
- foreach ($tmp1 as $name => $tmp) {
- foreach ($tmp as $type => $data) {
- $_template->parent->required_plugins[$code][$name][$type] = $data;
- }
- }
- }
- }
- if ($this->smarty->debugging) {
- Smarty_Internal_Debug::end_render($_template);
- }
- // write to cache when nessecary
- if (!$_template->source->recompiled && ($_template->caching == Smarty::CACHING_LIFETIME_SAVED || $_template->caching == Smarty::CACHING_LIFETIME_CURRENT)) {
- if ($this->smarty->debugging) {
- Smarty_Internal_Debug::start_cache($_template);
- }
- $_template->properties['has_nocache_code'] = false;
- // get text between non-cached items
- $cache_split = preg_split("!/\*%%SmartyNocache:{$_template->properties['nocache_hash']}%%\*\/(.+?)/\*/%%SmartyNocache:{$_template->properties['nocache_hash']}%%\*/!s", $_output);
- // get non-cached items
- preg_match_all("!/\*%%SmartyNocache:{$_template->properties['nocache_hash']}%%\*\/(.+?)/\*/%%SmartyNocache:{$_template->properties['nocache_hash']}%%\*/!s", $_output, $cache_parts);
- $output = '';
- // loop over items, stitch back together
- foreach ($cache_split as $curr_idx => $curr_split) {
- // escape PHP tags in template content
- $output .= preg_replace('/(<%|%>|<\?php|<\?|\?>)/', '', $curr_split);
- if (isset($cache_parts[0][$curr_idx])) {
- $_template->properties['has_nocache_code'] = true;
- // remove nocache tags from cache output
- $output .= preg_replace("!/\*/?%%SmartyNocache:{$_template->properties['nocache_hash']}%%\*/!", '', $cache_parts[0][$curr_idx]);
- }
- }
- if (!$no_output_filter && (isset($this->smarty->autoload_filters['output']) || isset($this->smarty->registered_filters['output']))) {
- $output = Smarty_Internal_Filter_Handler::runFilter('output', $output, $_template);
- }
- // rendering (must be done before writing cache file because of {function} nocache handling)
- $_smarty_tpl = $_template;
- try {
- ob_start();
- eval("?>" . $output);
- $_output = ob_get_clean();
- } catch (Exception $e) {
- ob_get_clean();
- throw $e;
- }
- // write cache file content
- $_template->writeCachedContent($output);
- if ($this->smarty->debugging) {
- Smarty_Internal_Debug::end_cache($_template);
- }
- } else {
- // var_dump('renderTemplate', $_template->has_nocache_code, $_template->template_resource, $_template->properties['nocache_hash'], $_template->parent->properties['nocache_hash'], $_output);
- if (!empty($_template->properties['nocache_hash']) && !empty($_template->parent->properties['nocache_hash'])) {
- // replace nocache_hash
- $_output = preg_replace("/{$_template->properties['nocache_hash']}/", $_template->parent->properties['nocache_hash'], $_output);
- $_template->parent->has_nocache_code = $_template->parent->has_nocache_code || $_template->has_nocache_code;
- }
- }
- } else {
- if ($this->smarty->debugging) {
- Smarty_Internal_Debug::start_cache($_template);
- }
- try {
- ob_start();
- $_template->properties['unifunc']($_template);
- if (isset($_template->_capture_stack[0])) {
- $_template->capture_error();
- }
- $_output = ob_get_clean();
- } catch (Exception $e) {
- ob_get_clean();
- throw $e;
- }
- if ($this->smarty->debugging) {
- Smarty_Internal_Debug::end_cache($_template);
- }
- }
- if ((!$this->caching || $_template->source->recompiled) && !$no_output_filter && (isset($this->smarty->autoload_filters['output']) || isset($this->smarty->registered_filters['output']))) {
- $_output = Smarty_Internal_Filter_Handler::runFilter('output', $_output, $_template);
- }
- if (isset($this->error_reporting)) {
- error_reporting($_smarty_old_error_level);
- }
- // display or fetch
- if ($display) {
- if ($this->caching && $this->cache_modified_check) {
- $_isCached = $_template->isCached() && !$_template->has_nocache_code;
- $_last_modified_date = @substr($_SERVER['HTTP_IF_MODIFIED_SINCE'], 0, strpos($_SERVER['HTTP_IF_MODIFIED_SINCE'], 'GMT') + 3);
- if ($_isCached && $_template->cached->timestamp <= strtotime($_last_modified_date)) {
- switch (PHP_SAPI) {
- case 'cgi': // php-cgi < 5.3
- case 'cgi-fcgi': // php-cgi >= 5.3
- case 'fpm-fcgi': // php-fpm >= 5.3.3
- header('Status: 304 Not Modified');
- break;
-
- case 'cli':
- if (/* ^phpunit */!empty($_SERVER['SMARTY_PHPUNIT_DISABLE_HEADERS'])/* phpunit$ */) {
- $_SERVER['SMARTY_PHPUNIT_HEADERS'][] = '304 Not Modified';
- }
- break;
-
- default:
- header('HTTP/1.1 304 Not Modified');
- break;
- }
- } else {
- switch (PHP_SAPI) {
- case 'cli':
- if (/* ^phpunit */!empty($_SERVER['SMARTY_PHPUNIT_DISABLE_HEADERS'])/* phpunit$ */) {
- $_SERVER['SMARTY_PHPUNIT_HEADERS'][] = 'Last-Modified: ' . gmdate('D, d M Y H:i:s', $_template->cached->timestamp) . ' GMT';
- }
- break;
-
- default:
- header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $_template->cached->timestamp) . ' GMT');
- break;
- }
- echo $_output;
- }
- } else {
- echo $_output;
- }
- // debug output
- if ($this->smarty->debugging) {
- Smarty_Internal_Debug::display_debug($this);
- }
- if ($merge_tpl_vars) {
- // restore local variables
- $_template->tpl_vars = $save_tpl_vars;
- $_template->config_vars = $save_config_vars;
- }
- return;
- } else {
- if ($merge_tpl_vars) {
- // restore local variables
- $_template->tpl_vars = $save_tpl_vars;
- $_template->config_vars = $save_config_vars;
- }
- // return fetched content
- return $_output;
- }
- }
-
- /**
- * displays a Smarty template
- *
- * @param string $template the resource handle of the template file or template object
- * @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 object $parent next higher level of Smarty variables
- */
- public function display($template = null, $cache_id = null, $compile_id = null, $parent = null)
- {
- // display template
- $this->fetch($template, $cache_id, $compile_id, $parent, true);
- }
-
- /**
- * test if cache is valid
- *
- * @param string|object $template the resource handle of the template file or template object
- * @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 object $parent next higher level of Smarty variables
- * @return boolean cache status
- */
- public function isCached($template = null, $cache_id = null, $compile_id = null, $parent = null)
- {
- if ($template === null && $this instanceof $this->template_class) {
- return $this->cached->valid;
- }
- if (!($template instanceof $this->template_class)) {
- if ($parent === null) {
- $parent = $this;
- }
- $template = $this->smarty->createTemplate($template, $cache_id, $compile_id, $parent, false);
- }
- // return cache status of template
- return $template->cached->valid;
- }
-
- /**
- * creates a data object
- *
- * @param object $parent next higher level of Smarty variables
- * @returns Smarty_Data data object
- */
- public function createData($parent = null)
- {
- return new Smarty_Data($parent, $this);
- }
-
- /**
- * Registers plugin to be used in templates
- *
- * @param string $type plugin type
- * @param string $tag name of template tag
- * @param callback $callback PHP callback to register
- * @param boolean $cacheable if true (default) this fuction is cachable
- * @param array $cache_attr caching attributes if any
- * @throws SmartyException when the plugin tag is invalid
- */
- public function registerPlugin($type, $tag, $callback, $cacheable = true, $cache_attr = null)
- {
- if (isset($this->smarty->registered_plugins[$type][$tag])) {
- throw new SmartyException("Plugin tag \"{$tag}\" already registered");
- } elseif (!is_callable($callback)) {
- throw new SmartyException("Plugin \"{$tag}\" not callable");
- } else {
- $this->smarty->registered_plugins[$type][$tag] = array($callback, (bool) $cacheable, (array) $cache_attr);
- }
- }
-
- /**
- * Unregister Plugin
- *
- * @param string $type of plugin
- * @param string $tag name of plugin
- */
- public function unregisterPlugin($type, $tag)
- {
- if (isset($this->smarty->registered_plugins[$type][$tag])) {
- unset($this->smarty->registered_plugins[$type][$tag]);
- }
- }
-
- /**
- * Registers a resource to fetch a template
- *
- * @param string $type name of resource type
- * @param Smarty_Resource|array $callback or instance of Smarty_Resource, or array of callbacks to handle resource (deprecated)
- */
- public function registerResource($type, $callback)
- {
- $this->smarty->registered_resources[$type] = $callback instanceof Smarty_Resource ? $callback : array($callback, false);
- }
-
- /**
- * Unregisters a resource
- *
- * @param string $type name of resource type
- */
- public function unregisterResource($type)
- {
- if (isset($this->smarty->registered_resources[$type])) {
- unset($this->smarty->registered_resources[$type]);
- }
- }
-
- /**
- * Registers a cache resource to cache a template's output
- *
- * @param string $type name of cache resource type
- * @param Smarty_CacheResource $callback instance of Smarty_CacheResource to handle output caching
- */
- public function registerCacheResource($type, Smarty_CacheResource $callback)
- {
- $this->smarty->registered_cache_resources[$type] = $callback;
- }
-
- /**
- * Unregisters a cache resource
- *
- * @param string $type name of cache resource type
- */
- public function unregisterCacheResource($type)
- {
- if (isset($this->smarty->registered_cache_resources[$type])) {
- unset($this->smarty->registered_cache_resources[$type]);
- }
- }
-
- /**
- * Registers object to be used in templates
- *
- * @param string $object name of template object
- * @param object $object_impl the referenced PHP object to register
- * @param array $allowed list of allowed methods (empty = all)
- * @param boolean $smarty_args smarty argument format, else traditional
- * @param array $block_methods list of block-methods
- * @param array $block_functs list of methods that are block format
- * @throws SmartyException if any of the methods in $allowed or $block_methods are invalid
- */
- public function registerObject($object_name, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())
- {
- // test if allowed methodes callable
- if (!empty($allowed)) {
- foreach ((array) $allowed as $method) {
- if (!is_callable(array($object_impl, $method))) {
- throw new SmartyException("Undefined method '$method' in registered object");
- }
- }
- }
- // test if block methodes callable
- if (!empty($block_methods)) {
- foreach ((array) $block_methods as $method) {
- if (!is_callable(array($object_impl, $method))) {
- throw new SmartyException("Undefined method '$method' in registered object");
- }
- }
- }
- // register the object
- $this->smarty->registered_objects[$object_name] =
- array($object_impl, (array) $allowed, (boolean) $smarty_args, (array) $block_methods);
- }
-
- /**
- * return a reference to a registered object
- *
- * @param string $name object name
- * @return object
- * @throws SmartyException if no such object is found
- */
- public function getRegisteredObject($name)
- {
- if (!isset($this->smarty->registered_objects[$name])) {
- throw new SmartyException("'$name' is not a registered object");
- }
- if (!is_object($this->smarty->registered_objects[$name][0])) {
- throw new SmartyException("registered '$name' is not an object");
- }
- return $this->smarty->registered_objects[$name][0];
- }
-
- /**
- * unregister an object
- *
- * @param string $name object name
- * @throws SmartyException if no such object is found
- */
- public function unregisterObject($name)
- {
- unset($this->smarty->registered_objects[$name]);
- return;
- }
-
- /**
- * Registers static classes to be used in templates
- *
- * @param string $class name of template class
- * @param string $class_impl the referenced PHP class to register
- * @throws SmartyException if $class_impl does not refer to an existing class
- */
- public function registerClass($class_name, $class_impl)
- {
- // test if exists
- if (!class_exists($class_impl)) {
- throw new SmartyException("Undefined class '$class_impl' in register template class");
- }
- // register the class
- $this->smarty->registered_classes[$class_name] = $class_impl;
- }
-
- /**
- * Registers a default plugin handler
- *
- * @param callable $callback class/method name
- * @throws SmartyException if $callback is not callable
- */
- public function registerDefaultPluginHandler($callback)
- {
- if (is_callable($callback)) {
- $this->smarty->default_plugin_handler_func = $callback;
- } else {
- throw new SmartyException("Default plugin handler '$callback' not callable");
- }
- }
-
- /**
- * Registers a default template handler
- *
- * @param callable $callback class/method name
- * @throws SmartyException if $callback is not callable
- */
- public function registerDefaultTemplateHandler($callback)
- {
- if (is_callable($callback)) {
- $this->smarty->default_template_handler_func = $callback;
- } else {
- throw new SmartyException("Default template handler '$callback' not callable");
- }
- }
-
- /**
- * Registers a default template handler
- *
- * @param callable $callback class/method name
- * @throws SmartyException if $callback is not callable
- */
- public function registerDefaultConfigHandler($callback)
- {
- if (is_callable($callback)) {
- $this->smarty->default_config_handler_func = $callback;
- } else {
- throw new SmartyException("Default config handler '$callback' not callable");
- }
- }
-
- /**
- * Registers a filter function
- *
- * @param string $type filter type
- * @param callback $callback
- */
- public function registerFilter($type, $callback)
- {
- $this->smarty->registered_filters[$type][$this->_get_filter_name($callback)] = $callback;
- }
-
- /**
- * Unregisters a filter function
- *
- * @param string $type filter type
- * @param callback $callback
- */
- public function unregisterFilter($type, $callback)
- {
- $name = $this->_get_filter_name($callback);
- if (isset($this->smarty->registered_filters[$type][$name])) {
- unset($this->smarty->registered_filters[$type][$name]);
- }
- }
-
- /**
- * Return internal filter name
- *
- * @param callback $function_name
- */
- public function _get_filter_name($function_name)
- {
- if (is_array($function_name)) {
- $_class_name = (is_object($function_name[0]) ?
- get_class($function_name[0]) : $function_name[0]);
- return $_class_name . '_' . $function_name[1];
- } else {
- return $function_name;
- }
- }
-
- /**
- * load a filter of specified type and name
- *
- * @param string $type filter type
- * @param string $name filter name
- * @return bool
- */
- public function loadFilter($type, $name)
- {
- $_plugin = "smarty_{$type}filter_{$name}";
- $_filter_name = $_plugin;
- if ($this->smarty->loadPlugin($_plugin)) {
- if (class_exists($_plugin, false)) {
- $_plugin = array($_plugin, 'execute');
- }
- if (is_callable($_plugin)) {
- $this->smarty->registered_filters[$type][$_filter_name] = $_plugin;
- return true;
- }
- }
- throw new SmartyException("{$type}filter \"{$name}\" not callable");
- return false;
- }
-
- /**
- * unload a filter of specified type and name
- *
- * @param string $type filter type
- * @param string $name filter name
- * @return bool
- */
- public function unloadFilter($type, $name)
- {
- $_filter_name = "smarty_{$type}filter_{$name}";
- if (isset($this->smarty->registered_filters[$type][$_filter_name])) {
- unset ($this->smarty->registered_filters[$type][$_filter_name]);
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * preg_replace callback to convert camelcase getter/setter to underscore property names
- *
- * @param string $match match string
- * @return string replacemant
- */
- private function replaceCamelcase($match) {
- return "_" . strtolower($match[1]);
- }
-
- /**
- * Handle unknown class methods
- *
- * @param string $name unknown method-name
- * @param array $args argument array
- */
- public function __call($name, $args)
- {
- static $_prefixes = array('set' => true, 'get' => true);
- static $_resolved_property_name = array();
- static $_resolved_property_source = array();
-
- // method of Smarty object?
- if (method_exists($this->smarty, $name)) {
- return call_user_func_array(array($this->smarty, $name), $args);
- }
- // see if this is a set/get for a property
- $first3 = strtolower(substr($name, 0, 3));
- if (isset($_prefixes[$first3]) && isset($name[3]) && $name[3] !== '_') {
- if (isset($_resolved_property_name[$name])) {
- $property_name = $_resolved_property_name[$name];
- } else {
- // try to keep case correct for future PHP 6.0 case-sensitive class methods
- // lcfirst() not available < PHP 5.3.0, so improvise
- $property_name = strtolower(substr($name, 3, 1)) . substr($name, 4);
- // convert camel case to underscored name
- $property_name = preg_replace_callback('/([A-Z])/', array($this,'replaceCamelcase'), $property_name);
- $_resolved_property_name[$name] = $property_name;
- }
- if (isset($_resolved_property_source[$property_name])) {
- $_is_this = $_resolved_property_source[$property_name];
- } else {
- $_is_this = null;
- if (property_exists($this, $property_name)) {
- $_is_this = true;
- } else if (property_exists($this->smarty, $property_name)) {
- $_is_this = false;
- }
- $_resolved_property_source[$property_name] = $_is_this;
- }
- if ($_is_this) {
- if ($first3 == 'get')
- return $this->$property_name;
- else
- return $this->$property_name = $args[0];
- } else if ($_is_this === false) {
- if ($first3 == 'get')
- return $this->smarty->$property_name;
- else
- return $this->smarty->$property_name = $args[0];
- } else {
- throw new SmartyException("property '$property_name' does not exist.");
- return false;
- }
- }
- if ($name == 'Smarty') {
- throw new SmartyException("PHP5 requires you to call __construct() instead of Smarty()");
- }
- // must be unknown
- throw new SmartyException("Call of unknown method '$name'.");
- }
-
-}
-
-?>
\ No newline at end of file
diff --git a/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php b/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php
deleted file mode 100755
index 1f50be75e..000000000
--- a/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php
+++ /dev/null
@@ -1,626 +0,0 @@
-nocache_hash = str_replace('.', '-', uniqid(rand(), true));
- }
-
- /**
- * Method to compile a Smarty template
- *
- * @param Smarty_Internal_Template $template template object to compile
- * @return bool true if compiling succeeded, false if it failed
- */
- public function compileTemplate(Smarty_Internal_Template $template)
- {
- if (empty($template->properties['nocache_hash'])) {
- $template->properties['nocache_hash'] = $this->nocache_hash;
- } else {
- $this->nocache_hash = $template->properties['nocache_hash'];
- }
- // flag for nochache sections
- $this->nocache = false;
- $this->tag_nocache = false;
- // save template object in compiler class
- $this->template = $template;
- // reset has noche code flag
- $this->template->has_nocache_code = false;
- $this->smarty->_current_file = $saved_filepath = $this->template->source->filepath;
- // template header code
- $template_header = '';
- if (!$this->suppressHeader) {
- $template_header .= "template->source->filepath . "\" */ ?>\n";
- }
-
- do {
- // flag for aborting current and start recompile
- $this->abort_and_recompile = false;
- // get template source
- $_content = $template->source->content;
- // run prefilter if required
- if (isset($this->smarty->autoload_filters['pre']) || isset($this->smarty->registered_filters['pre'])) {
- $template->source->content = $_content = Smarty_Internal_Filter_Handler::runFilter('pre', $_content, $template);
- }
- // on empty template just return header
- if ($_content == '') {
- if ($this->suppressTemplatePropertyHeader) {
- $code = '';
- } else {
- $code = $template_header . $template->createTemplateCodeFrame();
- }
- return $code;
- }
- // call compiler
- $_compiled_code = $this->doCompile($_content);
- } while ($this->abort_and_recompile);
- $this->template->source->filepath = $saved_filepath;
- // free memory
- unset($this->parser->root_buffer, $this->parser->current_buffer, $this->parser, $this->lex, $this->template);
- self::$_tag_objects = array();
- // return compiled code to template object
- $merged_code = '';
- if (!$this->suppressMergedTemplates) {
- foreach ($this->merged_templates as $code) {
- $merged_code .= $code;
- }
- }
- if ($this->suppressTemplatePropertyHeader) {
- $code = $_compiled_code . $merged_code;
- } else {
- $code = $template_header . $template->createTemplateCodeFrame($_compiled_code) . $merged_code;
- }
- // run postfilter if required
- if (isset($this->smarty->autoload_filters['post']) || isset($this->smarty->registered_filters['post'])) {
- $code = Smarty_Internal_Filter_Handler::runFilter('post', $code, $template);
- }
- return $code;
- }
-
- /**
- * Compile Tag
- *
- * This is a call back from the lexer/parser
- * It executes the required compile plugin for the Smarty tag
- *
- * @param string $tag tag name
- * @param array $args array with tag attributes
- * @param array $parameter array with compilation parameter
- * @return string compiled code
- */
- public function compileTag($tag, $args, $parameter = array())
- {
- // $args contains the attributes parsed and compiled by the lexer/parser
- // assume that tag does compile into code, but creates no HTML output
- $this->has_code = true;
- $this->has_output = false;
- // log tag/attributes
- if (isset($this->smarty->get_used_tags) && $this->smarty->get_used_tags) {
- $this->template->used_tags[] = array($tag, $args);
- }
- // check nocache option flag
- if (in_array("'nocache'",$args) || in_array(array('nocache'=>'true'),$args)
- || in_array(array('nocache'=>'"true"'),$args) || in_array(array('nocache'=>"'true'"),$args)) {
- $this->tag_nocache = true;
- }
- // compile the smarty tag (required compile classes to compile the tag are autoloaded)
- if (($_output = $this->callTagCompiler($tag, $args, $parameter)) === false) {
- if (isset($this->smarty->template_functions[$tag])) {
- // template defined by {template} tag
- $args['_attr']['name'] = "'" . $tag . "'";
- $_output = $this->callTagCompiler('call', $args, $parameter);
- }
- }
- if ($_output !== false) {
- if ($_output !== true) {
- // did we get compiled code
- if ($this->has_code) {
- // Does it create output?
- if ($this->has_output) {
- $_output .= "\n";
- }
- // return compiled code
- return $_output;
- }
- }
- // tag did not produce compiled code
- return '';
- } else {
- // map_named attributes
- if (isset($args['_attr'])) {
- foreach ($args['_attr'] as $key => $attribute) {
- if (is_array($attribute)) {
- $args = array_merge($args, $attribute);
- }
- }
- }
- // not an internal compiler tag
- if (strlen($tag) < 6 || substr($tag, -5) != 'close') {
- // check if tag is a registered object
- if (isset($this->smarty->registered_objects[$tag]) && isset($parameter['object_methode'])) {
- $methode = $parameter['object_methode'];
- if (!in_array($methode, $this->smarty->registered_objects[$tag][3]) &&
- (empty($this->smarty->registered_objects[$tag][1]) || in_array($methode, $this->smarty->registered_objects[$tag][1]))) {
- return $this->callTagCompiler('private_object_function', $args, $parameter, $tag, $methode);
- } elseif (in_array($methode, $this->smarty->registered_objects[$tag][3])) {
- return $this->callTagCompiler('private_object_block_function', $args, $parameter, $tag, $methode);
- } else {
- return $this->trigger_template_error ('unallowed methode "' . $methode . '" in registered object "' . $tag . '"', $this->lex->taglineno);
- }
- }
- // check if tag is registered
- foreach (array(Smarty::PLUGIN_COMPILER, Smarty::PLUGIN_FUNCTION, Smarty::PLUGIN_BLOCK) as $plugin_type) {
- if (isset($this->smarty->registered_plugins[$plugin_type][$tag])) {
- // if compiler function plugin call it now
- if ($plugin_type == Smarty::PLUGIN_COMPILER) {
- $new_args = array();
- foreach ($args as $key => $mixed) {
- if (is_array($mixed)) {
- $new_args = array_merge($new_args, $mixed);
- } else {
- $new_args[$key] = $mixed;
- }
- }
- if (!$this->smarty->registered_plugins[$plugin_type][$tag][1]) {
- $this->tag_nocache = true;
- }
- $function = $this->smarty->registered_plugins[$plugin_type][$tag][0];
- if (!is_array($function)) {
- return $function($new_args, $this);
- } else if (is_object($function[0])) {
- return $this->smarty->registered_plugins[$plugin_type][$tag][0][0]->$function[1]($new_args, $this);
- } else {
- return call_user_func_array($function, array($new_args, $this));
- }
- }
- // compile registered function or block function
- if ($plugin_type == Smarty::PLUGIN_FUNCTION || $plugin_type == Smarty::PLUGIN_BLOCK) {
- return $this->callTagCompiler('private_registered_' . $plugin_type, $args, $parameter, $tag);
- }
-
- }
- }
- // check plugins from plugins folder
- foreach ($this->smarty->plugin_search_order as $plugin_type) {
- if ($plugin_type == Smarty::PLUGIN_BLOCK && $this->smarty->loadPlugin('smarty_compiler_' . $tag) && (!isset($this->smarty->security_policy) || $this->smarty->security_policy->isTrustedTag($tag, $this))) {
- $plugin = 'smarty_compiler_' . $tag;
- if (is_callable($plugin)) {
- // convert arguments format for old compiler plugins
- $new_args = array();
- foreach ($args as $key => $mixed) {
- if (is_array($mixed)) {
- $new_args = array_merge($new_args, $mixed);
- } else {
- $new_args[$key] = $mixed;
- }
- }
- return $plugin($new_args, $this->smarty);
- }
- if (class_exists($plugin, false)) {
- $plugin_object = new $plugin;
- if (method_exists($plugin_object, 'compile')) {
- return $plugin_object->compile($args, $this);
- }
- }
- throw new SmartyException("Plugin \"{$tag}\" not callable");
- } else {
- if ($function = $this->getPlugin($tag, $plugin_type)) {
- if(!isset($this->smarty->security_policy) || $this->smarty->security_policy->isTrustedTag($tag, $this)) {
- return $this->callTagCompiler('private_' . $plugin_type . '_plugin', $args, $parameter, $tag, $function);
- }
- }
- }
- }
- if (is_callable($this->smarty->default_plugin_handler_func)) {
- $found = false;
- // look for already resolved tags
- foreach ($this->smarty->plugin_search_order as $plugin_type) {
- if (isset($this->default_handler_plugins[$plugin_type][$tag])) {
- $found = true;
- break;
- }
- }
- if (!$found) {
- // call default handler
- foreach ($this->smarty->plugin_search_order as $plugin_type) {
- if ($this->getPluginFromDefaultHandler($tag, $plugin_type)) {
- $found = true;
- break;
- }
- }
- }
- if ($found) {
- // if compiler function plugin call it now
- if ($plugin_type == Smarty::PLUGIN_COMPILER) {
- $new_args = array();
- foreach ($args as $mixed) {
- $new_args = array_merge($new_args, $mixed);
- }
- $function = $this->default_handler_plugins[$plugin_type][$tag][0];
- if (!is_array($function)) {
- return $function($new_args, $this);
- } else if (is_object($function[0])) {
- return $this->default_handler_plugins[$plugin_type][$tag][0][0]->$function[1]($new_args, $this);
- } else {
- return call_user_func_array($function, array($new_args, $this));
- }
- } else {
- return $this->callTagCompiler('private_registered_' . $plugin_type, $args, $parameter, $tag);
- }
- }
- }
- } else {
- // compile closing tag of block function
- $base_tag = substr($tag, 0, -5);
- // check if closing tag is a registered object
- if (isset($this->smarty->registered_objects[$base_tag]) && isset($parameter['object_methode'])) {
- $methode = $parameter['object_methode'];
- if (in_array($methode, $this->smarty->registered_objects[$base_tag][3])) {
- return $this->callTagCompiler('private_object_block_function', $args, $parameter, $tag, $methode);
- } else {
- return $this->trigger_template_error ('unallowed closing tag methode "' . $methode . '" in registered object "' . $base_tag . '"', $this->lex->taglineno);
- }
- }
- // registered block tag ?
- if (isset($this->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$base_tag]) || isset($this->default_handler_plugins[Smarty::PLUGIN_BLOCK][$base_tag])) {
- return $this->callTagCompiler('private_registered_block', $args, $parameter, $tag);
- }
- // block plugin?
- if ($function = $this->getPlugin($base_tag, Smarty::PLUGIN_BLOCK)) {
- return $this->callTagCompiler('private_block_plugin', $args, $parameter, $tag, $function);
- }
- if ($this->smarty->loadPlugin('smarty_compiler_' . $tag)) {
- $plugin = 'smarty_compiler_' . $tag;
- if (is_callable($plugin)) {
- return $plugin($args, $this->smarty);
- }
- if (class_exists($plugin, false)) {
- $plugin_object = new $plugin;
- if (method_exists($plugin_object, 'compile')) {
- return $plugin_object->compile($args, $this);
- }
- }
- throw new SmartyException("Plugin \"{$tag}\" not callable");
- }
- }
- $this->trigger_template_error ("unknown tag \"" . $tag . "\"", $this->lex->taglineno);
- }
- }
-
- /**
- * lazy loads internal compile plugin for tag and calls the compile methode
- *
- * compile objects cached for reuse.
- * class name format: Smarty_Internal_Compile_TagName
- * plugin filename format: Smarty_Internal_Tagname.php
- *
- * @param string $tag tag name
- * @param array $args list of tag attributes
- * @param mixed $param1 optional parameter
- * @param mixed $param2 optional parameter
- * @param mixed $param3 optional parameter
- * @return string compiled code
- */
- public function callTagCompiler($tag, $args, $param1 = null, $param2 = null, $param3 = null)
- {
- // re-use object if already exists
- if (isset(self::$_tag_objects[$tag])) {
- // compile this tag
- return self::$_tag_objects[$tag]->compile($args, $this, $param1, $param2, $param3);
- }
- // lazy load internal compiler plugin
- $class_name = 'Smarty_Internal_Compile_' . $tag;
- if ($this->smarty->loadPlugin($class_name)) {
- // check if tag allowed by security
- if (!isset($this->smarty->security_policy) || $this->smarty->security_policy->isTrustedTag($tag, $this)) {
- // use plugin if found
- self::$_tag_objects[$tag] = new $class_name;
- // compile this tag
- return self::$_tag_objects[$tag]->compile($args, $this, $param1, $param2, $param3);
- }
- }
- // no internal compile plugin for this tag
- return false;
- }
-
- /**
- * Check for plugins and return function name
- *
- * @param string $pugin_name name of plugin or function
- * @param string $plugin_type type of plugin
- * @return string call name of function
- */
- public function getPlugin($plugin_name, $plugin_type)
- {
- $function = null;
- if ($this->template->caching && ($this->nocache || $this->tag_nocache)) {
- if (isset($this->template->required_plugins['nocache'][$plugin_name][$plugin_type])) {
- $function = $this->template->required_plugins['nocache'][$plugin_name][$plugin_type]['function'];
- } else if (isset($this->template->required_plugins['compiled'][$plugin_name][$plugin_type])) {
- $this->template->required_plugins['nocache'][$plugin_name][$plugin_type] = $this->template->required_plugins['compiled'][$plugin_name][$plugin_type];
- $function = $this->template->required_plugins['nocache'][$plugin_name][$plugin_type]['function'];
- }
- } else {
- if (isset($this->template->required_plugins['compiled'][$plugin_name][$plugin_type])) {
- $function = $this->template->required_plugins['compiled'][$plugin_name][$plugin_type]['function'];
- } else if (isset($this->template->required_plugins['nocache'][$plugin_name][$plugin_type])) {
- $this->template->required_plugins['compiled'][$plugin_name][$plugin_type] = $this->template->required_plugins['nocache'][$plugin_name][$plugin_type];
- $function = $this->template->required_plugins['compiled'][$plugin_name][$plugin_type]['function'];
- }
- }
- if (isset($function)) {
- if ($plugin_type == 'modifier') {
- $this->modifier_plugins[$plugin_name] = true;
- }
- return $function;
- }
- // loop through plugin dirs and find the plugin
- $function = 'smarty_' . $plugin_type . '_' . $plugin_name;
- $file = $this->smarty->loadPlugin($function, false);
-
- if (is_string($file)) {
- if ($this->template->caching && ($this->nocache || $this->tag_nocache)) {
- $this->template->required_plugins['nocache'][$plugin_name][$plugin_type]['file'] = $file;
- $this->template->required_plugins['nocache'][$plugin_name][$plugin_type]['function'] = $function;
- } else {
- $this->template->required_plugins['compiled'][$plugin_name][$plugin_type]['file'] = $file;
- $this->template->required_plugins['compiled'][$plugin_name][$plugin_type]['function'] = $function;
- }
- if ($plugin_type == 'modifier') {
- $this->modifier_plugins[$plugin_name] = true;
- }
- return $function;
- }
- if (is_callable($function)) {
- // plugin function is defined in the script
- return $function;
- }
- return false;
- }
-
- /**
- * Check for plugins by default plugin handler
- *
- * @param string $tag name of tag
- * @param string $plugin_type type of plugin
- * @return boolean true if found
- */
- public function getPluginFromDefaultHandler($tag, $plugin_type)
- {
- $callback = null;
- $script = null;
- $result = call_user_func_array(
- $this->smarty->default_plugin_handler_func,
- array($tag, $plugin_type, $this->template, &$callback, &$script)
- );
- if ($result) {
- if ($script !== null) {
- if (is_file($script)) {
- if ($this->template->caching && ($this->nocache || $this->tag_nocache)) {
- $this->template->required_plugins['nocache'][$tag][$plugin_type]['file'] = $script;
- $this->template->required_plugins['nocache'][$tag][$plugin_type]['function'] = $callback;
- } else {
- $this->template->required_plugins['compiled'][$tag][$plugin_type]['file'] = $script;
- $this->template->required_plugins['compiled'][$tag][$plugin_type]['function'] = $callback;
- }
- include_once $script;
- } else {
- $this->trigger_template_error("Default plugin handler: Returned script file \"{$script}\" for \"{$tag}\" not found");
- }
- }
- if (!is_string($callback) && !(is_array($callback) && is_string($callback[0]) && is_string($callback[1]))) {
- $this->trigger_template_error("Default plugin handler: Returned callback for \"{$tag}\" must be a static function name or array of class and function name");
- }
- if (is_callable($callback)) {
- $this->default_handler_plugins[$plugin_type][$tag] = array($callback, true, array());
- return true;
- } else {
- $this->trigger_template_error("Default plugin handler: Returned callback for \"{$tag}\" not callable");
- }
- }
- return false;
- }
-
- /**
- * Inject inline code for nocache template sections
- *
- * This method gets the content of each template element from the parser.
- * If the content is compiled code and it should be not cached the code is injected
- * into the rendered output.
- *
- * @param string $content content of template element
- * @param boolean $is_code true if content is compiled code
- * @return string content
- */
- public function processNocacheCode($content, $is_code)
- {
- // If the template is not evaluated and we have a nocache section and or a nocache tag
- if ($is_code && !empty($content)) {
- // generate replacement code
- if ((!($this->template->source->recompiled) || $this->forceNocache) && $this->template->caching && !$this->suppressNocacheProcessing &&
- ($this->nocache || $this->tag_nocache || $this->forceNocache == 2)) {
- $this->template->has_nocache_code = true;
- $_output = str_replace("'", "\'", $content);
- $_output = str_replace('\\\\', '\\\\\\\\', $_output);
- $_output = str_replace("^#^", "'", $_output);
- $_output = "nocache_hash}%%*/" . $_output . "/*/%%SmartyNocache:{$this->nocache_hash}%%*/';?>\n";
- // make sure we include modifer plugins for nocache code
- foreach ($this->modifier_plugins as $plugin_name => $dummy) {
- if (isset($this->template->required_plugins['compiled'][$plugin_name]['modifier'])) {
- $this->template->required_plugins['nocache'][$plugin_name]['modifier'] = $this->template->required_plugins['compiled'][$plugin_name]['modifier'];
- }
- }
- } else {
- $_output = $content;
- }
- } else {
- $_output = $content;
- }
- $this->modifier_plugins = array();
- $this->suppressNocacheProcessing = false;
- $this->tag_nocache = false;
- return $_output;
- }
-
- /**
- * display compiler error messages without dying
- *
- * If parameter $args is empty it is a parser detected syntax error.
- * In this case the parser is called to obtain information about expected tokens.
- *
- * If parameter $args contains a string this is used as error message
- *
- * @param string $args individual error message or null
- * @param string $line line-number
- * @throws SmartyCompilerException when an unexpected token is found
- */
- public function trigger_template_error($args = null, $line = null)
- {
- // get template source line which has error
- if (!isset($line)) {
- $line = $this->lex->line;
- }
- $match = preg_split("/\n/", $this->lex->data);
- $error_text = 'Syntax Error in template "' . $this->template->source->filepath . '" on line ' . $line . ' "' . htmlspecialchars(trim(preg_replace('![\t\r\n]+!',' ',$match[$line-1]))) . '" ';
- if (isset($args)) {
- // individual error message
- $error_text .= $args;
- } else {
- // expected token from parser
- $error_text .= ' - Unexpected "' . $this->lex->value.'"';
- if (count($this->parser->yy_get_expected_tokens($this->parser->yymajor)) <= 4 ) {
- foreach ($this->parser->yy_get_expected_tokens($this->parser->yymajor) as $token) {
- $exp_token = $this->parser->yyTokenName[$token];
- if (isset($this->lex->smarty_token_names[$exp_token])) {
- // token type from lexer
- $expect[] = '"' . $this->lex->smarty_token_names[$exp_token] . '"';
- } else {
- // otherwise internal token name
- $expect[] = $this->parser->yyTokenName[$token];
- }
- }
- $error_text .= ', expected one of: ' . implode(' , ', $expect);
- }
- }
- throw new SmartyCompilerException($error_text);
- }
-
-}
-
-?>
\ No newline at end of file
diff --git a/tools/smarty/sysplugins/smarty_internal_templatelexer.php b/tools/smarty/sysplugins/smarty_internal_templatelexer.php
deleted file mode 100755
index d8e77e81b..000000000
--- a/tools/smarty/sysplugins/smarty_internal_templatelexer.php
+++ /dev/null
@@ -1,1190 +0,0 @@
- '===',
- 'NONEIDENTITY' => '!==',
- 'EQUALS' => '==',
- 'NOTEQUALS' => '!=',
- 'GREATEREQUAL' => '(>=,ge)',
- 'LESSEQUAL' => '(<=,le)',
- 'GREATERTHAN' => '(>,gt)',
- 'LESSTHAN' => '(<,lt)',
- 'MOD' => '(%,mod)',
- 'NOT' => '(!,not)',
- 'LAND' => '(&&,and)',
- 'LOR' => '(||,or)',
- 'LXOR' => 'xor',
- 'OPENP' => '(',
- 'CLOSEP' => ')',
- 'OPENB' => '[',
- 'CLOSEB' => ']',
- 'PTR' => '->',
- 'APTR' => '=>',
- 'EQUAL' => '=',
- 'NUMBER' => 'number',
- 'UNIMATH' => '+" , "-',
- 'MATH' => '*" , "/" , "%',
- 'INCDEC' => '++" , "--',
- 'SPACE' => ' ',
- 'DOLLAR' => '$',
- 'SEMICOLON' => ';',
- 'COLON' => ':',
- 'DOUBLECOLON' => '::',
- 'AT' => '@',
- 'HATCH' => '#',
- 'QUOTE' => '"',
- 'BACKTICK' => '`',
- 'VERT' => '|',
- 'DOT' => '.',
- 'COMMA' => '","',
- 'ANDSYM' => '"&"',
- 'QMARK' => '"?"',
- 'ID' => 'identifier',
- 'OTHER' => 'text',
- 'LINEBREAK' => 'newline',
- 'FAKEPHPSTARTTAG' => 'Fake PHP start tag',
- 'PHPSTARTTAG' => 'PHP start tag',
- 'PHPENDTAG' => 'PHP end tag',
- 'LITERALSTART' => 'Literal start',
- 'LITERALEND' => 'Literal end',
- 'LDELSLASH' => 'closing tag',
- 'COMMENT' => 'comment',
- 'AS' => 'as',
- 'TO' => 'to',
- );
-
-
- function __construct($data,$compiler)
- {
-// $this->data = preg_replace("/(\r\n|\r|\n)/", "\n", $data);
- $this->data = $data;
- $this->counter = 0;
- $this->line = 1;
- $this->smarty = $compiler->smarty;
- $this->compiler = $compiler;
- $this->ldel = preg_quote($this->smarty->left_delimiter,'/');
- $this->ldel_length = strlen($this->smarty->left_delimiter);
- $this->rdel = preg_quote($this->smarty->right_delimiter,'/');
- $this->smarty_token_names['LDEL'] = $this->smarty->left_delimiter;
- $this->smarty_token_names['RDEL'] = $this->smarty->right_delimiter;
- $this->mbstring_overload = ini_get('mbstring.func_overload') & 2;
- }
-
-
- private $_yy_state = 1;
- private $_yy_stack = array();
-
- function yylex()
- {
- return $this->{'yylex' . $this->_yy_state}();
- }
-
- function yypushstate($state)
- {
- array_push($this->_yy_stack, $this->_yy_state);
- $this->_yy_state = $state;
- }
-
- function yypopstate()
- {
- $this->_yy_state = array_pop($this->_yy_stack);
- }
-
- function yybegin($state)
- {
- $this->_yy_state = $state;
- }
-
-
-
- function yylex1()
- {
- $tokenMap = array (
- 1 => 0,
- 2 => 0,
- 3 => 1,
- 5 => 0,
- 6 => 0,
- 7 => 0,
- 8 => 0,
- 9 => 0,
- 10 => 0,
- 11 => 0,
- 12 => 1,
- 14 => 0,
- 15 => 0,
- 16 => 0,
- 17 => 0,
- 18 => 0,
- 19 => 0,
- 20 => 0,
- 21 => 0,
- 22 => 0,
- 23 => 0,
- 24 => 2,
- 27 => 0,
- 28 => 0,
- );
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- $yy_global_pattern = "/\G(".$this->ldel."[$]smarty\\.block\\.child".$this->rdel.")|\G(\\{\\})|\G(".$this->ldel."\\*([\S\s]*?)\\*".$this->rdel.")|\G([\t ]*[\r\n]+[\t ]*)|\G(".$this->ldel."strip".$this->rdel.")|\G(".$this->ldel."\\s{1,}strip\\s{1,}".$this->rdel.")|\G(".$this->ldel."\/strip".$this->rdel.")|\G(".$this->ldel."\\s{1,}\/strip\\s{1,}".$this->rdel.")|\G(".$this->ldel."\\s*literal\\s*".$this->rdel.")|\G(".$this->ldel."\\s{1,}\/)|\G(".$this->ldel."\\s*(if|elseif|else if|while)\\s+)|\G(".$this->ldel."\\s*for\\s+)|\G(".$this->ldel."\\s*foreach(?![^\s]))|\G(".$this->ldel."\\s*setfilter\\s+)|\G(".$this->ldel."\\s{1,})|\G(".$this->ldel."\/)|\G(".$this->ldel.")|\G(<\\?(?:php\\w+|=|[a-zA-Z]+)?)|\G(\\?>)|\G(<%)|\G(%>)|\G(([\S\s]*?)(?=([\t ]*[\r\n]+[\t ]*|".$this->ldel."|<\\?|\\?>|<%|%>)))|\G([\S\s]+)|\G(.)/iS";
-
- do {
- if ($this->mbstring_overload ? preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) {
- $yysubmatches = $yymatches;
- $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
- if (!count($yymatches)) {
- throw new Exception('Error: lexing failed because a rule matched' .
- ' an empty string. Input "' . substr($this->data,
- $this->counter, 5) . '... state TEXT');
- }
- next($yymatches); // skip global match
- $this->token = key($yymatches); // token number
- if ($tokenMap[$this->token]) {
- // extract sub-patterns for passing to lex function
- $yysubmatches = array_slice($yysubmatches, $this->token + 1,
- $tokenMap[$this->token]);
- } else {
- $yysubmatches = array();
- }
- $this->value = current($yymatches); // token value
- $r = $this->{'yy_r1_' . $this->token}($yysubmatches);
- if ($r === null) {
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- // accept this token
- return true;
- } elseif ($r === true) {
- // we have changed state
- // process this token in the new state
- return $this->yylex();
- } elseif ($r === false) {
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- // skip this token
- continue;
- } } else {
- throw new Exception('Unexpected input at line' . $this->line .
- ': ' . $this->data[$this->counter]);
- }
- break;
- } while (true);
-
- } // end function
-
-
- const TEXT = 1;
- function yy_r1_1($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_SMARTYBLOCKCHILD;
- }
- function yy_r1_2($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- }
- function yy_r1_3($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_COMMENT;
- }
- function yy_r1_5($yy_subpatterns)
- {
-
- if ($this->strip) {
- return false;
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_LINEBREAK;
- }
- }
- function yy_r1_6($yy_subpatterns)
- {
-
- $this->strip = true;
- return false;
- }
- function yy_r1_7($yy_subpatterns)
- {
-
- if ($this->smarty->auto_literal) {
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- } else {
- $this->strip = true;
- return false;
- }
- }
- function yy_r1_8($yy_subpatterns)
- {
-
- $this->strip = false;
- return false;
- }
- function yy_r1_9($yy_subpatterns)
- {
-
- if ($this->smarty->auto_literal) {
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- } else {
- $this->strip = false;
- return false;
- }
- }
- function yy_r1_10($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LITERALSTART;
- $this->yypushstate(self::LITERAL);
- }
- function yy_r1_11($yy_subpatterns)
- {
-
- if ($this->smarty->auto_literal) {
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
- $this->yypushstate(self::SMARTY);
- $this->taglineno = $this->line;
- }
- }
- function yy_r1_12($yy_subpatterns)
- {
-
- if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_LDELIF;
- $this->yypushstate(self::SMARTY);
- $this->taglineno = $this->line;
- }
- }
- function yy_r1_14($yy_subpatterns)
- {
-
- if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_LDELFOR;
- $this->yypushstate(self::SMARTY);
- $this->taglineno = $this->line;
- }
- }
- function yy_r1_15($yy_subpatterns)
- {
-
- if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH;
- $this->yypushstate(self::SMARTY);
- $this->taglineno = $this->line;
- }
- }
- function yy_r1_16($yy_subpatterns)
- {
-
- if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_LDELSETFILTER;
- $this->yypushstate(self::SMARTY);
- $this->taglineno = $this->line;
- }
- }
- function yy_r1_17($yy_subpatterns)
- {
-
- if ($this->smarty->auto_literal) {
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_LDEL;
- $this->yypushstate(self::SMARTY);
- $this->taglineno = $this->line;
- }
- }
- function yy_r1_18($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
- $this->yypushstate(self::SMARTY);
- $this->taglineno = $this->line;
- }
- function yy_r1_19($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LDEL;
- $this->yypushstate(self::SMARTY);
- $this->taglineno = $this->line;
- }
- function yy_r1_20($yy_subpatterns)
- {
-
- if (in_array($this->value, Array('', '=', 'token = Smarty_Internal_Templateparser::TP_PHPSTARTTAG;
- } elseif ($this->value == 'token = Smarty_Internal_Templateparser::TP_XMLTAG;
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_FAKEPHPSTARTTAG;
- $this->value = substr($this->value, 0, 2);
- }
- }
- function yy_r1_21($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_PHPENDTAG;
- }
- function yy_r1_22($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ASPSTARTTAG;
- }
- function yy_r1_23($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ASPENDTAG;
- }
- function yy_r1_24($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- }
- function yy_r1_27($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- }
- function yy_r1_28($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- }
-
-
- function yylex2()
- {
- $tokenMap = array (
- 1 => 0,
- 2 => 0,
- 3 => 1,
- 5 => 0,
- 6 => 0,
- 7 => 0,
- 8 => 0,
- 9 => 0,
- 10 => 0,
- 11 => 0,
- 12 => 0,
- 13 => 0,
- 14 => 0,
- 15 => 0,
- 16 => 0,
- 17 => 0,
- 18 => 0,
- 19 => 0,
- 20 => 1,
- 22 => 1,
- 24 => 1,
- 26 => 0,
- 27 => 0,
- 28 => 0,
- 29 => 0,
- 30 => 0,
- 31 => 0,
- 32 => 0,
- 33 => 0,
- 34 => 0,
- 35 => 0,
- 36 => 0,
- 37 => 0,
- 38 => 0,
- 39 => 0,
- 40 => 0,
- 41 => 0,
- 42 => 0,
- 43 => 3,
- 47 => 0,
- 48 => 0,
- 49 => 0,
- 50 => 0,
- 51 => 0,
- 52 => 0,
- 53 => 0,
- 54 => 0,
- 55 => 1,
- 57 => 1,
- 59 => 0,
- 60 => 0,
- 61 => 0,
- 62 => 0,
- 63 => 0,
- 64 => 0,
- 65 => 0,
- 66 => 0,
- 67 => 0,
- 68 => 0,
- 69 => 0,
- 70 => 0,
- 71 => 0,
- 72 => 0,
- 73 => 0,
- 74 => 0,
- 75 => 0,
- 76 => 0,
- );
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- $yy_global_pattern = "/\G('[^'\\\\]*(?:\\\\.[^'\\\\]*)*')|\G(".$this->ldel."\\s{1,}\/)|\G(".$this->ldel."\\s*(if|elseif|else if|while)\\s+)|\G(".$this->ldel."\\s*for\\s+)|\G(".$this->ldel."\\s*foreach(?![^\s]))|\G(".$this->ldel."\\s{1,})|\G(\\s{1,}".$this->rdel.")|\G(".$this->ldel."\/)|\G(".$this->ldel.")|\G(".$this->rdel.")|\G(\\s+is\\s+in\\s+)|\G(\\s+as\\s+)|\G(\\s+to\\s+)|\G(\\s+step\\s+)|\G(\\s+instanceof\\s+)|\G(\\s*===\\s*)|\G(\\s*!==\\s*)|\G(\\s*==\\s*|\\s+eq\\s+)|\G(\\s*!=\\s*|\\s*<>\\s*|\\s+(ne|neq)\\s+)|\G(\\s*>=\\s*|\\s+(ge|gte)\\s+)|\G(\\s*<=\\s*|\\s+(le|lte)\\s+)|\G(\\s*>\\s*|\\s+gt\\s+)|\G(\\s*<\\s*|\\s+lt\\s+)|\G(\\s+mod\\s+)|\G(!\\s*|not\\s+)|\G(\\s*&&\\s*|\\s*and\\s+)|\G(\\s*\\|\\|\\s*|\\s*or\\s+)|\G(\\s*xor\\s+)|\G(\\s+is\\s+odd\\s+by\\s+)|\G(\\s+is\\s+not\\s+odd\\s+by\\s+)|\G(\\s+is\\s+odd)|\G(\\s+is\\s+not\\s+odd)|\G(\\s+is\\s+even\\s+by\\s+)|\G(\\s+is\\s+not\\s+even\\s+by\\s+)|\G(\\s+is\\s+even)|\G(\\s+is\\s+not\\s+even)|\G(\\s+is\\s+div\\s+by\\s+)|\G(\\s+is\\s+not\\s+div\\s+by\\s+)|\G(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\)\\s*)|\G(\\s*\\(\\s*)|\G(\\s*\\))|\G(\\[\\s*)|\G(\\s*\\])|\G(\\s*->\\s*)|\G(\\s*=>\\s*)|\G(\\s*=\\s*)|\G(\\+\\+|--)|\G(\\s*(\\+|-)\\s*)|\G(\\s*(\\*|\/|%)\\s*)|\G(\\$)|\G(\\s*;)|\G(::)|\G(\\s*:\\s*)|\G(@)|\G(#)|\G(\")|\G(`)|\G(\\|)|\G(\\.)|\G(\\s*,\\s*)|\G(\\s*&\\s*)|\G(\\s*\\?\\s*)|\G(0[xX][0-9a-fA-F]+)|\G([0-9]*[a-zA-Z_]\\w*)|\G(\\d+)|\G(\\s+)|\G(.)/iS";
-
- do {
- if ($this->mbstring_overload ? preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) {
- $yysubmatches = $yymatches;
- $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
- if (!count($yymatches)) {
- throw new Exception('Error: lexing failed because a rule matched' .
- ' an empty string. Input "' . substr($this->data,
- $this->counter, 5) . '... state SMARTY');
- }
- next($yymatches); // skip global match
- $this->token = key($yymatches); // token number
- if ($tokenMap[$this->token]) {
- // extract sub-patterns for passing to lex function
- $yysubmatches = array_slice($yysubmatches, $this->token + 1,
- $tokenMap[$this->token]);
- } else {
- $yysubmatches = array();
- }
- $this->value = current($yymatches); // token value
- $r = $this->{'yy_r2_' . $this->token}($yysubmatches);
- if ($r === null) {
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- // accept this token
- return true;
- } elseif ($r === true) {
- // we have changed state
- // process this token in the new state
- return $this->yylex();
- } elseif ($r === false) {
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- // skip this token
- continue;
- } } else {
- throw new Exception('Unexpected input at line' . $this->line .
- ': ' . $this->data[$this->counter]);
- }
- break;
- } while (true);
-
- } // end function
-
-
- const SMARTY = 2;
- function yy_r2_1($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_SINGLEQUOTESTRING;
- }
- function yy_r2_2($yy_subpatterns)
- {
-
- if ($this->smarty->auto_literal) {
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
- $this->yypushstate(self::SMARTY);
- $this->taglineno = $this->line;
- }
- }
- function yy_r2_3($yy_subpatterns)
- {
-
- if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_LDELIF;
- $this->yypushstate(self::SMARTY);
- $this->taglineno = $this->line;
- }
- }
- function yy_r2_5($yy_subpatterns)
- {
-
- if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_LDELFOR;
- $this->yypushstate(self::SMARTY);
- $this->taglineno = $this->line;
- }
- }
- function yy_r2_6($yy_subpatterns)
- {
-
- if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH;
- $this->yypushstate(self::SMARTY);
- $this->taglineno = $this->line;
- }
- }
- function yy_r2_7($yy_subpatterns)
- {
-
- if ($this->smarty->auto_literal) {
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_LDEL;
- $this->yypushstate(self::SMARTY);
- $this->taglineno = $this->line;
- }
- }
- function yy_r2_8($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_RDEL;
- $this->yypopstate();
- }
- function yy_r2_9($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
- $this->yypushstate(self::SMARTY);
- $this->taglineno = $this->line;
- }
- function yy_r2_10($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LDEL;
- $this->yypushstate(self::SMARTY);
- $this->taglineno = $this->line;
- }
- function yy_r2_11($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_RDEL;
- $this->yypopstate();
- }
- function yy_r2_12($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ISIN;
- }
- function yy_r2_13($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_AS;
- }
- function yy_r2_14($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_TO;
- }
- function yy_r2_15($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_STEP;
- }
- function yy_r2_16($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_INSTANCEOF;
- }
- function yy_r2_17($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_IDENTITY;
- }
- function yy_r2_18($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_NONEIDENTITY;
- }
- function yy_r2_19($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_EQUALS;
- }
- function yy_r2_20($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_NOTEQUALS;
- }
- function yy_r2_22($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_GREATEREQUAL;
- }
- function yy_r2_24($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LESSEQUAL;
- }
- function yy_r2_26($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_GREATERTHAN;
- }
- function yy_r2_27($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LESSTHAN;
- }
- function yy_r2_28($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_MOD;
- }
- function yy_r2_29($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_NOT;
- }
- function yy_r2_30($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LAND;
- }
- function yy_r2_31($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LOR;
- }
- function yy_r2_32($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LXOR;
- }
- function yy_r2_33($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ISODDBY;
- }
- function yy_r2_34($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ISNOTODDBY;
- }
- function yy_r2_35($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ISODD;
- }
- function yy_r2_36($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ISNOTODD;
- }
- function yy_r2_37($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ISEVENBY;
- }
- function yy_r2_38($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ISNOTEVENBY;
- }
- function yy_r2_39($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ISEVEN;
- }
- function yy_r2_40($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ISNOTEVEN;
- }
- function yy_r2_41($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ISDIVBY;
- }
- function yy_r2_42($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ISNOTDIVBY;
- }
- function yy_r2_43($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_TYPECAST;
- }
- function yy_r2_47($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_OPENP;
- }
- function yy_r2_48($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_CLOSEP;
- }
- function yy_r2_49($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_OPENB;
- }
- function yy_r2_50($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_CLOSEB;
- }
- function yy_r2_51($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_PTR;
- }
- function yy_r2_52($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_APTR;
- }
- function yy_r2_53($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_EQUAL;
- }
- function yy_r2_54($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_INCDEC;
- }
- function yy_r2_55($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_UNIMATH;
- }
- function yy_r2_57($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_MATH;
- }
- function yy_r2_59($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_DOLLAR;
- }
- function yy_r2_60($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_SEMICOLON;
- }
- function yy_r2_61($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_DOUBLECOLON;
- }
- function yy_r2_62($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_COLON;
- }
- function yy_r2_63($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_AT;
- }
- function yy_r2_64($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_HATCH;
- }
- function yy_r2_65($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_QUOTE;
- $this->yypushstate(self::DOUBLEQUOTEDSTRING);
- }
- function yy_r2_66($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_BACKTICK;
- $this->yypopstate();
- }
- function yy_r2_67($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_VERT;
- }
- function yy_r2_68($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_DOT;
- }
- function yy_r2_69($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_COMMA;
- }
- function yy_r2_70($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ANDSYM;
- }
- function yy_r2_71($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_QMARK;
- }
- function yy_r2_72($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_HEX;
- }
- function yy_r2_73($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ID;
- }
- function yy_r2_74($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_INTEGER;
- }
- function yy_r2_75($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_SPACE;
- }
- function yy_r2_76($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- }
-
-
-
- function yylex3()
- {
- $tokenMap = array (
- 1 => 0,
- 2 => 0,
- 3 => 0,
- 4 => 0,
- 5 => 0,
- 6 => 0,
- 7 => 0,
- 8 => 2,
- 11 => 0,
- );
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- $yy_global_pattern = "/\G(".$this->ldel."\\s*literal\\s*".$this->rdel.")|\G(".$this->ldel."\\s*\/literal\\s*".$this->rdel.")|\G([\t ]*[\r\n]+[\t ]*)|\G(<\\?(?:php\\w+|=|[a-zA-Z]+)?)|\G(\\?>)|\G(<%)|\G(%>)|\G(([\S\s]*?)(?=([\t ]*[\r\n]+[\t ]*|".$this->ldel."\/?literal".$this->rdel."|<\\?|<%)))|\G(.)/iS";
-
- do {
- if ($this->mbstring_overload ? preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) {
- $yysubmatches = $yymatches;
- $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
- if (!count($yymatches)) {
- throw new Exception('Error: lexing failed because a rule matched' .
- ' an empty string. Input "' . substr($this->data,
- $this->counter, 5) . '... state LITERAL');
- }
- next($yymatches); // skip global match
- $this->token = key($yymatches); // token number
- if ($tokenMap[$this->token]) {
- // extract sub-patterns for passing to lex function
- $yysubmatches = array_slice($yysubmatches, $this->token + 1,
- $tokenMap[$this->token]);
- } else {
- $yysubmatches = array();
- }
- $this->value = current($yymatches); // token value
- $r = $this->{'yy_r3_' . $this->token}($yysubmatches);
- if ($r === null) {
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- // accept this token
- return true;
- } elseif ($r === true) {
- // we have changed state
- // process this token in the new state
- return $this->yylex();
- } elseif ($r === false) {
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- // skip this token
- continue;
- } } else {
- throw new Exception('Unexpected input at line' . $this->line .
- ': ' . $this->data[$this->counter]);
- }
- break;
- } while (true);
-
- } // end function
-
-
- const LITERAL = 3;
- function yy_r3_1($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LITERALSTART;
- $this->yypushstate(self::LITERAL);
- }
- function yy_r3_2($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LITERALEND;
- $this->yypopstate();
- }
- function yy_r3_3($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LITERAL;
- }
- function yy_r3_4($yy_subpatterns)
- {
-
- if (in_array($this->value, Array('', '=', 'token = Smarty_Internal_Templateparser::TP_PHPSTARTTAG;
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_FAKEPHPSTARTTAG;
- $this->value = substr($this->value, 0, 2);
- }
- }
- function yy_r3_5($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_PHPENDTAG;
- }
- function yy_r3_6($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ASPSTARTTAG;
- }
- function yy_r3_7($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ASPENDTAG;
- }
- function yy_r3_8($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LITERAL;
- }
- function yy_r3_11($yy_subpatterns)
- {
-
- $this->compiler->trigger_template_error ("missing or misspelled literal closing tag");
- }
-
-
- function yylex4()
- {
- $tokenMap = array (
- 1 => 0,
- 2 => 1,
- 4 => 0,
- 5 => 0,
- 6 => 0,
- 7 => 0,
- 8 => 0,
- 9 => 0,
- 10 => 0,
- 11 => 0,
- 12 => 0,
- 13 => 3,
- 17 => 0,
- 18 => 0,
- );
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- $yy_global_pattern = "/\G(".$this->ldel."\\s{1,}\/)|\G(".$this->ldel."\\s*(if|elseif|else if|while)\\s+)|\G(".$this->ldel."\\s*for\\s+)|\G(".$this->ldel."\\s*foreach(?![^\s]))|\G(".$this->ldel."\\s{1,})|\G(".$this->ldel."\/)|\G(".$this->ldel.")|\G(\")|\G(`\\$)|\G(\\$[0-9]*[a-zA-Z_]\\w*)|\G(\\$)|\G(([^\"\\\\]*?)((?:\\\\.[^\"\\\\]*?)*?)(?=(".$this->ldel."|\\$|`\\$|\")))|\G([\S\s]+)|\G(.)/iS";
-
- do {
- if ($this->mbstring_overload ? preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) {
- $yysubmatches = $yymatches;
- $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
- if (!count($yymatches)) {
- throw new Exception('Error: lexing failed because a rule matched' .
- ' an empty string. Input "' . substr($this->data,
- $this->counter, 5) . '... state DOUBLEQUOTEDSTRING');
- }
- next($yymatches); // skip global match
- $this->token = key($yymatches); // token number
- if ($tokenMap[$this->token]) {
- // extract sub-patterns for passing to lex function
- $yysubmatches = array_slice($yysubmatches, $this->token + 1,
- $tokenMap[$this->token]);
- } else {
- $yysubmatches = array();
- }
- $this->value = current($yymatches); // token value
- $r = $this->{'yy_r4_' . $this->token}($yysubmatches);
- if ($r === null) {
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- // accept this token
- return true;
- } elseif ($r === true) {
- // we have changed state
- // process this token in the new state
- return $this->yylex();
- } elseif ($r === false) {
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- // skip this token
- continue;
- } } else {
- throw new Exception('Unexpected input at line' . $this->line .
- ': ' . $this->data[$this->counter]);
- }
- break;
- } while (true);
-
- } // end function
-
-
- const DOUBLEQUOTEDSTRING = 4;
- function yy_r4_1($yy_subpatterns)
- {
-
- if ($this->smarty->auto_literal) {
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
- $this->yypushstate(self::SMARTY);
- $this->taglineno = $this->line;
- }
- }
- function yy_r4_2($yy_subpatterns)
- {
-
- if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_LDELIF;
- $this->yypushstate(self::SMARTY);
- $this->taglineno = $this->line;
- }
- }
- function yy_r4_4($yy_subpatterns)
- {
-
- if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_LDELFOR;
- $this->yypushstate(self::SMARTY);
- $this->taglineno = $this->line;
- }
- }
- function yy_r4_5($yy_subpatterns)
- {
-
- if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH;
- $this->yypushstate(self::SMARTY);
- $this->taglineno = $this->line;
- }
- }
- function yy_r4_6($yy_subpatterns)
- {
-
- if ($this->smarty->auto_literal) {
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_LDEL;
- $this->yypushstate(self::SMARTY);
- $this->taglineno = $this->line;
- }
- }
- function yy_r4_7($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
- $this->yypushstate(self::SMARTY);
- $this->taglineno = $this->line;
- }
- function yy_r4_8($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LDEL;
- $this->yypushstate(self::SMARTY);
- $this->taglineno = $this->line;
- }
- function yy_r4_9($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_QUOTE;
- $this->yypopstate();
- }
- function yy_r4_10($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_BACKTICK;
- $this->value = substr($this->value,0,-1);
- $this->yypushstate(self::SMARTY);
- $this->taglineno = $this->line;
- }
- function yy_r4_11($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_DOLLARID;
- }
- function yy_r4_12($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- }
- function yy_r4_13($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- }
- function yy_r4_17($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- }
- function yy_r4_18($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- }
-
-}
-?>
\ No newline at end of file
diff --git a/tools/smarty/sysplugins/smarty_internal_templateparser.php b/tools/smarty/sysplugins/smarty_internal_templateparser.php
deleted file mode 100755
index 6dfdeeffe..000000000
--- a/tools/smarty/sysplugins/smarty_internal_templateparser.php
+++ /dev/null
@@ -1,3218 +0,0 @@
-string = $s->string;
- $this->metadata = $s->metadata;
- } else {
- $this->string = (string) $s;
- if ($m instanceof TP_yyToken) {
- $this->metadata = $m->metadata;
- } elseif (is_array($m)) {
- $this->metadata = $m;
- }
- }
- }
-
- function __toString()
- {
- return $this->_string;
- }
-
- function offsetExists($offset)
- {
- return isset($this->metadata[$offset]);
- }
-
- function offsetGet($offset)
- {
- return $this->metadata[$offset];
- }
-
- function offsetSet($offset, $value)
- {
- if ($offset === null) {
- if (isset($value[0])) {
- $x = ($value instanceof TP_yyToken) ?
- $value->metadata : $value;
- $this->metadata = array_merge($this->metadata, $x);
- return;
- }
- $offset = count($this->metadata);
- }
- if ($value === null) {
- return;
- }
- if ($value instanceof TP_yyToken) {
- if ($value->metadata) {
- $this->metadata[$offset] = $value->metadata;
- }
- } elseif ($value) {
- $this->metadata[$offset] = $value;
- }
- }
-
- function offsetUnset($offset)
- {
- unset($this->metadata[$offset]);
- }
-}
-
-class TP_yyStackEntry
-{
- public $stateno; /* The state-number */
- public $major; /* The major token value. This is the code
- ** number for the token at this stack level */
- public $minor; /* The user-supplied minor token value. This
- ** is the value of the token */
-};
-
-
-#line 12 "smarty_internal_templateparser.y"
-class Smarty_Internal_Templateparser#line 79 "smarty_internal_templateparser.php"
-{
-#line 14 "smarty_internal_templateparser.y"
-
- const Err1 = "Security error: Call to private object member not allowed";
- const Err2 = "Security error: Call to dynamic object member not allowed";
- const Err3 = "PHP in template not allowed. Use SmartyBC to enable it";
- // states whether the parse was successful or not
- public $successful = true;
- public $retvalue = 0;
- private $lex;
- private $internalError = false;
-
- function __construct($lex, $compiler) {
- $this->lex = $lex;
- $this->compiler = $compiler;
- $this->smarty = $this->compiler->smarty;
- $this->template = $this->compiler->template;
- $this->compiler->has_variable_string = false;
- $this->compiler->prefix_code = array();
- $this->prefix_number = 0;
- $this->block_nesting_level = 0;
- if ($this->security = isset($this->smarty->security_policy)) {
- $this->php_handling = $this->smarty->security_policy->php_handling;
- } else {
- $this->php_handling = $this->smarty->php_handling;
- }
- $this->is_xml = false;
- $this->asp_tags = (ini_get('asp_tags') != '0');
- $this->current_buffer = $this->root_buffer = new _smarty_template_buffer($this);
- }
-
- public static function escape_start_tag($tag_text) {
- $tag = preg_replace('/\A<\?(.*)\z/', '<?\1', $tag_text, -1 , $count); //Escape tag
- return $tag;
- }
-
- public static function escape_end_tag($tag_text) {
- return '?>';
- }
-
- public function compileVariable($variable) {
- if (strpos($variable,'(') == 0) {
- // not a variable variable
- $var = trim($variable,'\'');
- $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable($var, null, true, false)->nocache;
- $this->template->properties['variables'][$var] = $this->compiler->tag_nocache|$this->compiler->nocache;
- }
-// return '(isset($_smarty_tpl->tpl_vars['. $variable .'])?$_smarty_tpl->tpl_vars['. $variable .']->value:$_smarty_tpl->getVariable('. $variable .')->value)';
- return '$_smarty_tpl->tpl_vars['. $variable .']->value';
- }
-#line 131 "smarty_internal_templateparser.php"
-
- const TP_VERT = 1;
- const TP_COLON = 2;
- const TP_COMMENT = 3;
- const TP_PHPSTARTTAG = 4;
- const TP_PHPENDTAG = 5;
- const TP_ASPSTARTTAG = 6;
- const TP_ASPENDTAG = 7;
- const TP_FAKEPHPSTARTTAG = 8;
- const TP_XMLTAG = 9;
- const TP_OTHER = 10;
- const TP_LINEBREAK = 11;
- const TP_LITERALSTART = 12;
- const TP_LITERALEND = 13;
- const TP_LITERAL = 14;
- const TP_LDEL = 15;
- const TP_RDEL = 16;
- const TP_DOLLAR = 17;
- const TP_ID = 18;
- const TP_EQUAL = 19;
- const TP_PTR = 20;
- const TP_LDELIF = 21;
- const TP_LDELFOR = 22;
- const TP_SEMICOLON = 23;
- const TP_INCDEC = 24;
- const TP_TO = 25;
- const TP_STEP = 26;
- const TP_LDELFOREACH = 27;
- const TP_SPACE = 28;
- const TP_AS = 29;
- const TP_APTR = 30;
- const TP_LDELSETFILTER = 31;
- const TP_SMARTYBLOCKCHILD = 32;
- const TP_LDELSLASH = 33;
- const TP_INTEGER = 34;
- const TP_COMMA = 35;
- const TP_OPENP = 36;
- const TP_CLOSEP = 37;
- const TP_MATH = 38;
- const TP_UNIMATH = 39;
- const TP_ANDSYM = 40;
- const TP_ISIN = 41;
- const TP_ISDIVBY = 42;
- const TP_ISNOTDIVBY = 43;
- const TP_ISEVEN = 44;
- const TP_ISNOTEVEN = 45;
- const TP_ISEVENBY = 46;
- const TP_ISNOTEVENBY = 47;
- const TP_ISODD = 48;
- const TP_ISNOTODD = 49;
- const TP_ISODDBY = 50;
- const TP_ISNOTODDBY = 51;
- const TP_INSTANCEOF = 52;
- const TP_QMARK = 53;
- const TP_NOT = 54;
- const TP_TYPECAST = 55;
- const TP_HEX = 56;
- const TP_DOT = 57;
- const TP_SINGLEQUOTESTRING = 58;
- const TP_DOUBLECOLON = 59;
- const TP_AT = 60;
- const TP_HATCH = 61;
- const TP_OPENB = 62;
- const TP_CLOSEB = 63;
- const TP_EQUALS = 64;
- const TP_NOTEQUALS = 65;
- const TP_GREATERTHAN = 66;
- const TP_LESSTHAN = 67;
- const TP_GREATEREQUAL = 68;
- const TP_LESSEQUAL = 69;
- const TP_IDENTITY = 70;
- const TP_NONEIDENTITY = 71;
- const TP_MOD = 72;
- const TP_LAND = 73;
- const TP_LOR = 74;
- const TP_LXOR = 75;
- const TP_QUOTE = 76;
- const TP_BACKTICK = 77;
- const TP_DOLLARID = 78;
- const YY_NO_ACTION = 590;
- const YY_ACCEPT_ACTION = 589;
- const YY_ERROR_ACTION = 588;
-
- const YY_SZ_ACTTAB = 2393;
-static public $yy_action = array(
- /* 0 */ 211, 316, 317, 319, 318, 315, 314, 310, 309, 311,
- /* 10 */ 312, 313, 320, 189, 304, 161, 38, 589, 95, 265,
- /* 20 */ 317, 319, 7, 106, 289, 37, 26, 30, 146, 283,
- /* 30 */ 10, 285, 250, 286, 238, 280, 287, 49, 48, 46,
- /* 40 */ 45, 20, 29, 365, 366, 28, 32, 373, 374, 15,
- /* 50 */ 11, 328, 323, 322, 324, 327, 231, 211, 4, 189,
- /* 60 */ 329, 332, 211, 382, 383, 384, 385, 381, 380, 376,
- /* 70 */ 375, 377, 281, 378, 379, 211, 360, 450, 180, 251,
- /* 80 */ 117, 144, 196, 74, 135, 260, 17, 451, 26, 30,
- /* 90 */ 307, 283, 299, 361, 35, 158, 225, 368, 362, 451,
- /* 100 */ 343, 30, 30, 226, 44, 203, 285, 4, 47, 203,
- /* 110 */ 218, 259, 49, 48, 46, 45, 20, 29, 365, 366,
- /* 120 */ 28, 32, 373, 374, 15, 11, 351, 108, 176, 334,
- /* 130 */ 144, 193, 337, 23, 129, 134, 371, 289, 382, 383,
- /* 140 */ 384, 385, 381, 380, 376, 375, 377, 281, 378, 379,
- /* 150 */ 211, 360, 372, 26, 203, 142, 283, 31, 68, 122,
- /* 160 */ 242, 26, 109, 353, 283, 346, 454, 299, 361, 25,
- /* 170 */ 185, 225, 368, 362, 30, 343, 239, 30, 454, 289,
- /* 180 */ 4, 41, 26, 143, 165, 283, 4, 49, 48, 46,
- /* 190 */ 45, 20, 29, 365, 366, 28, 32, 373, 374, 15,
- /* 200 */ 11, 101, 160, 144, 26, 208, 34, 283, 31, 144,
- /* 210 */ 8, 289, 4, 382, 383, 384, 385, 381, 380, 376,
- /* 220 */ 375, 377, 281, 378, 379, 211, 360, 227, 203, 357,
- /* 230 */ 142, 197, 19, 73, 135, 144, 211, 302, 9, 158,
- /* 240 */ 340, 26, 299, 361, 283, 158, 225, 368, 362, 228,
- /* 250 */ 343, 294, 30, 6, 331, 235, 330, 221, 195, 337,
- /* 260 */ 126, 240, 49, 48, 46, 45, 20, 29, 365, 366,
- /* 270 */ 28, 32, 373, 374, 15, 11, 211, 16, 129, 244,
- /* 280 */ 249, 219, 208, 192, 337, 302, 228, 8, 382, 383,
- /* 290 */ 384, 385, 381, 380, 376, 375, 377, 281, 378, 379,
- /* 300 */ 163, 211, 107, 188, 105, 40, 40, 266, 277, 289,
- /* 310 */ 241, 232, 289, 49, 48, 46, 45, 20, 29, 365,
- /* 320 */ 366, 28, 32, 373, 374, 15, 11, 211, 168, 203,
- /* 330 */ 40, 2, 278, 167, 175, 244, 242, 289, 350, 382,
- /* 340 */ 383, 384, 385, 381, 380, 376, 375, 377, 281, 378,
- /* 350 */ 379, 191, 47, 184, 204, 234, 169, 198, 287, 386,
- /* 360 */ 203, 203, 289, 124, 49, 48, 46, 45, 20, 29,
- /* 370 */ 365, 366, 28, 32, 373, 374, 15, 11, 211, 204,
- /* 380 */ 182, 26, 26, 26, 283, 212, 224, 118, 131, 289,
- /* 390 */ 382, 383, 384, 385, 381, 380, 376, 375, 377, 281,
- /* 400 */ 378, 379, 370, 172, 244, 270, 204, 130, 211, 164,
- /* 410 */ 26, 287, 289, 229, 178, 49, 48, 46, 45, 20,
- /* 420 */ 29, 365, 366, 28, 32, 373, 374, 15, 11, 204,
- /* 430 */ 364, 298, 5, 26, 100, 30, 247, 148, 148, 99,
- /* 440 */ 159, 382, 383, 384, 385, 381, 380, 376, 375, 377,
- /* 450 */ 281, 378, 379, 211, 354, 370, 360, 174, 26, 369,
- /* 460 */ 142, 283, 360, 73, 135, 158, 157, 123, 24, 155,
- /* 470 */ 135, 30, 299, 361, 211, 190, 225, 368, 362, 272,
- /* 480 */ 343, 252, 225, 368, 362, 343, 343, 222, 223, 306,
- /* 490 */ 49, 48, 46, 45, 20, 29, 365, 366, 28, 32,
- /* 500 */ 373, 374, 15, 11, 129, 43, 236, 9, 269, 258,
- /* 510 */ 199, 133, 33, 14, 202, 103, 382, 383, 384, 385,
- /* 520 */ 381, 380, 376, 375, 377, 281, 378, 379, 211, 360,
- /* 530 */ 370, 170, 262, 142, 360, 36, 73, 135, 151, 141,
- /* 540 */ 289, 245, 135, 276, 211, 299, 361, 211, 44, 225,
- /* 550 */ 368, 362, 287, 343, 225, 368, 362, 119, 343, 295,
- /* 560 */ 216, 267, 282, 296, 211, 49, 48, 46, 45, 20,
- /* 570 */ 29, 365, 366, 28, 32, 373, 374, 15, 11, 284,
- /* 580 */ 181, 223, 333, 138, 302, 236, 297, 6, 127, 289,
- /* 590 */ 116, 382, 383, 384, 385, 381, 380, 376, 375, 377,
- /* 600 */ 281, 378, 379, 211, 360, 370, 177, 94, 142, 303,
- /* 610 */ 292, 54, 122, 139, 162, 289, 150, 261, 264, 293,
- /* 620 */ 299, 361, 30, 289, 225, 368, 362, 287, 343, 30,
- /* 630 */ 287, 30, 132, 300, 308, 287, 158, 211, 30, 334,
- /* 640 */ 49, 48, 46, 45, 20, 29, 365, 366, 28, 32,
- /* 650 */ 373, 374, 15, 11, 211, 204, 166, 12, 275, 287,
- /* 660 */ 273, 248, 342, 98, 97, 113, 382, 383, 384, 385,
- /* 670 */ 381, 380, 376, 375, 377, 281, 378, 379, 370, 370,
- /* 680 */ 370, 110, 18, 321, 324, 324, 324, 324, 324, 324,
- /* 690 */ 246, 49, 48, 46, 45, 20, 29, 365, 366, 28,
- /* 700 */ 32, 373, 374, 15, 11, 211, 324, 324, 324, 324,
- /* 710 */ 324, 324, 324, 324, 112, 136, 104, 382, 383, 384,
- /* 720 */ 385, 381, 380, 376, 375, 377, 281, 378, 379, 370,
- /* 730 */ 370, 370, 324, 324, 324, 324, 324, 324, 324, 324,
- /* 740 */ 324, 256, 49, 48, 46, 45, 20, 29, 365, 366,
- /* 750 */ 28, 32, 373, 374, 15, 11, 211, 324, 324, 324,
- /* 760 */ 324, 324, 324, 324, 324, 324, 324, 324, 382, 383,
- /* 770 */ 384, 385, 381, 380, 376, 375, 377, 281, 378, 379,
- /* 780 */ 351, 324, 324, 30, 324, 324, 324, 324, 324, 324,
- /* 790 */ 324, 324, 324, 49, 48, 46, 45, 20, 29, 365,
- /* 800 */ 366, 28, 32, 373, 374, 15, 11, 211, 324, 324,
- /* 810 */ 324, 324, 324, 324, 324, 324, 324, 355, 324, 382,
- /* 820 */ 383, 384, 385, 381, 380, 376, 375, 377, 281, 378,
- /* 830 */ 379, 324, 324, 324, 324, 324, 324, 324, 324, 324,
- /* 840 */ 324, 324, 324, 324, 49, 48, 46, 45, 20, 29,
- /* 850 */ 365, 366, 28, 32, 373, 374, 15, 11, 324, 324,
- /* 860 */ 324, 324, 324, 324, 324, 324, 324, 324, 324, 257,
- /* 870 */ 382, 383, 384, 385, 381, 380, 376, 375, 377, 281,
- /* 880 */ 378, 379, 211, 324, 324, 324, 194, 360, 211, 288,
- /* 890 */ 255, 145, 324, 352, 336, 135, 324, 200, 42, 22,
- /* 900 */ 27, 30, 30, 341, 7, 106, 30, 225, 368, 362,
- /* 910 */ 146, 343, 324, 203, 250, 286, 238, 324, 211, 49,
- /* 920 */ 48, 46, 45, 20, 29, 365, 366, 28, 32, 373,
- /* 930 */ 374, 15, 11, 305, 324, 324, 324, 324, 324, 47,
- /* 940 */ 324, 324, 324, 324, 324, 382, 383, 384, 385, 381,
- /* 950 */ 380, 376, 375, 377, 281, 378, 379, 211, 324, 359,
- /* 960 */ 39, 349, 360, 326, 348, 291, 156, 324, 352, 344,
- /* 970 */ 135, 324, 201, 42, 324, 30, 30, 30, 324, 7,
- /* 980 */ 106, 30, 225, 368, 362, 146, 343, 324, 324, 250,
- /* 990 */ 286, 238, 324, 324, 49, 48, 46, 45, 20, 29,
- /* 1000 */ 365, 366, 28, 32, 373, 374, 15, 11, 211, 324,
- /* 1010 */ 324, 324, 324, 324, 324, 324, 324, 324, 324, 324,
- /* 1020 */ 382, 383, 384, 385, 381, 380, 376, 375, 377, 281,
- /* 1030 */ 378, 379, 324, 324, 358, 39, 349, 324, 324, 324,
- /* 1040 */ 324, 324, 324, 324, 324, 49, 48, 46, 45, 20,
- /* 1050 */ 29, 365, 366, 28, 32, 373, 374, 15, 11, 324,
- /* 1060 */ 324, 324, 324, 324, 324, 324, 324, 324, 324, 324,
- /* 1070 */ 324, 382, 383, 384, 385, 381, 380, 376, 375, 377,
- /* 1080 */ 281, 378, 379, 324, 49, 48, 46, 45, 20, 29,
- /* 1090 */ 365, 366, 28, 32, 373, 374, 15, 11, 324, 324,
- /* 1100 */ 324, 324, 324, 324, 324, 324, 324, 324, 324, 324,
- /* 1110 */ 382, 383, 384, 385, 381, 380, 376, 375, 377, 281,
- /* 1120 */ 378, 379, 324, 324, 324, 324, 38, 324, 140, 207,
- /* 1130 */ 324, 360, 7, 106, 290, 147, 324, 356, 146, 135,
- /* 1140 */ 324, 324, 250, 286, 238, 230, 30, 13, 367, 30,
- /* 1150 */ 51, 225, 368, 362, 324, 343, 360, 324, 324, 324,
- /* 1160 */ 152, 324, 324, 324, 135, 50, 52, 301, 237, 363,
- /* 1170 */ 324, 360, 105, 1, 254, 154, 225, 368, 362, 135,
- /* 1180 */ 343, 324, 38, 324, 140, 214, 324, 96, 7, 106,
- /* 1190 */ 279, 225, 368, 362, 146, 343, 347, 345, 250, 286,
- /* 1200 */ 238, 230, 30, 13, 274, 324, 51, 338, 30, 30,
- /* 1210 */ 360, 324, 324, 324, 121, 324, 30, 53, 135, 30,
- /* 1220 */ 211, 50, 52, 301, 237, 363, 299, 361, 105, 1,
- /* 1230 */ 225, 368, 362, 211, 343, 453, 324, 268, 38, 324,
- /* 1240 */ 128, 214, 324, 96, 7, 106, 253, 453, 339, 30,
- /* 1250 */ 146, 335, 233, 324, 250, 286, 238, 230, 30, 3,
- /* 1260 */ 30, 324, 51, 30, 271, 324, 360, 324, 4, 324,
- /* 1270 */ 142, 47, 324, 84, 135, 324, 30, 50, 52, 301,
- /* 1280 */ 237, 363, 299, 361, 105, 1, 225, 368, 362, 324,
- /* 1290 */ 343, 144, 324, 324, 38, 324, 125, 92, 324, 96,
- /* 1300 */ 7, 106, 324, 324, 324, 324, 146, 324, 324, 324,
- /* 1310 */ 250, 286, 238, 230, 324, 13, 324, 324, 51, 324,
- /* 1320 */ 324, 324, 360, 324, 324, 324, 142, 324, 324, 89,
- /* 1330 */ 135, 324, 211, 50, 52, 301, 237, 363, 299, 361,
- /* 1340 */ 105, 1, 225, 368, 362, 324, 343, 456, 324, 324,
- /* 1350 */ 38, 324, 126, 214, 324, 96, 7, 106, 324, 456,
- /* 1360 */ 243, 324, 146, 324, 324, 324, 250, 286, 238, 230,
- /* 1370 */ 324, 21, 324, 324, 51, 324, 324, 324, 360, 324,
- /* 1380 */ 324, 324, 142, 47, 324, 87, 135, 324, 211, 50,
- /* 1390 */ 52, 301, 237, 363, 299, 361, 105, 1, 225, 368,
- /* 1400 */ 362, 324, 343, 456, 324, 324, 38, 324, 140, 210,
- /* 1410 */ 324, 96, 7, 106, 324, 456, 324, 324, 146, 324,
- /* 1420 */ 324, 324, 250, 286, 238, 230, 324, 13, 324, 324,
- /* 1430 */ 51, 324, 324, 324, 360, 324, 324, 324, 142, 47,
- /* 1440 */ 324, 63, 135, 324, 211, 50, 52, 301, 237, 363,
- /* 1450 */ 299, 361, 105, 1, 225, 368, 362, 324, 343, 325,
- /* 1460 */ 324, 324, 38, 324, 137, 214, 324, 96, 7, 106,
- /* 1470 */ 324, 30, 324, 324, 146, 324, 324, 324, 250, 286,
- /* 1480 */ 238, 230, 324, 13, 324, 324, 51, 324, 324, 324,
- /* 1490 */ 360, 324, 324, 324, 142, 47, 324, 80, 135, 324,
- /* 1500 */ 324, 50, 52, 301, 237, 363, 299, 361, 105, 1,
- /* 1510 */ 225, 368, 362, 324, 343, 324, 324, 324, 38, 324,
- /* 1520 */ 140, 206, 324, 96, 7, 106, 324, 324, 324, 324,
- /* 1530 */ 146, 324, 324, 324, 250, 286, 238, 220, 324, 13,
- /* 1540 */ 324, 324, 51, 324, 324, 324, 360, 324, 324, 324,
- /* 1550 */ 114, 324, 324, 75, 135, 324, 324, 50, 52, 301,
- /* 1560 */ 237, 363, 299, 361, 105, 1, 225, 368, 362, 324,
- /* 1570 */ 343, 324, 324, 324, 38, 324, 140, 205, 324, 96,
- /* 1580 */ 7, 106, 324, 324, 324, 324, 146, 324, 324, 324,
- /* 1590 */ 250, 286, 238, 230, 324, 13, 324, 324, 51, 324,
- /* 1600 */ 324, 324, 360, 324, 324, 324, 142, 324, 324, 77,
- /* 1610 */ 135, 324, 324, 50, 52, 301, 237, 363, 299, 361,
- /* 1620 */ 105, 1, 225, 368, 362, 324, 343, 324, 324, 324,
- /* 1630 */ 38, 324, 140, 209, 324, 96, 7, 106, 324, 324,
- /* 1640 */ 324, 324, 146, 324, 324, 324, 250, 286, 238, 230,
- /* 1650 */ 324, 13, 324, 324, 51, 324, 324, 324, 360, 324,
- /* 1660 */ 324, 324, 142, 324, 324, 85, 135, 324, 324, 50,
- /* 1670 */ 52, 301, 237, 363, 299, 361, 105, 1, 225, 368,
- /* 1680 */ 362, 324, 343, 324, 324, 324, 38, 324, 126, 213,
- /* 1690 */ 324, 96, 7, 106, 324, 324, 324, 324, 146, 324,
- /* 1700 */ 324, 324, 250, 286, 238, 230, 324, 21, 324, 324,
- /* 1710 */ 51, 324, 324, 324, 360, 324, 324, 324, 142, 324,
- /* 1720 */ 324, 71, 135, 324, 324, 50, 52, 301, 237, 363,
- /* 1730 */ 299, 361, 105, 324, 225, 368, 362, 324, 343, 324,
- /* 1740 */ 324, 324, 38, 324, 126, 214, 324, 96, 7, 106,
- /* 1750 */ 324, 324, 324, 324, 146, 324, 324, 324, 250, 286,
- /* 1760 */ 238, 230, 324, 21, 102, 186, 51, 324, 324, 324,
- /* 1770 */ 324, 324, 324, 324, 289, 324, 324, 22, 27, 324,
- /* 1780 */ 499, 50, 52, 301, 237, 363, 324, 499, 105, 499,
- /* 1790 */ 499, 203, 499, 499, 324, 324, 324, 324, 324, 499,
- /* 1800 */ 4, 499, 324, 96, 324, 324, 324, 324, 324, 324,
- /* 1810 */ 324, 324, 324, 360, 324, 324, 499, 117, 324, 324,
- /* 1820 */ 74, 135, 324, 144, 324, 324, 324, 499, 324, 299,
- /* 1830 */ 361, 324, 324, 225, 368, 362, 324, 343, 360, 324,
- /* 1840 */ 324, 499, 142, 324, 324, 66, 135, 324, 263, 324,
- /* 1850 */ 324, 324, 324, 324, 299, 361, 324, 324, 225, 368,
- /* 1860 */ 362, 324, 343, 324, 360, 324, 324, 324, 142, 324,
- /* 1870 */ 324, 79, 135, 324, 360, 324, 324, 324, 149, 324,
- /* 1880 */ 299, 361, 135, 360, 225, 368, 362, 142, 343, 324,
- /* 1890 */ 81, 135, 324, 324, 225, 368, 362, 324, 343, 299,
- /* 1900 */ 361, 324, 324, 225, 368, 362, 324, 343, 324, 324,
- /* 1910 */ 324, 360, 324, 324, 324, 115, 324, 324, 83, 135,
- /* 1920 */ 324, 324, 360, 324, 324, 324, 142, 299, 361, 72,
- /* 1930 */ 135, 225, 368, 362, 324, 343, 324, 324, 299, 361,
- /* 1940 */ 324, 324, 225, 368, 362, 324, 343, 324, 360, 324,
- /* 1950 */ 324, 324, 142, 324, 324, 70, 135, 324, 360, 324,
- /* 1960 */ 324, 324, 153, 324, 299, 361, 135, 360, 225, 368,
- /* 1970 */ 362, 142, 343, 324, 68, 135, 324, 324, 225, 368,
- /* 1980 */ 362, 324, 343, 299, 361, 324, 324, 225, 368, 362,
- /* 1990 */ 324, 343, 324, 324, 324, 360, 324, 324, 324, 142,
- /* 2000 */ 324, 324, 90, 135, 324, 324, 360, 324, 324, 324,
- /* 2010 */ 142, 299, 361, 86, 135, 225, 368, 362, 324, 343,
- /* 2020 */ 324, 324, 299, 361, 324, 324, 225, 368, 362, 324,
- /* 2030 */ 343, 324, 360, 194, 183, 324, 142, 324, 324, 91,
- /* 2040 */ 135, 324, 324, 289, 324, 324, 22, 27, 299, 361,
- /* 2050 */ 324, 360, 225, 368, 362, 142, 343, 324, 61, 135,
- /* 2060 */ 203, 324, 324, 324, 194, 171, 324, 299, 361, 324,
- /* 2070 */ 324, 225, 368, 362, 289, 343, 324, 22, 27, 360,
- /* 2080 */ 324, 324, 324, 142, 324, 324, 88, 135, 324, 324,
- /* 2090 */ 360, 203, 324, 324, 142, 299, 361, 69, 135, 225,
- /* 2100 */ 368, 362, 324, 343, 324, 324, 299, 361, 324, 324,
- /* 2110 */ 225, 368, 362, 324, 343, 324, 360, 194, 179, 324,
- /* 2120 */ 142, 324, 324, 76, 135, 324, 324, 289, 324, 324,
- /* 2130 */ 22, 27, 299, 361, 324, 360, 225, 368, 362, 142,
- /* 2140 */ 343, 324, 65, 135, 203, 324, 324, 324, 194, 187,
- /* 2150 */ 324, 299, 361, 324, 324, 225, 368, 362, 289, 343,
- /* 2160 */ 324, 22, 27, 360, 324, 324, 324, 111, 324, 324,
- /* 2170 */ 64, 135, 324, 324, 360, 203, 324, 324, 142, 299,
- /* 2180 */ 361, 62, 135, 225, 368, 362, 324, 343, 324, 324,
- /* 2190 */ 299, 361, 324, 324, 225, 368, 362, 324, 343, 324,
- /* 2200 */ 360, 194, 173, 324, 142, 324, 324, 82, 135, 324,
- /* 2210 */ 324, 289, 324, 324, 22, 27, 299, 361, 324, 360,
- /* 2220 */ 225, 368, 362, 142, 343, 324, 60, 135, 203, 324,
- /* 2230 */ 324, 324, 324, 324, 324, 299, 361, 324, 324, 225,
- /* 2240 */ 368, 362, 324, 343, 324, 324, 324, 360, 324, 324,
- /* 2250 */ 324, 93, 324, 324, 57, 120, 324, 324, 360, 324,
- /* 2260 */ 324, 324, 142, 299, 361, 58, 135, 225, 368, 362,
- /* 2270 */ 324, 343, 324, 324, 299, 361, 324, 324, 225, 368,
- /* 2280 */ 362, 324, 343, 324, 360, 324, 324, 324, 142, 324,
- /* 2290 */ 324, 59, 135, 324, 324, 324, 324, 324, 324, 324,
- /* 2300 */ 299, 361, 324, 360, 225, 368, 362, 93, 343, 324,
- /* 2310 */ 55, 120, 324, 324, 324, 324, 324, 324, 324, 299,
- /* 2320 */ 361, 324, 324, 215, 368, 362, 324, 343, 324, 324,
- /* 2330 */ 324, 360, 324, 324, 324, 142, 324, 324, 56, 135,
- /* 2340 */ 324, 324, 360, 324, 324, 324, 142, 299, 361, 78,
- /* 2350 */ 135, 225, 368, 362, 324, 343, 324, 324, 299, 361,
- /* 2360 */ 324, 324, 225, 368, 362, 324, 343, 324, 360, 324,
- /* 2370 */ 324, 324, 142, 324, 324, 67, 135, 324, 324, 324,
- /* 2380 */ 324, 324, 324, 324, 299, 361, 324, 324, 217, 368,
- /* 2390 */ 362, 324, 343,
- );
- static public $yy_lookahead = array(
- /* 0 */ 1, 82, 83, 84, 3, 4, 5, 6, 7, 8,
- /* 10 */ 9, 10, 11, 12, 18, 89, 15, 80, 81, 82,
- /* 20 */ 83, 84, 21, 22, 98, 26, 15, 28, 27, 18,
- /* 30 */ 19, 116, 31, 32, 33, 24, 110, 38, 39, 40,
- /* 40 */ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
- /* 50 */ 51, 4, 5, 6, 7, 8, 60, 1, 36, 12,
- /* 60 */ 13, 14, 1, 64, 65, 66, 67, 68, 69, 70,
- /* 70 */ 71, 72, 73, 74, 75, 1, 83, 16, 88, 57,
- /* 80 */ 87, 59, 88, 90, 91, 63, 30, 16, 15, 28,
- /* 90 */ 16, 18, 99, 100, 19, 20, 103, 104, 105, 28,
- /* 100 */ 107, 28, 28, 30, 2, 115, 116, 36, 52, 115,
- /* 110 */ 117, 118, 38, 39, 40, 41, 42, 43, 44, 45,
- /* 120 */ 46, 47, 48, 49, 50, 51, 83, 88, 89, 109,
- /* 130 */ 59, 111, 112, 15, 59, 17, 18, 98, 64, 65,
- /* 140 */ 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
- /* 150 */ 1, 83, 34, 15, 115, 87, 18, 19, 90, 91,
- /* 160 */ 92, 15, 119, 120, 18, 16, 16, 99, 100, 19,
- /* 170 */ 89, 103, 104, 105, 28, 107, 30, 28, 28, 98,
- /* 180 */ 36, 15, 15, 17, 18, 18, 36, 38, 39, 40,
- /* 190 */ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
- /* 200 */ 51, 88, 89, 59, 15, 57, 30, 18, 19, 59,
- /* 210 */ 62, 98, 36, 64, 65, 66, 67, 68, 69, 70,
- /* 220 */ 71, 72, 73, 74, 75, 1, 83, 60, 115, 16,
- /* 230 */ 87, 97, 15, 90, 91, 59, 1, 24, 19, 20,
- /* 240 */ 16, 15, 99, 100, 18, 20, 103, 104, 105, 60,
- /* 250 */ 107, 16, 28, 36, 84, 20, 86, 114, 111, 112,
- /* 260 */ 17, 18, 38, 39, 40, 41, 42, 43, 44, 45,
- /* 270 */ 46, 47, 48, 49, 50, 51, 1, 2, 59, 91,
- /* 280 */ 92, 93, 57, 111, 112, 24, 60, 62, 64, 65,
- /* 290 */ 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
- /* 300 */ 89, 1, 88, 89, 61, 35, 35, 37, 37, 98,
- /* 310 */ 17, 18, 98, 38, 39, 40, 41, 42, 43, 44,
- /* 320 */ 45, 46, 47, 48, 49, 50, 51, 1, 89, 115,
- /* 330 */ 35, 35, 37, 88, 88, 91, 92, 98, 77, 64,
- /* 340 */ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
- /* 350 */ 75, 23, 52, 89, 115, 29, 108, 97, 110, 63,
- /* 360 */ 115, 115, 98, 35, 38, 39, 40, 41, 42, 43,
- /* 370 */ 44, 45, 46, 47, 48, 49, 50, 51, 1, 115,
- /* 380 */ 89, 15, 15, 15, 18, 18, 18, 95, 17, 98,
- /* 390 */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
- /* 400 */ 74, 75, 110, 89, 91, 92, 115, 36, 1, 108,
- /* 410 */ 15, 110, 98, 18, 108, 38, 39, 40, 41, 42,
- /* 420 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 115,
- /* 430 */ 106, 106, 36, 15, 97, 28, 18, 113, 113, 108,
- /* 440 */ 95, 64, 65, 66, 67, 68, 69, 70, 71, 72,
- /* 450 */ 73, 74, 75, 1, 77, 110, 83, 108, 15, 18,
- /* 460 */ 87, 18, 83, 90, 91, 20, 87, 17, 19, 91,
- /* 470 */ 91, 28, 99, 100, 1, 23, 103, 104, 105, 100,
- /* 480 */ 107, 103, 103, 104, 105, 107, 107, 114, 2, 16,
- /* 490 */ 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
- /* 500 */ 48, 49, 50, 51, 59, 19, 57, 19, 37, 61,
- /* 510 */ 18, 17, 53, 2, 18, 95, 64, 65, 66, 67,
- /* 520 */ 68, 69, 70, 71, 72, 73, 74, 75, 1, 83,
- /* 530 */ 110, 89, 63, 87, 83, 25, 90, 91, 87, 17,
- /* 540 */ 98, 18, 91, 16, 1, 99, 100, 1, 2, 103,
- /* 550 */ 104, 105, 110, 107, 103, 104, 105, 18, 107, 16,
- /* 560 */ 114, 61, 16, 34, 1, 38, 39, 40, 41, 42,
- /* 570 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 16,
- /* 580 */ 89, 2, 18, 17, 24, 57, 34, 36, 17, 98,
- /* 590 */ 95, 64, 65, 66, 67, 68, 69, 70, 71, 72,
- /* 600 */ 73, 74, 75, 1, 83, 110, 89, 18, 87, 18,
- /* 610 */ 16, 90, 91, 92, 89, 98, 96, 16, 16, 16,
- /* 620 */ 99, 100, 28, 98, 103, 104, 105, 110, 107, 28,
- /* 630 */ 110, 28, 18, 18, 98, 110, 20, 1, 28, 109,
- /* 640 */ 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
- /* 650 */ 48, 49, 50, 51, 1, 115, 108, 28, 113, 110,
- /* 660 */ 28, 94, 112, 95, 95, 95, 64, 65, 66, 67,
- /* 670 */ 68, 69, 70, 71, 72, 73, 74, 75, 110, 110,
- /* 680 */ 110, 85, 94, 13, 121, 121, 121, 121, 121, 121,
- /* 690 */ 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
- /* 700 */ 47, 48, 49, 50, 51, 1, 121, 121, 121, 121,
- /* 710 */ 121, 121, 121, 121, 95, 95, 95, 64, 65, 66,
- /* 720 */ 67, 68, 69, 70, 71, 72, 73, 74, 75, 110,
- /* 730 */ 110, 110, 121, 121, 121, 121, 121, 121, 121, 121,
- /* 740 */ 121, 37, 38, 39, 40, 41, 42, 43, 44, 45,
- /* 750 */ 46, 47, 48, 49, 50, 51, 1, 121, 121, 121,
- /* 760 */ 121, 121, 121, 121, 121, 121, 121, 121, 64, 65,
- /* 770 */ 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
- /* 780 */ 83, 121, 121, 28, 121, 121, 121, 121, 121, 121,
- /* 790 */ 121, 121, 121, 38, 39, 40, 41, 42, 43, 44,
- /* 800 */ 45, 46, 47, 48, 49, 50, 51, 1, 121, 121,
- /* 810 */ 121, 121, 121, 121, 121, 121, 121, 120, 121, 64,
- /* 820 */ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
- /* 830 */ 75, 121, 121, 121, 121, 121, 121, 121, 121, 121,
- /* 840 */ 121, 121, 121, 121, 38, 39, 40, 41, 42, 43,
- /* 850 */ 44, 45, 46, 47, 48, 49, 50, 51, 121, 121,
- /* 860 */ 121, 121, 121, 121, 121, 121, 121, 121, 121, 63,
- /* 870 */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
- /* 880 */ 74, 75, 1, 121, 121, 121, 88, 83, 1, 16,
- /* 890 */ 16, 87, 121, 10, 16, 91, 121, 16, 15, 101,
- /* 900 */ 102, 28, 28, 16, 21, 22, 28, 103, 104, 105,
- /* 910 */ 27, 107, 121, 115, 31, 32, 33, 121, 1, 38,
- /* 920 */ 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
- /* 930 */ 49, 50, 51, 16, 121, 121, 121, 121, 121, 52,
- /* 940 */ 121, 121, 121, 121, 121, 64, 65, 66, 67, 68,
- /* 950 */ 69, 70, 71, 72, 73, 74, 75, 1, 121, 76,
- /* 960 */ 77, 78, 83, 16, 16, 16, 87, 121, 10, 16,
- /* 970 */ 91, 121, 16, 15, 121, 28, 28, 28, 121, 21,
- /* 980 */ 22, 28, 103, 104, 105, 27, 107, 121, 121, 31,
- /* 990 */ 32, 33, 121, 121, 38, 39, 40, 41, 42, 43,
- /* 1000 */ 44, 45, 46, 47, 48, 49, 50, 51, 1, 121,
- /* 1010 */ 121, 121, 121, 121, 121, 121, 121, 121, 121, 121,
- /* 1020 */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
- /* 1030 */ 74, 75, 121, 121, 76, 77, 78, 121, 121, 121,
- /* 1040 */ 121, 121, 121, 121, 121, 38, 39, 40, 41, 42,
- /* 1050 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 121,
- /* 1060 */ 121, 121, 121, 121, 121, 121, 121, 121, 121, 121,
- /* 1070 */ 121, 64, 65, 66, 67, 68, 69, 70, 71, 72,
- /* 1080 */ 73, 74, 75, 121, 38, 39, 40, 41, 42, 43,
- /* 1090 */ 44, 45, 46, 47, 48, 49, 50, 51, 121, 121,
- /* 1100 */ 121, 121, 121, 121, 121, 121, 121, 121, 121, 121,
- /* 1110 */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
- /* 1120 */ 74, 75, 121, 121, 121, 121, 15, 121, 17, 18,
- /* 1130 */ 121, 83, 21, 22, 16, 87, 121, 16, 27, 91,
- /* 1140 */ 121, 121, 31, 32, 33, 34, 28, 36, 100, 28,
- /* 1150 */ 39, 103, 104, 105, 121, 107, 83, 121, 121, 121,
- /* 1160 */ 87, 121, 121, 121, 91, 54, 55, 56, 57, 58,
- /* 1170 */ 121, 83, 61, 62, 63, 87, 103, 104, 105, 91,
- /* 1180 */ 107, 121, 15, 121, 17, 18, 121, 76, 21, 22,
- /* 1190 */ 16, 103, 104, 105, 27, 107, 16, 16, 31, 32,
- /* 1200 */ 33, 34, 28, 36, 16, 121, 39, 16, 28, 28,
- /* 1210 */ 83, 121, 121, 121, 87, 121, 28, 90, 91, 28,
- /* 1220 */ 1, 54, 55, 56, 57, 58, 99, 100, 61, 62,
- /* 1230 */ 103, 104, 105, 1, 107, 16, 121, 16, 15, 121,
- /* 1240 */ 17, 18, 121, 76, 21, 22, 16, 28, 16, 28,
- /* 1250 */ 27, 16, 20, 121, 31, 32, 33, 34, 28, 36,
- /* 1260 */ 28, 121, 39, 28, 16, 121, 83, 121, 36, 121,
- /* 1270 */ 87, 52, 121, 90, 91, 121, 28, 54, 55, 56,
- /* 1280 */ 57, 58, 99, 100, 61, 62, 103, 104, 105, 121,
- /* 1290 */ 107, 59, 121, 121, 15, 121, 17, 18, 121, 76,
- /* 1300 */ 21, 22, 121, 121, 121, 121, 27, 121, 121, 121,
- /* 1310 */ 31, 32, 33, 34, 121, 36, 121, 121, 39, 121,
- /* 1320 */ 121, 121, 83, 121, 121, 121, 87, 121, 121, 90,
- /* 1330 */ 91, 121, 1, 54, 55, 56, 57, 58, 99, 100,
- /* 1340 */ 61, 62, 103, 104, 105, 121, 107, 16, 121, 121,
- /* 1350 */ 15, 121, 17, 18, 121, 76, 21, 22, 121, 28,
- /* 1360 */ 29, 121, 27, 121, 121, 121, 31, 32, 33, 34,
- /* 1370 */ 121, 36, 121, 121, 39, 121, 121, 121, 83, 121,
- /* 1380 */ 121, 121, 87, 52, 121, 90, 91, 121, 1, 54,
- /* 1390 */ 55, 56, 57, 58, 99, 100, 61, 62, 103, 104,
- /* 1400 */ 105, 121, 107, 16, 121, 121, 15, 121, 17, 18,
- /* 1410 */ 121, 76, 21, 22, 121, 28, 121, 121, 27, 121,
- /* 1420 */ 121, 121, 31, 32, 33, 34, 121, 36, 121, 121,
- /* 1430 */ 39, 121, 121, 121, 83, 121, 121, 121, 87, 52,
- /* 1440 */ 121, 90, 91, 121, 1, 54, 55, 56, 57, 58,
- /* 1450 */ 99, 100, 61, 62, 103, 104, 105, 121, 107, 16,
- /* 1460 */ 121, 121, 15, 121, 17, 18, 121, 76, 21, 22,
- /* 1470 */ 121, 28, 121, 121, 27, 121, 121, 121, 31, 32,
- /* 1480 */ 33, 34, 121, 36, 121, 121, 39, 121, 121, 121,
- /* 1490 */ 83, 121, 121, 121, 87, 52, 121, 90, 91, 121,
- /* 1500 */ 121, 54, 55, 56, 57, 58, 99, 100, 61, 62,
- /* 1510 */ 103, 104, 105, 121, 107, 121, 121, 121, 15, 121,
- /* 1520 */ 17, 18, 121, 76, 21, 22, 121, 121, 121, 121,
- /* 1530 */ 27, 121, 121, 121, 31, 32, 33, 34, 121, 36,
- /* 1540 */ 121, 121, 39, 121, 121, 121, 83, 121, 121, 121,
- /* 1550 */ 87, 121, 121, 90, 91, 121, 121, 54, 55, 56,
- /* 1560 */ 57, 58, 99, 100, 61, 62, 103, 104, 105, 121,
- /* 1570 */ 107, 121, 121, 121, 15, 121, 17, 18, 121, 76,
- /* 1580 */ 21, 22, 121, 121, 121, 121, 27, 121, 121, 121,
- /* 1590 */ 31, 32, 33, 34, 121, 36, 121, 121, 39, 121,
- /* 1600 */ 121, 121, 83, 121, 121, 121, 87, 121, 121, 90,
- /* 1610 */ 91, 121, 121, 54, 55, 56, 57, 58, 99, 100,
- /* 1620 */ 61, 62, 103, 104, 105, 121, 107, 121, 121, 121,
- /* 1630 */ 15, 121, 17, 18, 121, 76, 21, 22, 121, 121,
- /* 1640 */ 121, 121, 27, 121, 121, 121, 31, 32, 33, 34,
- /* 1650 */ 121, 36, 121, 121, 39, 121, 121, 121, 83, 121,
- /* 1660 */ 121, 121, 87, 121, 121, 90, 91, 121, 121, 54,
- /* 1670 */ 55, 56, 57, 58, 99, 100, 61, 62, 103, 104,
- /* 1680 */ 105, 121, 107, 121, 121, 121, 15, 121, 17, 18,
- /* 1690 */ 121, 76, 21, 22, 121, 121, 121, 121, 27, 121,
- /* 1700 */ 121, 121, 31, 32, 33, 34, 121, 36, 121, 121,
- /* 1710 */ 39, 121, 121, 121, 83, 121, 121, 121, 87, 121,
- /* 1720 */ 121, 90, 91, 121, 121, 54, 55, 56, 57, 58,
- /* 1730 */ 99, 100, 61, 121, 103, 104, 105, 121, 107, 121,
- /* 1740 */ 121, 121, 15, 121, 17, 18, 121, 76, 21, 22,
- /* 1750 */ 121, 121, 121, 121, 27, 121, 121, 121, 31, 32,
- /* 1760 */ 33, 34, 121, 36, 88, 89, 39, 121, 121, 121,
- /* 1770 */ 121, 121, 121, 121, 98, 121, 121, 101, 102, 121,
- /* 1780 */ 16, 54, 55, 56, 57, 58, 121, 23, 61, 25,
- /* 1790 */ 26, 115, 28, 29, 121, 121, 121, 121, 121, 35,
- /* 1800 */ 36, 37, 121, 76, 121, 121, 121, 121, 121, 121,
- /* 1810 */ 121, 121, 121, 83, 121, 121, 52, 87, 121, 121,
- /* 1820 */ 90, 91, 121, 59, 121, 121, 121, 63, 121, 99,
- /* 1830 */ 100, 121, 121, 103, 104, 105, 121, 107, 83, 121,
- /* 1840 */ 121, 77, 87, 121, 121, 90, 91, 121, 118, 121,
- /* 1850 */ 121, 121, 121, 121, 99, 100, 121, 121, 103, 104,
- /* 1860 */ 105, 121, 107, 121, 83, 121, 121, 121, 87, 121,
- /* 1870 */ 121, 90, 91, 121, 83, 121, 121, 121, 87, 121,
- /* 1880 */ 99, 100, 91, 83, 103, 104, 105, 87, 107, 121,
- /* 1890 */ 90, 91, 121, 121, 103, 104, 105, 121, 107, 99,
- /* 1900 */ 100, 121, 121, 103, 104, 105, 121, 107, 121, 121,
- /* 1910 */ 121, 83, 121, 121, 121, 87, 121, 121, 90, 91,
- /* 1920 */ 121, 121, 83, 121, 121, 121, 87, 99, 100, 90,
- /* 1930 */ 91, 103, 104, 105, 121, 107, 121, 121, 99, 100,
- /* 1940 */ 121, 121, 103, 104, 105, 121, 107, 121, 83, 121,
- /* 1950 */ 121, 121, 87, 121, 121, 90, 91, 121, 83, 121,
- /* 1960 */ 121, 121, 87, 121, 99, 100, 91, 83, 103, 104,
- /* 1970 */ 105, 87, 107, 121, 90, 91, 121, 121, 103, 104,
- /* 1980 */ 105, 121, 107, 99, 100, 121, 121, 103, 104, 105,
- /* 1990 */ 121, 107, 121, 121, 121, 83, 121, 121, 121, 87,
- /* 2000 */ 121, 121, 90, 91, 121, 121, 83, 121, 121, 121,
- /* 2010 */ 87, 99, 100, 90, 91, 103, 104, 105, 121, 107,
- /* 2020 */ 121, 121, 99, 100, 121, 121, 103, 104, 105, 121,
- /* 2030 */ 107, 121, 83, 88, 89, 121, 87, 121, 121, 90,
- /* 2040 */ 91, 121, 121, 98, 121, 121, 101, 102, 99, 100,
- /* 2050 */ 121, 83, 103, 104, 105, 87, 107, 121, 90, 91,
- /* 2060 */ 115, 121, 121, 121, 88, 89, 121, 99, 100, 121,
- /* 2070 */ 121, 103, 104, 105, 98, 107, 121, 101, 102, 83,
- /* 2080 */ 121, 121, 121, 87, 121, 121, 90, 91, 121, 121,
- /* 2090 */ 83, 115, 121, 121, 87, 99, 100, 90, 91, 103,
- /* 2100 */ 104, 105, 121, 107, 121, 121, 99, 100, 121, 121,
- /* 2110 */ 103, 104, 105, 121, 107, 121, 83, 88, 89, 121,
- /* 2120 */ 87, 121, 121, 90, 91, 121, 121, 98, 121, 121,
- /* 2130 */ 101, 102, 99, 100, 121, 83, 103, 104, 105, 87,
- /* 2140 */ 107, 121, 90, 91, 115, 121, 121, 121, 88, 89,
- /* 2150 */ 121, 99, 100, 121, 121, 103, 104, 105, 98, 107,
- /* 2160 */ 121, 101, 102, 83, 121, 121, 121, 87, 121, 121,
- /* 2170 */ 90, 91, 121, 121, 83, 115, 121, 121, 87, 99,
- /* 2180 */ 100, 90, 91, 103, 104, 105, 121, 107, 121, 121,
- /* 2190 */ 99, 100, 121, 121, 103, 104, 105, 121, 107, 121,
- /* 2200 */ 83, 88, 89, 121, 87, 121, 121, 90, 91, 121,
- /* 2210 */ 121, 98, 121, 121, 101, 102, 99, 100, 121, 83,
- /* 2220 */ 103, 104, 105, 87, 107, 121, 90, 91, 115, 121,
- /* 2230 */ 121, 121, 121, 121, 121, 99, 100, 121, 121, 103,
- /* 2240 */ 104, 105, 121, 107, 121, 121, 121, 83, 121, 121,
- /* 2250 */ 121, 87, 121, 121, 90, 91, 121, 121, 83, 121,
- /* 2260 */ 121, 121, 87, 99, 100, 90, 91, 103, 104, 105,
- /* 2270 */ 121, 107, 121, 121, 99, 100, 121, 121, 103, 104,
- /* 2280 */ 105, 121, 107, 121, 83, 121, 121, 121, 87, 121,
- /* 2290 */ 121, 90, 91, 121, 121, 121, 121, 121, 121, 121,
- /* 2300 */ 99, 100, 121, 83, 103, 104, 105, 87, 107, 121,
- /* 2310 */ 90, 91, 121, 121, 121, 121, 121, 121, 121, 99,
- /* 2320 */ 100, 121, 121, 103, 104, 105, 121, 107, 121, 121,
- /* 2330 */ 121, 83, 121, 121, 121, 87, 121, 121, 90, 91,
- /* 2340 */ 121, 121, 83, 121, 121, 121, 87, 99, 100, 90,
- /* 2350 */ 91, 103, 104, 105, 121, 107, 121, 121, 99, 100,
- /* 2360 */ 121, 121, 103, 104, 105, 121, 107, 121, 83, 121,
- /* 2370 */ 121, 121, 87, 121, 121, 90, 91, 121, 121, 121,
- /* 2380 */ 121, 121, 121, 121, 99, 100, 121, 121, 103, 104,
- /* 2390 */ 105, 121, 107,
-);
- const YY_SHIFT_USE_DFLT = -5;
- const YY_SHIFT_MAX = 252;
- static public $yy_shift_ofst = array(
- /* 0 */ 1, 1391, 1391, 1223, 1167, 1167, 1167, 1223, 1111, 1167,
- /* 10 */ 1167, 1167, 1503, 1167, 1559, 1167, 1167, 1167, 1167, 1167,
- /* 20 */ 1167, 1167, 1167, 1167, 1167, 1615, 1167, 1167, 1167, 1167,
- /* 30 */ 1503, 1167, 1167, 1447, 1167, 1167, 1167, 1167, 1279, 1167,
- /* 40 */ 1167, 1167, 1279, 1167, 1335, 1335, 1727, 1671, 1727, 1727,
- /* 50 */ 1727, 1727, 1727, 224, 74, 149, -1, 755, 755, 755,
- /* 60 */ 956, 881, 806, 527, 326, 704, 275, 377, 653, 602,
- /* 70 */ 452, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007,
- /* 80 */ 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007,
- /* 90 */ 1046, 1046, 1232, 1443, 407, 1, 958, 73, 146, 225,
- /* 100 */ 546, 61, 61, 443, 443, 243, 371, 407, 407, 883,
- /* 110 */ 47, 1331, 11, 189, 1387, 1219, 226, 56, 138, 235,
- /* 120 */ 75, 887, 219, 366, 371, 367, 366, 366, 368, 293,
- /* 130 */ 371, 366, 917, 366, 366, 445, 366, 418, 366, 1248,
- /* 140 */ 368, 366, 300, 395, 293, 636, 629, 636, 616, 636,
- /* 150 */ 610, 636, 636, 636, 636, 616, 636, -5, 166, 167,
- /* 160 */ 601, 603, 873, 594, 148, 217, 148, 473, 947, 148,
- /* 170 */ 874, 878, 948, 1235, 148, 543, 1191, 1221, 148, 1230,
- /* 180 */ 563, 1188, 1121, 1118, 953, 949, 1181, 1174, 1180, 670,
- /* 190 */ 632, 632, 616, 616, 636, 616, 636, 102, 102, 396,
- /* 200 */ -5, -5, -5, -5, -5, 1764, 150, 22, 118, 71,
- /* 210 */ 176, -4, 486, 144, 144, 213, 270, 261, 296, 328,
- /* 220 */ 449, 271, 295, 615, 579, 560, 566, 441, 564, 396,
- /* 230 */ 528, 591, 551, 589, 571, 614, 552, 529, 539, 494,
- /* 240 */ 448, 492, 471, 450, 488, 469, 459, 511, 522, 510,
- /* 250 */ 496, 523, 500,
-);
- const YY_REDUCE_USE_DFLT = -86;
- const YY_REDUCE_MAX = 204;
- static public $yy_reduce_ofst = array(
- /* 0 */ -63, -7, 1730, 68, 446, 373, 143, 521, 2091, 2117,
- /* 10 */ 1800, 1407, 2080, 1884, 1912, 1575, 1949, 1923, 1865, 1968,
- /* 20 */ 1996, 2052, 2033, 2007, 1839, 1828, 1351, 1295, 1183, 1239,
- /* 30 */ 1463, 1519, 1781, 1755, 1631, 2175, 2248, 2201, 2164, 2285,
- /* 40 */ 2259, 2136, 2220, 1127, 379, 1048, 451, 1073, 804, 879,
- /* 50 */ 1875, 1791, 1088, 1976, 1945, 1676, 2060, 1676, 2113, 2029,
- /* 60 */ 798, 798, 798, 798, 798, 798, 798, 798, 798, 798,
- /* 70 */ 798, 798, 798, 798, 798, 798, 798, 798, 798, 798,
- /* 80 */ 798, 798, 798, 798, 798, 798, 798, 798, 798, 798,
- /* 90 */ 798, 798, 39, 113, 214, -81, 43, 442, -74, 20,
- /* 100 */ -10, 239, 264, 525, 517, 378, 188, 314, 291, 697,
- /* 110 */ 170, -6, 520, 248, -6, -6, 248, -6, 248, 246,
- /* 120 */ 172, -6, 172, 568, 313, 495, 495, 569, 570, 324,
- /* 130 */ 244, 292, 245, 420, 345, 172, 301, 495, 621, 491,
- /* 140 */ 495, 619, -6, 620, 325, -6, 211, -6, 147, -6,
- /* 150 */ 81, -6, -6, -6, -6, 172, -6, -6, 545, 549,
- /* 160 */ 536, 536, 536, 536, 530, 548, 530, 540, 536, 530,
- /* 170 */ 536, 536, 536, 536, 530, 540, 536, 536, 530, 536,
- /* 180 */ 540, 536, 536, 536, 536, 536, 536, 536, 536, 596,
- /* 190 */ 567, 588, 550, 550, 540, 550, 540, -85, -85, 331,
- /* 200 */ 306, 349, 337, 260, 134,
-);
- static public $yyExpectedTokens = array(
- /* 0 */ array(3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 15, 21, 22, 27, 31, 32, 33, ),
- /* 1 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 2 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 3 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 4 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 5 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 6 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 7 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 8 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 63, 76, ),
- /* 9 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 10 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 11 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 12 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 13 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 14 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 15 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 16 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 17 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 18 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 19 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 20 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 21 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 22 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 23 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 24 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 25 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 26 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 27 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 28 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 29 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 30 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 31 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 32 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 33 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 34 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 35 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 36 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 37 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 38 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 39 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 40 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 41 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 42 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 43 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 44 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 45 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 62, 76, ),
- /* 46 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 76, ),
- /* 47 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 76, ),
- /* 48 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 76, ),
- /* 49 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 76, ),
- /* 50 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 76, ),
- /* 51 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 76, ),
- /* 52 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 34, 36, 39, 54, 55, 56, 57, 58, 61, 76, ),
- /* 53 */ array(1, 16, 28, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 54 */ array(1, 16, 28, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 55 */ array(1, 16, 28, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 56 */ array(1, 26, 28, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 57 */ array(1, 28, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 58 */ array(1, 28, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 59 */ array(1, 28, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 60 */ array(1, 16, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 61 */ array(1, 16, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 62 */ array(1, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 63 */ array(1, 16, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 64 */ array(1, 29, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 65 */ array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 66 */ array(1, 2, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 67 */ array(1, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 77, ),
- /* 68 */ array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 69 */ array(1, 16, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 70 */ array(1, 23, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 71 */ array(1, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 72 */ array(1, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 73 */ array(1, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 74 */ array(1, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 75 */ array(1, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 76 */ array(1, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 77 */ array(1, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 78 */ array(1, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 79 */ array(1, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 80 */ array(1, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 81 */ array(1, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 82 */ array(1, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 83 */ array(1, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 84 */ array(1, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 85 */ array(1, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 86 */ array(1, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 87 */ array(1, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 88 */ array(1, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 89 */ array(1, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 90 */ array(38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 91 */ array(38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ),
- /* 92 */ array(1, 16, 20, 28, 36, 59, ),
- /* 93 */ array(1, 16, 28, 52, ),
- /* 94 */ array(1, 28, ),
- /* 95 */ array(3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 15, 21, 22, 27, 31, 32, 33, ),
- /* 96 */ array(10, 15, 21, 22, 27, 31, 32, 33, 76, 77, 78, ),
- /* 97 */ array(15, 18, 28, 30, ),
- /* 98 */ array(15, 18, 28, 30, ),
- /* 99 */ array(20, 57, 62, ),
- /* 100 */ array(1, 2, 16, ),
- /* 101 */ array(1, 16, 28, ),
- /* 102 */ array(1, 16, 28, ),
- /* 103 */ array(15, 18, 28, ),
- /* 104 */ array(15, 18, 28, ),
- /* 105 */ array(17, 18, 61, ),
- /* 106 */ array(17, 36, ),
- /* 107 */ array(1, 28, ),
- /* 108 */ array(1, 28, ),
- /* 109 */ array(10, 15, 21, 22, 27, 31, 32, 33, 76, 77, 78, ),
- /* 110 */ array(4, 5, 6, 7, 8, 12, 13, 14, ),
- /* 111 */ array(1, 16, 28, 29, 52, ),
- /* 112 */ array(15, 18, 19, 24, ),
- /* 113 */ array(15, 18, 19, 60, ),
- /* 114 */ array(1, 16, 28, 52, ),
- /* 115 */ array(1, 16, 28, 52, ),
- /* 116 */ array(15, 18, 60, ),
- /* 117 */ array(1, 30, 52, ),
- /* 118 */ array(15, 18, 19, ),
- /* 119 */ array(1, 16, 20, ),
- /* 120 */ array(19, 20, 59, ),
- /* 121 */ array(1, 16, 52, ),
- /* 122 */ array(19, 20, 59, ),
- /* 123 */ array(15, 18, ),
- /* 124 */ array(17, 36, ),
- /* 125 */ array(15, 18, ),
- /* 126 */ array(15, 18, ),
- /* 127 */ array(15, 18, ),
- /* 128 */ array(15, 18, ),
- /* 129 */ array(17, 18, ),
- /* 130 */ array(17, 36, ),
- /* 131 */ array(15, 18, ),
- /* 132 */ array(1, 16, ),
- /* 133 */ array(15, 18, ),
- /* 134 */ array(15, 18, ),
- /* 135 */ array(20, 59, ),
- /* 136 */ array(15, 18, ),
- /* 137 */ array(15, 18, ),
- /* 138 */ array(15, 18, ),
- /* 139 */ array(16, 28, ),
- /* 140 */ array(15, 18, ),
- /* 141 */ array(15, 18, ),
- /* 142 */ array(1, 52, ),
- /* 143 */ array(15, 18, ),
- /* 144 */ array(17, 18, ),
- /* 145 */ array(1, ),
- /* 146 */ array(28, ),
- /* 147 */ array(1, ),
- /* 148 */ array(20, ),
- /* 149 */ array(1, ),
- /* 150 */ array(28, ),
- /* 151 */ array(1, ),
- /* 152 */ array(1, ),
- /* 153 */ array(1, ),
- /* 154 */ array(1, ),
- /* 155 */ array(20, ),
- /* 156 */ array(1, ),
- /* 157 */ array(),
- /* 158 */ array(15, 17, 18, ),
- /* 159 */ array(15, 18, 60, ),
- /* 160 */ array(16, 28, ),
- /* 161 */ array(16, 28, ),
- /* 162 */ array(16, 28, ),
- /* 163 */ array(16, 28, ),
- /* 164 */ array(57, 62, ),
- /* 165 */ array(15, 36, ),
- /* 166 */ array(57, 62, ),
- /* 167 */ array(1, 16, ),
- /* 168 */ array(16, 28, ),
- /* 169 */ array(57, 62, ),
- /* 170 */ array(16, 28, ),
- /* 171 */ array(16, 28, ),
- /* 172 */ array(16, 28, ),
- /* 173 */ array(16, 28, ),
- /* 174 */ array(57, 62, ),
- /* 175 */ array(1, 16, ),
- /* 176 */ array(16, 28, ),
- /* 177 */ array(16, 28, ),
- /* 178 */ array(57, 62, ),
- /* 179 */ array(16, 28, ),
- /* 180 */ array(1, 16, ),
- /* 181 */ array(16, 28, ),
- /* 182 */ array(16, 28, ),
- /* 183 */ array(16, 28, ),
- /* 184 */ array(16, 28, ),
- /* 185 */ array(16, 28, ),
- /* 186 */ array(16, 28, ),
- /* 187 */ array(16, 28, ),
- /* 188 */ array(16, 28, ),
- /* 189 */ array(13, ),
- /* 190 */ array(28, ),
- /* 191 */ array(28, ),
- /* 192 */ array(20, ),
- /* 193 */ array(20, ),
- /* 194 */ array(1, ),
- /* 195 */ array(20, ),
- /* 196 */ array(1, ),
- /* 197 */ array(2, ),
- /* 198 */ array(2, ),
- /* 199 */ array(36, ),
- /* 200 */ array(),
- /* 201 */ array(),
- /* 202 */ array(),
- /* 203 */ array(),
- /* 204 */ array(),
- /* 205 */ array(16, 23, 25, 26, 28, 29, 35, 36, 37, 52, 59, 63, 77, ),
- /* 206 */ array(16, 19, 28, 36, 59, ),
- /* 207 */ array(36, 57, 59, 63, ),
- /* 208 */ array(15, 17, 18, 34, ),
- /* 209 */ array(16, 28, 36, 59, ),
- /* 210 */ array(30, 36, 59, ),
- /* 211 */ array(18, 60, ),
- /* 212 */ array(2, 19, ),
- /* 213 */ array(36, 59, ),
- /* 214 */ array(36, 59, ),
- /* 215 */ array(16, 24, ),
- /* 216 */ array(35, 37, ),
- /* 217 */ array(24, 77, ),
- /* 218 */ array(35, 63, ),
- /* 219 */ array(23, 35, ),
- /* 220 */ array(19, 57, ),
- /* 221 */ array(35, 37, ),
- /* 222 */ array(35, 37, ),
- /* 223 */ array(18, ),
- /* 224 */ array(2, ),
- /* 225 */ array(24, ),
- /* 226 */ array(17, ),
- /* 227 */ array(18, ),
- /* 228 */ array(18, ),
- /* 229 */ array(36, ),
- /* 230 */ array(57, ),
- /* 231 */ array(18, ),
- /* 232 */ array(36, ),
- /* 233 */ array(18, ),
- /* 234 */ array(17, ),
- /* 235 */ array(18, ),
- /* 236 */ array(34, ),
- /* 237 */ array(34, ),
- /* 238 */ array(18, ),
- /* 239 */ array(17, ),
- /* 240 */ array(61, ),
- /* 241 */ array(18, ),
- /* 242 */ array(37, ),
- /* 243 */ array(17, ),
- /* 244 */ array(19, ),
- /* 245 */ array(63, ),
- /* 246 */ array(53, ),
- /* 247 */ array(2, ),
- /* 248 */ array(17, ),
- /* 249 */ array(25, ),
- /* 250 */ array(18, ),
- /* 251 */ array(18, ),
- /* 252 */ array(61, ),
- /* 253 */ array(),
- /* 254 */ array(),
- /* 255 */ array(),
- /* 256 */ array(),
- /* 257 */ array(),
- /* 258 */ array(),
- /* 259 */ array(),
- /* 260 */ array(),
- /* 261 */ array(),
- /* 262 */ array(),
- /* 263 */ array(),
- /* 264 */ array(),
- /* 265 */ array(),
- /* 266 */ array(),
- /* 267 */ array(),
- /* 268 */ array(),
- /* 269 */ array(),
- /* 270 */ array(),
- /* 271 */ array(),
- /* 272 */ array(),
- /* 273 */ array(),
- /* 274 */ array(),
- /* 275 */ array(),
- /* 276 */ array(),
- /* 277 */ array(),
- /* 278 */ array(),
- /* 279 */ array(),
- /* 280 */ array(),
- /* 281 */ array(),
- /* 282 */ array(),
- /* 283 */ array(),
- /* 284 */ array(),
- /* 285 */ array(),
- /* 286 */ array(),
- /* 287 */ array(),
- /* 288 */ array(),
- /* 289 */ array(),
- /* 290 */ array(),
- /* 291 */ array(),
- /* 292 */ array(),
- /* 293 */ array(),
- /* 294 */ array(),
- /* 295 */ array(),
- /* 296 */ array(),
- /* 297 */ array(),
- /* 298 */ array(),
- /* 299 */ array(),
- /* 300 */ array(),
- /* 301 */ array(),
- /* 302 */ array(),
- /* 303 */ array(),
- /* 304 */ array(),
- /* 305 */ array(),
- /* 306 */ array(),
- /* 307 */ array(),
- /* 308 */ array(),
- /* 309 */ array(),
- /* 310 */ array(),
- /* 311 */ array(),
- /* 312 */ array(),
- /* 313 */ array(),
- /* 314 */ array(),
- /* 315 */ array(),
- /* 316 */ array(),
- /* 317 */ array(),
- /* 318 */ array(),
- /* 319 */ array(),
- /* 320 */ array(),
- /* 321 */ array(),
- /* 322 */ array(),
- /* 323 */ array(),
- /* 324 */ array(),
- /* 325 */ array(),
- /* 326 */ array(),
- /* 327 */ array(),
- /* 328 */ array(),
- /* 329 */ array(),
- /* 330 */ array(),
- /* 331 */ array(),
- /* 332 */ array(),
- /* 333 */ array(),
- /* 334 */ array(),
- /* 335 */ array(),
- /* 336 */ array(),
- /* 337 */ array(),
- /* 338 */ array(),
- /* 339 */ array(),
- /* 340 */ array(),
- /* 341 */ array(),
- /* 342 */ array(),
- /* 343 */ array(),
- /* 344 */ array(),
- /* 345 */ array(),
- /* 346 */ array(),
- /* 347 */ array(),
- /* 348 */ array(),
- /* 349 */ array(),
- /* 350 */ array(),
- /* 351 */ array(),
- /* 352 */ array(),
- /* 353 */ array(),
- /* 354 */ array(),
- /* 355 */ array(),
- /* 356 */ array(),
- /* 357 */ array(),
- /* 358 */ array(),
- /* 359 */ array(),
- /* 360 */ array(),
- /* 361 */ array(),
- /* 362 */ array(),
- /* 363 */ array(),
- /* 364 */ array(),
- /* 365 */ array(),
- /* 366 */ array(),
- /* 367 */ array(),
- /* 368 */ array(),
- /* 369 */ array(),
- /* 370 */ array(),
- /* 371 */ array(),
- /* 372 */ array(),
- /* 373 */ array(),
- /* 374 */ array(),
- /* 375 */ array(),
- /* 376 */ array(),
- /* 377 */ array(),
- /* 378 */ array(),
- /* 379 */ array(),
- /* 380 */ array(),
- /* 381 */ array(),
- /* 382 */ array(),
- /* 383 */ array(),
- /* 384 */ array(),
- /* 385 */ array(),
- /* 386 */ array(),
-);
- static public $yy_default = array(
- /* 0 */ 390, 571, 588, 588, 542, 542, 542, 588, 588, 588,
- /* 10 */ 588, 588, 588, 588, 588, 588, 588, 588, 588, 588,
- /* 20 */ 588, 588, 588, 588, 588, 588, 588, 588, 588, 588,
- /* 30 */ 588, 588, 588, 588, 588, 588, 588, 588, 588, 588,
- /* 40 */ 588, 588, 588, 588, 588, 588, 588, 588, 588, 588,
- /* 50 */ 588, 588, 588, 588, 588, 588, 450, 450, 450, 450,
- /* 60 */ 588, 588, 588, 588, 455, 588, 588, 588, 588, 588,
- /* 70 */ 588, 573, 457, 541, 574, 455, 471, 460, 540, 480,
- /* 80 */ 484, 432, 461, 452, 479, 483, 572, 474, 475, 476,
- /* 90 */ 487, 488, 499, 463, 450, 387, 588, 450, 450, 554,
- /* 100 */ 588, 507, 470, 450, 450, 588, 588, 450, 450, 588,
- /* 110 */ 588, 463, 588, 515, 463, 463, 515, 463, 515, 588,
- /* 120 */ 508, 463, 508, 588, 588, 588, 588, 588, 588, 588,
- /* 130 */ 588, 588, 588, 588, 588, 508, 515, 588, 588, 588,
- /* 140 */ 588, 588, 463, 588, 588, 467, 450, 473, 551, 490,
- /* 150 */ 450, 468, 486, 491, 492, 508, 466, 549, 588, 516,
- /* 160 */ 588, 588, 588, 588, 533, 515, 532, 588, 588, 513,
- /* 170 */ 588, 588, 588, 588, 534, 588, 588, 588, 535, 588,
- /* 180 */ 588, 588, 588, 588, 588, 588, 588, 588, 588, 405,
- /* 190 */ 587, 587, 529, 555, 470, 552, 507, 543, 544, 515,
- /* 200 */ 515, 515, 548, 548, 548, 465, 499, 499, 588, 499,
- /* 210 */ 499, 588, 527, 485, 499, 489, 588, 489, 588, 588,
- /* 220 */ 495, 588, 588, 588, 527, 489, 588, 588, 588, 527,
- /* 230 */ 495, 588, 553, 588, 588, 588, 497, 588, 588, 588,
- /* 240 */ 588, 588, 588, 588, 588, 588, 501, 527, 588, 458,
- /* 250 */ 588, 588, 588, 435, 524, 439, 501, 523, 511, 569,
- /* 260 */ 521, 415, 522, 570, 520, 388, 537, 512, 440, 462,
- /* 270 */ 459, 429, 550, 586, 430, 536, 528, 538, 539, 434,
- /* 280 */ 433, 565, 441, 527, 442, 547, 443, 526, 438, 449,
- /* 290 */ 428, 431, 436, 437, 444, 445, 498, 496, 504, 464,
- /* 300 */ 465, 494, 493, 545, 546, 446, 447, 427, 448, 397,
- /* 310 */ 396, 398, 399, 400, 395, 394, 389, 391, 392, 393,
- /* 320 */ 401, 402, 411, 410, 412, 413, 414, 409, 408, 403,
- /* 330 */ 404, 406, 407, 509, 514, 421, 420, 530, 422, 423,
- /* 340 */ 419, 418, 531, 510, 416, 417, 583, 424, 426, 581,
- /* 350 */ 579, 584, 585, 578, 580, 577, 425, 582, 575, 576,
- /* 360 */ 506, 469, 503, 502, 505, 477, 478, 472, 500, 517,
- /* 370 */ 525, 518, 519, 481, 482, 563, 562, 564, 566, 567,
- /* 380 */ 561, 560, 556, 557, 558, 559, 568,
-);
- const YYNOCODE = 122;
- const YYSTACKDEPTH = 100;
- const YYNSTATE = 387;
- const YYNRULE = 201;
- const YYERRORSYMBOL = 79;
- const YYERRSYMDT = 'yy0';
- const YYFALLBACK = 0;
- static public $yyFallback = array(
- );
- static function Trace($TraceFILE, $zTracePrompt)
- {
- if (!$TraceFILE) {
- $zTracePrompt = 0;
- } elseif (!$zTracePrompt) {
- $TraceFILE = 0;
- }
- self::$yyTraceFILE = $TraceFILE;
- self::$yyTracePrompt = $zTracePrompt;
- }
-
- static function PrintTrace()
- {
- self::$yyTraceFILE = fopen('php://output', 'w');
- self::$yyTracePrompt = '
';
- }
-
- static public $yyTraceFILE;
- static public $yyTracePrompt;
- public $yyidx; /* Index of top element in stack */
- public $yyerrcnt; /* Shifts left before out of the error */
- public $yystack = array(); /* The parser's stack */
-
- public $yyTokenName = array(
- '$', 'VERT', 'COLON', 'COMMENT',
- 'PHPSTARTTAG', 'PHPENDTAG', 'ASPSTARTTAG', 'ASPENDTAG',
- 'FAKEPHPSTARTTAG', 'XMLTAG', 'OTHER', 'LINEBREAK',
- 'LITERALSTART', 'LITERALEND', 'LITERAL', 'LDEL',
- 'RDEL', 'DOLLAR', 'ID', 'EQUAL',
- 'PTR', 'LDELIF', 'LDELFOR', 'SEMICOLON',
- 'INCDEC', 'TO', 'STEP', 'LDELFOREACH',
- 'SPACE', 'AS', 'APTR', 'LDELSETFILTER',
- 'SMARTYBLOCKCHILD', 'LDELSLASH', 'INTEGER', 'COMMA',
- 'OPENP', 'CLOSEP', 'MATH', 'UNIMATH',
- 'ANDSYM', 'ISIN', 'ISDIVBY', 'ISNOTDIVBY',
- 'ISEVEN', 'ISNOTEVEN', 'ISEVENBY', 'ISNOTEVENBY',
- 'ISODD', 'ISNOTODD', 'ISODDBY', 'ISNOTODDBY',
- 'INSTANCEOF', 'QMARK', 'NOT', 'TYPECAST',
- 'HEX', 'DOT', 'SINGLEQUOTESTRING', 'DOUBLECOLON',
- 'AT', 'HATCH', 'OPENB', 'CLOSEB',
- 'EQUALS', 'NOTEQUALS', 'GREATERTHAN', 'LESSTHAN',
- 'GREATEREQUAL', 'LESSEQUAL', 'IDENTITY', 'NONEIDENTITY',
- 'MOD', 'LAND', 'LOR', 'LXOR',
- 'QUOTE', 'BACKTICK', 'DOLLARID', 'error',
- 'start', 'template', 'template_element', 'smartytag',
- 'literal', 'literal_elements', 'literal_element', 'value',
- 'modifierlist', 'attributes', 'expr', 'varindexed',
- 'statement', 'statements', 'optspace', 'varvar',
- 'foraction', 'modparameters', 'attribute', 'ternary',
- 'array', 'ifcond', 'lop', 'variable',
- 'function', 'doublequoted_with_quotes', 'static_class_access', 'object',
- 'arrayindex', 'indexdef', 'varvarele', 'objectchain',
- 'objectelement', 'method', 'params', 'modifier',
- 'modparameter', 'arrayelements', 'arrayelement', 'doublequoted',
- 'doublequotedcontent',
- );
-
- static public $yyRuleName = array(
- /* 0 */ "start ::= template",
- /* 1 */ "template ::= template_element",
- /* 2 */ "template ::= template template_element",
- /* 3 */ "template ::=",
- /* 4 */ "template_element ::= smartytag",
- /* 5 */ "template_element ::= COMMENT",
- /* 6 */ "template_element ::= literal",
- /* 7 */ "template_element ::= PHPSTARTTAG",
- /* 8 */ "template_element ::= PHPENDTAG",
- /* 9 */ "template_element ::= ASPSTARTTAG",
- /* 10 */ "template_element ::= ASPENDTAG",
- /* 11 */ "template_element ::= FAKEPHPSTARTTAG",
- /* 12 */ "template_element ::= XMLTAG",
- /* 13 */ "template_element ::= OTHER",
- /* 14 */ "template_element ::= LINEBREAK",
- /* 15 */ "literal ::= LITERALSTART LITERALEND",
- /* 16 */ "literal ::= LITERALSTART literal_elements LITERALEND",
- /* 17 */ "literal_elements ::= literal_elements literal_element",
- /* 18 */ "literal_elements ::=",
- /* 19 */ "literal_element ::= literal",
- /* 20 */ "literal_element ::= LITERAL",
- /* 21 */ "literal_element ::= PHPSTARTTAG",
- /* 22 */ "literal_element ::= FAKEPHPSTARTTAG",
- /* 23 */ "literal_element ::= PHPENDTAG",
- /* 24 */ "literal_element ::= ASPSTARTTAG",
- /* 25 */ "literal_element ::= ASPENDTAG",
- /* 26 */ "smartytag ::= LDEL value RDEL",
- /* 27 */ "smartytag ::= LDEL value modifierlist attributes RDEL",
- /* 28 */ "smartytag ::= LDEL value attributes RDEL",
- /* 29 */ "smartytag ::= LDEL expr modifierlist attributes RDEL",
- /* 30 */ "smartytag ::= LDEL expr attributes RDEL",
- /* 31 */ "smartytag ::= LDEL DOLLAR ID EQUAL value RDEL",
- /* 32 */ "smartytag ::= LDEL DOLLAR ID EQUAL expr RDEL",
- /* 33 */ "smartytag ::= LDEL DOLLAR ID EQUAL expr attributes RDEL",
- /* 34 */ "smartytag ::= LDEL varindexed EQUAL expr attributes RDEL",
- /* 35 */ "smartytag ::= LDEL ID attributes RDEL",
- /* 36 */ "smartytag ::= LDEL ID RDEL",
- /* 37 */ "smartytag ::= LDEL ID PTR ID attributes RDEL",
- /* 38 */ "smartytag ::= LDEL ID modifierlist attributes RDEL",
- /* 39 */ "smartytag ::= LDEL ID PTR ID modifierlist attributes RDEL",
- /* 40 */ "smartytag ::= LDELIF expr RDEL",
- /* 41 */ "smartytag ::= LDELIF expr attributes RDEL",
- /* 42 */ "smartytag ::= LDELIF statement RDEL",
- /* 43 */ "smartytag ::= LDELIF statement attributes RDEL",
- /* 44 */ "smartytag ::= LDELFOR statements SEMICOLON optspace expr SEMICOLON optspace DOLLAR varvar foraction attributes RDEL",
- /* 45 */ "foraction ::= EQUAL expr",
- /* 46 */ "foraction ::= INCDEC",
- /* 47 */ "smartytag ::= LDELFOR statement TO expr attributes RDEL",
- /* 48 */ "smartytag ::= LDELFOR statement TO expr STEP expr attributes RDEL",
- /* 49 */ "smartytag ::= LDELFOREACH attributes RDEL",
- /* 50 */ "smartytag ::= LDELFOREACH SPACE value AS DOLLAR varvar attributes RDEL",
- /* 51 */ "smartytag ::= LDELFOREACH SPACE value AS DOLLAR varvar APTR DOLLAR varvar attributes RDEL",
- /* 52 */ "smartytag ::= LDELFOREACH SPACE expr AS DOLLAR varvar attributes RDEL",
- /* 53 */ "smartytag ::= LDELFOREACH SPACE expr AS DOLLAR varvar APTR DOLLAR varvar attributes RDEL",
- /* 54 */ "smartytag ::= LDELSETFILTER ID modparameters RDEL",
- /* 55 */ "smartytag ::= LDELSETFILTER ID modparameters modifierlist RDEL",
- /* 56 */ "smartytag ::= SMARTYBLOCKCHILD",
- /* 57 */ "smartytag ::= LDELSLASH ID RDEL",
- /* 58 */ "smartytag ::= LDELSLASH ID modifierlist RDEL",
- /* 59 */ "smartytag ::= LDELSLASH ID PTR ID RDEL",
- /* 60 */ "smartytag ::= LDELSLASH ID PTR ID modifierlist RDEL",
- /* 61 */ "attributes ::= attributes attribute",
- /* 62 */ "attributes ::= attribute",
- /* 63 */ "attributes ::=",
- /* 64 */ "attribute ::= SPACE ID EQUAL ID",
- /* 65 */ "attribute ::= SPACE ID EQUAL expr",
- /* 66 */ "attribute ::= SPACE ID EQUAL value",
- /* 67 */ "attribute ::= SPACE ID",
- /* 68 */ "attribute ::= SPACE expr",
- /* 69 */ "attribute ::= SPACE value",
- /* 70 */ "attribute ::= SPACE INTEGER EQUAL expr",
- /* 71 */ "statements ::= statement",
- /* 72 */ "statements ::= statements COMMA statement",
- /* 73 */ "statement ::= DOLLAR varvar EQUAL expr",
- /* 74 */ "statement ::= varindexed EQUAL expr",
- /* 75 */ "statement ::= OPENP statement CLOSEP",
- /* 76 */ "expr ::= value",
- /* 77 */ "expr ::= ternary",
- /* 78 */ "expr ::= DOLLAR ID COLON ID",
- /* 79 */ "expr ::= expr MATH value",
- /* 80 */ "expr ::= expr UNIMATH value",
- /* 81 */ "expr ::= expr ANDSYM value",
- /* 82 */ "expr ::= array",
- /* 83 */ "expr ::= expr modifierlist",
- /* 84 */ "expr ::= expr ifcond expr",
- /* 85 */ "expr ::= expr ISIN array",
- /* 86 */ "expr ::= expr ISIN value",
- /* 87 */ "expr ::= expr lop expr",
- /* 88 */ "expr ::= expr ISDIVBY expr",
- /* 89 */ "expr ::= expr ISNOTDIVBY expr",
- /* 90 */ "expr ::= expr ISEVEN",
- /* 91 */ "expr ::= expr ISNOTEVEN",
- /* 92 */ "expr ::= expr ISEVENBY expr",
- /* 93 */ "expr ::= expr ISNOTEVENBY expr",
- /* 94 */ "expr ::= expr ISODD",
- /* 95 */ "expr ::= expr ISNOTODD",
- /* 96 */ "expr ::= expr ISODDBY expr",
- /* 97 */ "expr ::= expr ISNOTODDBY expr",
- /* 98 */ "expr ::= value INSTANCEOF ID",
- /* 99 */ "expr ::= value INSTANCEOF value",
- /* 100 */ "ternary ::= OPENP expr CLOSEP QMARK DOLLAR ID COLON expr",
- /* 101 */ "ternary ::= OPENP expr CLOSEP QMARK expr COLON expr",
- /* 102 */ "value ::= variable",
- /* 103 */ "value ::= UNIMATH value",
- /* 104 */ "value ::= NOT value",
- /* 105 */ "value ::= TYPECAST value",
- /* 106 */ "value ::= variable INCDEC",
- /* 107 */ "value ::= HEX",
- /* 108 */ "value ::= INTEGER",
- /* 109 */ "value ::= INTEGER DOT INTEGER",
- /* 110 */ "value ::= INTEGER DOT",
- /* 111 */ "value ::= DOT INTEGER",
- /* 112 */ "value ::= ID",
- /* 113 */ "value ::= function",
- /* 114 */ "value ::= OPENP expr CLOSEP",
- /* 115 */ "value ::= SINGLEQUOTESTRING",
- /* 116 */ "value ::= doublequoted_with_quotes",
- /* 117 */ "value ::= ID DOUBLECOLON static_class_access",
- /* 118 */ "value ::= varindexed DOUBLECOLON static_class_access",
- /* 119 */ "value ::= smartytag",
- /* 120 */ "value ::= value modifierlist",
- /* 121 */ "variable ::= varindexed",
- /* 122 */ "variable ::= DOLLAR varvar AT ID",
- /* 123 */ "variable ::= object",
- /* 124 */ "variable ::= HATCH ID HATCH",
- /* 125 */ "variable ::= HATCH variable HATCH",
- /* 126 */ "varindexed ::= DOLLAR varvar arrayindex",
- /* 127 */ "arrayindex ::= arrayindex indexdef",
- /* 128 */ "arrayindex ::=",
- /* 129 */ "indexdef ::= DOT DOLLAR varvar",
- /* 130 */ "indexdef ::= DOT DOLLAR varvar AT ID",
- /* 131 */ "indexdef ::= DOT ID",
- /* 132 */ "indexdef ::= DOT INTEGER",
- /* 133 */ "indexdef ::= DOT LDEL expr RDEL",
- /* 134 */ "indexdef ::= OPENB ID CLOSEB",
- /* 135 */ "indexdef ::= OPENB ID DOT ID CLOSEB",
- /* 136 */ "indexdef ::= OPENB expr CLOSEB",
- /* 137 */ "indexdef ::= OPENB CLOSEB",
- /* 138 */ "varvar ::= varvarele",
- /* 139 */ "varvar ::= varvar varvarele",
- /* 140 */ "varvarele ::= ID",
- /* 141 */ "varvarele ::= LDEL expr RDEL",
- /* 142 */ "object ::= varindexed objectchain",
- /* 143 */ "objectchain ::= objectelement",
- /* 144 */ "objectchain ::= objectchain objectelement",
- /* 145 */ "objectelement ::= PTR ID arrayindex",
- /* 146 */ "objectelement ::= PTR DOLLAR varvar arrayindex",
- /* 147 */ "objectelement ::= PTR LDEL expr RDEL arrayindex",
- /* 148 */ "objectelement ::= PTR ID LDEL expr RDEL arrayindex",
- /* 149 */ "objectelement ::= PTR method",
- /* 150 */ "function ::= ID OPENP params CLOSEP",
- /* 151 */ "method ::= ID OPENP params CLOSEP",
- /* 152 */ "method ::= DOLLAR ID OPENP params CLOSEP",
- /* 153 */ "params ::= params COMMA expr",
- /* 154 */ "params ::= expr",
- /* 155 */ "params ::=",
- /* 156 */ "modifierlist ::= modifierlist modifier modparameters",
- /* 157 */ "modifierlist ::= modifier modparameters",
- /* 158 */ "modifier ::= VERT AT ID",
- /* 159 */ "modifier ::= VERT ID",
- /* 160 */ "modparameters ::= modparameters modparameter",
- /* 161 */ "modparameters ::=",
- /* 162 */ "modparameter ::= COLON value",
- /* 163 */ "modparameter ::= COLON array",
- /* 164 */ "static_class_access ::= method",
- /* 165 */ "static_class_access ::= method objectchain",
- /* 166 */ "static_class_access ::= ID",
- /* 167 */ "static_class_access ::= DOLLAR ID arrayindex",
- /* 168 */ "static_class_access ::= DOLLAR ID arrayindex objectchain",
- /* 169 */ "ifcond ::= EQUALS",
- /* 170 */ "ifcond ::= NOTEQUALS",
- /* 171 */ "ifcond ::= GREATERTHAN",
- /* 172 */ "ifcond ::= LESSTHAN",
- /* 173 */ "ifcond ::= GREATEREQUAL",
- /* 174 */ "ifcond ::= LESSEQUAL",
- /* 175 */ "ifcond ::= IDENTITY",
- /* 176 */ "ifcond ::= NONEIDENTITY",
- /* 177 */ "ifcond ::= MOD",
- /* 178 */ "lop ::= LAND",
- /* 179 */ "lop ::= LOR",
- /* 180 */ "lop ::= LXOR",
- /* 181 */ "array ::= OPENB arrayelements CLOSEB",
- /* 182 */ "arrayelements ::= arrayelement",
- /* 183 */ "arrayelements ::= arrayelements COMMA arrayelement",
- /* 184 */ "arrayelements ::=",
- /* 185 */ "arrayelement ::= value APTR expr",
- /* 186 */ "arrayelement ::= ID APTR expr",
- /* 187 */ "arrayelement ::= expr",
- /* 188 */ "doublequoted_with_quotes ::= QUOTE QUOTE",
- /* 189 */ "doublequoted_with_quotes ::= QUOTE doublequoted QUOTE",
- /* 190 */ "doublequoted ::= doublequoted doublequotedcontent",
- /* 191 */ "doublequoted ::= doublequotedcontent",
- /* 192 */ "doublequotedcontent ::= BACKTICK variable BACKTICK",
- /* 193 */ "doublequotedcontent ::= BACKTICK expr BACKTICK",
- /* 194 */ "doublequotedcontent ::= DOLLARID",
- /* 195 */ "doublequotedcontent ::= LDEL variable RDEL",
- /* 196 */ "doublequotedcontent ::= LDEL expr RDEL",
- /* 197 */ "doublequotedcontent ::= smartytag",
- /* 198 */ "doublequotedcontent ::= OTHER",
- /* 199 */ "optspace ::= SPACE",
- /* 200 */ "optspace ::=",
- );
-
- function tokenName($tokenType)
- {
- if ($tokenType === 0) {
- return 'End of Input';
- }
- if ($tokenType > 0 && $tokenType < count($this->yyTokenName)) {
- return $this->yyTokenName[$tokenType];
- } else {
- return "Unknown";
- }
- }
-
- static function yy_destructor($yymajor, $yypminor)
- {
- switch ($yymajor) {
- default: break; /* If no destructor action specified: do nothing */
- }
- }
-
- function yy_pop_parser_stack()
- {
- if (!count($this->yystack)) {
- return;
- }
- $yytos = array_pop($this->yystack);
- if (self::$yyTraceFILE && $this->yyidx >= 0) {
- fwrite(self::$yyTraceFILE,
- self::$yyTracePrompt . 'Popping ' . $this->yyTokenName[$yytos->major] .
- "\n");
- }
- $yymajor = $yytos->major;
- self::yy_destructor($yymajor, $yytos->minor);
- $this->yyidx--;
- return $yymajor;
- }
-
- function __destruct()
- {
- while ($this->yystack !== Array()) {
- $this->yy_pop_parser_stack();
- }
- if (is_resource(self::$yyTraceFILE)) {
- fclose(self::$yyTraceFILE);
- }
- }
-
- function yy_get_expected_tokens($token)
- {
- $state = $this->yystack[$this->yyidx]->stateno;
- $expected = self::$yyExpectedTokens[$state];
- if (in_array($token, self::$yyExpectedTokens[$state], true)) {
- return $expected;
- }
- $stack = $this->yystack;
- $yyidx = $this->yyidx;
- do {
- $yyact = $this->yy_find_shift_action($token);
- if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {
- // reduce action
- $done = 0;
- do {
- if ($done++ == 100) {
- $this->yyidx = $yyidx;
- $this->yystack = $stack;
- // too much recursion prevents proper detection
- // so give up
- return array_unique($expected);
- }
- $yyruleno = $yyact - self::YYNSTATE;
- $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs'];
- $nextstate = $this->yy_find_reduce_action(
- $this->yystack[$this->yyidx]->stateno,
- self::$yyRuleInfo[$yyruleno]['lhs']);
- if (isset(self::$yyExpectedTokens[$nextstate])) {
- $expected = array_merge($expected, self::$yyExpectedTokens[$nextstate]);
- if (in_array($token,
- self::$yyExpectedTokens[$nextstate], true)) {
- $this->yyidx = $yyidx;
- $this->yystack = $stack;
- return array_unique($expected);
- }
- }
- if ($nextstate < self::YYNSTATE) {
- // we need to shift a non-terminal
- $this->yyidx++;
- $x = new TP_yyStackEntry;
- $x->stateno = $nextstate;
- $x->major = self::$yyRuleInfo[$yyruleno]['lhs'];
- $this->yystack[$this->yyidx] = $x;
- continue 2;
- } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) {
- $this->yyidx = $yyidx;
- $this->yystack = $stack;
- // the last token was just ignored, we can't accept
- // by ignoring input, this is in essence ignoring a
- // syntax error!
- return array_unique($expected);
- } elseif ($nextstate === self::YY_NO_ACTION) {
- $this->yyidx = $yyidx;
- $this->yystack = $stack;
- // input accepted, but not shifted (I guess)
- return $expected;
- } else {
- $yyact = $nextstate;
- }
- } while (true);
- }
- break;
- } while (true);
- $this->yyidx = $yyidx;
- $this->yystack = $stack;
- return array_unique($expected);
- }
-
- function yy_is_expected_token($token)
- {
- if ($token === 0) {
- return true; // 0 is not part of this
- }
- $state = $this->yystack[$this->yyidx]->stateno;
- if (in_array($token, self::$yyExpectedTokens[$state], true)) {
- return true;
- }
- $stack = $this->yystack;
- $yyidx = $this->yyidx;
- do {
- $yyact = $this->yy_find_shift_action($token);
- if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {
- // reduce action
- $done = 0;
- do {
- if ($done++ == 100) {
- $this->yyidx = $yyidx;
- $this->yystack = $stack;
- // too much recursion prevents proper detection
- // so give up
- return true;
- }
- $yyruleno = $yyact - self::YYNSTATE;
- $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs'];
- $nextstate = $this->yy_find_reduce_action(
- $this->yystack[$this->yyidx]->stateno,
- self::$yyRuleInfo[$yyruleno]['lhs']);
- if (isset(self::$yyExpectedTokens[$nextstate]) &&
- in_array($token, self::$yyExpectedTokens[$nextstate], true)) {
- $this->yyidx = $yyidx;
- $this->yystack = $stack;
- return true;
- }
- if ($nextstate < self::YYNSTATE) {
- // we need to shift a non-terminal
- $this->yyidx++;
- $x = new TP_yyStackEntry;
- $x->stateno = $nextstate;
- $x->major = self::$yyRuleInfo[$yyruleno]['lhs'];
- $this->yystack[$this->yyidx] = $x;
- continue 2;
- } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) {
- $this->yyidx = $yyidx;
- $this->yystack = $stack;
- if (!$token) {
- // end of input: this is valid
- return true;
- }
- // the last token was just ignored, we can't accept
- // by ignoring input, this is in essence ignoring a
- // syntax error!
- return false;
- } elseif ($nextstate === self::YY_NO_ACTION) {
- $this->yyidx = $yyidx;
- $this->yystack = $stack;
- // input accepted, but not shifted (I guess)
- return true;
- } else {
- $yyact = $nextstate;
- }
- } while (true);
- }
- break;
- } while (true);
- $this->yyidx = $yyidx;
- $this->yystack = $stack;
- return true;
- }
-
- function yy_find_shift_action($iLookAhead)
- {
- $stateno = $this->yystack[$this->yyidx]->stateno;
-
- /* if ($this->yyidx < 0) return self::YY_NO_ACTION; */
- if (!isset(self::$yy_shift_ofst[$stateno])) {
- // no shift actions
- return self::$yy_default[$stateno];
- }
- $i = self::$yy_shift_ofst[$stateno];
- if ($i === self::YY_SHIFT_USE_DFLT) {
- return self::$yy_default[$stateno];
- }
- if ($iLookAhead == self::YYNOCODE) {
- return self::YY_NO_ACTION;
- }
- $i += $iLookAhead;
- if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||
- self::$yy_lookahead[$i] != $iLookAhead) {
- if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback)
- && ($iFallback = self::$yyFallback[$iLookAhead]) != 0) {
- if (self::$yyTraceFILE) {
- fwrite(self::$yyTraceFILE, self::$yyTracePrompt . "FALLBACK " .
- $this->yyTokenName[$iLookAhead] . " => " .
- $this->yyTokenName[$iFallback] . "\n");
- }
- return $this->yy_find_shift_action($iFallback);
- }
- return self::$yy_default[$stateno];
- } else {
- return self::$yy_action[$i];
- }
- }
-
- function yy_find_reduce_action($stateno, $iLookAhead)
- {
- /* $stateno = $this->yystack[$this->yyidx]->stateno; */
-
- if (!isset(self::$yy_reduce_ofst[$stateno])) {
- return self::$yy_default[$stateno];
- }
- $i = self::$yy_reduce_ofst[$stateno];
- if ($i == self::YY_REDUCE_USE_DFLT) {
- return self::$yy_default[$stateno];
- }
- if ($iLookAhead == self::YYNOCODE) {
- return self::YY_NO_ACTION;
- }
- $i += $iLookAhead;
- if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||
- self::$yy_lookahead[$i] != $iLookAhead) {
- return self::$yy_default[$stateno];
- } else {
- return self::$yy_action[$i];
- }
- }
-
- function yy_shift($yyNewState, $yyMajor, $yypMinor)
- {
- $this->yyidx++;
- if ($this->yyidx >= self::YYSTACKDEPTH) {
- $this->yyidx--;
- if (self::$yyTraceFILE) {
- fprintf(self::$yyTraceFILE, "%sStack Overflow!\n", self::$yyTracePrompt);
- }
- while ($this->yyidx >= 0) {
- $this->yy_pop_parser_stack();
- }
-#line 83 "smarty_internal_templateparser.y"
-
- $this->internalError = true;
- $this->compiler->trigger_template_error("Stack overflow in template parser");
-#line 1715 "smarty_internal_templateparser.php"
- return;
- }
- $yytos = new TP_yyStackEntry;
- $yytos->stateno = $yyNewState;
- $yytos->major = $yyMajor;
- $yytos->minor = $yypMinor;
- array_push($this->yystack, $yytos);
- if (self::$yyTraceFILE && $this->yyidx > 0) {
- fprintf(self::$yyTraceFILE, "%sShift %d\n", self::$yyTracePrompt,
- $yyNewState);
- fprintf(self::$yyTraceFILE, "%sStack:", self::$yyTracePrompt);
- for($i = 1; $i <= $this->yyidx; $i++) {
- fprintf(self::$yyTraceFILE, " %s",
- $this->yyTokenName[$this->yystack[$i]->major]);
- }
- fwrite(self::$yyTraceFILE,"\n");
- }
- }
-
- static public $yyRuleInfo = array(
- array( 'lhs' => 80, 'rhs' => 1 ),
- array( 'lhs' => 81, 'rhs' => 1 ),
- array( 'lhs' => 81, 'rhs' => 2 ),
- array( 'lhs' => 81, 'rhs' => 0 ),
- array( 'lhs' => 82, 'rhs' => 1 ),
- array( 'lhs' => 82, 'rhs' => 1 ),
- array( 'lhs' => 82, 'rhs' => 1 ),
- array( 'lhs' => 82, 'rhs' => 1 ),
- array( 'lhs' => 82, 'rhs' => 1 ),
- array( 'lhs' => 82, 'rhs' => 1 ),
- array( 'lhs' => 82, 'rhs' => 1 ),
- array( 'lhs' => 82, 'rhs' => 1 ),
- array( 'lhs' => 82, 'rhs' => 1 ),
- array( 'lhs' => 82, 'rhs' => 1 ),
- array( 'lhs' => 82, 'rhs' => 1 ),
- array( 'lhs' => 84, 'rhs' => 2 ),
- array( 'lhs' => 84, 'rhs' => 3 ),
- array( 'lhs' => 85, 'rhs' => 2 ),
- array( 'lhs' => 85, 'rhs' => 0 ),
- array( 'lhs' => 86, 'rhs' => 1 ),
- array( 'lhs' => 86, 'rhs' => 1 ),
- array( 'lhs' => 86, 'rhs' => 1 ),
- array( 'lhs' => 86, 'rhs' => 1 ),
- array( 'lhs' => 86, 'rhs' => 1 ),
- array( 'lhs' => 86, 'rhs' => 1 ),
- array( 'lhs' => 86, 'rhs' => 1 ),
- array( 'lhs' => 83, 'rhs' => 3 ),
- array( 'lhs' => 83, 'rhs' => 5 ),
- array( 'lhs' => 83, 'rhs' => 4 ),
- array( 'lhs' => 83, 'rhs' => 5 ),
- array( 'lhs' => 83, 'rhs' => 4 ),
- array( 'lhs' => 83, 'rhs' => 6 ),
- array( 'lhs' => 83, 'rhs' => 6 ),
- array( 'lhs' => 83, 'rhs' => 7 ),
- array( 'lhs' => 83, 'rhs' => 6 ),
- array( 'lhs' => 83, 'rhs' => 4 ),
- array( 'lhs' => 83, 'rhs' => 3 ),
- array( 'lhs' => 83, 'rhs' => 6 ),
- array( 'lhs' => 83, 'rhs' => 5 ),
- array( 'lhs' => 83, 'rhs' => 7 ),
- array( 'lhs' => 83, 'rhs' => 3 ),
- array( 'lhs' => 83, 'rhs' => 4 ),
- array( 'lhs' => 83, 'rhs' => 3 ),
- array( 'lhs' => 83, 'rhs' => 4 ),
- array( 'lhs' => 83, 'rhs' => 12 ),
- array( 'lhs' => 96, 'rhs' => 2 ),
- array( 'lhs' => 96, 'rhs' => 1 ),
- array( 'lhs' => 83, 'rhs' => 6 ),
- array( 'lhs' => 83, 'rhs' => 8 ),
- array( 'lhs' => 83, 'rhs' => 3 ),
- array( 'lhs' => 83, 'rhs' => 8 ),
- array( 'lhs' => 83, 'rhs' => 11 ),
- array( 'lhs' => 83, 'rhs' => 8 ),
- array( 'lhs' => 83, 'rhs' => 11 ),
- array( 'lhs' => 83, 'rhs' => 4 ),
- array( 'lhs' => 83, 'rhs' => 5 ),
- array( 'lhs' => 83, 'rhs' => 1 ),
- array( 'lhs' => 83, 'rhs' => 3 ),
- array( 'lhs' => 83, 'rhs' => 4 ),
- array( 'lhs' => 83, 'rhs' => 5 ),
- array( 'lhs' => 83, 'rhs' => 6 ),
- array( 'lhs' => 89, 'rhs' => 2 ),
- array( 'lhs' => 89, 'rhs' => 1 ),
- array( 'lhs' => 89, 'rhs' => 0 ),
- array( 'lhs' => 98, 'rhs' => 4 ),
- array( 'lhs' => 98, 'rhs' => 4 ),
- array( 'lhs' => 98, 'rhs' => 4 ),
- array( 'lhs' => 98, 'rhs' => 2 ),
- array( 'lhs' => 98, 'rhs' => 2 ),
- array( 'lhs' => 98, 'rhs' => 2 ),
- array( 'lhs' => 98, 'rhs' => 4 ),
- array( 'lhs' => 93, 'rhs' => 1 ),
- array( 'lhs' => 93, 'rhs' => 3 ),
- array( 'lhs' => 92, 'rhs' => 4 ),
- array( 'lhs' => 92, 'rhs' => 3 ),
- array( 'lhs' => 92, 'rhs' => 3 ),
- array( 'lhs' => 90, 'rhs' => 1 ),
- array( 'lhs' => 90, 'rhs' => 1 ),
- array( 'lhs' => 90, 'rhs' => 4 ),
- array( 'lhs' => 90, 'rhs' => 3 ),
- array( 'lhs' => 90, 'rhs' => 3 ),
- array( 'lhs' => 90, 'rhs' => 3 ),
- array( 'lhs' => 90, 'rhs' => 1 ),
- array( 'lhs' => 90, 'rhs' => 2 ),
- array( 'lhs' => 90, 'rhs' => 3 ),
- array( 'lhs' => 90, 'rhs' => 3 ),
- array( 'lhs' => 90, 'rhs' => 3 ),
- array( 'lhs' => 90, 'rhs' => 3 ),
- array( 'lhs' => 90, 'rhs' => 3 ),
- array( 'lhs' => 90, 'rhs' => 3 ),
- array( 'lhs' => 90, 'rhs' => 2 ),
- array( 'lhs' => 90, 'rhs' => 2 ),
- array( 'lhs' => 90, 'rhs' => 3 ),
- array( 'lhs' => 90, 'rhs' => 3 ),
- array( 'lhs' => 90, 'rhs' => 2 ),
- array( 'lhs' => 90, 'rhs' => 2 ),
- array( 'lhs' => 90, 'rhs' => 3 ),
- array( 'lhs' => 90, 'rhs' => 3 ),
- array( 'lhs' => 90, 'rhs' => 3 ),
- array( 'lhs' => 90, 'rhs' => 3 ),
- array( 'lhs' => 99, 'rhs' => 8 ),
- array( 'lhs' => 99, 'rhs' => 7 ),
- array( 'lhs' => 87, 'rhs' => 1 ),
- array( 'lhs' => 87, 'rhs' => 2 ),
- array( 'lhs' => 87, 'rhs' => 2 ),
- array( 'lhs' => 87, 'rhs' => 2 ),
- array( 'lhs' => 87, 'rhs' => 2 ),
- array( 'lhs' => 87, 'rhs' => 1 ),
- array( 'lhs' => 87, 'rhs' => 1 ),
- array( 'lhs' => 87, 'rhs' => 3 ),
- array( 'lhs' => 87, 'rhs' => 2 ),
- array( 'lhs' => 87, 'rhs' => 2 ),
- array( 'lhs' => 87, 'rhs' => 1 ),
- array( 'lhs' => 87, 'rhs' => 1 ),
- array( 'lhs' => 87, 'rhs' => 3 ),
- array( 'lhs' => 87, 'rhs' => 1 ),
- array( 'lhs' => 87, 'rhs' => 1 ),
- array( 'lhs' => 87, 'rhs' => 3 ),
- array( 'lhs' => 87, 'rhs' => 3 ),
- array( 'lhs' => 87, 'rhs' => 1 ),
- array( 'lhs' => 87, 'rhs' => 2 ),
- array( 'lhs' => 103, 'rhs' => 1 ),
- array( 'lhs' => 103, 'rhs' => 4 ),
- array( 'lhs' => 103, 'rhs' => 1 ),
- array( 'lhs' => 103, 'rhs' => 3 ),
- array( 'lhs' => 103, 'rhs' => 3 ),
- array( 'lhs' => 91, 'rhs' => 3 ),
- array( 'lhs' => 108, 'rhs' => 2 ),
- array( 'lhs' => 108, 'rhs' => 0 ),
- array( 'lhs' => 109, 'rhs' => 3 ),
- array( 'lhs' => 109, 'rhs' => 5 ),
- array( 'lhs' => 109, 'rhs' => 2 ),
- array( 'lhs' => 109, 'rhs' => 2 ),
- array( 'lhs' => 109, 'rhs' => 4 ),
- array( 'lhs' => 109, 'rhs' => 3 ),
- array( 'lhs' => 109, 'rhs' => 5 ),
- array( 'lhs' => 109, 'rhs' => 3 ),
- array( 'lhs' => 109, 'rhs' => 2 ),
- array( 'lhs' => 95, 'rhs' => 1 ),
- array( 'lhs' => 95, 'rhs' => 2 ),
- array( 'lhs' => 110, 'rhs' => 1 ),
- array( 'lhs' => 110, 'rhs' => 3 ),
- array( 'lhs' => 107, 'rhs' => 2 ),
- array( 'lhs' => 111, 'rhs' => 1 ),
- array( 'lhs' => 111, 'rhs' => 2 ),
- array( 'lhs' => 112, 'rhs' => 3 ),
- array( 'lhs' => 112, 'rhs' => 4 ),
- array( 'lhs' => 112, 'rhs' => 5 ),
- array( 'lhs' => 112, 'rhs' => 6 ),
- array( 'lhs' => 112, 'rhs' => 2 ),
- array( 'lhs' => 104, 'rhs' => 4 ),
- array( 'lhs' => 113, 'rhs' => 4 ),
- array( 'lhs' => 113, 'rhs' => 5 ),
- array( 'lhs' => 114, 'rhs' => 3 ),
- array( 'lhs' => 114, 'rhs' => 1 ),
- array( 'lhs' => 114, 'rhs' => 0 ),
- array( 'lhs' => 88, 'rhs' => 3 ),
- array( 'lhs' => 88, 'rhs' => 2 ),
- array( 'lhs' => 115, 'rhs' => 3 ),
- array( 'lhs' => 115, 'rhs' => 2 ),
- array( 'lhs' => 97, 'rhs' => 2 ),
- array( 'lhs' => 97, 'rhs' => 0 ),
- array( 'lhs' => 116, 'rhs' => 2 ),
- array( 'lhs' => 116, 'rhs' => 2 ),
- array( 'lhs' => 106, 'rhs' => 1 ),
- array( 'lhs' => 106, 'rhs' => 2 ),
- array( 'lhs' => 106, 'rhs' => 1 ),
- array( 'lhs' => 106, 'rhs' => 3 ),
- array( 'lhs' => 106, 'rhs' => 4 ),
- array( 'lhs' => 101, 'rhs' => 1 ),
- array( 'lhs' => 101, 'rhs' => 1 ),
- array( 'lhs' => 101, 'rhs' => 1 ),
- array( 'lhs' => 101, 'rhs' => 1 ),
- array( 'lhs' => 101, 'rhs' => 1 ),
- array( 'lhs' => 101, 'rhs' => 1 ),
- array( 'lhs' => 101, 'rhs' => 1 ),
- array( 'lhs' => 101, 'rhs' => 1 ),
- array( 'lhs' => 101, 'rhs' => 1 ),
- array( 'lhs' => 102, 'rhs' => 1 ),
- array( 'lhs' => 102, 'rhs' => 1 ),
- array( 'lhs' => 102, 'rhs' => 1 ),
- array( 'lhs' => 100, 'rhs' => 3 ),
- array( 'lhs' => 117, 'rhs' => 1 ),
- array( 'lhs' => 117, 'rhs' => 3 ),
- array( 'lhs' => 117, 'rhs' => 0 ),
- array( 'lhs' => 118, 'rhs' => 3 ),
- array( 'lhs' => 118, 'rhs' => 3 ),
- array( 'lhs' => 118, 'rhs' => 1 ),
- array( 'lhs' => 105, 'rhs' => 2 ),
- array( 'lhs' => 105, 'rhs' => 3 ),
- array( 'lhs' => 119, 'rhs' => 2 ),
- array( 'lhs' => 119, 'rhs' => 1 ),
- array( 'lhs' => 120, 'rhs' => 3 ),
- array( 'lhs' => 120, 'rhs' => 3 ),
- array( 'lhs' => 120, 'rhs' => 1 ),
- array( 'lhs' => 120, 'rhs' => 3 ),
- array( 'lhs' => 120, 'rhs' => 3 ),
- array( 'lhs' => 120, 'rhs' => 1 ),
- array( 'lhs' => 120, 'rhs' => 1 ),
- array( 'lhs' => 94, 'rhs' => 1 ),
- array( 'lhs' => 94, 'rhs' => 0 ),
- );
-
- static public $yyReduceMap = array(
- 0 => 0,
- 1 => 1,
- 2 => 1,
- 4 => 4,
- 5 => 5,
- 6 => 6,
- 7 => 7,
- 8 => 8,
- 9 => 9,
- 10 => 10,
- 11 => 11,
- 12 => 12,
- 13 => 13,
- 14 => 14,
- 15 => 15,
- 18 => 15,
- 200 => 15,
- 16 => 16,
- 75 => 16,
- 17 => 17,
- 103 => 17,
- 105 => 17,
- 106 => 17,
- 127 => 17,
- 165 => 17,
- 19 => 19,
- 20 => 19,
- 46 => 19,
- 68 => 19,
- 69 => 19,
- 76 => 19,
- 77 => 19,
- 82 => 19,
- 102 => 19,
- 107 => 19,
- 108 => 19,
- 113 => 19,
- 115 => 19,
- 116 => 19,
- 123 => 19,
- 138 => 19,
- 164 => 19,
- 166 => 19,
- 182 => 19,
- 187 => 19,
- 199 => 19,
- 21 => 21,
- 22 => 21,
- 23 => 23,
- 24 => 24,
- 25 => 25,
- 26 => 26,
- 27 => 27,
- 28 => 28,
- 30 => 28,
- 29 => 29,
- 31 => 31,
- 32 => 31,
- 33 => 33,
- 34 => 34,
- 35 => 35,
- 36 => 36,
- 37 => 37,
- 38 => 38,
- 39 => 39,
- 40 => 40,
- 41 => 41,
- 43 => 41,
- 42 => 42,
- 44 => 44,
- 45 => 45,
- 47 => 47,
- 48 => 48,
- 49 => 49,
- 50 => 50,
- 51 => 51,
- 52 => 52,
- 53 => 53,
- 54 => 54,
- 55 => 55,
- 56 => 56,
- 57 => 57,
- 58 => 58,
- 59 => 59,
- 60 => 60,
- 61 => 61,
- 62 => 62,
- 71 => 62,
- 154 => 62,
- 158 => 62,
- 162 => 62,
- 163 => 62,
- 63 => 63,
- 155 => 63,
- 161 => 63,
- 64 => 64,
- 65 => 65,
- 66 => 65,
- 70 => 65,
- 67 => 67,
- 72 => 72,
- 73 => 73,
- 74 => 73,
- 78 => 78,
- 79 => 79,
- 80 => 79,
- 81 => 79,
- 83 => 83,
- 120 => 83,
- 84 => 84,
- 87 => 84,
- 98 => 84,
- 85 => 85,
- 86 => 86,
- 88 => 88,
- 89 => 89,
- 90 => 90,
- 95 => 90,
- 91 => 91,
- 94 => 91,
- 92 => 92,
- 97 => 92,
- 93 => 93,
- 96 => 93,
- 99 => 99,
- 100 => 100,
- 101 => 101,
- 104 => 104,
- 109 => 109,
- 110 => 110,
- 111 => 111,
- 112 => 112,
- 114 => 114,
- 117 => 117,
- 118 => 118,
- 119 => 119,
- 121 => 121,
- 122 => 122,
- 124 => 124,
- 125 => 125,
- 126 => 126,
- 128 => 128,
- 184 => 128,
- 129 => 129,
- 130 => 130,
- 131 => 131,
- 132 => 132,
- 133 => 133,
- 136 => 133,
- 134 => 134,
- 135 => 135,
- 137 => 137,
- 139 => 139,
- 140 => 140,
- 141 => 141,
- 142 => 142,
- 143 => 143,
- 144 => 144,
- 145 => 145,
- 146 => 146,
- 147 => 147,
- 148 => 148,
- 149 => 149,
- 150 => 150,
- 151 => 151,
- 152 => 152,
- 153 => 153,
- 156 => 156,
- 157 => 157,
- 159 => 159,
- 160 => 160,
- 167 => 167,
- 168 => 168,
- 169 => 169,
- 170 => 170,
- 171 => 171,
- 172 => 172,
- 173 => 173,
- 174 => 174,
- 175 => 175,
- 176 => 176,
- 177 => 177,
- 178 => 178,
- 179 => 179,
- 180 => 180,
- 181 => 181,
- 183 => 183,
- 185 => 185,
- 186 => 186,
- 188 => 188,
- 189 => 189,
- 190 => 190,
- 191 => 191,
- 192 => 192,
- 193 => 192,
- 195 => 192,
- 194 => 194,
- 196 => 196,
- 197 => 197,
- 198 => 198,
- );
-#line 94 "smarty_internal_templateparser.y"
- function yy_r0(){
- $this->_retvalue = $this->root_buffer->to_smarty_php();
- }
-#line 2145 "smarty_internal_templateparser.php"
-#line 102 "smarty_internal_templateparser.y"
- function yy_r1(){
- $this->current_buffer->append_subtree($this->yystack[$this->yyidx + 0]->minor);
- }
-#line 2150 "smarty_internal_templateparser.php"
-#line 118 "smarty_internal_templateparser.y"
- function yy_r4(){
- if ($this->compiler->has_code) {
- $tmp =''; foreach ($this->compiler->prefix_code as $code) {$tmp.=$code;} $this->compiler->prefix_code=array();
- $this->_retvalue = new _smarty_tag($this, $this->compiler->processNocacheCode($tmp.$this->yystack[$this->yyidx + 0]->minor,true));
- } else {
- $this->_retvalue = new _smarty_tag($this, $this->yystack[$this->yyidx + 0]->minor);
- }
- $this->compiler->has_variable_string = false;
- $this->block_nesting_level = count($this->compiler->_tag_stack);
- }
-#line 2162 "smarty_internal_templateparser.php"
-#line 130 "smarty_internal_templateparser.y"
- function yy_r5(){
- $this->_retvalue = new _smarty_tag($this, '');
- }
-#line 2167 "smarty_internal_templateparser.php"
-#line 135 "smarty_internal_templateparser.y"
- function yy_r6(){
- $this->_retvalue = new _smarty_text($this, $this->yystack[$this->yyidx + 0]->minor);
- }
-#line 2172 "smarty_internal_templateparser.php"
-#line 140 "smarty_internal_templateparser.y"
- function yy_r7(){
- if ($this->php_handling == Smarty::PHP_PASSTHRU) {
- $this->_retvalue = new _smarty_text($this, self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor));
- } elseif ($this->php_handling == Smarty::PHP_QUOTE) {
- $this->_retvalue = new _smarty_text($this, htmlspecialchars($this->yystack[$this->yyidx + 0]->minor, ENT_QUOTES));
- } elseif ($this->php_handling == Smarty::PHP_ALLOW) {
- if (!($this->smarty instanceof SmartyBC)) {
- $this->compiler->trigger_template_error (self::Err3);
- }
- $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode('php_handling == Smarty::PHP_REMOVE) {
- $this->_retvalue = new _smarty_text($this, '');
- }
- }
-#line 2188 "smarty_internal_templateparser.php"
-#line 156 "smarty_internal_templateparser.y"
- function yy_r8(){
- if ($this->is_xml) {
- $this->compiler->tag_nocache = true;
- $this->is_xml = false;
- $save = $this->template->has_nocache_code;
- $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode("';?>", $this->compiler, true));
- $this->template->has_nocache_code = $save;
- } elseif ($this->php_handling == Smarty::PHP_PASSTHRU) {
- $this->_retvalue = new _smarty_text($this, '?>');
- } elseif ($this->php_handling == Smarty::PHP_QUOTE) {
- $this->_retvalue = new _smarty_text($this, htmlspecialchars('?>', ENT_QUOTES));
- } elseif ($this->php_handling == Smarty::PHP_ALLOW) {
- $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode('?>', true));
- } elseif ($this->php_handling == Smarty::PHP_REMOVE) {
- $this->_retvalue = new _smarty_text($this, '');
- }
- }
-#line 2207 "smarty_internal_templateparser.php"
-#line 175 "smarty_internal_templateparser.y"
- function yy_r9(){
- if ($this->php_handling == Smarty::PHP_PASSTHRU) {
- $this->_retvalue = new _smarty_text($this, '<%');
- } elseif ($this->php_handling == Smarty::PHP_QUOTE) {
- $this->_retvalue = new _smarty_text($this, htmlspecialchars($this->yystack[$this->yyidx + 0]->minor, ENT_QUOTES));
- } elseif ($this->php_handling == Smarty::PHP_ALLOW) {
- if ($this->asp_tags) {
- if (!($this->smarty instanceof SmartyBC)) {
- $this->compiler->trigger_template_error (self::Err3);
- }
- $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode('<%', true));
- } else {
- $this->_retvalue = new _smarty_text($this, '<%');
- }
- } elseif ($this->php_handling == Smarty::PHP_REMOVE) {
- if ($this->asp_tags) {
- $this->_retvalue = new _smarty_text($this, '');
- } else {
- $this->_retvalue = new _smarty_text($this, '<%');
- }
- }
- }
-#line 2231 "smarty_internal_templateparser.php"
-#line 199 "smarty_internal_templateparser.y"
- function yy_r10(){
- if ($this->php_handling == Smarty::PHP_PASSTHRU) {
- $this->_retvalue = new _smarty_text($this, '%>');
- } elseif ($this->php_handling == Smarty::PHP_QUOTE) {
- $this->_retvalue = new _smarty_text($this, htmlspecialchars('%>', ENT_QUOTES));
- } elseif ($this->php_handling == Smarty::PHP_ALLOW) {
- if ($this->asp_tags) {
- $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode('%>', true));
- } else {
- $this->_retvalue = new _smarty_text($this, '%>');
- }
- } elseif ($this->php_handling == Smarty::PHP_REMOVE) {
- if ($this->asp_tags) {
- $this->_retvalue = new _smarty_text($this, '');
- } else {
- $this->_retvalue = new _smarty_text($this, '%>');
- }
- }
- }
-#line 2252 "smarty_internal_templateparser.php"
-#line 219 "smarty_internal_templateparser.y"
- function yy_r11(){
- if ($this->lex->strip) {
- $this->_retvalue = new _smarty_text($this, preg_replace('![\$this->yystack[$this->yyidx + 0]->minor ]*[\r\n]+[\$this->yystack[$this->yyidx + 0]->minor ]*!', '', self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor)));
- } else {
- $this->_retvalue = new _smarty_text($this, self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor));
- }
- }
-#line 2261 "smarty_internal_templateparser.php"
-#line 228 "smarty_internal_templateparser.y"
- function yy_r12(){
- $this->compiler->tag_nocache = true;
- $this->is_xml = true;
- $save = $this->template->has_nocache_code;
- $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode("", $this->compiler, true));
- $this->template->has_nocache_code = $save;
- }
-#line 2270 "smarty_internal_templateparser.php"
-#line 237 "smarty_internal_templateparser.y"
- function yy_r13(){
- if ($this->lex->strip) {
- $this->_retvalue = new _smarty_text($this, preg_replace('![\t ]*[\r\n]+[\t ]*!', '', $this->yystack[$this->yyidx + 0]->minor));
- } else {
- $this->_retvalue = new _smarty_text($this, $this->yystack[$this->yyidx + 0]->minor);
- }
- }
-#line 2279 "smarty_internal_templateparser.php"
-#line 245 "smarty_internal_templateparser.y"
- function yy_r14(){
- $this->_retvalue = new _smarty_linebreak($this, $this->yystack[$this->yyidx + 0]->minor);
- }
-#line 2284 "smarty_internal_templateparser.php"
-#line 250 "smarty_internal_templateparser.y"
- function yy_r15(){
- $this->_retvalue = '';
- }
-#line 2289 "smarty_internal_templateparser.php"
-#line 254 "smarty_internal_templateparser.y"
- function yy_r16(){
- $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor;
- }
-#line 2294 "smarty_internal_templateparser.php"
-#line 258 "smarty_internal_templateparser.y"
- function yy_r17(){
- $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor;
- }
-#line 2299 "smarty_internal_templateparser.php"
-#line 266 "smarty_internal_templateparser.y"
- function yy_r19(){
- $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor;
- }
-#line 2304 "smarty_internal_templateparser.php"
-#line 274 "smarty_internal_templateparser.y"
- function yy_r21(){
- $this->_retvalue = self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor);
- }
-#line 2309 "smarty_internal_templateparser.php"
-#line 282 "smarty_internal_templateparser.y"
- function yy_r23(){
- $this->_retvalue = self::escape_end_tag($this->yystack[$this->yyidx + 0]->minor);
- }
-#line 2314 "smarty_internal_templateparser.php"
-#line 286 "smarty_internal_templateparser.y"
- function yy_r24(){
- $this->_retvalue = '<%';
- }
-#line 2319 "smarty_internal_templateparser.php"
-#line 290 "smarty_internal_templateparser.y"
- function yy_r25(){
- $this->_retvalue = '%>';
- }
-#line 2324 "smarty_internal_templateparser.php"
-#line 300 "smarty_internal_templateparser.y"
- function yy_r26(){
- $this->_retvalue = $this->compiler->compileTag('private_print_expression',array(),array('value'=>$this->yystack[$this->yyidx + -1]->minor));
- }
-#line 2329 "smarty_internal_templateparser.php"
-#line 304 "smarty_internal_templateparser.y"
- function yy_r27(){
- $this->_retvalue = $this->compiler->compileTag('private_print_expression',$this->yystack[$this->yyidx + -1]->minor,array('value'=>$this->yystack[$this->yyidx + -3]->minor, 'modifierlist'=>$this->yystack[$this->yyidx + -2]->minor));
- }
-#line 2334 "smarty_internal_templateparser.php"
-#line 308 "smarty_internal_templateparser.y"
- function yy_r28(){
- $this->_retvalue = $this->compiler->compileTag('private_print_expression',$this->yystack[$this->yyidx + -1]->minor,array('value'=>$this->yystack[$this->yyidx + -2]->minor));
- }
-#line 2339 "smarty_internal_templateparser.php"
-#line 312 "smarty_internal_templateparser.y"
- function yy_r29(){
- $this->_retvalue = $this->compiler->compileTag('private_print_expression',$this->yystack[$this->yyidx + -1]->minor,array('value'=>$this->yystack[$this->yyidx + -3]->minor,'modifierlist'=>$this->yystack[$this->yyidx + -2]->minor));
- }
-#line 2344 "smarty_internal_templateparser.php"
-#line 325 "smarty_internal_templateparser.y"
- function yy_r31(){
- $this->_retvalue = $this->compiler->compileTag('assign',array(array('value'=>$this->yystack[$this->yyidx + -1]->minor),array('var'=>"'".$this->yystack[$this->yyidx + -3]->minor."'")));
- }
-#line 2349 "smarty_internal_templateparser.php"
-#line 333 "smarty_internal_templateparser.y"
- function yy_r33(){
- $this->_retvalue = $this->compiler->compileTag('assign',array_merge(array(array('value'=>$this->yystack[$this->yyidx + -2]->minor),array('var'=>"'".$this->yystack[$this->yyidx + -4]->minor."'")),$this->yystack[$this->yyidx + -1]->minor));
- }
-#line 2354 "smarty_internal_templateparser.php"
-#line 337 "smarty_internal_templateparser.y"
- function yy_r34(){
- $this->_retvalue = $this->compiler->compileTag('assign',array_merge(array(array('value'=>$this->yystack[$this->yyidx + -2]->minor),array('var'=>$this->yystack[$this->yyidx + -4]->minor['var'])),$this->yystack[$this->yyidx + -1]->minor),array('smarty_internal_index'=>$this->yystack[$this->yyidx + -4]->minor['smarty_internal_index']));
- }
-#line 2359 "smarty_internal_templateparser.php"
-#line 342 "smarty_internal_templateparser.y"
- function yy_r35(){
- $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -2]->minor,$this->yystack[$this->yyidx + -1]->minor);
- }
-#line 2364 "smarty_internal_templateparser.php"
-#line 346 "smarty_internal_templateparser.y"
- function yy_r36(){
- $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -1]->minor,array());
- }
-#line 2369 "smarty_internal_templateparser.php"
-#line 351 "smarty_internal_templateparser.y"
- function yy_r37(){
- $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -4]->minor,$this->yystack[$this->yyidx + -1]->minor,array('object_methode'=>$this->yystack[$this->yyidx + -2]->minor));
- }
-#line 2374 "smarty_internal_templateparser.php"
-#line 356 "smarty_internal_templateparser.y"
- function yy_r38(){
- $this->_retvalue = ''.$this->compiler->compileTag($this->yystack[$this->yyidx + -3]->minor,$this->yystack[$this->yyidx + -1]->minor).'_retvalue .= $this->compiler->compileTag('private_modifier',array(),array('modifierlist'=>$this->yystack[$this->yyidx + -2]->minor,'value'=>'ob_get_clean()')).'?>';
- }
-#line 2380 "smarty_internal_templateparser.php"
-#line 362 "smarty_internal_templateparser.y"
- function yy_r39(){
- $this->_retvalue = ''.$this->compiler->compileTag($this->yystack[$this->yyidx + -5]->minor,$this->yystack[$this->yyidx + -1]->minor,array('object_methode'=>$this->yystack[$this->yyidx + -3]->minor)).'_retvalue .= $this->compiler->compileTag('private_modifier',array(),array('modifierlist'=>$this->yystack[$this->yyidx + -2]->minor,'value'=>'ob_get_clean()')).'?>';
- }
-#line 2386 "smarty_internal_templateparser.php"
-#line 368 "smarty_internal_templateparser.y"
- function yy_r40(){
- $tag = trim(substr($this->yystack[$this->yyidx + -2]->minor,$this->lex->ldel_length));
- $this->_retvalue = $this->compiler->compileTag(($tag == 'else if')? 'elseif' : $tag,array(),array('if condition'=>$this->yystack[$this->yyidx + -1]->minor));
- }
-#line 2392 "smarty_internal_templateparser.php"
-#line 373 "smarty_internal_templateparser.y"
- function yy_r41(){
- $tag = trim(substr($this->yystack[$this->yyidx + -3]->minor,$this->lex->ldel_length));
- $this->_retvalue = $this->compiler->compileTag(($tag == 'else if')? 'elseif' : $tag,$this->yystack[$this->yyidx + -1]->minor,array('if condition'=>$this->yystack[$this->yyidx + -2]->minor));
- }
-#line 2398 "smarty_internal_templateparser.php"
-#line 378 "smarty_internal_templateparser.y"
- function yy_r42(){
- $tag = trim(substr($this->yystack[$this->yyidx + -2]->minor,$this->lex->ldel_length));
- $this->_retvalue = $this->compiler->compileTag(($tag == 'else if')? 'elseif' : $tag,array(),array('if condition'=>$this->yystack[$this->yyidx + -1]->minor));
- }
-#line 2404 "smarty_internal_templateparser.php"
-#line 389 "smarty_internal_templateparser.y"
- function yy_r44(){
- $this->_retvalue = $this->compiler->compileTag('for',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('start'=>$this->yystack[$this->yyidx + -10]->minor),array('ifexp'=>$this->yystack[$this->yyidx + -7]->minor),array('var'=>$this->yystack[$this->yyidx + -3]->minor),array('step'=>$this->yystack[$this->yyidx + -2]->minor))),1);
- }
-#line 2409 "smarty_internal_templateparser.php"
-#line 393 "smarty_internal_templateparser.y"
- function yy_r45(){
- $this->_retvalue = '='.$this->yystack[$this->yyidx + 0]->minor;
- }
-#line 2414 "smarty_internal_templateparser.php"
-#line 401 "smarty_internal_templateparser.y"
- function yy_r47(){
- $this->_retvalue = $this->compiler->compileTag('for',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('start'=>$this->yystack[$this->yyidx + -4]->minor),array('to'=>$this->yystack[$this->yyidx + -2]->minor))),0);
- }
-#line 2419 "smarty_internal_templateparser.php"
-#line 405 "smarty_internal_templateparser.y"
- function yy_r48(){
- $this->_retvalue = $this->compiler->compileTag('for',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('start'=>$this->yystack[$this->yyidx + -6]->minor),array('to'=>$this->yystack[$this->yyidx + -4]->minor),array('step'=>$this->yystack[$this->yyidx + -2]->minor))),0);
- }
-#line 2424 "smarty_internal_templateparser.php"
-#line 410 "smarty_internal_templateparser.y"
- function yy_r49(){
- $this->_retvalue = $this->compiler->compileTag('foreach',$this->yystack[$this->yyidx + -1]->minor);
- }
-#line 2429 "smarty_internal_templateparser.php"
-#line 415 "smarty_internal_templateparser.y"
- function yy_r50(){
- $this->_retvalue = $this->compiler->compileTag('foreach',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('from'=>$this->yystack[$this->yyidx + -5]->minor),array('item'=>$this->yystack[$this->yyidx + -2]->minor))));
- }
-#line 2434 "smarty_internal_templateparser.php"
-#line 419 "smarty_internal_templateparser.y"
- function yy_r51(){
- $this->_retvalue = $this->compiler->compileTag('foreach',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('from'=>$this->yystack[$this->yyidx + -8]->minor),array('item'=>$this->yystack[$this->yyidx + -2]->minor),array('key'=>$this->yystack[$this->yyidx + -5]->minor))));
- }
-#line 2439 "smarty_internal_templateparser.php"
-#line 423 "smarty_internal_templateparser.y"
- function yy_r52(){
- $this->_retvalue = $this->compiler->compileTag('foreach',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('from'=>$this->yystack[$this->yyidx + -5]->minor),array('item'=>$this->yystack[$this->yyidx + -2]->minor))));
- }
-#line 2444 "smarty_internal_templateparser.php"
-#line 427 "smarty_internal_templateparser.y"
- function yy_r53(){
- $this->_retvalue = $this->compiler->compileTag('foreach',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('from'=>$this->yystack[$this->yyidx + -8]->minor),array('item'=>$this->yystack[$this->yyidx + -2]->minor),array('key'=>$this->yystack[$this->yyidx + -5]->minor))));
- }
-#line 2449 "smarty_internal_templateparser.php"
-#line 432 "smarty_internal_templateparser.y"
- function yy_r54(){
- $this->_retvalue = $this->compiler->compileTag('setfilter',array(),array('modifier_list'=>array(array_merge(array($this->yystack[$this->yyidx + -2]->minor),$this->yystack[$this->yyidx + -1]->minor))));
- }
-#line 2454 "smarty_internal_templateparser.php"
-#line 436 "smarty_internal_templateparser.y"
- function yy_r55(){
- $this->_retvalue = $this->compiler->compileTag('setfilter',array(),array('modifier_list'=>array_merge(array(array_merge(array($this->yystack[$this->yyidx + -3]->minor),$this->yystack[$this->yyidx + -2]->minor)),$this->yystack[$this->yyidx + -1]->minor)));
- }
-#line 2459 "smarty_internal_templateparser.php"
-#line 441 "smarty_internal_templateparser.y"
- function yy_r56(){
- $this->_retvalue = SMARTY_INTERNAL_COMPILE_BLOCK::compileChildBlock($this->compiler);
- }
-#line 2464 "smarty_internal_templateparser.php"
-#line 447 "smarty_internal_templateparser.y"
- function yy_r57(){
- $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -1]->minor.'close',array());
- }
-#line 2469 "smarty_internal_templateparser.php"
-#line 451 "smarty_internal_templateparser.y"
- function yy_r58(){
- $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -2]->minor.'close',array(),array('modifier_list'=>$this->yystack[$this->yyidx + -1]->minor));
- }
-#line 2474 "smarty_internal_templateparser.php"
-#line 456 "smarty_internal_templateparser.y"
- function yy_r59(){
- $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -3]->minor.'close',array(),array('object_methode'=>$this->yystack[$this->yyidx + -1]->minor));
- }
-#line 2479 "smarty_internal_templateparser.php"
-#line 460 "smarty_internal_templateparser.y"
- function yy_r60(){
- $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -4]->minor.'close',array(),array('object_methode'=>$this->yystack[$this->yyidx + -2]->minor, 'modifier_list'=>$this->yystack[$this->yyidx + -1]->minor));
- }
-#line 2484 "smarty_internal_templateparser.php"
-#line 468 "smarty_internal_templateparser.y"
- function yy_r61(){
- $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor;
- $this->_retvalue[] = $this->yystack[$this->yyidx + 0]->minor;
- }
-#line 2490 "smarty_internal_templateparser.php"
-#line 474 "smarty_internal_templateparser.y"
- function yy_r62(){
- $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor);
- }
-#line 2495 "smarty_internal_templateparser.php"
-#line 479 "smarty_internal_templateparser.y"
- function yy_r63(){
- $this->_retvalue = array();
- }
-#line 2500 "smarty_internal_templateparser.php"
-#line 484 "smarty_internal_templateparser.y"
- function yy_r64(){
- if (preg_match('~^true$~i', $this->yystack[$this->yyidx + 0]->minor)) {
- $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>'true');
- } elseif (preg_match('~^false$~i', $this->yystack[$this->yyidx + 0]->minor)) {
- $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>'false');
- } elseif (preg_match('~^null$~i', $this->yystack[$this->yyidx + 0]->minor)) {
- $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>'null');
- } else {
- $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>"'".$this->yystack[$this->yyidx + 0]->minor."'");
- }
- }
-#line 2513 "smarty_internal_templateparser.php"
-#line 496 "smarty_internal_templateparser.y"
- function yy_r65(){
- $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>$this->yystack[$this->yyidx + 0]->minor);
- }
-#line 2518 "smarty_internal_templateparser.php"
-#line 504 "smarty_internal_templateparser.y"
- function yy_r67(){
- $this->_retvalue = "'".$this->yystack[$this->yyidx + 0]->minor."'";
- }
-#line 2523 "smarty_internal_templateparser.php"
-#line 529 "smarty_internal_templateparser.y"
- function yy_r72(){
- $this->yystack[$this->yyidx + -2]->minor[]=$this->yystack[$this->yyidx + 0]->minor;
- $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor;
- }
-#line 2529 "smarty_internal_templateparser.php"
-#line 534 "smarty_internal_templateparser.y"
- function yy_r73(){
- $this->_retvalue = array('var' => $this->yystack[$this->yyidx + -2]->minor, 'value'=>$this->yystack[$this->yyidx + 0]->minor);
- }
-#line 2534 "smarty_internal_templateparser.php"
-#line 562 "smarty_internal_templateparser.y"
- function yy_r78(){
- $this->_retvalue = '$_smarty_tpl->getStreamVariable(\''. $this->yystack[$this->yyidx + -2]->minor .'://'. $this->yystack[$this->yyidx + 0]->minor . '\')';
- }
-#line 2539 "smarty_internal_templateparser.php"
-#line 567 "smarty_internal_templateparser.y"
- function yy_r79(){
- $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor . trim($this->yystack[$this->yyidx + -1]->minor) . $this->yystack[$this->yyidx + 0]->minor;
- }
-#line 2544 "smarty_internal_templateparser.php"
-#line 586 "smarty_internal_templateparser.y"
- function yy_r83(){
- $this->_retvalue = $this->compiler->compileTag('private_modifier',array(),array('value'=>$this->yystack[$this->yyidx + -1]->minor,'modifierlist'=>$this->yystack[$this->yyidx + 0]->minor));
- }
-#line 2549 "smarty_internal_templateparser.php"
-#line 592 "smarty_internal_templateparser.y"
- function yy_r84(){
- $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor;
- }
-#line 2554 "smarty_internal_templateparser.php"
-#line 596 "smarty_internal_templateparser.y"
- function yy_r85(){
- $this->_retvalue = 'in_array('.$this->yystack[$this->yyidx + -2]->minor.','.$this->yystack[$this->yyidx + 0]->minor.')';
- }
-#line 2559 "smarty_internal_templateparser.php"
-#line 600 "smarty_internal_templateparser.y"
- function yy_r86(){
- $this->_retvalue = 'in_array('.$this->yystack[$this->yyidx + -2]->minor.',(array)'.$this->yystack[$this->yyidx + 0]->minor.')';
- }
-#line 2564 "smarty_internal_templateparser.php"
-#line 608 "smarty_internal_templateparser.y"
- function yy_r88(){
- $this->_retvalue = '!('.$this->yystack[$this->yyidx + -2]->minor.' % '.$this->yystack[$this->yyidx + 0]->minor.')';
- }
-#line 2569 "smarty_internal_templateparser.php"
-#line 612 "smarty_internal_templateparser.y"
- function yy_r89(){
- $this->_retvalue = '('.$this->yystack[$this->yyidx + -2]->minor.' % '.$this->yystack[$this->yyidx + 0]->minor.')';
- }
-#line 2574 "smarty_internal_templateparser.php"
-#line 616 "smarty_internal_templateparser.y"
- function yy_r90(){
- $this->_retvalue = '!(1 & '.$this->yystack[$this->yyidx + -1]->minor.')';
- }
-#line 2579 "smarty_internal_templateparser.php"
-#line 620 "smarty_internal_templateparser.y"
- function yy_r91(){
- $this->_retvalue = '(1 & '.$this->yystack[$this->yyidx + -1]->minor.')';
- }
-#line 2584 "smarty_internal_templateparser.php"
-#line 624 "smarty_internal_templateparser.y"
- function yy_r92(){
- $this->_retvalue = '!(1 & '.$this->yystack[$this->yyidx + -2]->minor.' / '.$this->yystack[$this->yyidx + 0]->minor.')';
- }
-#line 2589 "smarty_internal_templateparser.php"
-#line 628 "smarty_internal_templateparser.y"
- function yy_r93(){
- $this->_retvalue = '(1 & '.$this->yystack[$this->yyidx + -2]->minor.' / '.$this->yystack[$this->yyidx + 0]->minor.')';
- }
-#line 2594 "smarty_internal_templateparser.php"
-#line 652 "smarty_internal_templateparser.y"
- function yy_r99(){
- $this->prefix_number++;
- $this->compiler->prefix_code[] = 'prefix_number.'='.$this->yystack[$this->yyidx + 0]->minor.';?>';
- $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.'$_tmp'.$this->prefix_number;
- }
-#line 2601 "smarty_internal_templateparser.php"
-#line 661 "smarty_internal_templateparser.y"
- function yy_r100(){
- $this->_retvalue = $this->yystack[$this->yyidx + -6]->minor.' ? '. $this->compileVariable("'".$this->yystack[$this->yyidx + -2]->minor."'") . ' : '.$this->yystack[$this->yyidx + 0]->minor;
- }
-#line 2606 "smarty_internal_templateparser.php"
-#line 665 "smarty_internal_templateparser.y"
- function yy_r101(){
- $this->_retvalue = $this->yystack[$this->yyidx + -5]->minor.' ? '.$this->yystack[$this->yyidx + -2]->minor.' : '.$this->yystack[$this->yyidx + 0]->minor;
- }
-#line 2611 "smarty_internal_templateparser.php"
-#line 680 "smarty_internal_templateparser.y"
- function yy_r104(){
- $this->_retvalue = '!'.$this->yystack[$this->yyidx + 0]->minor;
- }
-#line 2616 "smarty_internal_templateparser.php"
-#line 701 "smarty_internal_templateparser.y"
- function yy_r109(){
- $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor;
- }
-#line 2621 "smarty_internal_templateparser.php"
-#line 705 "smarty_internal_templateparser.y"
- function yy_r110(){
- $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.'.';
- }
-#line 2626 "smarty_internal_templateparser.php"
-#line 709 "smarty_internal_templateparser.y"
- function yy_r111(){
- $this->_retvalue = '.'.$this->yystack[$this->yyidx + 0]->minor;
- }
-#line 2631 "smarty_internal_templateparser.php"
-#line 714 "smarty_internal_templateparser.y"
- function yy_r112(){
- if (preg_match('~^true$~i', $this->yystack[$this->yyidx + 0]->minor)) {
- $this->_retvalue = 'true';
- } elseif (preg_match('~^false$~i', $this->yystack[$this->yyidx + 0]->minor)) {
- $this->_retvalue = 'false';
- } elseif (preg_match('~^null$~i', $this->yystack[$this->yyidx + 0]->minor)) {
- $this->_retvalue = 'null';
- } else {
- $this->_retvalue = "'".$this->yystack[$this->yyidx + 0]->minor."'";
- }
- }
-#line 2644 "smarty_internal_templateparser.php"
-#line 732 "smarty_internal_templateparser.y"
- function yy_r114(){
- $this->_retvalue = "(". $this->yystack[$this->yyidx + -1]->minor .")";
- }
-#line 2649 "smarty_internal_templateparser.php"
-#line 747 "smarty_internal_templateparser.y"
- function yy_r117(){
- if (!$this->security || isset($this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor]) || $this->smarty->security_policy->isTrustedStaticClass($this->yystack[$this->yyidx + -2]->minor, $this->compiler)) {
- if (isset($this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor])) {
- $this->_retvalue = $this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor].'::'.$this->yystack[$this->yyidx + 0]->minor;
- } else {
- $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'::'.$this->yystack[$this->yyidx + 0]->minor;
- }
- } else {
- $this->compiler->trigger_template_error ("static class '".$this->yystack[$this->yyidx + -2]->minor."' is undefined or not allowed by security setting");
- }
- }
-#line 2662 "smarty_internal_templateparser.php"
-#line 759 "smarty_internal_templateparser.y"
- function yy_r118(){
- if ($this->yystack[$this->yyidx + -2]->minor['var'] == '\'smarty\'') {
- $this->_retvalue = $this->compiler->compileTag('private_special_variable',array(),$this->yystack[$this->yyidx + -2]->minor['smarty_internal_index']).'::'.$this->yystack[$this->yyidx + 0]->minor;
- } else {
- $this->_retvalue = $this->compileVariable($this->yystack[$this->yyidx + -2]->minor['var']).$this->yystack[$this->yyidx + -2]->minor['smarty_internal_index'].'::'.$this->yystack[$this->yyidx + 0]->minor;
- }
- }
-#line 2671 "smarty_internal_templateparser.php"
-#line 768 "smarty_internal_templateparser.y"
- function yy_r119(){
- $this->prefix_number++;
- $this->compiler->prefix_code[] = ''.$this->yystack[$this->yyidx + 0]->minor.'prefix_number.'=ob_get_clean();?>';
- $this->_retvalue = '$_tmp'.$this->prefix_number;
- }
-#line 2678 "smarty_internal_templateparser.php"
-#line 783 "smarty_internal_templateparser.y"
- function yy_r121(){
- if ($this->yystack[$this->yyidx + 0]->minor['var'] == '\'smarty\'') {
- $smarty_var = $this->compiler->compileTag('private_special_variable',array(),$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']);
- $this->_retvalue = $smarty_var;
- } else {
- // used for array reset,next,prev,end,current
- $this->last_variable = $this->yystack[$this->yyidx + 0]->minor['var'];
- $this->last_index = $this->yystack[$this->yyidx + 0]->minor['smarty_internal_index'];
- $this->_retvalue = $this->compileVariable($this->yystack[$this->yyidx + 0]->minor['var']).$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index'];
- }
- }
-#line 2691 "smarty_internal_templateparser.php"
-#line 796 "smarty_internal_templateparser.y"
- function yy_r122(){
- $this->_retvalue = '$_smarty_tpl->tpl_vars['. $this->yystack[$this->yyidx + -2]->minor .']->'.$this->yystack[$this->yyidx + 0]->minor;
- }
-#line 2696 "smarty_internal_templateparser.php"
-#line 806 "smarty_internal_templateparser.y"
- function yy_r124(){
- $this->_retvalue = '$_smarty_tpl->getConfigVariable(\''. $this->yystack[$this->yyidx + -1]->minor .'\')';
- }
-#line 2701 "smarty_internal_templateparser.php"
-#line 810 "smarty_internal_templateparser.y"
- function yy_r125(){
- $this->_retvalue = '$_smarty_tpl->getConfigVariable('. $this->yystack[$this->yyidx + -1]->minor .')';
- }
-#line 2706 "smarty_internal_templateparser.php"
-#line 814 "smarty_internal_templateparser.y"
- function yy_r126(){
- $this->_retvalue = array('var'=>$this->yystack[$this->yyidx + -1]->minor, 'smarty_internal_index'=>$this->yystack[$this->yyidx + 0]->minor);
- }
-#line 2711 "smarty_internal_templateparser.php"
-#line 827 "smarty_internal_templateparser.y"
- function yy_r128(){
- return;
- }
-#line 2716 "smarty_internal_templateparser.php"
-#line 833 "smarty_internal_templateparser.y"
- function yy_r129(){
- $this->_retvalue = '['.$this->compileVariable($this->yystack[$this->yyidx + 0]->minor).']';
- }
-#line 2721 "smarty_internal_templateparser.php"
-#line 837 "smarty_internal_templateparser.y"
- function yy_r130(){
- $this->_retvalue = '['.$this->compileVariable($this->yystack[$this->yyidx + -2]->minor).'->'.$this->yystack[$this->yyidx + 0]->minor.']';
- }
-#line 2726 "smarty_internal_templateparser.php"
-#line 841 "smarty_internal_templateparser.y"
- function yy_r131(){
- $this->_retvalue = "['". $this->yystack[$this->yyidx + 0]->minor ."']";
- }
-#line 2731 "smarty_internal_templateparser.php"
-#line 845 "smarty_internal_templateparser.y"
- function yy_r132(){
- $this->_retvalue = "[". $this->yystack[$this->yyidx + 0]->minor ."]";
- }
-#line 2736 "smarty_internal_templateparser.php"
-#line 849 "smarty_internal_templateparser.y"
- function yy_r133(){
- $this->_retvalue = "[". $this->yystack[$this->yyidx + -1]->minor ."]";
- }
-#line 2741 "smarty_internal_templateparser.php"
-#line 854 "smarty_internal_templateparser.y"
- function yy_r134(){
- $this->_retvalue = '['.$this->compiler->compileTag('private_special_variable',array(),'[\'section\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\'][\'index\']').']';
- }
-#line 2746 "smarty_internal_templateparser.php"
-#line 858 "smarty_internal_templateparser.y"
- function yy_r135(){
- $this->_retvalue = '['.$this->compiler->compileTag('private_special_variable',array(),'[\'section\'][\''.$this->yystack[$this->yyidx + -3]->minor.'\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\']').']';
- }
-#line 2751 "smarty_internal_templateparser.php"
-#line 868 "smarty_internal_templateparser.y"
- function yy_r137(){
- $this->_retvalue = '[]';
- }
-#line 2756 "smarty_internal_templateparser.php"
-#line 881 "smarty_internal_templateparser.y"
- function yy_r139(){
- $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor;
- }
-#line 2761 "smarty_internal_templateparser.php"
-#line 886 "smarty_internal_templateparser.y"
- function yy_r140(){
- $this->_retvalue = '\''.$this->yystack[$this->yyidx + 0]->minor.'\'';
- }
-#line 2766 "smarty_internal_templateparser.php"
-#line 891 "smarty_internal_templateparser.y"
- function yy_r141(){
- $this->_retvalue = '('.$this->yystack[$this->yyidx + -1]->minor.')';
- }
-#line 2771 "smarty_internal_templateparser.php"
-#line 898 "smarty_internal_templateparser.y"
- function yy_r142(){
- if ($this->yystack[$this->yyidx + -1]->minor['var'] == '\'smarty\'') {
- $this->_retvalue = $this->compiler->compileTag('private_special_variable',array(),$this->yystack[$this->yyidx + -1]->minor['smarty_internal_index']).$this->yystack[$this->yyidx + 0]->minor;
- } else {
- $this->_retvalue = $this->compileVariable($this->yystack[$this->yyidx + -1]->minor['var']).$this->yystack[$this->yyidx + -1]->minor['smarty_internal_index'].$this->yystack[$this->yyidx + 0]->minor;
- }
- }
-#line 2780 "smarty_internal_templateparser.php"
-#line 907 "smarty_internal_templateparser.y"
- function yy_r143(){
- $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor;
- }
-#line 2785 "smarty_internal_templateparser.php"
-#line 912 "smarty_internal_templateparser.y"
- function yy_r144(){
- $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor;
- }
-#line 2790 "smarty_internal_templateparser.php"
-#line 917 "smarty_internal_templateparser.y"
- function yy_r145(){
- if ($this->security && substr($this->yystack[$this->yyidx + -1]->minor,0,1) == '_') {
- $this->compiler->trigger_template_error (self::Err1);
- }
- $this->_retvalue = '->'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor;
- }
-#line 2798 "smarty_internal_templateparser.php"
-#line 924 "smarty_internal_templateparser.y"
- function yy_r146(){
- if ($this->security) {
- $this->compiler->trigger_template_error (self::Err2);
- }
- $this->_retvalue = '->{'.$this->compileVariable($this->yystack[$this->yyidx + -1]->minor).$this->yystack[$this->yyidx + 0]->minor.'}';
- }
-#line 2806 "smarty_internal_templateparser.php"
-#line 931 "smarty_internal_templateparser.y"
- function yy_r147(){
- if ($this->security) {
- $this->compiler->trigger_template_error (self::Err2);
- }
- $this->_retvalue = '->{'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}';
- }
-#line 2814 "smarty_internal_templateparser.php"
-#line 938 "smarty_internal_templateparser.y"
- function yy_r148(){
- if ($this->security) {
- $this->compiler->trigger_template_error (self::Err2);
- }
- $this->_retvalue = '->{\''.$this->yystack[$this->yyidx + -4]->minor.'\'.'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}';
- }
-#line 2822 "smarty_internal_templateparser.php"
-#line 946 "smarty_internal_templateparser.y"
- function yy_r149(){
- $this->_retvalue = '->'.$this->yystack[$this->yyidx + 0]->minor;
- }
-#line 2827 "smarty_internal_templateparser.php"
-#line 954 "smarty_internal_templateparser.y"
- function yy_r150(){
- if (!$this->security || $this->smarty->security_policy->isTrustedPhpFunction($this->yystack[$this->yyidx + -3]->minor, $this->compiler)) {
- if (strcasecmp($this->yystack[$this->yyidx + -3]->minor,'isset') === 0 || strcasecmp($this->yystack[$this->yyidx + -3]->minor,'empty') === 0 || strcasecmp($this->yystack[$this->yyidx + -3]->minor,'array') === 0 || is_callable($this->yystack[$this->yyidx + -3]->minor)) {
- $func_name = strtolower($this->yystack[$this->yyidx + -3]->minor);
- if ($func_name == 'isset') {
- if (count($this->yystack[$this->yyidx + -1]->minor) == 0) {
- $this->compiler->trigger_template_error ('Illegal number of paramer in "isset()"');
- }
- $par = implode(',',$this->yystack[$this->yyidx + -1]->minor);
- if (strncasecmp($par,'$_smarty_tpl->getConfigVariable',strlen('$_smarty_tpl->getConfigVariable')) === 0) {
- $this->prefix_number++;
- $this->compiler->prefix_code[] = 'prefix_number.'='.str_replace(')',', false)',$par).';?>';
- $isset_par = '$_tmp'.$this->prefix_number;
- } else {
- $isset_par=str_replace("')->value","',null,true,false)->value",$par);
- }
- $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . "(". $isset_par .")";
- } elseif (in_array($func_name,array('empty','reset','current','end','prev','next'))){
- if (count($this->yystack[$this->yyidx + -1]->minor) != 1) {
- $this->compiler->trigger_template_error ('Illegal number of paramer in "empty()"');
- }
- if ($func_name == 'empty') {
- $this->_retvalue = $func_name.'('.str_replace("')->value","',null,true,false)->value",$this->yystack[$this->yyidx + -1]->minor[0]).')';
- } else {
- $this->_retvalue = $func_name.'('.$this->yystack[$this->yyidx + -1]->minor[0].')';
- }
- } else {
- $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . "(". implode(',',$this->yystack[$this->yyidx + -1]->minor) .")";
- }
- } else {
- $this->compiler->trigger_template_error ("unknown function \"" . $this->yystack[$this->yyidx + -3]->minor . "\"");
- }
- }
- }
-#line 2863 "smarty_internal_templateparser.php"
-#line 992 "smarty_internal_templateparser.y"
- function yy_r151(){
- if ($this->security && substr($this->yystack[$this->yyidx + -3]->minor,0,1) == '_') {
- $this->compiler->trigger_template_error (self::Err1);
- }
- $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . "(". implode(',',$this->yystack[$this->yyidx + -1]->minor) .")";
- }
-#line 2871 "smarty_internal_templateparser.php"
-#line 999 "smarty_internal_templateparser.y"
- function yy_r152(){
- if ($this->security) {
- $this->compiler->trigger_template_error (self::Err2);
- }
- $this->prefix_number++;
- $this->compiler->prefix_code[] = 'prefix_number.'='.$this->compileVariable("'".$this->yystack[$this->yyidx + -3]->minor."'").';?>';
- $this->_retvalue = '$_tmp'.$this->prefix_number.'('. implode(',',$this->yystack[$this->yyidx + -1]->minor) .')';
- }
-#line 2881 "smarty_internal_templateparser.php"
-#line 1010 "smarty_internal_templateparser.y"
- function yy_r153(){
- $this->_retvalue = array_merge($this->yystack[$this->yyidx + -2]->minor,array($this->yystack[$this->yyidx + 0]->minor));
- }
-#line 2886 "smarty_internal_templateparser.php"
-#line 1027 "smarty_internal_templateparser.y"
- function yy_r156(){
- $this->_retvalue = array_merge($this->yystack[$this->yyidx + -2]->minor,array(array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor)));
- }
-#line 2891 "smarty_internal_templateparser.php"
-#line 1031 "smarty_internal_templateparser.y"
- function yy_r157(){
- $this->_retvalue = array(array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor));
- }
-#line 2896 "smarty_internal_templateparser.php"
-#line 1039 "smarty_internal_templateparser.y"
- function yy_r159(){
- $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor);
- }
-#line 2901 "smarty_internal_templateparser.php"
-#line 1047 "smarty_internal_templateparser.y"
- function yy_r160(){
- $this->_retvalue = array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor);
- }
-#line 2906 "smarty_internal_templateparser.php"
-#line 1081 "smarty_internal_templateparser.y"
- function yy_r167(){
- $this->_retvalue = '$'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor;
- }
-#line 2911 "smarty_internal_templateparser.php"
-#line 1086 "smarty_internal_templateparser.y"
- function yy_r168(){
- $this->_retvalue = '$'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor;
- }
-#line 2916 "smarty_internal_templateparser.php"
-#line 1092 "smarty_internal_templateparser.y"
- function yy_r169(){
- $this->_retvalue = '==';
- }
-#line 2921 "smarty_internal_templateparser.php"
-#line 1096 "smarty_internal_templateparser.y"
- function yy_r170(){
- $this->_retvalue = '!=';
- }
-#line 2926 "smarty_internal_templateparser.php"
-#line 1100 "smarty_internal_templateparser.y"
- function yy_r171(){
- $this->_retvalue = '>';
- }
-#line 2931 "smarty_internal_templateparser.php"
-#line 1104 "smarty_internal_templateparser.y"
- function yy_r172(){
- $this->_retvalue = '<';
- }
-#line 2936 "smarty_internal_templateparser.php"
-#line 1108 "smarty_internal_templateparser.y"
- function yy_r173(){
- $this->_retvalue = '>=';
- }
-#line 2941 "smarty_internal_templateparser.php"
-#line 1112 "smarty_internal_templateparser.y"
- function yy_r174(){
- $this->_retvalue = '<=';
- }
-#line 2946 "smarty_internal_templateparser.php"
-#line 1116 "smarty_internal_templateparser.y"
- function yy_r175(){
- $this->_retvalue = '===';
- }
-#line 2951 "smarty_internal_templateparser.php"
-#line 1120 "smarty_internal_templateparser.y"
- function yy_r176(){
- $this->_retvalue = '!==';
- }
-#line 2956 "smarty_internal_templateparser.php"
-#line 1124 "smarty_internal_templateparser.y"
- function yy_r177(){
- $this->_retvalue = '%';
- }
-#line 2961 "smarty_internal_templateparser.php"
-#line 1128 "smarty_internal_templateparser.y"
- function yy_r178(){
- $this->_retvalue = '&&';
- }
-#line 2966 "smarty_internal_templateparser.php"
-#line 1132 "smarty_internal_templateparser.y"
- function yy_r179(){
- $this->_retvalue = '||';
- }
-#line 2971 "smarty_internal_templateparser.php"
-#line 1136 "smarty_internal_templateparser.y"
- function yy_r180(){
- $this->_retvalue = ' XOR ';
- }
-#line 2976 "smarty_internal_templateparser.php"
-#line 1143 "smarty_internal_templateparser.y"
- function yy_r181(){
- $this->_retvalue = 'array('.$this->yystack[$this->yyidx + -1]->minor.')';
- }
-#line 2981 "smarty_internal_templateparser.php"
-#line 1151 "smarty_internal_templateparser.y"
- function yy_r183(){
- $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.','.$this->yystack[$this->yyidx + 0]->minor;
- }
-#line 2986 "smarty_internal_templateparser.php"
-#line 1159 "smarty_internal_templateparser.y"
- function yy_r185(){
- $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'=>'.$this->yystack[$this->yyidx + 0]->minor;
- }
-#line 2991 "smarty_internal_templateparser.php"
-#line 1163 "smarty_internal_templateparser.y"
- function yy_r186(){
- $this->_retvalue = '\''.$this->yystack[$this->yyidx + -2]->minor.'\'=>'.$this->yystack[$this->yyidx + 0]->minor;
- }
-#line 2996 "smarty_internal_templateparser.php"
-#line 1175 "smarty_internal_templateparser.y"
- function yy_r188(){
- $this->_retvalue = "''";
- }
-#line 3001 "smarty_internal_templateparser.php"
-#line 1179 "smarty_internal_templateparser.y"
- function yy_r189(){
- $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor->to_smarty_php();
- }
-#line 3006 "smarty_internal_templateparser.php"
-#line 1184 "smarty_internal_templateparser.y"
- function yy_r190(){
- $this->yystack[$this->yyidx + -1]->minor->append_subtree($this->yystack[$this->yyidx + 0]->minor);
- $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor;
- }
-#line 3012 "smarty_internal_templateparser.php"
-#line 1189 "smarty_internal_templateparser.y"
- function yy_r191(){
- $this->_retvalue = new _smarty_doublequoted($this, $this->yystack[$this->yyidx + 0]->minor);
- }
-#line 3017 "smarty_internal_templateparser.php"
-#line 1193 "smarty_internal_templateparser.y"
- function yy_r192(){
- $this->_retvalue = new _smarty_code($this, $this->yystack[$this->yyidx + -1]->minor);
- }
-#line 3022 "smarty_internal_templateparser.php"
-#line 1201 "smarty_internal_templateparser.y"
- function yy_r194(){
- $this->_retvalue = new _smarty_code($this, '$_smarty_tpl->tpl_vars[\''. substr($this->yystack[$this->yyidx + 0]->minor,1) .'\']->value');
- }
-#line 3027 "smarty_internal_templateparser.php"
-#line 1209 "smarty_internal_templateparser.y"
- function yy_r196(){
- $this->_retvalue = new _smarty_code($this, '('.$this->yystack[$this->yyidx + -1]->minor.')');
- }
-#line 3032 "smarty_internal_templateparser.php"
-#line 1213 "smarty_internal_templateparser.y"
- function yy_r197(){
- $this->_retvalue = new _smarty_tag($this, $this->yystack[$this->yyidx + 0]->minor);
- }
-#line 3037 "smarty_internal_templateparser.php"
-#line 1217 "smarty_internal_templateparser.y"
- function yy_r198(){
- $this->_retvalue = new _smarty_dq_content($this, $this->yystack[$this->yyidx + 0]->minor);
- }
-#line 3042 "smarty_internal_templateparser.php"
-
- private $_retvalue;
-
- function yy_reduce($yyruleno)
- {
- $yymsp = $this->yystack[$this->yyidx];
- if (self::$yyTraceFILE && $yyruleno >= 0
- && $yyruleno < count(self::$yyRuleName)) {
- fprintf(self::$yyTraceFILE, "%sReduce (%d) [%s].\n",
- self::$yyTracePrompt, $yyruleno,
- self::$yyRuleName[$yyruleno]);
- }
-
- $this->_retvalue = $yy_lefthand_side = null;
- if (array_key_exists($yyruleno, self::$yyReduceMap)) {
- // call the action
- $this->_retvalue = null;
- $this->{'yy_r' . self::$yyReduceMap[$yyruleno]}();
- $yy_lefthand_side = $this->_retvalue;
- }
- $yygoto = self::$yyRuleInfo[$yyruleno]['lhs'];
- $yysize = self::$yyRuleInfo[$yyruleno]['rhs'];
- $this->yyidx -= $yysize;
- for($i = $yysize; $i; $i--) {
- // pop all of the right-hand side parameters
- array_pop($this->yystack);
- }
- $yyact = $this->yy_find_reduce_action($this->yystack[$this->yyidx]->stateno, $yygoto);
- if ($yyact < self::YYNSTATE) {
- if (!self::$yyTraceFILE && $yysize) {
- $this->yyidx++;
- $x = new TP_yyStackEntry;
- $x->stateno = $yyact;
- $x->major = $yygoto;
- $x->minor = $yy_lefthand_side;
- $this->yystack[$this->yyidx] = $x;
- } else {
- $this->yy_shift($yyact, $yygoto, $yy_lefthand_side);
- }
- } elseif ($yyact == self::YYNSTATE + self::YYNRULE + 1) {
- $this->yy_accept();
- }
- }
-
- function yy_parse_failed()
- {
- if (self::$yyTraceFILE) {
- fprintf(self::$yyTraceFILE, "%sFail!\n", self::$yyTracePrompt);
- }
- while ($this->yyidx >= 0) {
- $this->yy_pop_parser_stack();
- }
- }
-
- function yy_syntax_error($yymajor, $TOKEN)
- {
-#line 76 "smarty_internal_templateparser.y"
-
- $this->internalError = true;
- $this->yymajor = $yymajor;
- $this->compiler->trigger_template_error();
-#line 3105 "smarty_internal_templateparser.php"
- }
-
- function yy_accept()
- {
- if (self::$yyTraceFILE) {
- fprintf(self::$yyTraceFILE, "%sAccept!\n", self::$yyTracePrompt);
- }
- while ($this->yyidx >= 0) {
- $stack = $this->yy_pop_parser_stack();
- }
-#line 68 "smarty_internal_templateparser.y"
-
- $this->successful = !$this->internalError;
- $this->internalError = false;
- $this->retvalue = $this->_retvalue;
- //echo $this->retvalue."\n\n";
-#line 3123 "smarty_internal_templateparser.php"
- }
-
- function doParse($yymajor, $yytokenvalue)
- {
- $yyerrorhit = 0; /* True if yymajor has invoked an error */
-
- if ($this->yyidx === null || $this->yyidx < 0) {
- $this->yyidx = 0;
- $this->yyerrcnt = -1;
- $x = new TP_yyStackEntry;
- $x->stateno = 0;
- $x->major = 0;
- $this->yystack = array();
- array_push($this->yystack, $x);
- }
- $yyendofinput = ($yymajor==0);
-
- if (self::$yyTraceFILE) {
- fprintf(self::$yyTraceFILE, "%sInput %s\n",
- self::$yyTracePrompt, $this->yyTokenName[$yymajor]);
- }
-
- do {
- $yyact = $this->yy_find_shift_action($yymajor);
- if ($yymajor < self::YYERRORSYMBOL &&
- !$this->yy_is_expected_token($yymajor)) {
- // force a syntax error
- $yyact = self::YY_ERROR_ACTION;
- }
- if ($yyact < self::YYNSTATE) {
- $this->yy_shift($yyact, $yymajor, $yytokenvalue);
- $this->yyerrcnt--;
- if ($yyendofinput && $this->yyidx >= 0) {
- $yymajor = 0;
- } else {
- $yymajor = self::YYNOCODE;
- }
- } elseif ($yyact < self::YYNSTATE + self::YYNRULE) {
- $this->yy_reduce($yyact - self::YYNSTATE);
- } elseif ($yyact == self::YY_ERROR_ACTION) {
- if (self::$yyTraceFILE) {
- fprintf(self::$yyTraceFILE, "%sSyntax Error!\n",
- self::$yyTracePrompt);
- }
- if (self::YYERRORSYMBOL) {
- if ($this->yyerrcnt < 0) {
- $this->yy_syntax_error($yymajor, $yytokenvalue);
- }
- $yymx = $this->yystack[$this->yyidx]->major;
- if ($yymx == self::YYERRORSYMBOL || $yyerrorhit ){
- if (self::$yyTraceFILE) {
- fprintf(self::$yyTraceFILE, "%sDiscard input token %s\n",
- self::$yyTracePrompt, $this->yyTokenName[$yymajor]);
- }
- $this->yy_destructor($yymajor, $yytokenvalue);
- $yymajor = self::YYNOCODE;
- } else {
- while ($this->yyidx >= 0 &&
- $yymx != self::YYERRORSYMBOL &&
- ($yyact = $this->yy_find_shift_action(self::YYERRORSYMBOL)) >= self::YYNSTATE
- ){
- $this->yy_pop_parser_stack();
- }
- if ($this->yyidx < 0 || $yymajor==0) {
- $this->yy_destructor($yymajor, $yytokenvalue);
- $this->yy_parse_failed();
- $yymajor = self::YYNOCODE;
- } elseif ($yymx != self::YYERRORSYMBOL) {
- $u2 = 0;
- $this->yy_shift($yyact, self::YYERRORSYMBOL, $u2);
- }
- }
- $this->yyerrcnt = 3;
- $yyerrorhit = 1;
- } else {
- if ($this->yyerrcnt <= 0) {
- $this->yy_syntax_error($yymajor, $yytokenvalue);
- }
- $this->yyerrcnt = 3;
- $this->yy_destructor($yymajor, $yytokenvalue);
- if ($yyendofinput) {
- $this->yy_parse_failed();
- }
- $yymajor = self::YYNOCODE;
- }
- } else {
- $this->yy_accept();
- $yymajor = self::YYNOCODE;
- }
- } while ($yymajor != self::YYNOCODE && $this->yyidx >= 0);
- }
-}
-?>
\ No newline at end of file
diff --git a/tools/smarty/sysplugins/smarty_internal_utility.php b/tools/smarty/sysplugins/smarty_internal_utility.php
deleted file mode 100755
index 3e3e85f65..000000000
--- a/tools/smarty/sysplugins/smarty_internal_utility.php
+++ /dev/null
@@ -1,810 +0,0 @@
-
- * @author Uwe Tews
- * @package Smarty
- * @subpackage PluginsInternal
- * @version 3-SVN$Rev: 3286 $
- */
-
-
-/**
- * Utility class
- *
- * @package Smarty
- * @subpackage Security
- */
-class Smarty_Internal_Utility {
-
- /**
- * private constructor to prevent calls creation of new instances
- */
- private final function __construct()
- {
- // intentionally left blank
- }
-
- /**
- * Compile all template files
- *
- * @param string $extension template file name extension
- * @param bool $force_compile force all to recompile
- * @param int $time_limit set maximum execution time
- * @param int $max_errors set maximum allowed errors
- * @param Smarty $smarty Smarty instance
- * @return integer number of template files compiled
- */
- public static function compileAllTemplates($extention, $force_compile, $time_limit, $max_errors, Smarty $smarty)
- {
- // switch off time limit
- if (function_exists('set_time_limit')) {
- @set_time_limit($time_limit);
- }
- $smarty->force_compile = $force_compile;
- $_count = 0;
- $_error_count = 0;
- // loop over array of template directories
- foreach($smarty->getTemplateDir() as $_dir) {
- $_compileDirs = new RecursiveDirectoryIterator($_dir);
- $_compile = new RecursiveIteratorIterator($_compileDirs);
- foreach ($_compile as $_fileinfo) {
- if (substr($_fileinfo->getBasename(),0,1) == '.' || strpos($_fileinfo, '.svn') !== false) continue;
- $_file = $_fileinfo->getFilename();
- if (!substr_compare($_file, $extention, - strlen($extention)) == 0) continue;
- if ($_fileinfo->getPath() == substr($_dir, 0, -1)) {
- $_template_file = $_file;
- } else {
- $_template_file = substr($_fileinfo->getPath(), strlen($_dir)) . DS . $_file;
- }
- echo '
', $_dir, '---', $_template_file;
- flush();
- $_start_time = microtime(true);
- try {
- $_tpl = $smarty->createTemplate($_template_file,null,null,null,false);
- if ($_tpl->mustCompile()) {
- $_tpl->compileTemplateSource();
- echo ' compiled in ', microtime(true) - $_start_time, ' seconds';
- flush();
- } else {
- echo ' is up to date';
- flush();
- }
- }
- catch (Exception $e) {
- echo 'Error: ', $e->getMessage(), "
";
- $_error_count++;
- }
- // free memory
- $smarty->template_objects = array();
- $_tpl->smarty->template_objects = array();
- $_tpl = null;
- if ($max_errors !== null && $_error_count == $max_errors) {
- echo '
too many errors';
- exit();
- }
- }
- }
- return $_count;
- }
-
- /**
- * Compile all config files
- *
- * @param string $extension config file name extension
- * @param bool $force_compile force all to recompile
- * @param int $time_limit set maximum execution time
- * @param int $max_errors set maximum allowed errors
- * @param Smarty $smarty Smarty instance
- * @return integer number of config files compiled
- */
- public static function compileAllConfig($extention, $force_compile, $time_limit, $max_errors, Smarty $smarty)
- {
- // switch off time limit
- if (function_exists('set_time_limit')) {
- @set_time_limit($time_limit);
- }
- $smarty->force_compile = $force_compile;
- $_count = 0;
- $_error_count = 0;
- // loop over array of template directories
- foreach($smarty->getConfigDir() as $_dir) {
- $_compileDirs = new RecursiveDirectoryIterator($_dir);
- $_compile = new RecursiveIteratorIterator($_compileDirs);
- foreach ($_compile as $_fileinfo) {
- if (substr($_fileinfo->getBasename(),0,1) == '.' || strpos($_fileinfo, '.svn') !== false) continue;
- $_file = $_fileinfo->getFilename();
- if (!substr_compare($_file, $extention, - strlen($extention)) == 0) continue;
- if ($_fileinfo->getPath() == substr($_dir, 0, -1)) {
- $_config_file = $_file;
- } else {
- $_config_file = substr($_fileinfo->getPath(), strlen($_dir)) . DS . $_file;
- }
- echo '
', $_dir, '---', $_config_file;
- flush();
- $_start_time = microtime(true);
- try {
- $_config = new Smarty_Internal_Config($_config_file, $smarty);
- if ($_config->mustCompile()) {
- $_config->compileConfigSource();
- echo ' compiled in ', microtime(true) - $_start_time, ' seconds';
- flush();
- } else {
- echo ' is up to date';
- flush();
- }
- }
- catch (Exception $e) {
- echo 'Error: ', $e->getMessage(), "
";
- $_error_count++;
- }
- if ($max_errors !== null && $_error_count == $max_errors) {
- echo '
too many errors';
- exit();
- }
- }
- }
- return $_count;
- }
-
- /**
- * Delete compiled template file
- *
- * @param string $resource_name template name
- * @param string $compile_id compile id
- * @param integer $exp_time expiration time
- * @param Smarty $smarty Smarty instance
- * @return integer number of template files deleted
- */
- public static function clearCompiledTemplate($resource_name, $compile_id, $exp_time, Smarty $smarty)
- {
- $_compile_dir = $smarty->getCompileDir();
- $_compile_id = isset($compile_id) ? preg_replace('![^\w\|]+!', '_', $compile_id) : null;
- $_dir_sep = $smarty->use_sub_dirs ? DS : '^';
- if (isset($resource_name)) {
- $_save_stat = $smarty->caching;
- $smarty->caching = false;
- $tpl = new $smarty->template_class($resource_name, $smarty);
- $smarty->caching = $_save_stat;
-
- // remove from template cache
- $tpl->source; // have the template registered before unset()
- if ($smarty->allow_ambiguous_resources) {
- $_templateId = $tpl->source->unique_resource . $tpl->cache_id . $tpl->compile_id;
- } else {
- $_templateId = $smarty->joined_template_dir . '#' . $resource_name . $tpl->cache_id . $tpl->compile_id;
- }
- if (isset($_templateId[150])) {
- $_templateId = sha1($_templateId);
- }
- unset($smarty->template_objects[$_templateId]);
-
- if ($tpl->source->exists) {
- $_resource_part_1 = basename(str_replace('^', '/', $tpl->compiled->filepath));
- $_resource_part_1_length = strlen($_resource_part_1);
- } else {
- return 0;
- }
-
- $_resource_part_2 = str_replace('.php','.cache.php',$_resource_part_1);
- $_resource_part_2_length = strlen($_resource_part_2);
- } else {
- $_resource_part = '';
- }
- $_dir = $_compile_dir;
- if ($smarty->use_sub_dirs && isset($_compile_id)) {
- $_dir .= $_compile_id . $_dir_sep;
- }
- if (isset($_compile_id)) {
- $_compile_id_part = $_compile_dir . $_compile_id . $_dir_sep;
- $_compile_id_part_length = strlen($_compile_id_part);
- }
- $_count = 0;
- try {
- $_compileDirs = new RecursiveDirectoryIterator($_dir);
- // NOTE: UnexpectedValueException thrown for PHP >= 5.3
- } catch (Exception $e) {
- return 0;
- }
- $_compile = new RecursiveIteratorIterator($_compileDirs, RecursiveIteratorIterator::CHILD_FIRST);
- foreach ($_compile as $_file) {
- if (substr($_file->getBasename(), 0, 1) == '.' || strpos($_file, '.svn') !== false)
- continue;
-
- $_filepath = (string) $_file;
-
- if ($_file->isDir()) {
- if (!$_compile->isDot()) {
- // delete folder if empty
- @rmdir($_file->getPathname());
- }
- } else {
- $unlink = false;
- if ((!isset($_compile_id) || (isset($_filepath[$_compile_id_part_length]) && !strncmp($_filepath, $_compile_id_part, $_compile_id_part_length)))
- && (!isset($resource_name)
- || (isset($_filepath[$_resource_part_1_length])
- && substr_compare($_filepath, $_resource_part_1, -$_resource_part_1_length, $_resource_part_1_length) == 0)
- || (isset($_filepath[$_resource_part_2_length])
- && substr_compare($_filepath, $_resource_part_2, -$_resource_part_2_length, $_resource_part_2_length) == 0))) {
- if (isset($exp_time)) {
- if (time() - @filemtime($_filepath) >= $exp_time) {
- $unlink = true;
- }
- } else {
- $unlink = true;
- }
- }
-
- if ($unlink && @unlink($_filepath)) {
- $_count++;
- }
- }
- }
- // clear compiled cache
- Smarty_Resource::$sources = array();
- Smarty_Resource::$compileds = array();
- return $_count;
- }
-
- /**
- * Return array of tag/attributes of all tags used by an template
- *
- * @param Smarty_Internal_Template $templae template object
- * @return array of tag/attributes
- */
- public static function getTags(Smarty_Internal_Template $template)
- {
- $template->smarty->get_used_tags = true;
- $template->compileTemplateSource();
- return $template->used_tags;
- }
-
-
- /**
- * diagnose Smarty setup
- *
- * If $errors is secified, the diagnostic report will be appended to the array, rather than being output.
- *
- * @param Smarty $smarty Smarty instance to test
- * @param array $errors array to push results into rather than outputting them
- * @return bool status, true if everything is fine, false else
- */
- public static function testInstall(Smarty $smarty, &$errors=null)
- {
- $status = true;
-
- if ($errors === null) {
- echo "\n";
- echo "Smarty Installation test...\n";
- echo "Testing template directory...\n";
- }
-
- // test if all registered template_dir are accessible
- foreach($smarty->getTemplateDir() as $template_dir) {
- $_template_dir = $template_dir;
- $template_dir = realpath($template_dir);
- // resolve include_path or fail existance
- if (!$template_dir) {
- if ($smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_template_dir)) {
- // try PHP include_path
- if (($template_dir = Smarty_Internal_Get_Include_Path::getIncludePath($_template_dir)) !== false) {
- if ($errors === null) {
- echo "$template_dir is OK.\n";
- }
-
- continue;
- } else {
- $status = false;
- $message = "FAILED: $_template_dir does not exist (and couldn't be found in include_path either)";
- if ($errors === null) {
- echo $message . ".\n";
- } else {
- $errors['template_dir'] = $message;
- }
-
- continue;
- }
- } else {
- $status = false;
- $message = "FAILED: $_template_dir does not exist";
- if ($errors === null) {
- echo $message . ".\n";
- } else {
- $errors['template_dir'] = $message;
- }
-
- continue;
- }
- }
-
- if (!is_dir($template_dir)) {
- $status = false;
- $message = "FAILED: $template_dir is not a directory";
- if ($errors === null) {
- echo $message . ".\n";
- } else {
- $errors['template_dir'] = $message;
- }
- } elseif (!is_readable($template_dir)) {
- $status = false;
- $message = "FAILED: $template_dir is not readable";
- if ($errors === null) {
- echo $message . ".\n";
- } else {
- $errors['template_dir'] = $message;
- }
- } else {
- if ($errors === null) {
- echo "$template_dir is OK.\n";
- }
- }
- }
-
-
- if ($errors === null) {
- echo "Testing compile directory...\n";
- }
-
- // test if registered compile_dir is accessible
- $__compile_dir = $smarty->getCompileDir();
- $_compile_dir = realpath($__compile_dir);
- if (!$_compile_dir) {
- $status = false;
- $message = "FAILED: {$__compile_dir} does not exist";
- if ($errors === null) {
- echo $message . ".\n";
- } else {
- $errors['compile_dir'] = $message;
- }
- } elseif (!is_dir($_compile_dir)) {
- $status = false;
- $message = "FAILED: {$_compile_dir} is not a directory";
- if ($errors === null) {
- echo $message . ".\n";
- } else {
- $errors['compile_dir'] = $message;
- }
- } elseif (!is_readable($_compile_dir)) {
- $status = false;
- $message = "FAILED: {$_compile_dir} is not readable";
- if ($errors === null) {
- echo $message . ".\n";
- } else {
- $errors['compile_dir'] = $message;
- }
- } elseif (!is_writable($_compile_dir)) {
- $status = false;
- $message = "FAILED: {$_compile_dir} is not writable";
- if ($errors === null) {
- echo $message . ".\n";
- } else {
- $errors['compile_dir'] = $message;
- }
- } else {
- if ($errors === null) {
- echo "{$_compile_dir} is OK.\n";
- }
- }
-
-
- if ($errors === null) {
- echo "Testing plugins directory...\n";
- }
-
- // test if all registered plugins_dir are accessible
- // and if core plugins directory is still registered
- $_core_plugins_dir = realpath(dirname(__FILE__) .'/../plugins');
- $_core_plugins_available = false;
- foreach($smarty->getPluginsDir() as $plugin_dir) {
- $_plugin_dir = $plugin_dir;
- $plugin_dir = realpath($plugin_dir);
- // resolve include_path or fail existance
- if (!$plugin_dir) {
- if ($smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_plugin_dir)) {
- // try PHP include_path
- if (($plugin_dir = Smarty_Internal_Get_Include_Path::getIncludePath($_plugin_dir)) !== false) {
- if ($errors === null) {
- echo "$plugin_dir is OK.\n";
- }
-
- continue;
- } else {
- $status = false;
- $message = "FAILED: $_plugin_dir does not exist (and couldn't be found in include_path either)";
- if ($errors === null) {
- echo $message . ".\n";
- } else {
- $errors['plugins_dir'] = $message;
- }
-
- continue;
- }
- } else {
- $status = false;
- $message = "FAILED: $_plugin_dir does not exist";
- if ($errors === null) {
- echo $message . ".\n";
- } else {
- $errors['plugins_dir'] = $message;
- }
-
- continue;
- }
- }
-
- if (!is_dir($plugin_dir)) {
- $status = false;
- $message = "FAILED: $plugin_dir is not a directory";
- if ($errors === null) {
- echo $message . ".\n";
- } else {
- $errors['plugins_dir'] = $message;
- }
- } elseif (!is_readable($plugin_dir)) {
- $status = false;
- $message = "FAILED: $plugin_dir is not readable";
- if ($errors === null) {
- echo $message . ".\n";
- } else {
- $errors['plugins_dir'] = $message;
- }
- } elseif ($_core_plugins_dir && $_core_plugins_dir == realpath($plugin_dir)) {
- $_core_plugins_available = true;
- if ($errors === null) {
- echo "$plugin_dir is OK.\n";
- }
- } else {
- if ($errors === null) {
- echo "$plugin_dir is OK.\n";
- }
- }
- }
- if (!$_core_plugins_available) {
- $status = false;
- $message = "WARNING: Smarty's own libs/plugins is not available";
- if ($errors === null) {
- echo $message . ".\n";
- } elseif (!isset($errors['plugins_dir'])) {
- $errors['plugins_dir'] = $message;
- }
- }
-
- if ($errors === null) {
- echo "Testing cache directory...\n";
- }
-
-
- // test if all registered cache_dir is accessible
- $__cache_dir = $smarty->getCacheDir();
- $_cache_dir = realpath($__cache_dir);
- if (!$_cache_dir) {
- $status = false;
- $message = "FAILED: {$__cache_dir} does not exist";
- if ($errors === null) {
- echo $message . ".\n";
- } else {
- $errors['cache_dir'] = $message;
- }
- } elseif (!is_dir($_cache_dir)) {
- $status = false;
- $message = "FAILED: {$_cache_dir} is not a directory";
- if ($errors === null) {
- echo $message . ".\n";
- } else {
- $errors['cache_dir'] = $message;
- }
- } elseif (!is_readable($_cache_dir)) {
- $status = false;
- $message = "FAILED: {$_cache_dir} is not readable";
- if ($errors === null) {
- echo $message . ".\n";
- } else {
- $errors['cache_dir'] = $message;
- }
- } elseif (!is_writable($_cache_dir)) {
- $status = false;
- $message = "FAILED: {$_cache_dir} is not writable";
- if ($errors === null) {
- echo $message . ".\n";
- } else {
- $errors['cache_dir'] = $message;
- }
- } else {
- if ($errors === null) {
- echo "{$_cache_dir} is OK.\n";
- }
- }
-
-
- if ($errors === null) {
- echo "Testing configs directory...\n";
- }
-
- // test if all registered config_dir are accessible
- foreach($smarty->getConfigDir() as $config_dir) {
- $_config_dir = $config_dir;
- $config_dir = realpath($config_dir);
- // resolve include_path or fail existance
- if (!$config_dir) {
- if ($smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_config_dir)) {
- // try PHP include_path
- if (($config_dir = Smarty_Internal_Get_Include_Path::getIncludePath($_config_dir)) !== false) {
- if ($errors === null) {
- echo "$config_dir is OK.\n";
- }
-
- continue;
- } else {
- $status = false;
- $message = "FAILED: $_config_dir does not exist (and couldn't be found in include_path either)";
- if ($errors === null) {
- echo $message . ".\n";
- } else {
- $errors['config_dir'] = $message;
- }
-
- continue;
- }
- } else {
- $status = false;
- $message = "FAILED: $_config_dir does not exist";
- if ($errors === null) {
- echo $message . ".\n";
- } else {
- $errors['config_dir'] = $message;
- }
-
- continue;
- }
- }
-
- if (!is_dir($config_dir)) {
- $status = false;
- $message = "FAILED: $config_dir is not a directory";
- if ($errors === null) {
- echo $message . ".\n";
- } else {
- $errors['config_dir'] = $message;
- }
- } elseif (!is_readable($config_dir)) {
- $status = false;
- $message = "FAILED: $config_dir is not readable";
- if ($errors === null) {
- echo $message . ".\n";
- } else {
- $errors['config_dir'] = $message;
- }
- } else {
- if ($errors === null) {
- echo "$config_dir is OK.\n";
- }
- }
- }
-
-
- if ($errors === null) {
- echo "Testing sysplugin files...\n";
- }
- // test if sysplugins are available
- $source = SMARTY_SYSPLUGINS_DIR;
- if (is_dir($source)) {
- $expected = array(
- "smarty_cacheresource.php" => true,
- "smarty_cacheresource_custom.php" => true,
- "smarty_cacheresource_keyvaluestore.php" => true,
- "smarty_config_source.php" => true,
- "smarty_internal_cacheresource_file.php" => true,
- "smarty_internal_compile_append.php" => true,
- "smarty_internal_compile_assign.php" => true,
- "smarty_internal_compile_block.php" => true,
- "smarty_internal_compile_break.php" => true,
- "smarty_internal_compile_call.php" => true,
- "smarty_internal_compile_capture.php" => true,
- "smarty_internal_compile_config_load.php" => true,
- "smarty_internal_compile_continue.php" => true,
- "smarty_internal_compile_debug.php" => true,
- "smarty_internal_compile_eval.php" => true,
- "smarty_internal_compile_extends.php" => true,
- "smarty_internal_compile_for.php" => true,
- "smarty_internal_compile_foreach.php" => true,
- "smarty_internal_compile_function.php" => true,
- "smarty_internal_compile_if.php" => true,
- "smarty_internal_compile_include.php" => true,
- "smarty_internal_compile_include_php.php" => true,
- "smarty_internal_compile_insert.php" => true,
- "smarty_internal_compile_ldelim.php" => true,
- "smarty_internal_compile_nocache.php" => true,
- "smarty_internal_compile_private_block_plugin.php" => true,
- "smarty_internal_compile_private_function_plugin.php" => true,
- "smarty_internal_compile_private_modifier.php" => true,
- "smarty_internal_compile_private_object_block_function.php" => true,
- "smarty_internal_compile_private_object_function.php" => true,
- "smarty_internal_compile_private_print_expression.php" => true,
- "smarty_internal_compile_private_registered_block.php" => true,
- "smarty_internal_compile_private_registered_function.php" => true,
- "smarty_internal_compile_private_special_variable.php" => true,
- "smarty_internal_compile_rdelim.php" => true,
- "smarty_internal_compile_section.php" => true,
- "smarty_internal_compile_setfilter.php" => true,
- "smarty_internal_compile_while.php" => true,
- "smarty_internal_compilebase.php" => true,
- "smarty_internal_config.php" => true,
- "smarty_internal_config_file_compiler.php" => true,
- "smarty_internal_configfilelexer.php" => true,
- "smarty_internal_configfileparser.php" => true,
- "smarty_internal_data.php" => true,
- "smarty_internal_debug.php" => true,
- "smarty_internal_filter_handler.php" => true,
- "smarty_internal_function_call_handler.php" => true,
- "smarty_internal_get_include_path.php" => true,
- "smarty_internal_nocache_insert.php" => true,
- "smarty_internal_parsetree.php" => true,
- "smarty_internal_resource_eval.php" => true,
- "smarty_internal_resource_extends.php" => true,
- "smarty_internal_resource_file.php" => true,
- "smarty_internal_resource_registered.php" => true,
- "smarty_internal_resource_stream.php" => true,
- "smarty_internal_resource_string.php" => true,
- "smarty_internal_smartytemplatecompiler.php" => true,
- "smarty_internal_template.php" => true,
- "smarty_internal_templatebase.php" => true,
- "smarty_internal_templatecompilerbase.php" => true,
- "smarty_internal_templatelexer.php" => true,
- "smarty_internal_templateparser.php" => true,
- "smarty_internal_utility.php" => true,
- "smarty_internal_write_file.php" => true,
- "smarty_resource.php" => true,
- "smarty_resource_custom.php" => true,
- "smarty_resource_recompiled.php" => true,
- "smarty_resource_uncompiled.php" => true,
- "smarty_security.php" => true,
- );
- $iterator = new DirectoryIterator($source);
- foreach ($iterator as $file) {
- if (!$file->isDot()) {
- $filename = $file->getFilename();
- if (isset($expected[$filename])) {
- unset($expected[$filename]);
- }
- }
- }
- if ($expected) {
- $status = false;
- $message = "FAILED: files missing from libs/sysplugins: ". join(', ', array_keys($expected));
- if ($errors === null) {
- echo $message . ".\n";
- } else {
- $errors['sysplugins'] = $message;
- }
- } elseif ($errors === null) {
- echo "... OK\n";
- }
- } else {
- $status = false;
- $message = "FAILED: ". SMARTY_SYSPLUGINS_DIR .' is not a directory';
- if ($errors === null) {
- echo $message . ".\n";
- } else {
- $errors['sysplugins_dir_constant'] = $message;
- }
- }
-
- if ($errors === null) {
- echo "Testing plugin files...\n";
- }
- // test if core plugins are available
- $source = SMARTY_PLUGINS_DIR;
- if (is_dir($source)) {
- $expected = array(
- "block.textformat.php" => true,
- "function.counter.php" => true,
- "function.cycle.php" => true,
- "function.fetch.php" => true,
- "function.html_checkboxes.php" => true,
- "function.html_image.php" => true,
- "function.html_options.php" => true,
- "function.html_radios.php" => true,
- "function.html_select_date.php" => true,
- "function.html_select_time.php" => true,
- "function.html_table.php" => true,
- "function.mailto.php" => true,
- "function.math.php" => true,
- "modifier.capitalize.php" => true,
- "modifier.date_format.php" => true,
- "modifier.debug_print_var.php" => true,
- "modifier.escape.php" => true,
- "modifier.regex_replace.php" => true,
- "modifier.replace.php" => true,
- "modifier.spacify.php" => true,
- "modifier.truncate.php" => true,
- "modifiercompiler.cat.php" => true,
- "modifiercompiler.count_characters.php" => true,
- "modifiercompiler.count_paragraphs.php" => true,
- "modifiercompiler.count_sentences.php" => true,
- "modifiercompiler.count_words.php" => true,
- "modifiercompiler.default.php" => true,
- "modifiercompiler.escape.php" => true,
- "modifiercompiler.from_charset.php" => true,
- "modifiercompiler.indent.php" => true,
- "modifiercompiler.lower.php" => true,
- "modifiercompiler.noprint.php" => true,
- "modifiercompiler.string_format.php" => true,
- "modifiercompiler.strip.php" => true,
- "modifiercompiler.strip_tags.php" => true,
- "modifiercompiler.to_charset.php" => true,
- "modifiercompiler.unescape.php" => true,
- "modifiercompiler.upper.php" => true,
- "modifiercompiler.wordwrap.php" => true,
- "outputfilter.trimwhitespace.php" => true,
- "shared.escape_special_chars.php" => true,
- "shared.literal_compiler_param.php" => true,
- "shared.make_timestamp.php" => true,
- "shared.mb_str_replace.php" => true,
- "shared.mb_unicode.php" => true,
- "shared.mb_wordwrap.php" => true,
- "variablefilter.htmlspecialchars.php" => true,
- );
- $iterator = new DirectoryIterator($source);
- foreach ($iterator as $file) {
- if (!$file->isDot()) {
- $filename = $file->getFilename();
- if (isset($expected[$filename])) {
- unset($expected[$filename]);
- }
- }
- }
- if ($expected) {
- $status = false;
- $message = "FAILED: files missing from libs/plugins: ". join(', ', array_keys($expected));
- if ($errors === null) {
- echo $message . ".\n";
- } else {
- $errors['plugins'] = $message;
- }
- } elseif ($errors === null) {
- echo "... OK\n";
- }
- } else {
- $status = false;
- $message = "FAILED: ". SMARTY_PLUGINS_DIR .' is not a directory';
- if ($errors === null) {
- echo $message . ".\n";
- } else {
- $errors['plugins_dir_constant'] = $message;
- }
- }
-
- if ($errors === null) {
- echo "Tests complete.\n";
- echo "\n";
- }
-
- return $status;
- }
-
-}
-
-?>
\ No newline at end of file
diff --git a/tools/smarty/sysplugins/smarty_internal_write_file.php b/tools/smarty/sysplugins/smarty_internal_write_file.php
deleted file mode 100755
index 743503b04..000000000
--- a/tools/smarty/sysplugins/smarty_internal_write_file.php
+++ /dev/null
@@ -1,70 +0,0 @@
-_file_perms !== null) {
- $old_umask = umask(0);
- }
-
- $_dirpath = dirname($_filepath);
- // if subdirs, create dir structure
- if ($_dirpath !== '.' && !file_exists($_dirpath)) {
- mkdir($_dirpath, $smarty->_dir_perms === null ? 0777 : $smarty->_dir_perms, true);
- }
-
- // write to tmp file, then move to overt file lock race condition
- $_tmp_file = $_dirpath . DS . uniqid('wrt');
- if (!file_put_contents($_tmp_file, $_contents)) {
- error_reporting($_error_reporting);
- throw new SmartyException("unable to write file {$_tmp_file}");
- return false;
- }
-
- // remove original file
- @unlink($_filepath);
-
- // rename tmp file
- $success = rename($_tmp_file, $_filepath);
- if (!$success) {
- error_reporting($_error_reporting);
- throw new SmartyException("unable to write file {$_filepath}");
- return false;
- }
-
- if ($smarty->_file_perms !== null) {
- // set file permissions
- chmod($_filepath, $smarty->_file_perms);
- umask($old_umask);
- }
- error_reporting($_error_reporting);
- return true;
- }
-
-}
-
-?>
\ No newline at end of file
diff --git a/tools/smarty/sysplugins/smarty_resource.php b/tools/smarty/sysplugins/smarty_resource.php
deleted file mode 100755
index d27038703..000000000
--- a/tools/smarty/sysplugins/smarty_resource.php
+++ /dev/null
@@ -1,820 +0,0 @@
- true,
- 'string' => true,
- 'extends' => true,
- 'stream' => true,
- 'eval' => true,
- 'php' => true
- );
-
- /**
- * Name of the Class to compile this resource's contents with
- * @var string
- */
- public $compiler_class = 'Smarty_Internal_SmartyTemplateCompiler';
-
- /**
- * Name of the Class to tokenize this resource's contents with
- * @var string
- */
- public $template_lexer_class = 'Smarty_Internal_Templatelexer';
-
- /**
- * Name of the Class to parse this resource's contents with
- * @var string
- */
- public $template_parser_class = 'Smarty_Internal_Templateparser';
-
- /**
- * Load template's source into current template object
- *
- * {@internal The loaded source is assigned to $_template->source->content directly.}}
- *
- * @param Smarty_Template_Source $source source object
- * @return string template source
- * @throws SmartyException if source cannot be loaded
- */
- public abstract function getContent(Smarty_Template_Source $source);
-
- /**
- * populate Source Object with meta data from Resource
- *
- * @param Smarty_Template_Source $source source object
- * @param Smarty_Internal_Template $_template template object
- */
- public abstract function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null);
-
- /**
- * populate Source Object with timestamp and exists from Resource
- *
- * @param Smarty_Template_Source $source source object
- */
- public function populateTimestamp(Smarty_Template_Source $source)
- {
- // intentionally left blank
- }
-
-
- /**
- * modify resource_name according to resource handlers specifications
- *
- * @param Smarty $smarty Smarty instance
- * @param string $resource_name resource_name to make unique
- * @return string unique resource name
- */
- protected function buildUniqueResourceName(Smarty $smarty, $resource_name)
- {
- return get_class($this) . '#' . $smarty->joined_template_dir . '#' . $resource_name;
- }
-
- /**
- * populate Compiled Object with compiled filepath
- *
- * @param Smarty_Template_Compiled $compiled compiled object
- * @param Smarty_Internal_Template $_template template object
- */
- public function populateCompiledFilepath(Smarty_Template_Compiled $compiled, Smarty_Internal_Template $_template)
- {
- $_compile_id = isset($_template->compile_id) ? preg_replace('![^\w\|]+!', '_', $_template->compile_id) : null;
- $_filepath = $compiled->source->uid;
- // if use_sub_dirs, break file into directories
- if ($_template->smarty->use_sub_dirs) {
- $_filepath = substr($_filepath, 0, 2) . DS
- . substr($_filepath, 2, 2) . DS
- . substr($_filepath, 4, 2) . DS
- . $_filepath;
- }
- $_compile_dir_sep = $_template->smarty->use_sub_dirs ? DS : '^';
- if (isset($_compile_id)) {
- $_filepath = $_compile_id . $_compile_dir_sep . $_filepath;
- }
- // caching token
- if ($_template->caching) {
- $_cache = '.cache';
- } else {
- $_cache = '';
- }
- $_compile_dir = $_template->smarty->getCompileDir();
- // set basename if not specified
- $_basename = $this->getBasename($compiled->source);
- if ($_basename === null) {
- $_basename = basename( preg_replace('![^\w\/]+!', '_', $compiled->source->name) );
- }
- // separate (optional) basename by dot
- if ($_basename) {
- $_basename = '.' . $_basename;
- }
-
- $compiled->filepath = $_compile_dir . $_filepath . '.' . $compiled->source->type . $_basename . $_cache . '.php';
- }
-
- /**
- * build template filepath by traversing the template_dir array
- *
- * @param Smarty_Template_Source $source source object
- * @param Smarty_Internal_Template $_template template object
- * @return string fully qualified filepath
- * @throws SmartyException if default template handler is registered but not callable
- */
- protected function buildFilepath(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null)
- {
- $file = $source->name;
- if ($source instanceof Smarty_Config_Source) {
- $_directories = $source->smarty->getConfigDir();
- $_default_handler = $source->smarty->default_config_handler_func;
- } else {
- $_directories = $source->smarty->getTemplateDir();
- $_default_handler = $source->smarty->default_template_handler_func;
- }
-
- // go relative to a given template?
- $_file_is_dotted = $file[0] == '.' && ($file[1] == '.' || $file[1] == '/' || $file[1] == "\\");
- if ($_template && $_template->parent instanceof Smarty_Internal_Template && $_file_is_dotted) {
- if ($_template->parent->source->type != 'file' && $_template->parent->source->type != 'extends' && !$_template->parent->allow_relative_path) {
- throw new SmartyException("Template '{$file}' cannot be relative to template of resource type '{$_template->parent->source->type}'");
- }
- $file = dirname($_template->parent->source->filepath) . DS . $file;
- $_file_exact_match = true;
- if (!preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $file)) {
- // the path gained from the parent template is relative to the current working directory
- // as expansions (like include_path) have already been done
- $file = getcwd() . DS . $file;
- }
- }
-
- // resolve relative path
- if (!preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $file)) {
- $_was_relative_prefix = $file[0] == '.' ? substr($file, 0, strpos($file, '|')) : null;
- $_path = DS . trim($file, '/\\');
- $_was_relative = true;
- } else {
- $_path = $file;
- }
- // don't we all just love windows?
- $_path = str_replace('\\', '/', $_path);
- // resolve simples
- $_path = preg_replace('#(/\./(\./)*)|/{2,}#', '/', $_path);
- // resolve parents
- while (true) {
- $_parent = strpos($_path, '/../');
- if ($_parent === false) {
- break;
- } else if ($_parent === 0) {
- $_path = substr($_path, 3);
- break;
- }
- $_pos = strrpos($_path, '/', $_parent - strlen($_path) - 1);
- if ($_pos === false) {
- // don't we all just love windows?
- $_pos = $_parent;
- }
- $_path = substr_replace($_path, '', $_pos, $_parent + 3 - $_pos);
- }
- if (DS != '/') {
- // don't we all just love windows?
- $_path = str_replace('/', '\\', $_path);
- }
- // revert to relative
- if (isset($_was_relative)) {
- if (isset($_was_relative_prefix)){
- $_path = $_was_relative_prefix . $_path;
- } else {
- $_path = substr($_path, 1);
- }
- }
-
- // this is only required for directories
- $file = rtrim($_path, '/\\');
-
- // files relative to a template only get one shot
- if (isset($_file_exact_match)) {
- return $this->fileExists($source, $file) ? $file : false;
- }
-
- // template_dir index?
- if (preg_match('#^\[(?P[^\]]+)\](?P.+)$#', $file, $match)) {
- $_directory = null;
- // try string indexes
- if (isset($_directories[$match['key']])) {
- $_directory = $_directories[$match['key']];
- } else if (is_numeric($match['key'])) {
- // try numeric index
- $match['key'] = (int) $match['key'];
- if (isset($_directories[$match['key']])) {
- $_directory = $_directories[$match['key']];
- } else {
- // try at location index
- $keys = array_keys($_directories);
- $_directory = $_directories[$keys[$match['key']]];
- }
- }
-
- if ($_directory) {
- $_file = substr($file, strpos($file, ']') + 1);
- $_filepath = $_directory . $_file;
- if ($this->fileExists($source, $_filepath)) {
- return $_filepath;
- }
- }
- }
-
- // relative file name?
- if (!preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $file)) {
- foreach ($_directories as $_directory) {
- $_filepath = $_directory . $file;
- if ($this->fileExists($source, $_filepath)) {
- return $_filepath;
- }
- if ($source->smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_directory)) {
- // try PHP include_path
- if (($_filepath = Smarty_Internal_Get_Include_Path::getIncludePath($_filepath)) !== false) {
- return $_filepath;
- }
- }
- }
- }
-
- // try absolute filepath
- if ($this->fileExists($source, $file)) {
- return $file;
- }
-
- // no tpl file found
- if ($_default_handler) {
- if (!is_callable($_default_handler)) {
- if ($source instanceof Smarty_Config_Source) {
- throw new SmartyException("Default config handler not callable");
- } else {
- throw new SmartyException("Default template handler not callable");
- }
- }
- $_return = call_user_func_array($_default_handler,
- array($source->type, $source->name, &$_content, &$_timestamp, $source->smarty));
- if (is_string($_return)) {
- $source->timestamp = @filemtime($_return);
- $source->exists = !!$source->timestamp;
- return $_return;
- } elseif ($_return === true) {
- $source->content = $_content;
- $source->timestamp = $_timestamp;
- $source->exists = true;
- return $_filepath;
- }
- }
-
- // give up
- return false;
- }
-
- /**
- * test is file exists and save timestamp
- *
- * @param Smarty_Template_Source $source source object
- * @param string $file file name
- * @return bool true if file exists
- */
- protected function fileExists(Smarty_Template_Source $source, $file)
- {
- $source->timestamp = @filemtime($file);
- return $source->exists = !!$source->timestamp;
-
- }
-
- /**
- * Determine basename for compiled filename
- *
- * @param Smarty_Template_Source $source source object
- * @return string resource's basename
- */
- protected function getBasename(Smarty_Template_Source $source)
- {
- return null;
- }
-
- /**
- * Load Resource Handler
- *
- * @param Smarty $smarty smarty object
- * @param string $type name of the resource
- * @return Smarty_Resource Resource Handler
- */
- public static function load(Smarty $smarty, $type)
- {
- // try smarty's cache
- if (isset($smarty->_resource_handlers[$type])) {
- return $smarty->_resource_handlers[$type];
- }
-
- // try registered resource
- if (isset($smarty->registered_resources[$type])) {
- if ($smarty->registered_resources[$type] instanceof Smarty_Resource) {
- $smarty->_resource_handlers[$type] = $smarty->registered_resources[$type];
- // note registered to smarty is not kept unique!
- return $smarty->_resource_handlers[$type];
- }
-
- if (!isset(self::$resources['registered'])) {
- self::$resources['registered'] = new Smarty_Internal_Resource_Registered();
- }
- if (!isset($smarty->_resource_handlers[$type])) {
- $smarty->_resource_handlers[$type] = self::$resources['registered'];
- }
-
- return $smarty->_resource_handlers[$type];
- }
-
- // try sysplugins dir
- if (isset(self::$sysplugins[$type])) {
- if (!isset(self::$resources[$type])) {
- $_resource_class = 'Smarty_Internal_Resource_' . ucfirst($type);
- self::$resources[$type] = new $_resource_class();
- }
- return $smarty->_resource_handlers[$type] = self::$resources[$type];
- }
-
- // try plugins dir
- $_resource_class = 'Smarty_Resource_' . ucfirst($type);
- if ($smarty->loadPlugin($_resource_class)) {
- if (isset(self::$resources[$type])) {
- return $smarty->_resource_handlers[$type] = self::$resources[$type];
- }
-
- if (class_exists($_resource_class, false)) {
- self::$resources[$type] = new $_resource_class();
- return $smarty->_resource_handlers[$type] = self::$resources[$type];
- } else {
- $smarty->registerResource($type, array(
- "smarty_resource_{$type}_source",
- "smarty_resource_{$type}_timestamp",
- "smarty_resource_{$type}_secure",
- "smarty_resource_{$type}_trusted"
- ));
-
- // give it another try, now that the resource is registered properly
- return self::load($smarty, $type);
- }
- }
-
- // try streams
- $_known_stream = stream_get_wrappers();
- if (in_array($type, $_known_stream)) {
- // is known stream
- if (is_object($smarty->security_policy)) {
- $smarty->security_policy->isTrustedStream($type);
- }
- if (!isset(self::$resources['stream'])) {
- self::$resources['stream'] = new Smarty_Internal_Resource_Stream();
- }
- return $smarty->_resource_handlers[$type] = self::$resources['stream'];
- }
-
- // TODO: try default_(template|config)_handler
-
- // give up
- throw new SmartyException("Unkown resource type '{$type}'");
- }
-
- /**
- * extract resource_type and resource_name from template_resource and config_resource
- *
- * @note "C:/foo.tpl" was forced to file resource up till Smarty 3.1.3 (including).
- * @param string $resource_name template_resource or config_resource to parse
- * @param string $default_resource the default resource_type defined in $smarty
- * @param string &$name the parsed resource name
- * @param string &$type the parsed resource type
- * @return void
- */
- protected static function parseResourceName($resource_name, $default_resource, &$name, &$type)
- {
- $parts = explode(':', $resource_name, 2);
- if (!isset($parts[1]) || !isset($parts[0][1])) {
- // no resource given, use default
- // or single character before the colon is not a resource type, but part of the filepath
- $type = $default_resource;
- $name = $resource_name;
- } else {
- $type = $parts[0];
- $name = $parts[1];
- }
- }
-
-
- /**
- * modify resource_name according to resource handlers specifications
- *
- * @param Smarty $smarty Smarty instance
- * @param string $resource_name resource_name to make unique
- * @return string unique resource name
- */
-
- /**
- * modify template_resource according to resource handlers specifications
- *
- * @param string $smarty Smarty instance
- * @param string $template_resource template_resource to extracate resource handler and name of
- * @return string unique resource name
- */
- public static function getUniqueTemplateName($smarty, $template_resource)
- {
- self::parseResourceName($template_resource, $smarty->default_resource_type, $name, $type);
- // TODO: optimize for Smarty's internal resource types
- $resource = Smarty_Resource::load($smarty, $type);
- return $resource->buildUniqueResourceName($smarty, $name);
- }
-
- /**
- * initialize Source Object for given resource
- *
- * Either [$_template] or [$smarty, $template_resource] must be specified
- *
- * @param Smarty_Internal_Template $_template template object
- * @param Smarty $smarty smarty object
- * @param string $template_resource resource identifier
- * @return Smarty_Template_Source Source Object
- */
- public static function source(Smarty_Internal_Template $_template=null, Smarty $smarty=null, $template_resource=null)
- {
- if ($_template) {
- $smarty = $_template->smarty;
- $template_resource = $_template->template_resource;
- }
-
- // parse resource_name, load resource handler, identify unique resource name
- self::parseResourceName($template_resource, $smarty->default_resource_type, $name, $type);
- $resource = Smarty_Resource::load($smarty, $type);
- $unique_resource_name = $resource->buildUniqueResourceName($smarty, $name);
-
- // check runtime cache
- $_cache_key = 'template|' . $unique_resource_name;
- if (isset(self::$sources[$_cache_key])) {
- return self::$sources[$_cache_key];
- }
-
- // create source
- $source = new Smarty_Template_Source($resource, $smarty, $template_resource, $type, $name, $unique_resource_name);
- $resource->populate($source, $_template);
-
- // runtime cache
- self::$sources[$_cache_key] = $source;
- return $source;
- }
-
- /**
- * initialize Config Source Object for given resource
- *
- * @param Smarty_Internal_Config $_config config object
- * @return Smarty_Config_Source Source Object
- */
- public static function config(Smarty_Internal_Config $_config)
- {
- static $_incompatible_resources = array('eval' => true, 'string' => true, 'extends' => true, 'php' => true);
- $config_resource = $_config->config_resource;
- $smarty = $_config->smarty;
-
- // parse resource_name
- self::parseResourceName($config_resource, $smarty->default_config_type, $name, $type);
-
- // make sure configs are not loaded via anything smarty can't handle
- if (isset($_incompatible_resources[$type])) {
- throw new SmartyException ("Unable to use resource '{$type}' for config");
- }
-
- // load resource handler, identify unique resource name
- $resource = Smarty_Resource::load($smarty, $type);
- $unique_resource_name = $resource->buildUniqueResourceName($smarty, $name);
-
- // check runtime cache
- $_cache_key = 'config|' . $unique_resource_name;
- if (isset(self::$sources[$_cache_key])) {
- return self::$sources[$_cache_key];
- }
-
- // create source
- $source = new Smarty_Config_Source($resource, $smarty, $config_resource, $type, $name, $unique_resource_name);
- $resource->populate($source, null);
-
- // runtime cache
- self::$sources[$_cache_key] = $source;
- return $source;
- }
-
-}
-
-/**
- * Smarty Resource Data Object
- *
- * Meta Data Container for Template Files
- *
- * @package Smarty
- * @subpackage TemplateResources
- * @author Rodney Rehm
- *
- * @property integer $timestamp Source Timestamp
- * @property boolean $exists Source Existance
- * @property boolean $template Extended Template reference
- * @property string $content Source Content
- */
-class Smarty_Template_Source {
-
- /**
- * Name of the Class to compile this resource's contents with
- * @var string
- */
- public $compiler_class = null;
-
- /**
- * Name of the Class to tokenize this resource's contents with
- * @var string
- */
- public $template_lexer_class = null;
-
- /**
- * Name of the Class to parse this resource's contents with
- * @var string
- */
- public $template_parser_class = null;
-
- /**
- * Unique Template ID
- * @var string
- */
- public $uid = null;
-
- /**
- * Template Resource (Smarty_Internal_Template::$template_resource)
- * @var string
- */
- public $resource = null;
-
- /**
- * Resource Type
- * @var string
- */
- public $type = null;
-
- /**
- * Resource Name
- * @var string
- */
- public $name = null;
-
- /**
- * Unique Resource Name
- * @var string
- */
- public $unique_resource = null;
-
- /**
- * Source Filepath
- * @var string
- */
- public $filepath = null;
-
- /**
- * Source is bypassing compiler
- * @var boolean
- */
- public $uncompiled = null;
-
- /**
- * Source must be recompiled on every occasion
- * @var boolean
- */
- public $recompiled = null;
-
- /**
- * The Components an extended template is made of
- * @var array
- */
- public $components = null;
-
- /**
- * Resource Handler
- * @var Smarty_Resource
- */
- public $handler = null;
-
- /**
- * Smarty instance
- * @var Smarty
- */
- public $smarty = null;
-
- /**
- * 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 string $resource full template_resource
- * @param string $type type of resource
- * @param string $name resource name
- * @param string $unique_resource unqiue resource name
- */
- public function __construct(Smarty_Resource $handler, Smarty $smarty, $resource, $type, $name, $unique_resource)
- {
- $this->handler = $handler; // Note: prone to circular references
-
- $this->compiler_class = $handler->compiler_class;
- $this->template_lexer_class = $handler->template_lexer_class;
- $this->template_parser_class = $handler->template_parser_class;
- $this->uncompiled = $this->handler instanceof Smarty_Resource_Uncompiled;
- $this->recompiled = $this->handler instanceof Smarty_Resource_Recompiled;
-
- $this->smarty = $smarty;
- $this->resource = $resource;
- $this->type = $type;
- $this->name = $name;
- $this->unique_resource = $unique_resource;
- }
-
- /**
- * get a Compiled Object of this source
- *
- * @param Smarty_Internal_Template $_template template objet
- * @return Smarty_Template_Compiled compiled object
- */
- public function getCompiled(Smarty_Internal_Template $_template)
- {
- // check runtime cache
- $_cache_key = $this->unique_resource . '#' . $_template->compile_id;
- if (isset(Smarty_Resource::$compileds[$_cache_key])) {
- return Smarty_Resource::$compileds[$_cache_key];
- }
-
- $compiled = new Smarty_Template_Compiled($this);
- $this->handler->populateCompiledFilepath($compiled, $_template);
- $compiled->timestamp = @filemtime($compiled->filepath);
- $compiled->exists = !!$compiled->timestamp;
-
- // runtime cache
- Smarty_Resource::$compileds[$_cache_key] = $compiled;
-
- return $compiled;
- }
-
- /**
- * render the uncompiled source
- *
- * @param Smarty_Internal_Template $_template template object
- */
- public function renderUncompiled(Smarty_Internal_Template $_template)
- {
- return $this->handler->renderUncompiled($this, $_template);
- }
-
- /**
- * <> Generic Setter.
- *
- * @param string $property_name valid: timestamp, exists, content, template
- * @param mixed $value new value (is not checked)
- * @throws SmartyException if $property_name is not valid
- */
- public function __set($property_name, $value)
- {
- switch ($property_name) {
- // regular attributes
- case 'timestamp':
- case 'exists':
- case 'content':
- // required for extends: only
- case 'template':
- $this->$property_name = $value;
- break;
-
- default:
- throw new SmartyException("invalid source property '$property_name'.");
- }
- }
-
- /**
- * <> Generic getter.
- *
- * @param string $property_name valid: timestamp, exists, content
- * @return mixed
- * @throws SmartyException if $property_name is not valid
- */
- public function __get($property_name)
- {
- switch ($property_name) {
- case 'timestamp':
- case 'exists':
- $this->handler->populateTimestamp($this);
- return $this->$property_name;
-
- case 'content':
- return $this->content = $this->handler->getContent($this);
-
- default:
- throw new SmartyException("source property '$property_name' does not exist.");
- }
- }
-
-}
-
-/**
- * Smarty Resource Data Object
- *
- * Meta Data Container for Template Files
- *
- * @package Smarty
- * @subpackage TemplateResources
- * @author Rodney Rehm
- *
- * @property string $content compiled content
- */
-class Smarty_Template_Compiled {
-
- /**
- * Compiled Filepath
- * @var string
- */
- public $filepath = null;
-
- /**
- * Compiled Timestamp
- * @var integer
- */
- public $timestamp = null;
-
- /**
- * Compiled Existance
- * @var boolean
- */
- public $exists = false;
-
- /**
- * Compiled Content Loaded
- * @var boolean
- */
- public $loaded = false;
-
- /**
- * Template was compiled
- * @var boolean
- */
- public $isCompiled = false;
-
- /**
- * Source Object
- * @var Smarty_Template_Source
- */
- public $source = null;
-
- /**
- * Metadata properties
- *
- * populated by Smarty_Internal_Template::decodeProperties()
- * @var array
- */
- public $_properties = null;
-
- /**
- * create Compiled Object container
- *
- * @param Smarty_Template_Source $source source object this compiled object belongs to
- */
- public function __construct(Smarty_Template_Source $source)
- {
- $this->source = $source;
- }
-
-}
-
-?>
\ No newline at end of file
diff --git a/tools/smarty/sysplugins/smarty_resource_custom.php b/tools/smarty/sysplugins/smarty_resource_custom.php
deleted file mode 100755
index 9ec1f356b..000000000
--- a/tools/smarty/sysplugins/smarty_resource_custom.php
+++ /dev/null
@@ -1,96 +0,0 @@
-filepath = strtolower($source->type . ':' . $source->name);
- $source->uid = sha1($source->type . ':' . $source->name);
-
- $mtime = $this->fetchTimestamp($source->name);
- if ($mtime !== null) {
- $source->timestamp = $mtime;
- } else {
- $this->fetch($source->name, $content, $timestamp);
- $source->timestamp = isset($timestamp) ? $timestamp : false;
- if( isset($content) )
- $source->content = $content;
- }
- $source->exists = !!$source->timestamp;
- }
-
- /**
- * Load template's source into current template object
- *
- * @param Smarty_Template_Source $source source object
- * @return string template source
- * @throws SmartyException if source cannot be loaded
- */
- public function getContent(Smarty_Template_Source $source)
- {
- $this->fetch($source->name, $content, $timestamp);
- if (isset($content)) {
- return $content;
- }
-
- throw new SmartyException("Unable to read template {$source->type} '{$source->name}'");
- }
-
- /**
- * Determine basename for compiled filename
- *
- * @param Smarty_Template_Source $source source object
- * @return string resource's basename
- */
- protected function getBasename(Smarty_Template_Source $source)
- {
- return basename($source->name);
- }
-
-}
-
-?>
\ No newline at end of file
diff --git a/tools/smarty/sysplugins/smarty_resource_recompiled.php b/tools/smarty/sysplugins/smarty_resource_recompiled.php
deleted file mode 100755
index ab55b93a6..000000000
--- a/tools/smarty/sysplugins/smarty_resource_recompiled.php
+++ /dev/null
@@ -1,36 +0,0 @@
-filepath = false;
- $compiled->timestamp = false;
- $compiled->exists = false;
- }
-
-}
-
-?>
\ No newline at end of file
diff --git a/tools/smarty/sysplugins/smarty_resource_uncompiled.php b/tools/smarty/sysplugins/smarty_resource_uncompiled.php
deleted file mode 100755
index ea8023507..000000000
--- a/tools/smarty/sysplugins/smarty_resource_uncompiled.php
+++ /dev/null
@@ -1,44 +0,0 @@
-filepath = false;
- $compiled->timestamp = false;
- $compiled->exists = false;
- }
-
-}
-
-?>
\ No newline at end of file
diff --git a/tools/smarty/sysplugins/smarty_security.php b/tools/smarty/sysplugins/smarty_security.php
deleted file mode 100755
index 3d4f3189c..000000000
--- a/tools/smarty/sysplugins/smarty_security.php
+++ /dev/null
@@ -1,427 +0,0 @@
-" tags in templates.
- * possible values:
- *
- * - Smarty::PHP_PASSTHRU -> echo PHP tags as they are
- * - Smarty::PHP_QUOTE -> escape tags as entities
- * - Smarty::PHP_REMOVE -> remove php tags
- * - Smarty::PHP_ALLOW -> execute php tags
- *
- *
- * @var integer
- */
- public $php_handling = Smarty::PHP_PASSTHRU;
- /**
- * This is the list of template directories that are considered secure.
- * $template_dir is in this list implicitly.
- *
- * @var array
- */
- public $secure_dir = array();
- /**
- * This is an array of directories where trusted php scripts reside.
- * {@link $security} is disabled during their inclusion/execution.
- *
- * @var array
- */
- public $trusted_dir = array();
- /**
- * This is an array of trusted static classes.
- *
- * If empty access to all static classes is allowed.
- * If set to 'none' none is allowed.
- * @var array
- */
- public $static_classes = array();
- /**
- * This is an array of trusted PHP functions.
- *
- * If empty all functions are allowed.
- * To disable all PHP functions set $php_functions = null.
- * @var array
- */
- public $php_functions = array(
- 'isset', 'empty',
- 'count', 'sizeof',
- 'in_array', 'is_array',
- 'time',
- 'nl2br',
- );
- /**
- * This is an array of trusted PHP modifers.
- *
- * If empty all modifiers are allowed.
- * To disable all modifier set $modifiers = null.
- * @var array
- */
- public $php_modifiers = array(
- 'escape',
- 'count'
- );
- /**
- * This is an array of allowed tags.
- *
- * If empty no restriction by allowed_tags.
- * @var array
- */
- public $allowed_tags = array();
- /**
- * This is an array of disabled tags.
- *
- * If empty no restriction by disabled_tags.
- * @var array
- */
- public $disabled_tags = array();
- /**
- * This is an array of allowed modifier plugins.
- *
- * If empty no restriction by allowed_modifiers.
- * @var array
- */
- public $allowed_modifiers = array();
- /**
- * This is an array of disabled modifier plugins.
- *
- * If empty no restriction by disabled_modifiers.
- * @var array
- */
- public $disabled_modifiers = array();
- /**
- * This is an array of trusted streams.
- *
- * If empty all streams are allowed.
- * To disable all streams set $streams = null.
- * @var array
- */
- public $streams = array('file');
- /**
- * + flag if constants can be accessed from template
- * @var boolean
- */
- public $allow_constants = true;
- /**
- * + flag if super globals can be accessed from template
- * @var boolean
- */
- public $allow_super_globals = true;
-
- /**
- * Cache for $resource_dir lookups
- * @var array
- */
- protected $_resource_dir = null;
- /**
- * Cache for $template_dir lookups
- * @var array
- */
- protected $_template_dir = null;
- /**
- * Cache for $config_dir lookups
- * @var array
- */
- protected $_config_dir = null;
- /**
- * Cache for $secure_dir lookups
- * @var array
- */
- protected $_secure_dir = null;
- /**
- * Cache for $php_resource_dir lookups
- * @var array
- */
- protected $_php_resource_dir = null;
- /**
- * Cache for $trusted_dir lookups
- * @var array
- */
- protected $_trusted_dir = null;
-
-
- /**
- * @param Smarty $smarty
- */
- public function __construct($smarty)
- {
- $this->smarty = $smarty;
- }
-
- /**
- * Check if PHP function is trusted.
- *
- * @param string $function_name
- * @param object $compiler compiler object
- * @return boolean true if function is trusted
- * @throws SmartyCompilerException if php function is not trusted
- */
- public function isTrustedPhpFunction($function_name, $compiler)
- {
- if (isset($this->php_functions) && (empty($this->php_functions) || in_array($function_name, $this->php_functions))) {
- return true;
- }
-
- $compiler->trigger_template_error("PHP function '{$function_name}' not allowed by security setting");
- return false; // should not, but who knows what happens to the compiler in the future?
- }
-
- /**
- * Check if static class is trusted.
- *
- * @param string $class_name
- * @param object $compiler compiler object
- * @return boolean true if class is trusted
- * @throws SmartyCompilerException if static class is not trusted
- */
- public function isTrustedStaticClass($class_name, $compiler)
- {
- if (isset($this->static_classes) && (empty($this->static_classes) || in_array($class_name, $this->static_classes))) {
- return true;
- }
-
- $compiler->trigger_template_error("access to static class '{$class_name}' not allowed by security setting");
- return false; // should not, but who knows what happens to the compiler in the future?
- }
-
- /**
- * Check if PHP modifier is trusted.
- *
- * @param string $modifier_name
- * @param object $compiler compiler object
- * @return boolean true if modifier is trusted
- * @throws SmartyCompilerException if modifier is not trusted
- */
- public function isTrustedPhpModifier($modifier_name, $compiler)
- {
- if (isset($this->php_modifiers) && (empty($this->php_modifiers) || in_array($modifier_name, $this->php_modifiers))) {
- return true;
- }
-
- $compiler->trigger_template_error("modifier '{$modifier_name}' not allowed by security setting");
- return false; // should not, but who knows what happens to the compiler in the future?
- }
-
- /**
- * Check if tag is trusted.
- *
- * @param string $tag_name
- * @param object $compiler compiler object
- * @return boolean true if tag is trusted
- * @throws SmartyCompilerException if modifier is not trusted
- */
- public function isTrustedTag($tag_name, $compiler)
- {
- // check for internal always required tags
- if (in_array($tag_name, array('assign', 'call', 'private_filter', 'private_block_plugin', 'private_function_plugin', 'private_object_block_function',
- 'private_object_function', 'private_registered_function', 'private_registered_block', 'private_special_variable', 'private_print_expression', 'private_modifier'))) {
- return true;
- }
- // check security settings
- if (empty($this->allowed_tags)) {
- if (empty($this->disabled_tags) || !in_array($tag_name, $this->disabled_tags)) {
- return true;
- } else {
- $compiler->trigger_template_error("tag '{$tag_name}' disabled by security setting", $compiler->lex->taglineno);
- }
- } else if (in_array($tag_name, $this->allowed_tags) && !in_array($tag_name, $this->disabled_tags)) {
- return true;
- } else {
- $compiler->trigger_template_error("tag '{$tag_name}' not allowed by security setting", $compiler->lex->taglineno);
- }
- return false; // should not, but who knows what happens to the compiler in the future?
- }
-
- /**
- * Check if modifier plugin is trusted.
- *
- * @param string $modifier_name
- * @param object $compiler compiler object
- * @return boolean true if tag is trusted
- * @throws SmartyCompilerException if modifier is not trusted
- */
- public function isTrustedModifier($modifier_name, $compiler)
- {
- // check for internal always allowed modifier
- if (in_array($modifier_name, array('default'))) {
- return true;
- }
- // check security settings
- if (empty($this->allowed_modifiers)) {
- if (empty($this->disabled_modifiers) || !in_array($modifier_name, $this->disabled_modifiers)) {
- return true;
- } else {
- $compiler->trigger_template_error("modifier '{$modifier_name}' disabled by security setting", $compiler->lex->taglineno);
- }
- } else if (in_array($modifier_name, $this->allowed_modifiers) && !in_array($modifier_name, $this->disabled_modifiers)) {
- return true;
- } else {
- $compiler->trigger_template_error("modifier '{$modifier_name}' not allowed by security setting", $compiler->lex->taglineno);
- }
- return false; // should not, but who knows what happens to the compiler in the future?
- }
-
- /**
- * Check if stream is trusted.
- *
- * @param string $stream_name
- * @return boolean true if stream is trusted
- * @throws SmartyException if stream is not trusted
- */
- public function isTrustedStream($stream_name)
- {
- if (isset($this->streams) && (empty($this->streams) || in_array($stream_name, $this->streams))) {
- return true;
- }
-
- throw new SmartyException("stream '{$stream_name}' not allowed by security setting");
- }
-
- /**
- * Check if directory of file resource is trusted.
- *
- * @param string $filepath
- * @return boolean true if directory is trusted
- * @throws SmartyException if directory is not trusted
- */
- public function isTrustedResourceDir($filepath)
- {
- $_template = false;
- $_config = false;
- $_secure = false;
-
- $_template_dir = $this->smarty->getTemplateDir();
- $_config_dir = $this->smarty->getConfigDir();
-
- // check if index is outdated
- if ((!$this->_template_dir || $this->_template_dir !== $_template_dir)
- || (!$this->_config_dir || $this->_config_dir !== $_config_dir)
- || (!empty($this->secure_dir) && (!$this->_secure_dir || $this->_secure_dir !== $this->secure_dir))
- ) {
- $this->_resource_dir = array();
- $_template = true;
- $_config = true;
- $_secure = !empty($this->secure_dir);
- }
-
- // rebuild template dir index
- if ($_template) {
- $this->_template_dir = $_template_dir;
- foreach ($_template_dir as $directory) {
- $directory = realpath($directory);
- $this->_resource_dir[$directory] = true;
- }
- }
-
- // rebuild config dir index
- if ($_config) {
- $this->_config_dir = $_config_dir;
- foreach ($_config_dir as $directory) {
- $directory = realpath($directory);
- $this->_resource_dir[$directory] = true;
- }
- }
-
- // rebuild secure dir index
- if ($_secure) {
- $this->_secure_dir = $this->secure_dir;
- foreach ((array) $this->secure_dir as $directory) {
- $directory = realpath($directory);
- $this->_resource_dir[$directory] = true;
- }
- }
-
- $_filepath = realpath($filepath);
- $directory = dirname($_filepath);
- $_directory = array();
- while (true) {
- // remember the directory to add it to _resource_dir in case we're successful
- $_directory[] = $directory;
- // test if the directory is trusted
- if (isset($this->_resource_dir[$directory])) {
- // merge sub directories of current $directory into _resource_dir to speed up subsequent lookups
- $this->_resource_dir = array_merge($this->_resource_dir, $_directory);
- return true;
- }
- // abort if we've reached root
- if (($pos = strrpos($directory, DS)) === false || !isset($directory[1])) {
- break;
- }
- // bubble up one level
- $directory = substr($directory, 0, $pos);
- }
-
- // give up
- throw new SmartyException("directory '{$_filepath}' not allowed by security setting");
- }
-
- /**
- * Check if directory of file resource is trusted.
- *
- * @param string $filepath
- * @return boolean true if directory is trusted
- * @throws SmartyException if PHP directory is not trusted
- */
- public function isTrustedPHPDir($filepath)
- {
- if (empty($this->trusted_dir)) {
- throw new SmartyException("directory '{$filepath}' not allowed by security setting (no trusted_dir specified)");
- }
-
- // check if index is outdated
- if (!$this->_trusted_dir || $this->_trusted_dir !== $this->trusted_dir) {
- $this->_php_resource_dir = array();
-
- $this->_trusted_dir = $this->trusted_dir;
- foreach ((array) $this->trusted_dir as $directory) {
- $directory = realpath($directory);
- $this->_php_resource_dir[$directory] = true;
- }
- }
-
- $_filepath = realpath($filepath);
- $directory = dirname($_filepath);
- $_directory = array();
- while (true) {
- // remember the directory to add it to _resource_dir in case we're successful
- $_directory[] = $directory;
- // test if the directory is trusted
- if (isset($this->_php_resource_dir[$directory])) {
- // merge sub directories of current $directory into _resource_dir to speed up subsequent lookups
- $this->_php_resource_dir = array_merge($this->_php_resource_dir, $_directory);
- return true;
- }
- // abort if we've reached root
- if (($pos = strrpos($directory, DS)) === false || !isset($directory[2])) {
- break;
- }
- // bubble up one level
- $directory = substr($directory, 0, $pos);
- }
-
- throw new SmartyException("directory '{$_filepath}' not allowed by security setting");
- }
-
-}
-
-?>
\ No newline at end of file