> 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/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_debug.php b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_debug.php
new file mode 100644
index 0000000..2aea13f
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_debug.php
@@ -0,0 +1,206 @@
+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/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_filter_handler.php b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_filter_handler.php
new file mode 100644
index 0000000..c9370e1
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_filter_handler.php
@@ -0,0 +1,70 @@
+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/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_function_call_handler.php b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_function_call_handler.php
new file mode 100644
index 0000000..fa4b43b
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_function_call_handler.php
@@ -0,0 +1,55 @@
+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/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_get_include_path.php b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_get_include_path.php
new file mode 100644
index 0000000..0f572ec
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_get_include_path.php
@@ -0,0 +1,43 @@
+
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_nocache_insert.php b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_nocache_insert.php
new file mode 100644
index 0000000..64a2b1e
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_nocache_insert.php
@@ -0,0 +1,53 @@
+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/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_parsetree.php b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_parsetree.php
new file mode 100644
index 0000000..99f4c65
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_parsetree.php
@@ -0,0 +1,395 @@
+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/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_resource_eval.php b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_resource_eval.php
new file mode 100644
index 0000000..c025dc2
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_resource_eval.php
@@ -0,0 +1,94 @@
+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/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_resource_extends.php b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_resource_extends.php
new file mode 100644
index 0000000..53ea3eb
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_resource_extends.php
@@ -0,0 +1,148 @@
+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/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_resource_file.php b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_resource_file.php
new file mode 100644
index 0000000..48b391d
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_resource_file.php
@@ -0,0 +1,90 @@
+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/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_resource_php.php b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_resource_php.php
new file mode 100644
index 0000000..7cd8bae
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_resource_php.php
@@ -0,0 +1,114 @@
+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/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_resource_registered.php b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_resource_registered.php
new file mode 100644
index 0000000..44497b9
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_resource_registered.php
@@ -0,0 +1,95 @@
+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/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_resource_stream.php b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_resource_stream.php
new file mode 100644
index 0000000..85698c2
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_resource_stream.php
@@ -0,0 +1,76 @@
+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/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_resource_string.php b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_resource_string.php
new file mode 100644
index 0000000..9571337
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_resource_string.php
@@ -0,0 +1,96 @@
+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/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_smartytemplatecompiler.php b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_smartytemplatecompiler.php
new file mode 100644
index 0000000..1ec1aa4
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_smartytemplatecompiler.php
@@ -0,0 +1,127 @@
+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/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_template.php b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_template.php
new file mode 100644
index 0000000..6367c0d
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_template.php
@@ -0,0 +1,684 @@
+ 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/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_templatebase.php b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_templatebase.php
new file mode 100644
index 0000000..1633cf2
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_templatebase.php
@@ -0,0 +1,763 @@
+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/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_templatecompilerbase.php b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_templatecompilerbase.php
new file mode 100644
index 0000000..9511f2e
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_templatecompilerbase.php
@@ -0,0 +1,626 @@
+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/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_templatelexer.php b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_templatelexer.php
new file mode 100644
index 0000000..d8e77e8
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_templatelexer.php
@@ -0,0 +1,1190 @@
+ '===',
+ '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/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_templateparser.php b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_templateparser.php
new file mode 100644
index 0000000..6dfdeef
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_templateparser.php
@@ -0,0 +1,3218 @@
+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/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_utility.php b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_utility.php
new file mode 100644
index 0000000..e6dc7af
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_utility.php
@@ -0,0 +1,810 @@
+
+ * @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/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_write_file.php b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_write_file.php
new file mode 100644
index 0000000..743503b
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_write_file.php
@@ -0,0 +1,70 @@
+_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/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_resource.php b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_resource.php
new file mode 100644
index 0000000..d270387
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_resource.php
@@ -0,0 +1,820 @@
+ 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/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_resource_custom.php b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_resource_custom.php
new file mode 100644
index 0000000..9ec1f35
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_resource_custom.php
@@ -0,0 +1,96 @@
+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/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_resource_recompiled.php b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_resource_recompiled.php
new file mode 100644
index 0000000..ab55b93
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_resource_recompiled.php
@@ -0,0 +1,36 @@
+filepath = false;
+ $compiled->timestamp = false;
+ $compiled->exists = false;
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_resource_uncompiled.php b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_resource_uncompiled.php
new file mode 100644
index 0000000..ea80235
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_resource_uncompiled.php
@@ -0,0 +1,44 @@
+filepath = false;
+ $compiled->timestamp = false;
+ $compiled->exists = false;
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_security.php b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_security.php
new file mode 100644
index 0000000..3d4f318
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_security.php
@@ -0,0 +1,427 @@
+" 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
diff --git a/ThinkPHP/Library/Vendor/TemplateLite/class.compiler.php b/ThinkPHP/Library/Vendor/TemplateLite/class.compiler.php
new file mode 100644
index 0000000..dbb9168
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/TemplateLite/class.compiler.php
@@ -0,0 +1,986 @@
+, Mark Dickenson
+ * Copyright: 2003,2004,2005 by Paul Lockaby, 2005,2006 Mark Dickenson
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * The latest version of template_lite can be obtained from:
+ * http://templatelite.sourceforge.net
+ *
+ */
+
+class Template_Lite_Compiler extends Template_Lite {
+ // public configuration variables
+ var $left_delimiter = "";
+ var $right_delimiter = "";
+ var $plugins_dir = "";
+ var $template_dir = "";
+ var $reserved_template_varname = "";
+ var $default_modifiers = array();
+
+ var $php_extract_vars = true; // Set this to false if you do not want the $this->_tpl variables to be extracted for use by PHP code inside the template.
+
+ // private internal variables
+ var $_vars = array(); // stores all internal assigned variables
+ var $_confs = array(); // stores all internal config variables
+ var $_plugins = array(); // stores all internal plugins
+ var $_linenum = 0; // the current line number in the file we are processing
+ var $_file = ""; // the current file we are processing
+ var $_literal = array(); // stores all literal blocks
+ var $_foreachelse_stack = array();
+ var $_for_stack = 0;
+ var $_sectionelse_stack = array(); // keeps track of whether section had 'else' part
+ var $_switch_stack = array();
+ var $_tag_stack = array();
+ var $_require_stack = array(); // stores all files that are "required" inside of the template
+ var $_php_blocks = array(); // stores all of the php blocks
+ var $_error_level = null;
+ var $_sl_md5 = '39fc70570b8b60cbc1b85839bf242aff';
+
+ var $_db_qstr_regexp = null; // regexps are setup in the constructor
+ var $_si_qstr_regexp = null;
+ var $_qstr_regexp = null;
+ var $_func_regexp = null;
+ var $_var_bracket_regexp = null;
+ var $_dvar_regexp = null;
+ var $_cvar_regexp = null;
+ var $_svar_regexp = null;
+ var $_mod_regexp = null;
+ var $_var_regexp = null;
+ var $_obj_params_regexp = null;
+ var $_templatelite_vars = array();
+
+ function Template_Lite_compiler()
+ {
+ // matches double quoted strings:
+ // "foobar"
+ // "foo\"bar"
+ // "foobar" . "foo\"bar"
+ $this->_db_qstr_regexp = '"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"';
+
+ // matches single quoted strings:
+ // 'foobar'
+ // 'foo\'bar'
+ $this->_si_qstr_regexp = '\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\'';
+
+ // matches single or double quoted strings
+ $this->_qstr_regexp = '(?:' . $this->_db_qstr_regexp . '|' . $this->_si_qstr_regexp . ')';
+
+ // matches bracket portion of vars
+ // [0]
+ // [foo]
+ // [$bar]
+ // [#bar#]
+ $this->_var_bracket_regexp = '\[[\$|\#]?\w+\#?\]';
+// $this->_var_bracket_regexp = '\[\$?[\w\.]+\]';
+
+ // matches section vars:
+ // %foo.bar%
+ $this->_svar_regexp = '\%\w+\.\w+\%';
+
+ // matches $ vars (not objects):
+ // $foo
+ // $foo[0]
+ // $foo[$bar]
+ // $foo[5][blah]
+// $this->_dvar_regexp = '\$[a-zA-Z0-9_]{1,}(?:' . $this->_var_bracket_regexp . ')*(?:' . $this->_var_bracket_regexp . ')*';
+ $this->_dvar_regexp = '\$[a-zA-Z0-9_]{1,}(?:' . $this->_var_bracket_regexp . ')*(?:\.\$?\w+(?:' . $this->_var_bracket_regexp . ')*)*';
+
+ // matches config vars:
+ // #foo#
+ // #foobar123_foo#
+ $this->_cvar_regexp = '\#[a-zA-Z0-9_]{1,}(?:' . $this->_var_bracket_regexp . ')*(?:' . $this->_var_bracket_regexp . ')*\#';
+
+ // matches valid variable syntax:
+ // $foo
+ // 'text'
+ // "text"
+ $this->_var_regexp = '(?:(?:' . $this->_dvar_regexp . '|' . $this->_cvar_regexp . ')|' . $this->_qstr_regexp . ')';
+
+ // matches valid modifier syntax:
+ // |foo
+ // |@foo
+ // |foo:"bar"
+ // |foo:$bar
+ // |foo:"bar":$foobar
+ // |foo|bar
+ $this->_mod_regexp = '(?:\|@?[0-9a-zA-Z_]+(?::(?>-?\w+|' . $this->_dvar_regexp . '|' . $this->_qstr_regexp .'))*)';
+
+ // matches valid function name:
+ // foo123
+ // _foo_bar
+ $this->_func_regexp = '[a-zA-Z_]+';
+// $this->_func_regexp = '[a-zA-Z_]\w*';
+
+ }
+
+ function _compile_file($file_contents)
+ {
+ $ldq = preg_quote($this->left_delimiter);
+ $rdq = preg_quote($this->right_delimiter);
+ $_match = array(); // a temp variable for the current regex match
+ $tags = array(); // all original tags
+ $text = array(); // all original text
+ $compiled_text = '_version.' '.strftime("%Y-%m-%d %H:%M:%S %Z").' */ ?>'."\n\n"; // stores the compiled result
+ $compiled_tags = array(); // all tags and stuff
+
+ $this->_require_stack = array();
+
+ $this->_load_filters();
+
+ if (count($this->_plugins['prefilter']) > 0)
+ {
+ foreach ($this->_plugins['prefilter'] as $function)
+ {
+ if ($function === false)
+ {
+ continue;
+ }
+ $file_contents = $function($file_contents, $this);
+ }
+ }
+
+ // remove all comments
+ $file_contents = preg_replace("!{$ldq}\*.*?\*{$rdq}!se","",$file_contents);
+
+ // replace all php start and end tags
+ $file_contents = preg_replace('%(<\?(?!php|=|$))%i', ''."\n", $file_contents);
+
+ // remove literal blocks
+ preg_match_all("!{$ldq}\s*literal\s*{$rdq}(.*?){$ldq}\s*/literal\s*{$rdq}!s", $file_contents, $_match);
+ $this->_literal = $_match[1];
+ $file_contents = preg_replace("!{$ldq}\s*literal\s*{$rdq}(.*?){$ldq}\s*/literal\s*{$rdq}!s", stripslashes($ldq . "literal" . $rdq), $file_contents);
+
+ // remove php blocks
+ preg_match_all("!{$ldq}\s*php\s*{$rdq}(.*?){$ldq}\s*/php\s*{$rdq}!s", $file_contents, $_match);
+ $this->_php_blocks = $_match[1];
+ $file_contents = preg_replace("!{$ldq}\s*php\s*{$rdq}(.*?){$ldq}\s*/php\s*{$rdq}!s", stripslashes($ldq . "php" . $rdq), $file_contents);
+
+ // gather all template tags
+ preg_match_all("!{$ldq}\s*(.*?)\s*{$rdq}!s", $file_contents, $_match);
+ $tags = $_match[1];
+
+ // put all of the non-template tag text blocks into an array, using the template tags as delimiters
+ $text = preg_split("!{$ldq}.*?{$rdq}!s", $file_contents);
+
+ // compile template tags
+ $count_tags = count($tags);
+ for ($i = 0, $for_max = $count_tags; $i < $for_max; $i++)
+ {
+ $this->_linenum += substr_count($text[$i], "\n");
+ $compiled_tags[] = $this->_compile_tag($tags[$i]);
+ $this->_linenum += substr_count($tags[$i], "\n");
+ }
+
+ // build the compiled template by replacing and interleaving text blocks and compiled tags
+ $count_compiled_tags = count($compiled_tags);
+ for ($i = 0, $for_max = $count_compiled_tags; $i < $for_max; $i++)
+ {
+ if ($compiled_tags[$i] == '') {
+ $text[$i+1] = preg_replace('~^(\r\n|\r|\n)~', '', $text[$i+1]);
+ }
+ $compiled_text .= $text[$i].$compiled_tags[$i];
+ }
+ $compiled_text .= $text[$i];
+
+ foreach ($this->_require_stack as $key => $value)
+ {
+ $compiled_text = '_get_plugin_dir($key) . $key . '\'); $this->register_' . $value[0] . '("' . $value[1] . '", "' . $value[2] . '"); ?>' . $compiled_text;
+ }
+
+ // remove unnecessary close/open tags
+ $compiled_text = preg_replace('!\?>\n?<\?php!', '', $compiled_text);
+
+ if (count($this->_plugins['postfilter']) > 0)
+ {
+ foreach ($this->_plugins['postfilter'] as $function)
+ {
+ if ($function === false)
+ {
+ continue;
+ }
+ $compiled_text = $function($compiled_text, $this);
+ }
+ }
+
+ return $compiled_text;
+ }
+
+ function _compile_tag($tag)
+ {
+ $_match = array(); // stores the tags
+ $_result = ""; // the compiled tag
+ $_variable = ""; // the compiled variable
+
+ // extract the tag command, modifier and arguments
+ preg_match_all('/(?:(' . $this->_var_regexp . '|' . $this->_svar_regexp . '|\/?' . $this->_func_regexp . ')(' . $this->_mod_regexp . '*)(?:\s*[,\.]\s*)?)(?:\s+(.*))?/xs', $tag, $_match);
+
+ if ($_match[1][0]{0} == '$' || ($_match[1][0]{0} == '#' && $_match[1][0]{strlen($_match[1][0]) - 1} == '#') || $_match[1][0]{0} == "'" || $_match[1][0]{0} == '"' || $_match[1][0]{0} == '%')
+ {
+ $_result = $this->_parse_variables($_match[1], $_match[2]);
+ return "\n";
+ }
+ // process a function
+ $tag_command = $_match[1][0];
+ $tag_modifiers = !empty($_match[2][0]) ? $_match[2][0] : null;
+ $tag_arguments = !empty($_match[3][0]) ? $_match[3][0] : null;
+ $_result = $this->_parse_function($tag_command, $tag_modifiers, $tag_arguments);
+ return $_result;
+ }
+
+ function _parse_function($function, $modifiers, $arguments)
+ {
+ switch ($function) {
+ case 'include':
+ if (!function_exists('compile_include'))
+ {
+ require_once(TEMPLATE_LITE_DIR . "internal/compile.include.php");
+ }
+ return compile_include($arguments, $this);
+ break;
+ case 'insert':
+ $_args = $this->_parse_arguments($arguments);
+ if (!isset($_args['name']))
+ {
+ $this->trigger_error("missing 'name' attribute in 'insert'", E_USER_ERROR, __FILE__, __LINE__);
+ }
+ foreach ($_args as $key => $value)
+ {
+ if (is_bool($value))
+ {
+ $value = $value ? 'true' : 'false';
+ }
+ $arg_list[] = "'$key' => $value";
+ }
+ return '_run_insert(array(' . implode(', ', (array)$arg_list) . ')); ?>';
+ break;
+ case 'ldelim':
+ return $this->left_delimiter;
+ break;
+ case 'rdelim':
+ return $this->right_delimiter;
+ break;
+ case 'literal':
+ list (,$literal) = each($this->_literal);
+ $this->_linenum += substr_count($literal, "\n");
+ return "\n";
+ break;
+ case 'php':
+ list (,$php_block) = each($this->_php_blocks);
+ $this->_linenum += substr_count($php_block, "\n");
+ $php_extract = '';
+ if($this->php_extract_vars)
+ {
+ if (strnatcmp(PHP_VERSION, '4.3.0') >= 0)
+ {
+ $php_extract = '_vars, EXTR_REFS); ?>' . "\n";
+ }
+ else
+ {
+ $php_extract = '_vars); ?>' . "\n";
+ }
+ }
+ return $php_extract . '';
+ break;
+ case 'foreach':
+ array_push($this->_foreachelse_stack, false);
+ $_args = $this->_parse_arguments($arguments);
+ if (!isset($_args['from']))
+ {
+ $this->trigger_error("missing 'from' attribute in 'foreach'", E_USER_ERROR, __FILE__, __LINE__);
+ }
+ if (!isset($_args['value']) && !isset($_args['item']))
+ {
+ $this->trigger_error("missing 'value' attribute in 'foreach'", E_USER_ERROR, __FILE__, __LINE__);
+ }
+ if (isset($_args['value']))
+ {
+ $_args['value'] = $this->_dequote($_args['value']);
+ }
+ elseif (isset($_args['item']))
+ {
+ $_args['value'] = $this->_dequote($_args['item']);
+ }
+ isset($_args['key']) ? $_args['key'] = "\$this->_vars['".$this->_dequote($_args['key'])."'] => " : $_args['key'] = '';
+ $_result = '_vars[\'' . $_args['value'] . '\']): ?>';
+ return $_result;
+ break;
+ case 'foreachelse':
+ $this->_foreachelse_stack[count($this->_foreachelse_stack)-1] = true;
+ return "";
+ break;
+ case '/foreach':
+ if (array_pop($this->_foreachelse_stack))
+ {
+ return "";
+ }
+ else
+ {
+ return "";
+ }
+ break;
+ case 'for':
+ $this->_for_stack++;
+ $_args = $this->_parse_arguments($arguments);
+ if (!isset($_args['start']))
+ {
+ $this->trigger_error("missing 'start' attribute in 'for'", E_USER_ERROR, __FILE__, __LINE__);
+ }
+ if (!isset($_args['stop']))
+ {
+ $this->trigger_error("missing 'stop' attribute in 'for'", E_USER_ERROR, __FILE__, __LINE__);
+ }
+ if (!isset($_args['step']))
+ {
+ $_args['step'] = 1;
+ }
+ $_result = '_for_stack . ' = ' . $_args['start'] . '; ((' . $_args['start'] . ' < ' . $_args['stop'] . ') ? ($for' . $this->_for_stack . ' < ' . $_args['stop'] . ') : ($for' . $this->_for_stack . ' > ' . $_args['stop'] . ')); $for' . $this->_for_stack . ' += ((' . $_args['start'] . ' < ' . $_args['stop'] . ') ? ' . $_args['step'] . ' : -' . $_args['step'] . ')): ?>';
+ if (isset($_args['value']))
+ {
+ $_result .= 'assign(\'' . $this->_dequote($_args['value']) . '\', $for' . $this->_for_stack . '); ?>';
+ }
+ return $_result;
+ break;
+ case '/for':
+ $this->_for_stack--;
+ return "";
+ break;
+ case 'section':
+ array_push($this->_sectionelse_stack, false);
+ if (!function_exists('compile_section_start'))
+ {
+ require_once(TEMPLATE_LITE_DIR . "internal/compile.section_start.php");
+ }
+ return compile_section_start($arguments, $this);
+ break;
+ case 'sectionelse':
+ $this->_sectionelse_stack[count($this->_sectionelse_stack)-1] = true;
+ return "";
+ break;
+ case '/section':
+ if (array_pop($this->_sectionelse_stack))
+ {
+ return "";
+ }
+ else
+ {
+ return "";
+ }
+ break;
+ case 'while':
+ $_args = $this->_compile_if($arguments, false, true);
+ return '';
+ break;
+ case '/while':
+ return "";
+ break;
+ case 'if':
+ return $this->_compile_if($arguments);
+ break;
+ case 'else':
+ return "";
+ break;
+ case 'elseif':
+ return $this->_compile_if($arguments, true);
+ break;
+ case '/if':
+ return "";
+ break;
+ case 'assign':
+ $_args = $this->_parse_arguments($arguments);
+ if (!isset($_args['var']))
+ {
+ $this->trigger_error("missing 'var' attribute in 'assign'", E_USER_ERROR, __FILE__, __LINE__);
+ }
+ if (!isset($_args['value']))
+ {
+ $this->trigger_error("missing 'value' attribute in 'assign'", E_USER_ERROR, __FILE__, __LINE__);
+ }
+ return 'assign(\'' . $this->_dequote($_args['var']) . '\', ' . $_args['value'] . '); ?>';
+ break;
+ case 'switch':
+ $_args = $this->_parse_arguments($arguments);
+ if (!isset($_args['from']))
+ {
+ $this->trigger_error("missing 'from' attribute in 'switch'", E_USER_ERROR, __FILE__, __LINE__);
+ }
+ array_push($this->_switch_stack, array("matched" => false, "var" => $this->_dequote($_args['from'])));
+ return;
+ break;
+ case '/switch':
+ array_pop($this->_switch_stack);
+ return '';
+ break;
+ case 'case':
+ if (count($this->_switch_stack) > 0)
+ {
+ $_result = "_parse_arguments($arguments);
+ $_index = count($this->_switch_stack) - 1;
+ if (!$this->_switch_stack[$_index]["matched"])
+ {
+ $_result .= 'switch(' . $this->_switch_stack[$_index]["var"] . '): ';
+ $this->_switch_stack[$_index]["matched"] = true;
+ }
+ else
+ {
+ $_result .= 'break; ';
+ }
+ if (!empty($_args['value']))
+ {
+ $_result .= 'case '.$_args['value'].': ';
+ }
+ else
+ {
+ $_result .= 'default: ';
+ }
+ return $_result . ' ?>';
+ }
+ else
+ {
+ $this->trigger_error("unexpected 'case', 'case' can only be in a 'switch'", E_USER_ERROR, __FILE__, __LINE__);
+ }
+ break;
+ case 'config_load':
+ $_args = $this->_parse_arguments($arguments);
+ if (empty($_args['file']))
+ {
+ $this->trigger_error("missing 'file' attribute in 'config_load' tag", E_USER_ERROR, __FILE__, __LINE__);
+ }
+ isset($_args['section']) ? null : $_args['section'] = 'null';
+ isset($_args['var']) ? null : $_args['var'] = 'null';
+ return 'config_load(' . $_args['file'] . ', ' . $_args['section'] . ', ' . $_args['var'] . '); ?>';
+ break;
+ default:
+ $_result = "";
+ if ($this->_compile_compiler_function($function, $arguments, $_result))
+ {
+ return $_result;
+ }
+ else if ($this->_compile_custom_block($function, $modifiers, $arguments, $_result))
+ {
+ return $_result;
+ }
+ elseif ($this->_compile_custom_function($function, $modifiers, $arguments, $_result))
+ {
+ return $_result;
+ }
+ else
+ {
+ $this->trigger_error($function." function does not exist", E_USER_ERROR, __FILE__, __LINE__);
+ }
+ break;
+ }
+ }
+
+ function _compile_compiler_function($function, $arguments, &$_result)
+ {
+ if ($function = $this->_plugin_exists($function, "compiler"))
+ {
+ $_args = $this->_parse_arguments($arguments);
+ $_result = '';
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ function _compile_custom_function($function, $modifiers, $arguments, &$_result)
+ {
+ if (!function_exists('compile_compile_custom_function'))
+ {
+ require_once(TEMPLATE_LITE_DIR . "internal/compile.compile_custom_function.php");
+ }
+ return compile_compile_custom_function($function, $modifiers, $arguments, $_result, $this);
+ }
+
+ function _compile_custom_block($function, $modifiers, $arguments, &$_result)
+ {
+ if (!function_exists('compile_compile_custom_block'))
+ {
+ require_once(TEMPLATE_LITE_DIR . "internal/compile.compile_custom_block.php");
+ }
+ return compile_compile_custom_block($function, $modifiers, $arguments, $_result, $this);
+ }
+
+ function _compile_if($arguments, $elseif = false, $while = false)
+ {
+ if (!function_exists('compile_compile_if'))
+ {
+ require_once(TEMPLATE_LITE_DIR . "internal/compile.compile_if.php");
+ }
+ return compile_compile_if($arguments, $elseif, $while, $this);
+ }
+
+ function _parse_is_expr($is_arg, $_arg)
+ {
+ if (!function_exists('compile_parse_is_expr'))
+ {
+ require_once(TEMPLATE_LITE_DIR . "internal/compile.parse_is_expr.php");
+ }
+ return compile_parse_is_expr($is_arg, $_arg, $this);
+ }
+
+ function _compile_config($variable)
+ {
+ if (!function_exists('compile_compile_config'))
+ {
+ require_once(TEMPLATE_LITE_DIR . "internal/compile.compile_config.php");
+ }
+ return compile_compile_config($variable, $this);
+ }
+
+ function _dequote($string)
+ {
+ if (($string{0} == "'" || $string{0} == '"') && $string{strlen($string)-1} == $string{0})
+ {
+ return substr($string, 1, -1);
+ }
+ else
+ {
+ return $string;
+ }
+ }
+
+ function _parse_arguments($arguments)
+ {
+ $_match = array();
+ $_result = array();
+ $_variables = array();
+ preg_match_all('/(?:' . $this->_qstr_regexp . ' | (?>[^"\'=\s]+))+|[=]/x', $arguments, $_match);
+ /*
+ Parse state:
+ 0 - expecting attribute name
+ 1 - expecting '='
+ 2 - expecting attribute value (not '=')
+ */
+ $state = 0;
+ foreach($_match[0] as $value)
+ {
+ switch($state) {
+ case 0:
+ // valid attribute name
+ if (is_string($value))
+ {
+ $a_name = $value;
+ $state = 1;
+ }
+ else
+ {
+ $this->trigger_error("invalid attribute name: '$token'", E_USER_ERROR, __FILE__, __LINE__);
+ }
+ break;
+ case 1:
+ if ($value == '=')
+ {
+ $state = 2;
+ }
+ else
+ {
+ $this->trigger_error("expecting '=' after '$last_value'", E_USER_ERROR, __FILE__, __LINE__);
+ }
+ break;
+ case 2:
+ if ($value != '=')
+ {
+ if ($value == 'yes' || $value == 'on' || $value == 'true')
+ {
+ $value = true;
+ }
+ elseif ($value == 'no' || $value == 'off' || $value == 'false')
+ {
+ $value = false;
+ }
+ elseif ($value == 'null')
+ {
+ $value = null;
+ }
+
+ if(!preg_match_all('/(?:(' . $this->_var_regexp . '|' . $this->_svar_regexp . ')(' . $this->_mod_regexp . '*))(?:\s+(.*))?/xs', $value, $_variables))
+ {
+ $_result[$a_name] = $value;
+ }
+ else
+ {
+ $_result[$a_name] = $this->_parse_variables($_variables[1], $_variables[2]);
+ }
+ $state = 0;
+ }
+ else
+ {
+ $this->trigger_error("'=' cannot be an attribute value", E_USER_ERROR, __FILE__, __LINE__);
+ }
+ break;
+ }
+ $last_value = $value;
+ }
+ if($state != 0)
+ {
+ if($state == 1)
+ {
+ $this->trigger_error("expecting '=' after attribute name '$last_value'", E_USER_ERROR, __FILE__, __LINE__);
+ }
+ else
+ {
+ $this->trigger_error("missing attribute value", E_USER_ERROR, __FILE__, __LINE__);
+ }
+ }
+ return $_result;
+ }
+
+ function _parse_variables($variables, $modifiers)
+ {
+ $_result = "";
+ foreach($variables as $key => $value)
+ {
+ $tag_variable = trim($variables[$key]);
+ if(!empty($this->default_modifiers) && !preg_match('!(^|\|)templatelite:nodefaults($|\|)!',$modifiers[$key]))
+ {
+ $_default_mod_string = implode('|',(array)$this->default_modifiers);
+ $modifiers[$key] = empty($modifiers[$key]) ? $_default_mod_string : $_default_mod_string . '|' . $modifiers[$key];
+ }
+ if (empty($modifiers[$key]))
+ {
+ $_result .= $this->_parse_variable($tag_variable).'.';
+ }
+ else
+ {
+ $_result .= $this->_parse_modifier($this->_parse_variable($tag_variable), $modifiers[$key]).'.';
+ }
+ }
+ return substr($_result, 0, -1);
+ }
+
+ function _parse_variable($variable)
+ {
+ // replace variable with value
+ if ($variable{0} == "\$")
+ {
+ // replace the variable
+ return $this->_compile_variable($variable);
+ }
+ elseif ($variable{0} == '#')
+ {
+ // replace the config variable
+ return $this->_compile_config($variable);
+ }
+ elseif ($variable{0} == '"')
+ {
+ // expand the quotes to pull any variables out of it
+ // fortunately variables inside of a quote aren't fancy, no modifiers, no quotes
+ // just get everything from the $ to the ending space and parse it
+ // if the $ is escaped, then we won't expand it
+ $_result = "";
+ preg_match_all('/(?:[^\\\]' . $this->_dvar_regexp . ')/', substr($variable, 1, -1), $_expand); // old match
+// preg_match_all('/(?:[^\\\]' . $this->_dvar_regexp . '[^\\\])/', $variable, $_expand);
+ $_expand = array_unique($_expand[0]);
+ foreach($_expand as $key => $value)
+ {
+ $_expand[$key] = trim($value);
+ if (strpos($_expand[$key], '$') > 0)
+ {
+ $_expand[$key] = substr($_expand[$key], strpos($_expand[$key], '$'));
+ }
+ }
+ $_result = $variable;
+ foreach($_expand as $value)
+ {
+ $value = trim($value);
+ $_result = str_replace($value, '" . ' . $this->_parse_variable($value) . ' . "', $_result);
+ }
+ $_result = str_replace("`", "", $_result);
+ return $_result;
+ }
+ elseif ($variable{0} == "'")
+ {
+ // return the value just as it is
+ return $variable;
+ }
+ elseif ($variable{0} == "%")
+ {
+ return $this->_parse_section_prop($variable);
+ }
+ else
+ {
+ // return it as is; i believe that there was a reason before that i did not just return it as is,
+ // but i forgot what that reason is ...
+ // the reason i return the variable 'as is' right now is so that unquoted literals are allowed
+ return $variable;
+ }
+ }
+
+ function _parse_section_prop($section_prop_expr)
+ {
+ $parts = explode('|', $section_prop_expr, 2);
+ $var_ref = $parts[0];
+ $modifiers = isset($parts[1]) ? $parts[1] : '';
+
+ preg_match('!%(\w+)\.(\w+)%!', $var_ref, $match);
+ $section_name = $match[1];
+ $prop_name = $match[2];
+
+ $output = "\$this->_sections['$section_name']['$prop_name']";
+
+ $this->_parse_modifier($output, $modifiers);
+
+ return $output;
+ }
+
+ function _compile_variable($variable)
+ {
+ $_result = "";
+
+ // remove the $
+ $variable = substr($variable, 1);
+
+ // get [foo] and .foo and (...) pieces
+ preg_match_all('!(?:^\w+)|(?:' . $this->_var_bracket_regexp . ')|\.\$?\w+|\S+!', $variable, $_match);
+ $variable = $_match[0];
+ $var_name = array_shift($variable);
+
+ if ($var_name == $this->reserved_template_varname)
+ {
+ if ($variable[0]{0} == '[' || $variable[0]{0} == '.')
+ {
+ $find = array("[", "]", ".");
+ switch(strtoupper(str_replace($find, "", $variable[0])))
+ {
+ case 'GET':
+ $_result = "\$_GET";
+ break;
+ case 'POST':
+ $_result = "\$_POST";
+ break;
+ case 'COOKIE':
+ $_result = "\$_COOKIE";
+ break;
+ case 'ENV':
+ $_result = "\$_ENV";
+ break;
+ case 'SERVER':
+ $_result = "\$_SERVER";
+ break;
+ case 'SESSION':
+ $_result = "\$_SESSION";
+ break;
+ case 'NOW':
+ $_result = "time()";
+ break;
+ case 'SECTION':
+ $_result = "\$this->_sections";
+ break;
+ case 'LDELIM':
+ $_result = "\$this->left_delimiter";
+ break;
+ case 'RDELIM':
+ $_result = "\$this->right_delimiter";
+ break;
+ case 'VERSION':
+ $_result = "\$this->_version";
+ break;
+ case 'CONFIG':
+ $_result = "\$this->_confs";
+ break;
+ case 'TEMPLATE':
+ $_result = "\$this->_file";
+ break;
+ case 'CONST':
+ $constant = str_replace($find, "", $_match[0][2]);
+ $_result = "constant('$constant')";
+ $variable = array();
+ break;
+ default:
+ $_var_name = str_replace($find, "", $variable[0]);
+ $_result = "\$this->_templatelite_vars['$_var_name']";
+ break;
+ }
+ array_shift($variable);
+ }
+ else
+ {
+ $this->trigger_error('$' . $var_name.implode('', $variable) . ' is an invalid $templatelite reference', E_USER_ERROR, __FILE__, __LINE__);
+ }
+ }
+ else
+ {
+ $_result = "\$this->_vars['$var_name']";
+ }
+
+ foreach ($variable as $var)
+ {
+ if ($var{0} == '[')
+ {
+ $var = substr($var, 1, -1);
+ if (is_numeric($var))
+ {
+ $_result .= "[$var]";
+ }
+ elseif ($var{0} == '$')
+ {
+ $_result .= "[" . $this->_compile_variable($var) . "]";
+ }
+ elseif ($var{0} == '#')
+ {
+ $_result .= "[" . $this->_compile_config($var) . "]";
+ }
+ else
+ {
+// $_result .= "['$var']";
+ $parts = explode('.', $var);
+ $section = $parts[0];
+ $section_prop = isset($parts[1]) ? $parts[1] : 'index';
+ $_result .= "[\$this->_sections['$section']['$section_prop']]";
+ }
+ }
+ else if ($var{0} == '.')
+ {
+ if ($var{1} == '$')
+ {
+ $_result .= "[\$this->_TPL['" . substr($var, 2) . "']]";
+ }
+ else
+ {
+ $_result .= "['" . substr($var, 1) . "']";
+ }
+ }
+ else if (substr($var,0,2) == '->')
+ {
+ if(substr($var,2,2) == '__')
+ {
+ $this->trigger_error('call to internal object members is not allowed', E_USER_ERROR, __FILE__, __LINE__);
+ }
+ else if (substr($var, 2, 1) == '$')
+ {
+ $_output .= '->{(($var=$this->_TPL[\''.substr($var,3).'\']) && substr($var,0,2)!=\'__\') ? $_var : $this->trigger_error("cannot access property \\"$var\\"")}';
+ }
+ }
+ else
+ {
+ $this->trigger_error('$' . $var_name.implode('', $variable) . ' is an invalid reference', E_USER_ERROR, __FILE__, __LINE__);
+ }
+ }
+ return $_result;
+ }
+
+ function _parse_modifier($variable, $modifiers)
+ {
+ $_match = array();
+ $_mods = array(); // stores all modifiers
+ $_args = array(); // modifier arguments
+
+ preg_match_all('!\|(@?\w+)((?>:(?:'. $this->_qstr_regexp . '|[^|]+))*)!', '|' . $modifiers, $_match);
+ list(, $_mods, $_args) = $_match;
+
+ $count_mods = count($_mods);
+ for ($i = 0, $for_max = $count_mods; $i < $for_max; $i++)
+ {
+ preg_match_all('!:(' . $this->_qstr_regexp . '|[^:]+)!', $_args[$i], $_match);
+ $_arg = $_match[1];
+
+ if ($_mods[$i]{0} == '@')
+ {
+ $_mods[$i] = substr($_mods[$i], 1);
+ $_map_array = 0;
+ } else {
+ $_map_array = 1;
+ }
+
+ foreach($_arg as $key => $value)
+ {
+ $_arg[$key] = $this->_parse_variable($value);
+ }
+
+ if ($this->_plugin_exists($_mods[$i], "modifier") || function_exists($_mods[$i]))
+ {
+ if (count($_arg) > 0)
+ {
+ $_arg = ', '.implode(', ', $_arg);
+ }
+ else
+ {
+ $_arg = '';
+ }
+
+ $php_function = "PHP";
+ if ($this->_plugin_exists($_mods[$i], "modifier"))
+ {
+ $php_function = "plugin";
+ }
+ $variable = "\$this->_run_modifier($variable, '$_mods[$i]', '$php_function', $_map_array$_arg)";
+ }
+ else
+ {
+ $variable = "\$this->trigger_error(\"'" . $_mods[$i] . "' modifier does not exist\", E_USER_NOTICE, __FILE__, __LINE__);";
+ }
+ }
+ return $variable;
+ }
+
+ function _plugin_exists($function, $type)
+ {
+ // check for object functions
+ if (isset($this->_plugins[$type][$function]) && is_array($this->_plugins[$type][$function]) && is_object($this->_plugins[$type][$function][0]) && method_exists($this->_plugins[$type][$function][0], $this->_plugins[$type][$function][1]))
+ {
+ return '$this->_plugins[\'' . $type . '\'][\'' . $function . '\'][0]->' . $this->_plugins[$type][$function][1];
+ }
+ // check for standard functions
+ if (isset($this->_plugins[$type][$function]) && function_exists($this->_plugins[$type][$function]))
+ {
+ return $this->_plugins[$type][$function];
+ }
+ // check for a plugin in the plugin directory
+ if (file_exists($this->_get_plugin_dir($type . '.' . $function . '.php') . $type . '.' . $function . '.php'))
+ {
+ require_once($this->_get_plugin_dir($type . '.' . $function . '.php') . $type . '.' . $function . '.php');
+ if (function_exists('tpl_' . $type . '_' . $function))
+ {
+ $this->_require_stack[$type . '.' . $function . '.php'] = array($type, $function, 'tpl_' . $type . '_' . $function);
+ return ('tpl_' . $type . '_' . $function);
+ }
+ }
+ return false;
+ }
+
+ function _load_filters()
+ {
+ if (count($this->_plugins['prefilter']) > 0)
+ {
+ foreach ($this->_plugins['prefilter'] as $filter_name => $prefilter)
+ {
+ if (!function_exists($prefilter))
+ {
+ @include_once( $this->_get_plugin_dir("prefilter." . $filter_name . ".php") . "prefilter." . $filter_name . ".php");
+ }
+ }
+ }
+ if (count($this->_plugins['postfilter']) > 0)
+ {
+ foreach ($this->_plugins['postfilter'] as $filter_name => $postfilter)
+ {
+ if (!function_exists($postfilter))
+ {
+ @include_once( $this->_get_plugin_dir("postfilter." . $filter_name . ".php") . "postfilter." . $filter_name . ".php");
+ }
+ }
+ }
+ }
+}
+
+?>
diff --git a/ThinkPHP/Library/Vendor/TemplateLite/class.config.php b/ThinkPHP/Library/Vendor/TemplateLite/class.config.php
new file mode 100644
index 0000000..98d3e79
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/TemplateLite/class.config.php
@@ -0,0 +1,165 @@
+, Mark Dickenson
+ * Copyright: 2003,2004,2005 by Paul Lockaby, 2005,2006 Mark Dickenson
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * The latest version of template_lite can be obtained from:
+ * http://templatelite.sourceforge.net
+ *
+ */
+
+class config {
+ var $overwrite = false; // overwrite variables of the same name? if false, an array will be created
+ var $booleanize = true; // turn true/false, yes/no, on/off, into 1/0
+ var $fix_new_lines = true; // turns \r\n into \n?
+ var $read_hidden = true; // read hidden sections?
+
+ var $_db_qstr_regexp = null;
+ var $_bool_true_regexp = null;
+ var $_bool_false_regexp = null;
+ var $_qstr_regexp = null;
+
+ function config()
+ {
+ $this->_db_qstr_regexp = '"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"';
+ $this->_bool_true_regexp = 'true|yes|on';
+ $this->_bool_false_regexp = 'false|no|off';
+ $this->_qstr_regexp = '(?:' . $this->_db_qstr_regexp . '|' . $this->_bool_true_regexp . '|' . $this->_bool_false_regexp . ')';
+ }
+
+ function config_load($file, $section_name = null, $var_name = null)
+ {
+ $_result = array();
+ $contents = file_get_contents($file);
+ if (empty($contents))
+ {
+ die("Could not open $file");
+ }
+
+ // insert new line into beginning of file
+ $contents = "\n" . $contents;
+ // fix new-lines
+ if ($this->fix_new_lines)
+ {
+ $contents = str_replace("\r\n","\n",$contents);
+ }
+
+ // match globals
+ if (preg_match("/^(.*?)(\n\[|\Z)/s", $contents, $match))
+ {
+ $_result["globals"] = $this->_parse_config_section($match[1]);
+ }
+
+ // match sections
+ if (preg_match_all("/^\[(.*?)\]/m", $contents, $match))
+ {
+ foreach ($match[1] as $section)
+ {
+ if ($section{0} == '.' && !$this->read_hidden)
+ {
+ continue;
+ }
+ preg_match("/\[".preg_quote($section)."\](.*?)(\n\[|\Z)/s",$contents,$match);
+ if ($section{0} == '.')
+ {
+ $section = substr($section, 1);
+ }
+ $_result[$section] = $this->_parse_config_section($match[1]);
+ }
+ }
+
+
+ if (!empty($var_name))
+ {
+ if (empty($section_name))
+ {
+ return $_result["globals"][$var_name];
+ }
+ else
+ {
+ if(isset($_result[$section_name][$var_name]))
+ {
+ return $_result[$section_name][$var_name];
+ }
+ else
+ {
+ return array();
+ }
+ }
+ }
+ else
+ {
+ if (empty($section_name))
+ {
+ return $_result;
+ }
+ else
+ {
+ if(isset($_result[$section_name]))
+ {
+ return $_result[$section_name];
+ }
+ else
+ {
+ return array();
+ }
+ }
+ }
+ }
+
+ function _parse_config_section($body)
+ {
+ $_result = array();
+ preg_match_all('!(\n\s*[a-zA-Z0-9_]+)\s*=\s*(' . $this->_qstr_regexp . ')!s', $body, $ini);
+ $keys = $ini[1];
+ $values = $ini[2];
+ for($i = 0, $for_max = count($ini[0]); $i < $for_max; $i++)
+ {
+ if ($this->booleanize)
+ {
+ if (preg_match('/^(' . $this->_bool_true_regexp . ')$/i', $values[$i]))
+ {
+ $values[$i] = true;
+ }
+ elseif (preg_match('/^(' . $this->_bool_false_regexp . ')$/i', $values[$i]))
+ {
+ $values[$i] = false;
+ }
+ }
+ if (!is_numeric($values[$i]) && !is_bool($values[$i]))
+ {
+ $values[$i] = str_replace("\n",'',stripslashes(substr($values[$i], 1, -1)));
+ }
+ if ($this->overwrite || !isset($_result[trim($keys[$i])]))
+ {
+ $_result[trim($keys[$i])] = $values[$i];
+ }
+ else
+ {
+ if (!is_array($_result[trim($keys[$i])]))
+ {
+ $_result[trim($keys[$i])] = array($_result[trim($keys[$i])]);
+ }
+ $_result[trim($keys[$i])][] = $values[$i];
+ }
+ }
+ return $_result;
+ }
+}
+?>
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/TemplateLite/class.template.php b/ThinkPHP/Library/Vendor/TemplateLite/class.template.php
new file mode 100644
index 0000000..89e85ab
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/TemplateLite/class.template.php
@@ -0,0 +1,926 @@
+, Mark Dickenson
+ * Copyright: 2003,2004,2005 by Paul Lockaby, 2005,2006 Mark Dickenson
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * The latest version of template_lite can be obtained from:
+ * http://templatelite.sourceforge.net
+ *
+ */
+
+if (!defined('TEMPLATE_LITE_DIR')) {
+ define('TEMPLATE_LITE_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR);
+}
+
+class Template_Lite {
+ // public configuration variables
+ var $left_delimiter = "{"; // the left delimiter for template tags
+ var $right_delimiter = "}"; // the right delimiter for template tags
+ var $cache = false; // whether or not to allow caching of files
+ var $force_compile = false; // force a compile regardless of saved state
+ var $template_dir = "templates"; // where the templates are to be found
+ var $plugins_dir = array("plugins"); // where the plugins are to be found
+ var $compile_dir = "compiled"; // the directory to store the compiled files in
+ var $config_dir = "templates"; // where the config files are
+ var $cache_dir = "cached"; // where cache files are stored
+ var $config_overwrite = false;
+ var $config_booleanize = true;
+ var $config_fix_new_lines = true;
+ var $config_read_hidden = true;
+ var $cache_lifetime = 0; // how long the file in cache should be considered "fresh"
+ var $encode_file_name = true; // Set this to false if you do not want the name of the compiled/cached file to be md5 encoded.
+ var $php_extract_vars = false; // Set this to true if you want the $this->_tpl variables to be extracted for use by PHP code inside the template.
+ var $reserved_template_varname = "templatelite";
+ var $default_modifiers = array();
+ var $debugging = false;
+
+ var $compiler_file = 'class.compiler.php';
+ var $compiler_class = 'Template_Lite_Compiler';
+ var $config_class = 'config';
+
+ // gzip output configuration
+ var $send_now = 1;
+ var $force_compression = 0;
+ var $compression_level = 9;
+ var $enable_gzip = 1;
+
+ // private internal variables
+ var $_vars = array(); // stores all internal assigned variables
+ var $_confs = array(); // stores all internal config variables
+ var $_plugins = array( 'modifier' => array(),
+ 'function' => array(),
+ 'block' => array(),
+ 'compiler' => array(),
+ 'resource' => array(),
+ 'prefilter' => array(),
+ 'postfilter' => array(),
+ 'outputfilter' => array());
+ var $_linenum = 0; // the current line number in the file we are processing
+ var $_file = ""; // the current file we are processing
+ var $_config_obj = null;
+ var $_compile_obj = null;
+ var $_cache_id = null;
+ var $_cache_dir = ""; // stores where this specific file is going to be cached
+ var $_cache_info = array('config' => array(), 'template' => array());
+ var $_sl_md5 = '39fc70570b8b60cbc1b85839bf242aff';
+ var $_version = 'V2.10 Template Lite 4 January 2007 (c) 2005-2007 Mark Dickenson. All rights reserved. Released LGPL.';
+ var $_version_date = "2007-01-04 10:34:21";
+ var $_config_module_loaded = false;
+ var $_templatelite_debug_info = array();
+ var $_templatelite_debug_loop = false;
+ var $_templatelite_debug_dir = "";
+ var $_inclusion_depth = 0;
+ var $_null = null;
+ var $_resource_type = 1;
+ var $_resource_time;
+ var $_sections = array();
+ var $_foreach = array();
+
+ function Template_Lite()
+ {
+ $this->_version_date = strtotime($this->_version_date);
+ }
+
+ function load_filter($type, $name)
+ {
+ switch ($type)
+ {
+ case 'output':
+ include_once( $this->_get_plugin_dir($type . "filter." . $name . ".php") . $type . "filter." . $name . ".php");
+ $this->_plugins['outputfilter'][$name] = "template_" . $type . "filter_" . $name;
+ break;
+ case 'pre':
+ case 'post':
+ if (!isset($this->_plugins[$type . 'filter'][$name]))
+ {
+ $this->_plugins[$type . 'filter'][$name] = "template_" . $type . "filter_" . $name;
+ }
+ break;
+ }
+ }
+
+ function assign($key, $value = null)
+ {
+ if (is_array($key))
+ {
+ foreach($key as $var => $val)
+ if ($var != "")
+ {
+ $this->_vars[$var] = $val;
+ }
+ }
+ else
+ {
+ if ($key != "")
+ {
+ $this->_vars[$key] = $value;
+ }
+ }
+ }
+
+ function assign_by_ref($key, $value = null)
+ {
+ if ($key != '')
+ {
+ $this->_vars[$key] = &$value;
+ }
+ }
+
+ function assign_config($key, $value = null)
+ {
+ if (is_array($key))
+ {
+ foreach($key as $var => $val)
+ {
+ if ($var != "")
+ {
+ $this->_confs[$var] = $val;
+ }
+ }
+ }
+ else
+ {
+ if ($key != "")
+ {
+ $this->_confs[$key] = $value;
+ }
+ }
+ }
+
+ function append($key, $value=null, $merge=false)
+ {
+ if (is_array($key))
+ {
+ foreach ($key as $_key => $_value)
+ {
+ if ($_key != '')
+ {
+ if(!@is_array($this->_vars[$_key]))
+ {
+ settype($this->_vars[$_key],'array');
+ }
+ if($merge && is_array($_value))
+ {
+ foreach($_value as $_mergekey => $_mergevalue)
+ {
+ $this->_vars[$_key][$_mergekey] = $_mergevalue;
+ }
+ }
+ else
+ {
+ $this->_vars[$_key][] = $_value;
+ }
+ }
+ }
+ }
+ else
+ {
+ if ($key != '' && isset($value))
+ {
+ if(!@is_array($this->_vars[$key]))
+ {
+ settype($this->_vars[$key],'array');
+ }
+ if($merge && is_array($value))
+ {
+ foreach($value as $_mergekey => $_mergevalue)
+ {
+ $this->_vars[$key][$_mergekey] = $_mergevalue;
+ }
+ }
+ else
+ {
+ $this->_vars[$key][] = $value;
+ }
+ }
+ }
+ }
+
+ function append_by_ref($key, &$value, $merge=false)
+ {
+ if ($key != '' && isset($value))
+ {
+ if(!@is_array($this->_vars[$key]))
+ {
+ settype($this->_vars[$key],'array');
+ }
+ if ($merge && is_array($value))
+ {
+ foreach($value as $_key => $_val)
+ {
+ $this->_vars[$key][$_key] = &$value[$_key];
+ }
+ }
+ else
+ {
+ $this->_vars[$key][] = &$value;
+ }
+ }
+ }
+
+ function clear_assign($key = null)
+ {
+ if ($key == null)
+ {
+ $this->_vars = array();
+ }
+ else
+ {
+ if (is_array($key))
+ {
+ foreach($key as $index => $value)
+ {
+ if (in_array($value, $this->_vars))
+ {
+ unset($this->_vars[$index]);
+ }
+ }
+ }
+ else
+ {
+ if (in_array($key, $this->_vars))
+ {
+ unset($this->_vars[$index]);
+ }
+ }
+ }
+ }
+
+ function clear_all_assign()
+ {
+ $this->_vars = array();
+ }
+
+ function clear_config($key = null)
+ {
+ if ($key == null)
+ {
+ $this->_conf = array();
+ }
+ else
+ {
+ if (is_array($key))
+ {
+ foreach($key as $index => $value)
+ {
+ if (in_array($value, $this->_conf))
+ {
+ unset($this->_conf[$index]);
+ }
+ }
+ }
+ else
+ {
+ if (in_array($key, $this->_conf))
+ {
+ unset($this->_conf[$key]);
+ }
+ }
+ }
+ }
+
+ function &get_template_vars($key = null)
+ {
+ if ($key == null)
+ {
+ return $this->_vars;
+ }
+ else
+ {
+ if (isset($this->_vars[$key]))
+ {
+ return $this->_vars[$key];
+ }
+ else
+ {
+ return $this->_null;
+ }
+ }
+ }
+
+ function &get_config_vars($key = null)
+ {
+ if ($key == null)
+ {
+ return $this->_confs;
+ }
+ else
+ {
+ if (isset($this->_confs[$key]))
+ {
+ return $this->_confs[$key];
+ }
+ else
+ {
+ return $this->_null;
+ }
+ }
+ }
+
+ function clear_compiled_tpl($file = null)
+ {
+ $this->_destroy_dir($file, null, $this->_get_dir($this->compile_dir));
+ }
+
+ function clear_cache($file = null, $cache_id = null, $compile_id = null, $exp_time = null)
+ {
+ if (!$this->cache)
+ {
+ return;
+ }
+ $this->_destroy_dir($file, $cache_id, $this->_get_dir($this->cache_dir));
+ }
+
+ function clear_all_cache($exp_time = null)
+ {
+ $this->clear_cache();
+ }
+
+ function is_cached($file, $cache_id = null)
+ {
+ if (!$this->force_compile && $this->cache && $this->_is_cached($file, $cache_id))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ function register_modifier($modifier, $implementation)
+ {
+ $this->_plugins['modifier'][$modifier] = $implementation;
+ }
+
+ function unregister_modifier($modifier)
+ {
+ unset($this->_plugins['modifier'][$modifier]);
+ }
+
+ function register_function($function, $implementation)
+ {
+ $this->_plugins['function'][$function] = $implementation;
+ }
+
+ function unregister_function($function)
+ {
+ unset($this->_plugins['function'][$function]);
+ }
+
+ function register_block($function, $implementation)
+ {
+ $this->_plugins['block'][$function] = $implementation;
+ }
+
+ function unregister_block($function)
+ {
+ unset($this->_plugins['block'][$function]);
+ }
+
+ function register_compiler($function, $implementation)
+ {
+ $this->_plugins['compiler'][$function] = $implementation;
+ }
+
+ function unregister_compiler($function)
+ {
+ unset($this->_plugins['compiler'][$function]);
+ }
+
+ function register_prefilter($function)
+ {
+ $_name = (is_array($function)) ? $function[1] : $function;
+ $this->_plugins['prefilter'][$_name] = $_name;
+ }
+
+ function unregister_prefilter($function)
+ {
+ unset($this->_plugins['prefilter'][$function]);
+ }
+
+ function register_postfilter($function)
+ {
+ $_name = (is_array($function)) ? $function[1] : $function;
+ $this->_plugins['postfilter'][$_name] = $_name;
+ }
+
+ function unregister_postfilter($function)
+ {
+ unset($this->_plugins['postfilter'][$function]);
+ }
+
+ function register_outputfilter($function)
+ {
+ $_name = (is_array($function)) ? $function[1] : $function;
+ $this->_plugins['outputfilter'][$_name] = $_name;
+ }
+
+ function unregister_outputfilter($function)
+ {
+ unset($this->_plugins['outputfilter'][$function]);
+ }
+
+ function register_resource($type, $functions)
+ {
+ if (count($functions) == 4)
+ {
+ $this->_plugins['resource'][$type] = $functions;
+ }
+ else
+ {
+ $this->trigger_error("malformed function-list for '$type' in register_resource");
+ }
+ }
+
+ function unregister_resource($type)
+ {
+ unset($this->_plugins['resource'][$type]);
+ }
+
+ function template_exists($file)
+ {
+ if (file_exists($this->_get_dir($this->template_dir).$file))
+ {
+ $this->_resource_time = filemtime($this->_get_dir($this->template_dir).$file);
+ $this->_resource_type = 1;
+ return true;
+ }
+ else
+ {
+ if (file_exists($file))
+ {
+ $this->_resource_time = filemtime($file);
+ $this->_resource_type = "file";
+ return true;
+ }
+ return false;
+ }
+ }
+
+ function _get_resource($file)
+ {
+ $_resource_name = explode(':', trim($file));
+
+ if (count($_resource_name) == 1 || $_resource_name[0] == "file")
+ {
+ if($_resource_name[0] == "file")
+ {
+ $file = substr($file, 5);
+ }
+
+ $exists = $this->template_exists($file);
+
+ if (!$exists)
+ {
+ $this->trigger_error("file '$file' does not exist", E_USER_ERROR);
+ }
+ }
+ else
+ {
+ $this->_resource_type = $_resource_name[0];
+ $file = substr($file, strlen($this->_resource_type) + 1);
+ $exists = isset($this->_plugins['resource'][$this->_resource_type]) && call_user_func_array($this->_plugins['resource'][$this->_resource_type][1], array($file, &$resource_timestamp, &$this));
+
+ if (!$exists)
+ {
+ $this->trigger_error("file '$file' does not exist", E_USER_ERROR);
+ }
+ $this->_resource_time = $resource_timestamp;
+ }
+ return $file;
+ }
+
+ function display($file, $cache_id = null)
+ {
+ $this->fetch($file, $cache_id, true);
+ }
+
+ function fetch($file, $cache_id = null, $display = false)
+ {
+ $file = $this->_get_resource($file);
+
+ if ($this->debugging)
+ {
+ $this->_templatelite_debug_info[] = array('type' => 'template',
+ 'filename' => $file,
+ 'depth' => 0,
+ 'exec_time' => array_sum(explode(' ', microtime())) );
+ $included_tpls_idx = count($this->_templatelite_debug_info) - 1;
+ }
+
+ $this->_cache_id = $cache_id;
+ $this->template_dir = $this->_get_dir($this->template_dir);
+ $this->compile_dir = $this->_get_dir($this->compile_dir);
+ if ($this->cache)
+ {
+ $this->_cache_dir = $this->_build_dir($this->cache_dir, $this->_cache_id);
+ }
+
+ $name = ($this->encode_file_name) ? md5((($this->_resource_type == 1) ? $this->template_dir.$file : $this->_resource_type . "_" . $file)).'.php' : str_replace(".", "_", str_replace("/", "_", $this->_resource_type . "_" . $file)).'.php';
+
+ $this->_error_level = $this->debugging ? error_reporting() : error_reporting(error_reporting() & ~E_NOTICE);
+// $this->_error_level = error_reporting(E_ALL);
+
+ if (!$this->force_compile && $this->cache && $this->_is_cached($file, $cache_id))
+ {
+ ob_start();
+ include($this->_cache_dir.$name);
+ $output = ob_get_contents();
+ ob_end_clean();
+ $output = substr($output, strpos($output, "\n") + 1);
+ }
+ else
+ {
+
+ $output = $this->_fetch_compile($file, $cache_id);
+
+ if ($this->cache)
+ {
+ $f = fopen($this->_cache_dir.$name, "w");
+ fwrite($f, serialize($this->_cache_info) . "\n$output");
+ fclose($f);
+ }
+ }
+
+ if (strpos($output, $this->_sl_md5) !== false)
+ {
+ preg_match_all('!' . $this->_sl_md5 . '{_run_insert (.*)}' . $this->_sl_md5 . '!U',$output,$_match);
+ foreach($_match[1] as $value)
+ {
+ $arguments = unserialize($value);
+ $output = str_replace($this->_sl_md5 . '{_run_insert ' . $value . '}' . $this->_sl_md5, call_user_func_array('insert_' . $arguments['name'], array((array)$arguments, $this)), $output);
+ }
+ }
+
+ foreach ($this->_plugins['outputfilter'] as $function)
+ {
+ $output = $function($output, $this);
+ }
+
+ error_reporting($this->_error_level);
+
+ if ($this->debugging)
+ {
+ $this->_templatelite_debug_info[$included_tpls_idx]['exec_time'] = array_sum(explode(' ', microtime())) - $this->_templatelite_debug_info[$included_tpls_idx]['exec_time'];
+ }
+
+ if ($display)
+ {
+ echo $output;
+ if($this->debugging && !$this->_templatelite_debug_loop)
+ {
+ $this->debugging = false;
+ if(!function_exists("template_generate_debug_output"))
+ {
+ require_once(TEMPLATE_LITE_DIR . "internal/template.generate_debug_output.php");
+ }
+ $debug_output = template_generate_debug_output($this);
+ $this->debugging = true;
+ echo $debug_output;
+ }
+ }
+ else
+ {
+ return $output;
+ }
+ }
+
+ function config_load($file, $section_name = null, $var_name = null)
+ {
+ require_once(TEMPLATE_LITE_DIR . "internal/template.config_loader.php");
+ }
+
+ function _is_cached($file, $cache_id)
+ {
+ $this->_cache_dir = $this->_get_dir($this->cache_dir, $cache_id);
+ $this->config_dir = $this->_get_dir($this->config_dir);
+ $this->template_dir = $this->_get_dir($this->template_dir);
+
+ $file = $this->_get_resource($file);
+
+ $name = ($this->encode_file_name) ? md5((($this->_resource_type == 1) ? $this->template_dir.$file : $this->_resource_type . "_" . $file)).'.php' : str_replace(".", "_", str_replace("/", "_", $this->_resource_type . "_" . $file)).'.php';
+
+ if (file_exists($this->_cache_dir.$name) && (((time() - filemtime($this->_cache_dir.$name)) < $this->cache_lifetime) || $this->cache_lifetime == -1) && (filemtime($this->_cache_dir.$name) > $this->_resource_time))
+ {
+ $fh = fopen($this->_cache_dir.$name, "r");
+ if (!feof($fh) && ($line = fgets($fh, filesize($this->_cache_dir.$name))))
+ {
+ $includes = unserialize($line);
+ if (isset($includes['template']))
+ {
+ foreach($includes['template'] as $value)
+ {
+ if (!(file_exists($this->template_dir.$value) && (filemtime($this->_cache_dir.$name) > filemtime($this->template_dir.$value))))
+ {
+ return false;
+ }
+ }
+ }
+ if (isset($includes['config']))
+ {
+ foreach($includes['config'] as $value)
+ {
+ if (!(file_exists($this->config_dir.$value) && (filemtime($this->_cache_dir.$name) > filemtime($this->config_dir.$value))))
+ {
+ return false;
+ }
+ }
+ }
+ }
+ fclose($fh);
+ }
+ else
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function _fetch_compile_include($_templatelite_include_file, $_templatelite_include_vars)
+ {
+ if(!function_exists("template_fetch_compile_include"))
+ {
+ require_once(TEMPLATE_LITE_DIR . "internal/template.fetch_compile_include.php");
+ }
+ return template_fetch_compile_include($_templatelite_include_file, $_templatelite_include_vars, $this);
+ }
+
+ function _fetch_compile($file)
+ {
+ $this->template_dir = $this->_get_dir($this->template_dir);
+
+ $name = ($this->encode_file_name) ? md5((($this->_resource_type == 1) ? $this->template_dir.$file : $this->_resource_type . "_" . $file)).'.php' : str_replace(".", "_", str_replace("/", "_", $this->_resource_type . "_" . $file)).'.php';
+
+ if ($this->cache)
+ {
+ array_push($this->_cache_info['template'], $file);
+ }
+
+ if (!$this->force_compile && file_exists($this->compile_dir.'c_'.$name)
+ && (filemtime($this->compile_dir.'c_'.$name) > $this->_resource_time)
+ && (filemtime($this->compile_dir.'c_'.$name) > $this->_version_date))
+ {
+ ob_start();
+ include($this->compile_dir.'c_'.$name);
+ $output = ob_get_contents();
+ ob_end_clean();
+ error_reporting($this->_error_level);
+ return $output;
+ }
+
+ $file_contents = "";
+ if($this->_resource_type == 1)
+ {
+ $f = fopen($this->template_dir . $file, "r");
+ $size = filesize($this->template_dir . $file);
+ if ($size > 0)
+ {
+ $file_contents = fread($f, $size);
+ }
+ }
+ else
+ if($this->_resource_type == "file")
+ {
+ $f = fopen($file, "r");
+ $size = filesize($file);
+ if ($size > 0)
+ {
+ $file_contents = fread($f, $size);
+ }
+ }
+ else
+ {
+ call_user_func_array($this->_plugins['resource'][$this->_resource_type][0], array($file, &$file_contents, &$this));
+ }
+
+ $this->_file = $file;
+ fclose($f);
+
+ if (!is_object($this->_compile_obj))
+ {
+ if (file_exists(TEMPLATE_LITE_DIR . $this->compiler_file)) {
+ require_once(TEMPLATE_LITE_DIR . $this->compiler_file);
+ } else {
+ require_once($this->compiler_file);
+ }
+ $this->_compile_obj = new $this->compiler_class;
+ }
+ $this->_compile_obj->left_delimiter = $this->left_delimiter;
+ $this->_compile_obj->right_delimiter = $this->right_delimiter;
+ $this->_compile_obj->plugins_dir = &$this->plugins_dir;
+ $this->_compile_obj->template_dir = &$this->template_dir;
+ $this->_compile_obj->_vars = &$this->_vars;
+ $this->_compile_obj->_confs = &$this->_confs;
+ $this->_compile_obj->_plugins = &$this->_plugins;
+ $this->_compile_obj->_linenum = &$this->_linenum;
+ $this->_compile_obj->_file = &$this->_file;
+ $this->_compile_obj->php_extract_vars = &$this->php_extract_vars;
+ $this->_compile_obj->reserved_template_varname = &$this->reserved_template_varname;
+ $this->_compile_obj->default_modifiers = $this->default_modifiers;
+
+ $output = $this->_compile_obj->_compile_file($file_contents);
+
+ $f = fopen($this->compile_dir.'c_'.$name, "w");
+ fwrite($f, $output);
+ fclose($f);
+
+ ob_start();
+ eval(' ?>' . $output . ' $value)
+ {
+ if($php_function == "PHP")
+ {
+ $variable[$key] = call_user_func_array($modifier, $arguments);
+ }
+ else
+ {
+ $variable[$key] = call_user_func_array($this->_plugins["modifier"][$modifier], $arguments);
+ }
+ }
+ }
+ else
+ {
+ if($php_function == "PHP")
+ {
+ $variable = call_user_func_array($modifier, $arguments);
+ }
+ else
+ {
+ $variable = call_user_func_array($this->_plugins["modifier"][$modifier], $arguments);
+ }
+ }
+ return $variable;
+ }
+
+ function _run_insert($arguments)
+ {
+ if ($this->cache)
+ {
+ return $this->_sl_md5 . '{_run_insert ' . serialize((array)$arguments) . '}' . $this->_sl_md5;
+ }
+ else
+ {
+ if (!function_exists('insert_' . $arguments['name']))
+ {
+ $this->trigger_error("function 'insert_" . $arguments['name'] . "' does not exist in 'insert'", E_USER_ERROR);
+ }
+ if (isset($arguments['assign']))
+ {
+ $this->assign($arguments['assign'], call_user_func_array('insert_' . $arguments['name'], array((array)$arguments, $this)));
+ }
+ else
+ {
+ return call_user_func_array('insert_' . $arguments['name'], array((array)$arguments, $this));
+ }
+ }
+ }
+
+ function _get_dir($dir, $id = null)
+ {
+ if (empty($dir))
+ {
+ $dir = '.';
+ }
+ if (substr($dir, -1) != DIRECTORY_SEPARATOR)
+ {
+ $dir .= DIRECTORY_SEPARATOR;
+ }
+ if (!empty($id))
+ {
+ $_args = explode('|', $id);
+ if (count($_args) == 1 && empty($_args[0]))
+ {
+ return $dir;
+ }
+ foreach($_args as $value)
+ {
+ $dir .= $value.DIRECTORY_SEPARATOR;
+ }
+ }
+ return $dir;
+ }
+
+ function _get_plugin_dir($plugin_name)
+ {
+ static $_path_array = null;
+
+ $plugin_dir_path = "";
+ $_plugin_dir_list = is_array($this->plugins_dir) ? $this->plugins_dir : (array)$this->plugins_dir;
+ foreach ($_plugin_dir_list as $_plugin_dir)
+ {
+ if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $_plugin_dir))
+ {
+ // path is relative
+ if (file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . $_plugin_dir . DIRECTORY_SEPARATOR . $plugin_name))
+ {
+ $plugin_dir_path = dirname(__FILE__) . DIRECTORY_SEPARATOR . $_plugin_dir . DIRECTORY_SEPARATOR;
+ break;
+ }
+ }
+ else
+ {
+ // path is absolute
+ if(!isset($_path_array))
+ {
+ $_ini_include_path = ini_get('include_path');
+
+ if(strstr($_ini_include_path,';'))
+ {
+ // windows pathnames
+ $_path_array = explode(';',$_ini_include_path);
+ }
+ else
+ {
+ $_path_array = explode(':',$_ini_include_path);
+ }
+ }
+
+ if(!in_array($_plugin_dir,$_path_array))
+ {
+ array_unshift($_path_array,$_plugin_dir);
+ }
+
+ foreach ($_path_array as $_include_path)
+ {
+ if (file_exists($_include_path . DIRECTORY_SEPARATOR . $plugin_name))
+ {
+ $plugin_dir_path = $_include_path . DIRECTORY_SEPARATOR;
+ break 2;
+ }
+ }
+ }
+ }
+ return $plugin_dir_path;
+ }
+
+// function _parse_resource_link($resource_link)
+// {
+// $stuffing = "file:/this/is/the/time_5-23.tpl";
+// $stuffing_data = explode(":", $stuffing);
+// preg_match_all('/(?:([0-9a-z._-]+))/i', $stuffing, $stuff);
+// print_r($stuff);
+// echo "
Path: " . str_replace($stuff[0][count($stuff[0]) - 1], "", $stuffing);
+// echo "
Filename: " . $stuff[0][count($stuff[0]) - 1];
+// }
+
+ function _build_dir($dir, $id)
+ {
+ if(!function_exists("template_build_dir"))
+ {
+ require_once(TEMPLATE_LITE_DIR . "internal/template.build_dir.php");
+ }
+ return template_build_dir($dir, $id, $this);
+ }
+
+ function _destroy_dir($file, $id, $dir)
+ {
+ if(!function_exists("template_destroy_dir"))
+ {
+ require_once(TEMPLATE_LITE_DIR . "internal/template.destroy_dir.php");
+ }
+ return template_destroy_dir($file, $id, $dir, $this);
+ }
+
+ function trigger_error($error_msg, $error_type = E_USER_ERROR, $file = null, $line = null)
+ {
+ if(isset($file) && isset($line))
+ {
+ $info = ' ('.basename($file).", line $line)";
+ }
+ else
+ {
+ $info = null;
+ }
+ trigger_error('TPL: [in ' . $this->_file . ' line ' . $this->_linenum . "]: syntax error: $error_msg$info", $error_type);
+ }
+}
+?>
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.compile_config.php b/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.compile_config.php
new file mode 100644
index 0000000..b7741d6
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.compile_config.php
@@ -0,0 +1,74 @@
+_var_bracket_regexp . ')|\.\$?\w+|\S+!', $variable, $_match);
+ $variable = $_match[0];
+ $var_name = array_shift($variable);
+
+ $_result = "\$this->_confs['$var_name']";
+ foreach ($variable as $var)
+ {
+ if ($var{0} == '[')
+ {
+ $var = substr($var, 1, -1);
+ if (is_numeric($var))
+ {
+ $_result .= "[$var]";
+ }
+ elseif ($var{0} == '$')
+ {
+ $_result .= "[" . $object->_compile_variable($var) . "]";
+ }
+ elseif ($var{0} == '#')
+ {
+ $_result .= "[" . $object->_compile_config($var) . "]";
+ }
+ else
+ {
+ $_result .= "['$var']";
+ }
+ }
+ else if ($var{0} == '.')
+ {
+ if ($var{1} == '$')
+ {
+ $_result .= "[\$this->_TPL['" . substr($var, 2) . "']]";
+ }
+ else
+ {
+ $_result .= "['" . substr($var, 1) . "']";
+ }
+ }
+ else if (substr($var,0,2) == '->')
+ {
+ if(substr($var,2,2) == '__')
+ {
+ $object->trigger_error('call to internal object members is not allowed', E_USER_ERROR, __FILE__, __LINE__);
+ }
+ else if (substr($var, 2, 1) == '$')
+ {
+ $_output .= '->{(($var=$this->_TPL[\''.substr($var,3).'\']) && substr($var,0,2)!=\'__\') ? $_var : $this->trigger_error("cannot access property \\"$var\\"")}';
+ }
+ }
+ else
+ {
+ $object->trigger_error('#' . $var_name.implode('', $variable) . '# is an invalid reference', E_USER_ERROR, __FILE__, __LINE__);
+ }
+ }
+ return $_result;
+}
+
+?>
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.compile_custom_block.php b/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.compile_custom_block.php
new file mode 100644
index 0000000..1232587
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.compile_custom_block.php
@@ -0,0 +1,60 @@
+_plugin_exists($function, "block"))
+ {
+ if ($start_tag)
+ {
+ $_args = $object->_parse_arguments($arguments);
+ foreach($_args as $key => $value)
+ {
+ if (is_bool($value))
+ {
+ $value = $value ? 'true' : 'false';
+ }
+ if (is_null($value))
+ {
+ $value = 'null';
+ }
+ $_args[$key] = "'$key' => $value";
+ }
+ $_result = "_tag_stack[] = array('$function', array(".implode(',', (array)$_args).")); ";
+ $_result .= $function . '(array(' . implode(',', (array)$_args) .'), null, $this); ';
+ $_result .= 'ob_start(); ?>';
+ }
+ else
+ {
+ $_result .= '_block_content = ob_get_contents(); ob_end_clean(); ';
+ $_result .= '$this->_block_content = ' . $function . '($this->_tag_stack[count($this->_tag_stack) - 1][1], $this->_block_content, $this); ';
+ if (!empty($modifiers))
+ {
+ $_result .= '$this->_block_content = ' . $object->_parse_modifier('$this->_block_content', $modifiers) . '; ';
+ }
+ $_result .= 'echo $this->_block_content; array_pop($this->_tag_stack); ?>';
+ }
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.compile_custom_function.php b/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.compile_custom_function.php
new file mode 100644
index 0000000..c088751
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.compile_custom_function.php
@@ -0,0 +1,44 @@
+_plugin_exists($function, "function"))
+ {
+ $_args = $object->_parse_arguments($arguments);
+ foreach($_args as $key => $value)
+ {
+ if (is_bool($value))
+ {
+ $value = $value ? 'true' : 'false';
+ }
+ if (is_null($value))
+ {
+ $value = 'null';
+ }
+ $_args[$key] = "'$key' => $value";
+ }
+ $_result = '_parse_modifier($function . '(array(' . implode(',', (array)$_args) . '), $this)', $modifiers) . '; ';
+ }
+ else
+ {
+ $_result .= $function . '(array(' . implode(',', (array)$_args) . '), $this);';
+ }
+ $_result .= '?>';
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.compile_if.php b/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.compile_if.php
new file mode 100644
index 0000000..1fca273
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.compile_if.php
@@ -0,0 +1,154 @@
+(' . $object->_var_regexp . '|\/?' . $object->_svar_regexp . '|\/?' . $object->_func_regexp . ')(?:' . $object->_mod_regexp . '*)?|\-?0[xX][0-9a-fA-F]+|\-?\d+(?:\.\d+)?|\.\d+|!==|===|==|!=|<>|<<|>>|<=|>=|\&\&|\|\||\(|\)|,|\!|\^|=|\&|\~|<|>|\%|\+|\-|\/|\*|\@|\b\w+\b|\S+)/x', $arguments, $_match);
+ $_args = $_match[0];
+
+ // make sure we have balanced parenthesis
+ $_args_count = array_count_values($_args);
+ if(isset($_args_count['(']) && $_args_count['('] != $_args_count[')'])
+ {
+ $object->trigger_error("unbalanced parenthesis in if statement", E_USER_ERROR, __FILE__, __LINE__);
+ }
+
+ $count_args = count($_args);
+ for ($i = 0, $for_max = $count_args; $i < $for_max; $i++)
+ {
+ $_arg = &$_args[$i];
+ switch (strtolower($_arg))
+ {
+ case '!':
+ case '%':
+ case '!==':
+ case '==':
+ case '===':
+ case '>':
+ case '<':
+ case '!=':
+ case '<>':
+ case '<<':
+ case '>>':
+ case '<=':
+ case '>=':
+ case '&&':
+ case '||':
+ case '^':
+ case '&':
+ case '~':
+ case ')':
+ case ',':
+ case '+':
+ case '-':
+ case '*':
+ case '/':
+ case '@':
+ break;
+ case 'eq':
+ $_arg = '==';
+ break;
+ case 'ne':
+ case 'neq':
+ $_arg = '!=';
+ break;
+ case 'lt':
+ $_arg = '<';
+ break;
+ case 'le':
+ case 'lte':
+ $_arg = '<=';
+ break;
+ case 'gt':
+ $_arg = '>';
+ break;
+ case 'ge':
+ case 'gte':
+ $_arg = '>=';
+ break;
+ case 'and':
+ $_arg = '&&';
+ break;
+ case 'or':
+ $_arg = '||';
+ break;
+ case 'not':
+ $_arg = '!';
+ break;
+ case 'mod':
+ $_arg = '%';
+ break;
+ case '(':
+ array_push($_is_arg_stack, $i);
+ break;
+ case 'is':
+ if ($_args[$i-1] == ')')
+ {
+ $is_arg_start = array_pop($is_arg_stack);
+ }
+ else
+ {
+ $_is_arg_count = count($_args);
+ $is_arg = implode(' ', array_slice($_args, $is_arg_start, $i - $is_arg_start));
+ $_arg_tokens = $object->_parse_is_expr($is_arg, array_slice($_args, $i+1));
+ array_splice($_args, $is_arg_start, count($_args), $_arg_tokens);
+ $i = $_is_arg_count - count($_args);
+ }
+ break;
+ default:
+ preg_match('/(?:(' . $object->_var_regexp . '|' . $object->_svar_regexp . '|' . $object->_func_regexp . ')(' . $object->_mod_regexp . '*)(?:\s*[,\.]\s*)?)(?:\s+(.*))?/xs', $_arg, $_match);
+ if (isset($_match[0]{0}) && ($_match[0]{0} == '$' || ($_match[0]{0} == '#' && $_match[0]{strlen($_match[0]) - 1} == '#') || $_match[0]{0} == "'" || $_match[0]{0} == '"' || $_match[0]{0} == '%'))
+ {
+ // process a variable
+ $_arg = $object->_parse_variables(array($_match[1]), array($_match[2]));
+ }
+ elseif (is_numeric($_arg))
+ {
+ // pass the number through
+ }
+ elseif (function_exists($_match[0]) || $_match[0] == "empty" || $_match[0] == "isset" || $_match[0] == "unset" || strtolower($_match[0]) == "true" || strtolower($_match[0]) == "false" || strtolower($_match[0]) == "null")
+ {
+ // pass the function through
+ }
+ elseif (empty($_arg))
+ {
+ // pass the empty argument through
+ }
+ else
+ {
+ $object->trigger_error("unidentified token '$_arg'", E_USER_ERROR, __FILE__, __LINE__);
+ }
+ break;
+ }
+ }
+
+ if($while)
+ {
+ return implode(' ', $_args);
+ }
+ else
+ {
+ if ($elseif)
+ {
+ return '';
+ }
+ else
+ {
+ return '';
+ }
+ }
+ return $_result;
+}
+
+?>
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.generate_compiler_debug_output.php b/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.generate_compiler_debug_output.php
new file mode 100644
index 0000000..f34fa9e
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.generate_compiler_debug_output.php
@@ -0,0 +1,35 @@
+_vars;\n";
+ $debug_output .= "ksort(\$assigned_vars);\n";
+ $debug_output .= "if (@is_array(\$this->_config[0])) {\n";
+ $debug_output .= " \$config_vars = \$this->_config[0];\n";
+ $debug_output .= " ksort(\$config_vars);\n";
+ $debug_output .= " \$this->assign('_debug_config_keys', array_keys(\$config_vars));\n";
+ $debug_output .= " \$this->assign('_debug_config_vals', array_values(\$config_vars));\n";
+ $debug_output .= "} \n";
+
+ $debug_output .= "\$included_templates = \$this->_templatelite_debug_info;\n";
+
+ $debug_output .= "\$this->assign('_debug_keys', array_keys(\$assigned_vars));\n";
+ $debug_output .= "\$this->assign('_debug_vals', array_values(\$assigned_vars));\n";
+ $debug_output .= "\$this->assign('_debug_tpls', \$included_templates);\n";
+
+ $debug_output .= "\$this->_templatelite_debug_loop = true;\n";
+ $debug_output .= "\$this->_templatelite_debug_dir = \$this->template_dir;\n";
+ $debug_output .= "\$this->template_dir = TEMPLATE_LITE_DIR . 'internal/';\n";
+ $debug_output .= "echo \$this->_fetch_compile('debug.tpl');\n";
+ $debug_output .= "\$this->template_dir = \$this->_templatelite_debug_dir;\n";
+ $debug_output .= "\$this->_templatelite_debug_loop = false; \n";
+ return $debug_output;
+}
+
+?>
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.include.php b/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.include.php
new file mode 100644
index 0000000..22be975
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.include.php
@@ -0,0 +1,56 @@
+_parse_arguments($arguments);
+
+ $arg_list = array();
+ if (empty($_args['file']))
+ {
+ $object->trigger_error("missing 'file' attribute in include tag", E_USER_ERROR, __FILE__, __LINE__);
+ }
+
+ foreach ($_args as $arg_name => $arg_value)
+ {
+ if ($arg_name == 'file')
+ {
+ $include_file = $arg_value;
+ continue;
+ }
+ else if ($arg_name == 'assign')
+ {
+ $assign_var = $arg_value;
+ continue;
+ }
+ if (is_bool($arg_value))
+ {
+ $arg_value = $arg_value ? 'true' : 'false';
+ }
+ $arg_list[] = "'$arg_name' => $arg_value";
+ }
+
+ if (isset($assign_var))
+ {
+ $output = '_vars;' .
+ "\n\$this->assign(" . $assign_var . ", \$this->_fetch_compile_include(" . $include_file . ", array(".implode(',', (array)$arg_list).")));\n" .
+ "\$this->_vars = \$_templatelite_tpl_vars;\n" .
+ "unset(\$_templatelite_tpl_vars);\n" .
+ ' ?>';
+ }
+ else
+ {
+ $output = '_vars;' .
+ "\necho \$this->_fetch_compile_include(" . $include_file . ", array(".implode(',', (array)$arg_list)."));\n" .
+ "\$this->_vars = \$_templatelite_tpl_vars;\n" .
+ "unset(\$_templatelite_tpl_vars);\n" .
+ ' ?>';
+ }
+ return $output;
+}
+?>
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.parse_is_expr.php b/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.parse_is_expr.php
new file mode 100644
index 0000000..e5d0edf
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.parse_is_expr.php
@@ -0,0 +1,77 @@
+_parse_variable($expr_arg) . "))";
+ }
+ else
+ {
+ $expr = "!(1 & $is_arg)";
+ }
+ break;
+
+ case 'odd':
+ if (isset($_args[$expr_end]) && $_args[$expr_end] == 'by')
+ {
+ $expr_end++;
+ $expr_arg = $_args[$expr_end++];
+ $expr = "(1 & ($is_arg / " . $object->_parse_variable($expr_arg) . "))";
+ }
+ else
+ {
+ $expr = "(1 & $is_arg)";
+ }
+ break;
+
+ case 'div':
+ if (@$_args[$expr_end] == 'by')
+ {
+ $expr_end++;
+ $expr_arg = $_args[$expr_end++];
+ $expr = "!($is_arg % " . $object->_parse_variable($expr_arg) . ")";
+ }
+ else
+ {
+ $object->trigger_error("expecting 'by' after 'div'", E_USER_ERROR, __FILE__, __LINE__);
+ }
+ break;
+
+ default:
+ $object->trigger_error("unknown 'is' expression - '$expr_type'", E_USER_ERROR, __FILE__, __LINE__);
+ break;
+ }
+
+ if ($negate_expr) {
+ $expr = "!($expr)";
+ }
+
+ array_splice($_args, 0, $expr_end, $expr);
+
+ return $_args;
+}
+
+?>
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.section_start.php b/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.section_start.php
new file mode 100644
index 0000000..7ee700d
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/TemplateLite/internal/compile.section_start.php
@@ -0,0 +1,129 @@
+_parse_arguments($arguments);
+ $arg_list = array();
+
+ $output = 'trigger_error("missing section name", E_USER_ERROR, __FILE__, __LINE__);
+ }
+
+ $output .= "if (isset(\$this->_sections['$section_name'])) unset(\$this->_sections['$section_name']);\n";
+ $section_props = "\$this->_sections['$section_name']";
+
+ foreach ($attrs as $attr_name => $attr_value)
+ {
+ switch ($attr_name)
+ {
+ case 'loop':
+ $output .= "{$section_props}['loop'] = is_array($attr_value) ? count($attr_value) : max(0, (int)$attr_value);\n";
+ break;
+
+ case 'show':
+ if (is_bool($attr_value))
+ {
+ $show_attr_value = $attr_value ? 'true' : 'false';
+ }
+ else
+ {
+ $show_attr_value = "(bool)$attr_value";
+ }
+ $output .= "{$section_props}['show'] = $show_attr_value;\n";
+ break;
+
+ case 'name':
+ $output .= "{$section_props}['$attr_name'] = '$attr_value';\n";
+ break;
+
+ case 'max':
+ case 'start':
+ $output .= "{$section_props}['$attr_name'] = (int)$attr_value;\n";
+ break;
+
+ case 'step':
+ $output .= "{$section_props}['$attr_name'] = ((int)$attr_value) == 0 ? 1 : (int)$attr_value;\n";
+ break;
+
+ default:
+ $object->trigger_error("unknown section attribute - '$attr_name'", E_USER_ERROR, __FILE__, __LINE__);
+ break;
+ }
+ }
+
+ if (!isset($attrs['show']))
+ {
+ $output .= "{$section_props}['show'] = true;\n";
+ }
+
+ if (!isset($attrs['loop']))
+ {
+ $output .= "{$section_props}['loop'] = 1;\n";
+ }
+
+ if (!isset($attrs['max']))
+ {
+ $output .= "{$section_props}['max'] = {$section_props}['loop'];\n";
+ }
+ else
+ {
+ $output .= "if ({$section_props}['max'] < 0)\n" .
+ " {$section_props}['max'] = {$section_props}['loop'];\n";
+ }
+
+ if (!isset($attrs['step']))
+ {
+ $output .= "{$section_props}['step'] = 1;\n";
+ }
+
+ if (!isset($attrs['start']))
+ {
+ $output .= "{$section_props}['start'] = {$section_props}['step'] > 0 ? 0 : {$section_props}['loop']-1;\n";
+ }
+ else
+ {
+ $output .= "if ({$section_props}['start'] < 0)\n" .
+ " {$section_props}['start'] = max({$section_props}['step'] > 0 ? 0 : -1, {$section_props}['loop'] + {$section_props}['start']);\n" .
+ "else\n" .
+ " {$section_props}['start'] = min({$section_props}['start'], {$section_props}['step'] > 0 ? {$section_props}['loop'] : {$section_props}['loop']-1);\n";
+ }
+
+ $output .= "if ({$section_props}['show']) {\n";
+ if (!isset($attrs['start']) && !isset($attrs['step']) && !isset($attrs['max']))
+ {
+ $output .= " {$section_props}['total'] = {$section_props}['loop'];\n";
+ }
+ else
+ {
+ $output .= " {$section_props}['total'] = min(ceil(({$section_props}['step'] > 0 ? {$section_props}['loop'] - {$section_props}['start'] : {$section_props}['start']+1)/abs({$section_props}['step'])), {$section_props}['max']);\n";
+ }
+ $output .= " if ({$section_props}['total'] == 0)\n" .
+ " {$section_props}['show'] = false;\n" .
+ "} else\n" .
+ " {$section_props}['total'] = 0;\n";
+
+ $output .= "if ({$section_props}['show']):\n";
+ $output .= "
+ for ({$section_props}['index'] = {$section_props}['start'], {$section_props}['iteration'] = 1;
+ {$section_props}['iteration'] <= {$section_props}['total'];
+ {$section_props}['index'] += {$section_props}['step'], {$section_props}['iteration']++):\n";
+ $output .= "{$section_props}['rownum'] = {$section_props}['iteration'];\n";
+ $output .= "{$section_props}['index_prev'] = {$section_props}['index'] - {$section_props}['step'];\n";
+ $output .= "{$section_props}['index_next'] = {$section_props}['index'] + {$section_props}['step'];\n";
+ $output .= "{$section_props}['first'] = ({$section_props}['iteration'] == 1);\n";
+ $output .= "{$section_props}['last'] = ({$section_props}['iteration'] == {$section_props}['total']);\n";
+
+ $output .= "?>";
+
+ return $output;
+}
+?>
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/TemplateLite/internal/debug.tpl b/ThinkPHP/Library/Vendor/TemplateLite/internal/debug.tpl
new file mode 100644
index 0000000..c7f4d45
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/TemplateLite/internal/debug.tpl
@@ -0,0 +1,77 @@
+{* templatelite debug console *}
+
+{if isset($_templatelite_debug_output) and $_templatelite_debug_output eq "html"}
+
+ Template Lite Debug Console |
+ Included templates & config files (load time in seconds): |
+ {foreach key=key value=templates from=$_debug_tpls}
+
+ {for start=0 stop=$_debug_tpls[$key].depth} {/for}
+
+ {$_debug_tpls[$key].filename}{if isset($_debug_tpls[$key].exec_time)}
+ ({$_debug_tpls[$key].exec_time|string_format:"%.5f"} seconds){if $key eq 0} (total){/if}
+ {/if} |
+ {foreachelse}
+ No template assigned |
+ {/foreach}
+ Assigned template variables: |
+ {foreach key=key value=vars from=$_debug_keys}
+
+ {ldelim}${$_debug_keys[$key]}{rdelim} |
+ {$_debug_vals[$key]|@debug_print_var} |
+ {foreachelse}
+ No template variables assigned |
+ {/foreach}
+ Assigned config file variables (outer template scope): |
+ {foreach key=key value=config_vars from=$_debug_config_keys}
+
+ {ldelim}#{$_debug_config_keys[$key]}#{rdelim} |
+ {$_debug_config_vals[$key]|@debug_print_var} |
+ {foreachelse}
+ No config vars assigned |
+ {/foreach}
+
+{else}
+
+{/if}
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/TemplateLite/internal/template.build_dir.php b/ThinkPHP/Library/Vendor/TemplateLite/internal/template.build_dir.php
new file mode 100644
index 0000000..2698594
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/TemplateLite/internal/template.build_dir.php
@@ -0,0 +1,28 @@
+_get_dir($dir);
+ }
+ $_result = $object->_get_dir($dir);
+ foreach($_args as $value)
+ {
+ $_result .= $value.DIRECTORY_SEPARATOR;
+ if (!is_dir($_result))
+ {
+ @mkdir($_result, 0777);
+ }
+ }
+ return $_result;
+}
+
+?>
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/TemplateLite/internal/template.config_loader.php b/ThinkPHP/Library/Vendor/TemplateLite/internal/template.config_loader.php
new file mode 100644
index 0000000..bc5e1c2
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/TemplateLite/internal/template.config_loader.php
@@ -0,0 +1,76 @@
+_config_module_loaded = true;
+$this->template_dir = $this->_get_dir($this->template_dir);
+$this->config_dir = $this->_get_dir($this->config_dir);
+$this->compile_dir = $this->_get_dir($this->compile_dir);
+$name = ($this->encode_file_name) ? md5($this->template_dir . $file . $section_name . $var_name).'.php' : str_replace(".", "_", str_replace("/", "_", $file."_".$section_name."_".$var_name)).'.php';
+
+if ($this->debugging)
+{
+ $debug_start_time = array_sum(explode(' ', microtime()));
+}
+
+if ($this->cache)
+{
+ array_push($this->_cache_info['config'], $file);
+}
+
+if (!$this->force_compile && file_exists($this->compile_dir.'c_'.$name) && (filemtime($this->compile_dir.'c_'.$name) > filemtime($this->config_dir.$file)))
+{
+ include($this->compile_dir.'c_'.$name);
+ return true;
+}
+
+if (!is_object($this->_config_obj))
+{
+ require_once(TEMPLATE_LITE_DIR . "class.config.php");
+ $this->_config_obj = new $this->config_class;
+ $this->_config_obj->overwrite = $this->config_overwrite;
+ $this->_config_obj->booleanize = $this->config_booleanize;
+ $this->_config_obj->fix_new_lines = $this->config_fix_new_lines;
+ $this->_config_obj->read_hidden = $this->config_read_hidden;
+}
+
+if (!($_result = $this->_config_obj->config_load($this->config_dir.$file, $section_name, $var_name)))
+{
+ return false;
+}
+
+if (!empty($var_name) || !empty($section_name))
+{
+ $output = "\$this->_confs = " . var_export($_result, true) . ";";
+}
+else
+{
+ // must shift of the bottom level of the array to get rid of the section labels
+ $_temp = array();
+ foreach($_result as $value)
+ {
+ $_temp = array_merge($_temp, $value);
+ }
+ $output = "\$this->_confs = " . var_export($_temp, true) . ";";
+}
+
+$f = fopen($this->compile_dir.'c_'.$name, "w");
+fwrite($f, '');
+fclose($f);
+eval($output);
+
+if ($this->debugging)
+{
+ $this->_templatelite_debug_info[] = array('type' => 'config',
+ 'filename' => $file.' ['.$section_name.'] '.$var_name,
+ 'depth' => 0,
+ 'exec_time' => array_sum(explode(' ', microtime())) - $debug_start_time );
+}
+
+return true;
+
+?>
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/TemplateLite/internal/template.destroy_dir.php b/ThinkPHP/Library/Vendor/TemplateLite/internal/template.destroy_dir.php
new file mode 100644
index 0000000..edaf5ac
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/TemplateLite/internal/template.destroy_dir.php
@@ -0,0 +1,68 @@
+template_dir = $object->_get_dir($object->template_dir);
+
+ $name = ($object->encode_file_name) ? md5($object->template_dir.$file).'.php' : str_replace(".", "_", str_replace("/", "_", $file)).'.php';
+ @unlink($dir.$name);
+ }
+ else
+ {
+ $_args = "";
+ foreach(explode('|', $id) as $value)
+ {
+ $_args .= $value.DIRECTORY_SEPARATOR;
+ }
+ template_rm_dir($dir.DIRECTORY_SEPARATOR.$_args);
+ }
+ }
+}
+
+function template_rm_dir($dir)
+{
+ if (is_file(substr($dir, 0, -1)))
+ {
+ @unlink(substr($dir, 0, -1));
+ return;
+ }
+ if ($d = opendir($dir))
+ {
+ while(($f = readdir($d)) !== false)
+ {
+ if ($f != '.' && $f != '..')
+ {
+ template_rm_dir($dir.$f.DIRECTORY_SEPARATOR, $object);
+ }
+ }
+ @rmdir($dir.$f);
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/TemplateLite/internal/template.fetch_compile_include.php b/ThinkPHP/Library/Vendor/TemplateLite/internal/template.fetch_compile_include.php
new file mode 100644
index 0000000..662fc8e
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/TemplateLite/internal/template.fetch_compile_include.php
@@ -0,0 +1,42 @@
+debugging)
+ {
+ $object->_templatelite_debug_info[] = array('type' => 'template',
+ 'filename' => $_templatelite_include_file,
+ 'depth' => ++$object->_inclusion_depth,
+ 'exec_time' => array_sum(explode(' ', microtime())) );
+ $included_tpls_idx = count($object->_templatelite_debug_info) - 1;
+ }
+
+ $object->_vars = array_merge($object->_vars, $_templatelite_include_vars);
+ $_templatelite_include_file = $object->_get_resource($_templatelite_include_file);
+ if(isset($object->_confs[0]))
+ {
+ array_unshift($object->_confs, $object->_confs[0]);
+ $_compiled_output = $object->_fetch_compile($_templatelite_include_file);
+ array_shift($object->_confs);
+ }
+ else
+ {
+ $_compiled_output = $object->_fetch_compile($_templatelite_include_file);
+ }
+
+ $object->_inclusion_depth--;
+
+ if ($object->debugging)
+ {
+ $object->_templatelite_debug_info[$included_tpls_idx]['exec_time'] = array_sum(explode(' ', microtime())) - $object->_templatelite_debug_info[$included_tpls_idx]['exec_time'];
+ }
+ return $_compiled_output;
+}
+
+?>
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/TemplateLite/internal/template.generate_debug_output.php b/ThinkPHP/Library/Vendor/TemplateLite/internal/template.generate_debug_output.php
new file mode 100644
index 0000000..358dc4d
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/TemplateLite/internal/template.generate_debug_output.php
@@ -0,0 +1,37 @@
+_vars;
+ ksort($assigned_vars);
+ if (@is_array($object->_config[0]))
+ {
+ $config_vars = $object->_config[0];
+ ksort($config_vars);
+ $object->assign("_debug_config_keys", array_keys($config_vars));
+ $object->assign("_debug_config_vals", array_values($config_vars));
+ }
+
+ $included_templates = $object->_templatelite_debug_info;
+
+ $object->assign("_debug_keys", array_keys($assigned_vars));
+ $object->assign("_debug_vals", array_values($assigned_vars));
+ $object->assign("_debug_tpls", $included_templates);
+ $object->assign("_templatelite_debug_output", "");
+
+ $object->_templatelite_debug_loop = true;
+ $object->_templatelite_debug_dir = $object->template_dir;
+ $object->template_dir = TEMPLATE_LITE_DIR . "internal/";
+ $debug_output = $object->fetch("debug.tpl");
+ $object->template_dir = $object->_templatelite_debug_dir;
+ $object->_templatelite_debug_loop = false;
+ return $debug_output;
+}
+
+?>
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/jsonRPC/jsonRPCClient.php b/ThinkPHP/Library/Vendor/jsonRPC/jsonRPCClient.php
new file mode 100644
index 0000000..c07360d
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/jsonRPC/jsonRPCClient.php
@@ -0,0 +1,165 @@
+
+
+This file is part of JSON-RPC PHP.
+
+JSON-RPC PHP is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+JSON-RPC PHP is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with JSON-RPC PHP; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+/**
+ * The object of this class are generic jsonRPC 1.0 clients
+ * http://json-rpc.org/wiki/specification
+ *
+ * @author sergio
+ */
+class jsonRPCClient {
+
+ /**
+ * Debug state
+ *
+ * @var boolean
+ */
+ private $debug;
+
+ /**
+ * The server URL
+ *
+ * @var string
+ */
+ private $url;
+ /**
+ * The request id
+ *
+ * @var integer
+ */
+ private $id;
+ /**
+ * If true, notifications are performed instead of requests
+ *
+ * @var boolean
+ */
+ private $notification = false;
+
+ /**
+ * Takes the connection parameters
+ *
+ * @param string $url
+ * @param boolean $debug
+ */
+ public function __construct($url,$debug = false) {
+ // server URL
+ $this->url = $url;
+ // proxy
+ empty($proxy) ? $this->proxy = '' : $this->proxy = $proxy;
+ // debug state
+ empty($debug) ? $this->debug = false : $this->debug = true;
+ // message id
+ $this->id = 1;
+ }
+
+ /**
+ * Sets the notification state of the object. In this state, notifications are performed, instead of requests.
+ *
+ * @param boolean $notification
+ */
+ public function setRPCNotification($notification) {
+ empty($notification) ?
+ $this->notification = false
+ :
+ $this->notification = true;
+ }
+
+ /**
+ * Performs a jsonRCP request and gets the results as an array
+ *
+ * @param string $method
+ * @param array $params
+ * @return array
+ */
+ public function __call($method,$params) {
+
+ // check
+ if (!is_scalar($method)) {
+ throw new Exception('Method name has no scalar value');
+ }
+
+ // check
+ if (is_array($params)) {
+ // no keys
+ $params = array_values($params);
+ } else {
+ throw new Exception('Params must be given as array');
+ }
+
+ // sets notification or request task
+ if ($this->notification) {
+ $currentId = NULL;
+ } else {
+ $currentId = $this->id;
+ }
+
+ // prepares the request
+ $request = array(
+ 'method' => $method,
+ 'params' => $params,
+ 'id' => $currentId
+ );
+ $request = json_encode($request);
+ $this->debug && $this->debug.='***** Request *****'."\n".$request."\n".'***** End Of request *****'."\n\n";
+
+ // performs the HTTP POST
+ $opts = array ('http' => array (
+ 'method' => 'POST',
+ 'header' => 'Content-type: application/json',
+ 'content' => $request
+ ));
+ $context = stream_context_create($opts);
+ if ($fp = fopen($this->url, 'r', false, $context)) {
+ $response = '';
+ while($row = fgets($fp)) {
+ $response.= trim($row)."\n";
+ }
+ $this->debug && $this->debug.='***** Server response *****'."\n".$response.'***** End of server response *****'."\n";
+ $response = json_decode($response,true);
+ } else {
+ throw new Exception('Unable to connect to '.$this->url);
+ }
+
+ // debug output
+ if ($this->debug) {
+ echo nl2br($debug);
+ }
+
+ // final checks and return
+ if (!$this->notification) {
+ // check
+ if ($response['id'] != $currentId) {
+ throw new Exception('Incorrect response id (request id: '.$currentId.', response id: '.$response['id'].')');
+ }
+ if (!is_null($response['error'])) {
+ throw new Exception('Request error: '.$response['error']);
+ }
+
+ return $response['result'];
+
+ } else {
+ return true;
+ }
+ }
+}
+?>
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/jsonRPC/jsonRPCServer.php b/ThinkPHP/Library/Vendor/jsonRPC/jsonRPCServer.php
new file mode 100644
index 0000000..aa318f3
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/jsonRPC/jsonRPCServer.php
@@ -0,0 +1,85 @@
+
+
+This file is part of JSON-RPC PHP.
+
+JSON-RPC PHP is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+JSON-RPC PHP is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with JSON-RPC PHP; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+/**
+ * This class build a json-RPC Server 1.0
+ * http://json-rpc.org/wiki/specification
+ *
+ * @author sergio
+ */
+class jsonRPCServer {
+ /**
+ * This function handle a request binding it to a given object
+ *
+ * @param object $object
+ * @return boolean
+ */
+ public static function handle($object) {
+
+ // checks if a JSON-RCP request has been received
+ if (
+ $_SERVER['REQUEST_METHOD'] != 'POST' ||
+ empty($_SERVER['CONTENT_TYPE']) ||
+ $_SERVER['CONTENT_TYPE'] != 'application/json'
+ ) {
+ // This is not a JSON-RPC request
+ return false;
+ }
+
+ // reads the input data
+ $request = json_decode(file_get_contents('php://input'),true);
+
+ // executes the task on local object
+ try {
+ if ($result = @call_user_func_array(array($object,$request['method']),$request['params'])) {
+ $response = array (
+ 'id' => $request['id'],
+ 'result' => $result,
+ 'error' => NULL
+ );
+ } else {
+ $response = array (
+ 'id' => $request['id'],
+ 'result' => NULL,
+ 'error' => 'unknown method or incorrect parameters'
+ );
+ }
+ } catch (Exception $e) {
+ $response = array (
+ 'id' => $request['id'],
+ 'result' => NULL,
+ 'error' => $e->getMessage()
+ );
+ }
+
+ // output the response
+ if (!empty($request['id'])) { // notifications don't want response
+ header('content-type: text/javascript');
+ echo json_encode($response);
+ }
+
+ // finish
+ return true;
+ }
+}
+?>
diff --git a/ThinkPHP/Library/Vendor/phpRPC/bigint.php b/ThinkPHP/Library/Vendor/phpRPC/bigint.php
new file mode 100644
index 0000000..9c8dc70
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/bigint.php
@@ -0,0 +1,369 @@
+ |
+| |
+| This file may be distributed and/or modified under the |
+| terms of the GNU General Public License (GPL) version |
+| 2.0 as published by the Free Software Foundation and |
+| appearing in the included file LICENSE. |
+| |
+\**********************************************************/
+
+/* Big integer expansion library.
+ *
+ * Copyright: Ma Bingyao
+ * mgccl
+ * Version: 3.0.1
+ * LastModified: Apr 12, 2010
+ * This library is free. You can redistribute it and/or modify it under GPL.
+ */
+
+if (extension_loaded('gmp')) {
+ function bigint_dec2num($dec) {
+ return gmp_init($dec);
+ }
+ function bigint_num2dec($num) {
+ return gmp_strval($num);
+ }
+ function bigint_str2num($str) {
+ return gmp_init("0x".bin2hex($str));
+ }
+ function bigint_num2str($num) {
+ $str = gmp_strval($num, 16);
+ $len = strlen($str);
+ if ($len % 2 == 1) {
+ $str = '0'.$str;
+ }
+ return pack("H*", $str);
+ }
+ function bigint_random($n, $s) {
+ $result = gmp_init(0);
+ for ($i = 0; $i < $n; $i++) {
+ if (mt_rand(0, 1)) {
+ gmp_setbit($result, $i);
+ }
+ }
+ if ($s) {
+ gmp_setbit($result, $n - 1);
+ }
+ return $result;
+ }
+ function bigint_powmod($x, $y, $m) {
+ return gmp_powm($x, $y, $m);
+ }
+}
+else if (extension_loaded('big_int')) {
+ function bigint_dec2num($dec) {
+ return bi_from_str($dec);
+ }
+ function bigint_num2dec($num) {
+ return bi_to_str($num);
+ }
+ function bigint_str2num($str) {
+ return bi_from_str(bin2hex($str), 16);
+ }
+ function bigint_num2str($num) {
+ $str = bi_to_str($num, 16);
+ $len = strlen($str);
+ if ($len % 2 == 1) {
+ $str = '0'.$str;
+ }
+ return pack("H*", $str);
+ }
+ function bigint_random($n, $s) {
+ $result = bi_rand($n);
+ if ($s) {
+ $result = bi_set_bit($result, $n - 1);
+ }
+ return $result;
+ }
+ function bigint_powmod($x, $y, $m) {
+ return bi_powmod($x, $y, $m);
+ }
+}
+else if (extension_loaded('bcmath')) {
+ function bigint_dec2num($dec) {
+ return $dec;
+ }
+ function bigint_num2dec($num) {
+ return $num;
+ }
+ function bigint_str2num($str) {
+ bcscale(0);
+ $len = strlen($str);
+ $result = '0';
+ $m = '1';
+ for ($i = 0; $i < $len; $i++) {
+ $result = bcadd(bcmul($m, ord($str{$len - $i - 1})), $result);
+ $m = bcmul($m, '256');
+ }
+ return $result;
+ }
+ function bigint_num2str($num) {
+ bcscale(0);
+ $str = "";
+ while (bccomp($num, '0') == 1) {
+ $str = chr(bcmod($num, '256')) . $str;
+ $num = bcdiv($num, '256');
+ }
+ return $str;
+ }
+ // author of bcmath bigint_random: mgccl
+ function bigint_pow($b, $e) {
+ if ($b == 2) {
+ $a[96] = '79228162514264337593543950336';
+ $a[128] = '340282366920938463463374607431768211456';
+ $a[160] = '1461501637330902918203684832716283019655932542976';
+ $a[192] = '6277101735386680763835789423207666416102355444464034512896';
+ $a[256] = '115792089237316195423570985008687907853269984665640564039457584007913129639936';
+ $a[512] = '13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084096';
+ $a[768] = '1552518092300708935148979488462502555256886017116696611139052038026050952686376886330878408828646477950487730697131073206171580044114814391444287275041181139204454976020849905550265285631598444825262999193716468750892846853816057856';
+ $a[1024] = '179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216';
+ $a[1356] = '1572802244866018108182967249994981337399178505432223228293716677435703277129801955281491139254988030713172834803458459525011536776047399098682525970017006610187370020027540826048617586909475175880278263391147764612823746132583281588112028234096933800670620569966257212339315820309710495898777306979706509398705741430192541287726011814541176060679505247297118998085067003005943214893171428950699778511718055936';
+ $a[2048] = '32317006071311007300714876688669951960444102669715484032130345427524655138867890893197201411522913463688717960921898019494119559150490921095088152386448283120630877367300996091750197750389652106796057638384067568276792218642619756161838094338476170470581645852036305042887575891541065808607552399123930385521914333389668342420684974786564569494856176035326322058077805659331026192708460314150258592864177116725943603718461857357598351152301645904403697613233287231227125684710820209725157101726931323469678542580656697935045997268352998638215525166389437335543602135433229604645318478604952148193555853611059596230656';
+ $a[3072] = '5809605995369958062859502533304574370686975176362895236661486152287203730997110225737336044533118407251326157754980517443990529594540047121662885672187032401032111639706440498844049850989051627200244765807041812394729680540024104827976584369381522292361208779044769892743225751738076979568811309579125511333093243519553784816306381580161860200247492568448150242515304449577187604136428738580990172551573934146255830366405915000869643732053218566832545291107903722831634138599586406690325959725187447169059540805012310209639011750748760017095360734234945757416272994856013308616958529958304677637019181594088528345061285863898271763457294883546638879554311615446446330199254382340016292057090751175533888161918987295591531536698701292267685465517437915790823154844634780260102891718032495396075041899485513811126977307478969074857043710716150121315922024556759241239013152919710956468406379442914941614357107914462567329693696';
+ $a[4096] = '1044388881413152506691752710716624382579964249047383780384233483283953907971557456848826811934997558340890106714439262837987573438185793607263236087851365277945956976543709998340361590134383718314428070011855946226376318839397712745672334684344586617496807908705803704071284048740118609114467977783598029006686938976881787785946905630190260940599579453432823469303026696443059025015972399867714215541693835559885291486318237914434496734087811872639496475100189041349008417061675093668333850551032972088269550769983616369411933015213796825837188091833656751221318492846368125550225998300412344784862595674492194617023806505913245610825731835380087608622102834270197698202313169017678006675195485079921636419370285375124784014907159135459982790513399611551794271106831134090584272884279791554849782954323534517065223269061394905987693002122963395687782878948440616007412945674919823050571642377154816321380631045902916136926708342856440730447899971901781465763473223850267253059899795996090799469201774624817718449867455659250178329070473119433165550807568221846571746373296884912819520317457002440926616910874148385078411929804522981857338977648103126085903001302413467189726673216491511131602920781738033436090243804708340403154190336';
+ $a[8192] = '1090748135619415929462984244733782862448264161996232692431832786189721331849119295216264234525201987223957291796157025273109870820177184063610979765077554799078906298842192989538609825228048205159696851613591638196771886542609324560121290553901886301017900252535799917200010079600026535836800905297805880952350501630195475653911005312364560014847426035293551245843928918752768696279344088055617515694349945406677825140814900616105920256438504578013326493565836047242407382442812245131517757519164899226365743722432277368075027627883045206501792761700945699168497257879683851737049996900961120515655050115561271491492515342105748966629547032786321505730828430221664970324396138635251626409516168005427623435996308921691446181187406395310665404885739434832877428167407495370993511868756359970390117021823616749458620969857006263612082706715408157066575137281027022310927564910276759160520878304632411049364568754920967322982459184763427383790272448438018526977764941072715611580434690827459339991961414242741410599117426060556483763756314527611362658628383368621157993638020878537675545336789915694234433955666315070087213535470255670312004130725495834508357439653828936077080978550578912967907352780054935621561090795845172954115972927479877527738560008204118558930004777748727761853813510493840581861598652211605960308356405941821189714037868726219481498727603653616298856174822413033485438785324024751419417183012281078209729303537372804574372095228703622776363945290869806258422355148507571039619387449629866808188769662815778153079393179093143648340761738581819563002994422790754955061288818308430079648693232179158765918035565216157115402992120276155607873107937477466841528362987708699450152031231862594203085693838944657061346236704234026821102958954951197087076546186622796294536451620756509351018906023773821539532776208676978589731966330308893304665169436185078350641568336944530051437491311298834367265238595404904273455928723949525227184617404367854754610474377019768025576605881038077270707717942221977090385438585844095492116099852538903974655703943973086090930596963360767529964938414598185705963754561497355827813623833288906309004288017321424808663962671333528009232758350873059614118723781422101460198615747386855096896089189180441339558524822867541113212638793675567650340362970031930023397828465318547238244232028015189689660418822976000815437610652254270163595650875433851147123214227266605403581781469090806576468950587661997186505665475715792896';
+ return (isset($a[$e]) ? $a[$e] : bcpow(2, $e));
+ }
+ return bcpow($b, $e);
+ }
+ function bigint_random($n, $s) {
+ bcscale(0);
+ $t = bigint_pow(2, $n);
+ if ($s == 1) {
+ $m = bcdiv($t, 2);
+ $t = bcsub($m, 1);
+ }
+ else {
+ $m = 0;
+ $t = bcsub($t, 1);
+ }
+ $l = strlen($t);
+ $n = (int) ($l / 9) + 1;
+ $r = '';
+ while($n) {
+ $r .= substr('000000000' . mt_rand(0, 999999999), -9);
+ --$n;
+ }
+ $r = substr($r, 0, $l);
+ while (bccomp($r, $t) == 1) $r = substr($r, 1, $l) . mt_rand(0, 9);
+ return bcadd($r, $m);
+ }
+ if (!function_exists('bcpowmod')) {
+ function bcpowmod($x, $y, $modulus, $scale = 0) {
+ $t = '1';
+ while (bccomp($y, '0')) {
+ if (bccomp(bcmod($y, '2'), '0')) {
+ $t = bcmod(bcmul($t, $x), $modulus);
+ $y = bcsub($y, '1');
+ }
+
+ $x = bcmod(bcmul($x, $x), $modulus);
+ $y = bcdiv($y, '2');
+ }
+ return $t;
+ }
+ }
+ function bigint_powmod($x, $y, $m) {
+ return bcpowmod($x, $y, $m);
+ }
+}
+else {
+ function bigint_mul($a, $b) {
+ $n = count($a);
+ $m = count($b);
+ $nm = $n + $m;
+ $c = array_fill(0, $nm, 0);
+ for ($i = 0; $i < $n; $i++) {
+ for ($j = 0; $j < $m; $j++) {
+ $c[$i + $j] += $a[$i] * $b[$j];
+ $c[$i + $j + 1] += ($c[$i + $j] >> 15) & 0x7fff;
+ $c[$i + $j] &= 0x7fff;
+ }
+ }
+ return $c;
+ }
+ function bigint_div($a, $b, $is_mod = 0) {
+ $n = count($a);
+ $m = count($b);
+ $c = array();
+ $d = floor(0x8000 / ($b[$m - 1] + 1));
+ $a = bigint_mul($a, array($d));
+ $b = bigint_mul($b, array($d));
+ for ($j = $n - $m; $j >= 0; $j--) {
+ $tmp = $a[$j + $m] * 0x8000 + $a[$j + $m - 1];
+ $rr = $tmp % $b[$m - 1];
+ $qq = round(($tmp - $rr) / $b[$m - 1]);
+ if (($qq == 0x8000) || (($m > 1) && ($qq * $b[$m - 2] > 0x8000 * $rr + $a[$j + $m - 2]))) {
+ $qq--;
+ $rr += $b[$m - 1];
+ if (($rr < 0x8000) && ($qq * $b[$m - 2] > 0x8000 * $rr + $a[$j + $m - 2])) $qq--;
+ }
+ for ($i = 0; $i < $m; $i++) {
+ $tmp = $i + $j;
+ $a[$tmp] -= $b[$i] * $qq;
+ $a[$tmp + 1] += floor($a[$tmp] / 0x8000);
+ $a[$tmp] &= 0x7fff;
+ }
+ $c[$j] = $qq;
+ if ($a[$tmp + 1] < 0) {
+ $c[$j]--;
+ for ($i = 0; $i < $m; $i++) {
+ $tmp = $i + $j;
+ $a[$tmp] += $b[$i];
+ if ($a[$tmp] > 0x7fff) {
+ $a[$tmp + 1]++;
+ $a[$tmp] &= 0x7fff;
+ }
+ }
+ }
+ }
+ if (!$is_mod) return $c;
+ $b = array();
+ for ($i = 0; $i < $m; $i++) $b[$i] = $a[$i];
+ return bigint_div($b, array($d));
+ }
+ function bigint_zerofill($str, $num) {
+ return str_pad($str, $num, '0', STR_PAD_LEFT);
+ }
+ function bigint_dec2num($dec) {
+ $n = strlen($dec);
+ $a = array(0);
+ $n += 4 - ($n % 4);
+ $dec = bigint_zerofill($dec, $n);
+ $n >>= 2;
+ for ($i = 0; $i < $n; $i++) {
+ $a = bigint_mul($a, array(10000));
+ $a[0] += (int)substr($dec, 4 * $i, 4);
+ $m = count($a);
+ $j = 0;
+ $a[$m] = 0;
+ while ($j < $m && $a[$j] > 0x7fff) {
+ $a[$j++] &= 0x7fff;
+ $a[$j]++;
+ }
+ while ((count($a) > 1) && (!$a[count($a) - 1])) array_pop($a);
+ }
+ return $a;
+ }
+ function bigint_num2dec($num) {
+ $n = count($num) << 1;
+ $b = array();
+ for ($i = 0; $i < $n; $i++) {
+ $tmp = bigint_div($num, array(10000), 1);
+ $b[$i] = bigint_zerofill($tmp[0], 4);
+ $num = bigint_div($num, array(10000));
+ }
+ while ((count($b) > 1) && !(int)$b[count($b) - 1]) array_pop($b);
+ $n = count($b) - 1;
+ $b[$n] = (int)$b[$n];
+ $b = join('', array_reverse($b));
+ return $b;
+ }
+ function bigint_str2num($str) {
+ $n = strlen($str);
+ $n += 15 - ($n % 15);
+ $str = str_pad($str, $n, chr(0), STR_PAD_LEFT);
+ $j = 0;
+ $result = array();
+ for ($i = 0; $i < $n; $i++) {
+ $result[$j++] = (ord($str{$i++}) << 7) | (ord($str{$i}) >> 1);
+ $result[$j++] = ((ord($str{$i++}) & 0x01) << 14) | (ord($str{$i++}) << 6) | (ord($str{$i}) >> 2);
+ $result[$j++] = ((ord($str{$i++}) & 0x03) << 13) | (ord($str{$i++}) << 5) | (ord($str{$i}) >> 3);
+ $result[$j++] = ((ord($str{$i++}) & 0x07) << 12) | (ord($str{$i++}) << 4) | (ord($str{$i}) >> 4);
+ $result[$j++] = ((ord($str{$i++}) & 0x0f) << 11) | (ord($str{$i++}) << 3) | (ord($str{$i}) >> 5);
+ $result[$j++] = ((ord($str{$i++}) & 0x1f) << 10) | (ord($str{$i++}) << 2) | (ord($str{$i}) >> 6);
+ $result[$j++] = ((ord($str{$i++}) & 0x3f) << 9) | (ord($str{$i++}) << 1) | (ord($str{$i}) >> 7);
+ $result[$j++] = ((ord($str{$i++}) & 0x7f) << 8) | ord($str{$i});
+ }
+ $result = array_reverse($result);
+ $i = count($result) - 1;
+ while ($result[$i] == 0) {
+ array_pop($result);
+ $i--;
+ }
+ return $result;
+ }
+ function bigint_num2str($num) {
+ ksort($num, SORT_NUMERIC);
+ $n = count($num);
+ $n += 8 - ($n % 8);
+ $num = array_reverse(array_pad($num, $n, 0));
+ $s = '';
+ for ($i = 0; $i < $n; $i++) {
+ $s .= chr($num[$i] >> 7);
+ $s .= chr((($num[$i++] & 0x7f) << 1) | ($num[$i] >> 14));
+ $s .= chr(($num[$i] >> 6) & 0xff);
+ $s .= chr((($num[$i++] & 0x3f) << 2) | ($num[$i] >> 13));
+ $s .= chr(($num[$i] >> 5) & 0xff);
+ $s .= chr((($num[$i++] & 0x1f) << 3) | ($num[$i] >> 12));
+ $s .= chr(($num[$i] >> 4) & 0xff);
+ $s .= chr((($num[$i++] & 0x0f) << 4) | ($num[$i] >> 11));
+ $s .= chr(($num[$i] >> 3) & 0xff);
+ $s .= chr((($num[$i++] & 0x07) << 5) | ($num[$i] >> 10));
+ $s .= chr(($num[$i] >> 2) & 0xff);
+ $s .= chr((($num[$i++] & 0x03) << 6) | ($num[$i] >> 9));
+ $s .= chr(($num[$i] >> 1) & 0xff);
+ $s .= chr((($num[$i++] & 0x01) << 7) | ($num[$i] >> 8));
+ $s .= chr($num[$i] & 0xff);
+ }
+ return ltrim($s, chr(0));
+ }
+
+ function bigint_random($n, $s) {
+ $lowBitMasks = array(0x0000, 0x0001, 0x0003, 0x0007,
+ 0x000f, 0x001f, 0x003f, 0x007f,
+ 0x00ff, 0x01ff, 0x03ff, 0x07ff,
+ 0x0fff, 0x1fff, 0x3fff);
+ $r = $n % 15;
+ $q = floor($n / 15);
+ $result = array();
+ for ($i = 0; $i < $q; $i++) {
+ $result[$i] = mt_rand(0, 0x7fff);
+ }
+ if ($r != 0) {
+ $result[$q] = mt_rand(0, $lowBitMasks[$r]);
+ if ($s) {
+ $result[$q] |= 1 << ($r - 1);
+ }
+ }
+ else if ($s) {
+ $result[$q - 1] |= 0x4000;
+ }
+ return $result;
+ }
+ function bigint_powmod($x, $y, $m) {
+ $n = count($y);
+ $p = array(1);
+ for ($i = 0; $i < $n - 1; $i++) {
+ $tmp = $y[$i];
+ for ($j = 0; $j < 0xf; $j++) {
+ if ($tmp & 1) $p = bigint_div(bigint_mul($p, $x), $m, 1);
+ $tmp >>= 1;
+ $x = bigint_div(bigint_mul($x, $x), $m, 1);
+ }
+ }
+ $tmp = $y[$i];
+ while ($tmp) {
+ if ($tmp & 1) $p = bigint_div(bigint_mul($p, $x), $m, 1);
+ $tmp >>= 1;
+ $x = bigint_div(bigint_mul($x, $x), $m, 1);
+ }
+ return $p;
+ }
+}
+?>
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/phpRPC/compat.php b/ThinkPHP/Library/Vendor/phpRPC/compat.php
new file mode 100644
index 0000000..7686488
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/compat.php
@@ -0,0 +1,242 @@
+ |
+| |
+| This file may be distributed and/or modified under the |
+| terms of the GNU General Public License (GPL) version |
+| 2.0 as published by the Free Software Foundation and |
+| appearing in the included file LICENSE. |
+| |
+\**********************************************************/
+
+/* Provides missing functionality for older versions of PHP.
+ *
+ * Copyright: Ma Bingyao
+ * Version: 1.5
+ * LastModified: Apr 12, 2010
+ * This library is free. You can redistribute it and/or modify it under GPL.
+ */
+
+require_once("phprpc_date.php");
+
+if (!function_exists('file_get_contents')) {
+ function file_get_contents($filename, $incpath = false, $resource_context = null) {
+ if (false === $fh = fopen($filename, 'rb', $incpath)) {
+ user_error('file_get_contents() failed to open stream: No such file or directory',
+ E_USER_WARNING);
+ return false;
+ }
+ clearstatcache();
+ if ($fsize = @filesize($filename)) {
+ $data = fread($fh, $fsize);
+ }
+ else {
+ $data = '';
+ while (!feof($fh)) {
+ $data .= fread($fh, 8192);
+ }
+ }
+ fclose($fh);
+ return $data;
+ }
+}
+
+if (!function_exists('ob_get_clean')) {
+ function ob_get_clean() {
+ $contents = ob_get_contents();
+ if ($contents !== false) ob_end_clean();
+ return $contents;
+ }
+}
+
+/**
+3 more bugs found and fixed:
+1. failed to work when the gz contained a filename - FIXED
+2. failed to work on 64-bit architecture (checksum) - FIXED
+3. failed to work when the gz contained a comment - cannot verify.
+Returns some errors (not all!) and filename.
+*/
+if (!function_exists('gzdecode')) {
+ function gzdecode($data, &$filename = '', &$error = '', $maxlength = null) {
+ $len = strlen($data);
+ if ($len < 18 || strcmp(substr($data, 0, 2), "\x1f\x8b")) {
+ $error = "Not in GZIP format.";
+ return null; // Not GZIP format (See RFC 1952)
+ }
+ $method = ord(substr($data, 2, 1)); // Compression method
+ $flags = ord(substr($data, 3, 1)); // Flags
+ if ($flags & 31 != $flags) {
+ $error = "Reserved bits not allowed.";
+ return null;
+ }
+ // NOTE: $mtime may be negative (PHP integer limitations)
+ $mtime = unpack("V", substr($data, 4, 4));
+ $mtime = $mtime[1];
+ $xfl = substr($data, 8, 1);
+ $os = substr($data, 8, 1);
+ $headerlen = 10;
+ $extralen = 0;
+ $extra = "";
+ if ($flags & 4) {
+ // 2-byte length prefixed EXTRA data in header
+ if ($len - $headerlen - 2 < 8) {
+ return false; // invalid
+ }
+ $extralen = unpack("v", substr($data, 8, 2));
+ $extralen = $extralen[1];
+ if ($len - $headerlen - 2 - $extralen < 8) {
+ return false; // invalid
+ }
+ $extra = substr($data, 10, $extralen);
+ $headerlen += 2 + $extralen;
+ }
+ $filenamelen = 0;
+ $filename = "";
+ if ($flags & 8) {
+ // C-style string
+ if ($len - $headerlen - 1 < 8) {
+ return false; // invalid
+ }
+ $filenamelen = strpos(substr($data, $headerlen), chr(0));
+ if ($filenamelen === false || $len - $headerlen - $filenamelen - 1 < 8) {
+ return false; // invalid
+ }
+ $filename = substr($data, $headerlen, $filenamelen);
+ $headerlen += $filenamelen + 1;
+ }
+ $commentlen = 0;
+ $comment = "";
+ if ($flags & 16) {
+ // C-style string COMMENT data in header
+ if ($len - $headerlen - 1 < 8) {
+ return false; // invalid
+ }
+ $commentlen = strpos(substr($data, $headerlen), chr(0));
+ if ($commentlen === false || $len - $headerlen - $commentlen - 1 < 8) {
+ return false; // Invalid header format
+ }
+ $comment = substr($data, $headerlen, $commentlen);
+ $headerlen += $commentlen + 1;
+ }
+ $headercrc = "";
+ if ($flags & 2) {
+ // 2-bytes (lowest order) of CRC32 on header present
+ if ($len - $headerlen - 2 < 8) {
+ return false; // invalid
+ }
+ $calccrc = crc32(substr($data, 0, $headerlen)) & 0xffff;
+ $headercrc = unpack("v", substr($data, $headerlen, 2));
+ $headercrc = $headercrc[1];
+ if ($headercrc != $calccrc) {
+ $error = "Header checksum failed.";
+ return false; // Bad header CRC
+ }
+ $headerlen += 2;
+ }
+ // GZIP FOOTER
+ $datacrc = unpack("V", substr($data, -8, 4));
+ $datacrc = sprintf('%u', $datacrc[1] & 0xFFFFFFFF);
+ $isize = unpack("V", substr($data, -4));
+ $isize = $isize[1];
+ // decompression:
+ $bodylen = $len - $headerlen - 8;
+ if ($bodylen < 1) {
+ // IMPLEMENTATION BUG!
+ return null;
+ }
+ $body = substr($data, $headerlen, $bodylen);
+ $data = "";
+ if ($bodylen > 0) {
+ switch ($method) {
+ case 8:
+ // Currently the only supported compression method:
+ $data = gzinflate($body, $maxlength);
+ break;
+ default:
+ $error = "Unknown compression method.";
+ return false;
+ }
+ } // zero-byte body content is allowed
+ // Verifiy CRC32
+ $crc = sprintf("%u", crc32($data));
+ $crcOK = $crc == $datacrc;
+ $lenOK = $isize == strlen($data);
+ if (!$lenOK || !$crcOK) {
+ $error = ( $lenOK ? '' : 'Length check FAILED. ') . ( $crcOK ? '' : 'Checksum FAILED.');
+ return false;
+ }
+ return $data;
+ }
+}
+if (version_compare(phpversion(), "5", "<")) {
+ function serialize_fix($v) {
+ return str_replace('O:11:"phprpc_date":7:{', 'O:11:"PHPRPC_Date":7:{', serialize($v));
+ }
+}
+else {
+ function serialize_fix($v) {
+ return serialize($v);
+ }
+}
+
+function declare_empty_class($classname) {
+ static $callback = null;
+ $classname = preg_replace('/[^a-zA-Z0-9\_]/', '', $classname);
+ if ($callback===null) {
+ $callback = $classname;
+ return;
+ }
+ if ($callback) {
+ call_user_func($callback, $classname);
+ }
+ if (!class_exists($classname)) {
+ if (version_compare(phpversion(), "5", "<")) {
+ eval('class ' . $classname . ' { }');
+ }
+ else {
+ eval('
+ class ' . $classname . ' {
+ private function __get($name) {
+ $vars = (array)$this;
+ $protected_name = "\0*\0$name";
+ $private_name = "\0'.$classname.'\0$name";
+ if (array_key_exists($name, $vars)) {
+ return $this->$name;
+ }
+ else if (array_key_exists($protected_name, $vars)) {
+ return $vars[$protected_name];
+ }
+ else if (array_key_exists($private_name, $vars)) {
+ return $vars[$private_name];
+ }
+ else {
+ $keys = array_keys($vars);
+ $keys = array_values(preg_grep("/^\\\\x00.*?\\\\x00".$name."$/", $keys));
+ if (isset($keys[0])) {
+ return $vars[$keys[0]];
+ }
+ else {
+ return NULL;
+ }
+ }
+ }
+ }');
+ }
+ }
+}
+declare_empty_class(ini_get('unserialize_callback_func'));
+ini_set('unserialize_callback_func', 'declare_empty_class');
+?>
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/phpRPC/dhparams.php b/ThinkPHP/Library/Vendor/phpRPC/dhparams.php
new file mode 100644
index 0000000..f6cbbb5
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/dhparams.php
@@ -0,0 +1,77 @@
+ |
+| |
+| This file may be distributed and/or modified under the |
+| terms of the GNU General Public License (GPL) version |
+| 2.0 as published by the Free Software Foundation and |
+| appearing in the included file LICENSE. |
+| |
+\**********************************************************/
+
+/* Diffie-Hellman Parameters for PHPRPC.
+ *
+ * Copyright: Ma Bingyao
+ * Version: 1.2
+ * LastModified: Apr 12, 2010
+ * This library is free. You can redistribute it and/or modify it under GPL.
+ */
+class DHParams {
+ var $len;
+ var $dhParams;
+ function getNearest($n, $a) {
+ $j = 0;
+ $m = abs($a[0] - $n);
+ for ($i = 1; $i < count($a); $i++) {
+ $t = abs($a[$i] - $n);
+ if ($m > $t) {
+ $m = $t;
+ $j = $i;
+ }
+ }
+ return $a[$j];
+ }
+ function DHParams($len = 128) {
+ if (extension_loaded('gmp')) {
+ $a = array(96, 128, 160, 192, 256, 512, 768, 1024, 1536, 2048, 3072, 4096);
+ }
+ else if (extension_loaded('big_int')) {
+ $a = array(96, 128, 160, 192, 256, 512, 768, 1024, 1536);
+ }
+ else if (extension_loaded('bcmath')) {
+ $a = array(96, 128, 160, 192, 256, 512);
+ }
+ else {
+ $a = array(96, 128, 160);
+ }
+ $this->len = $this->getNearest($len, $a);
+ $dhParams = unserialize(file_get_contents("dhparams/{$this->len}.dhp", true));
+ $this->dhParams = $dhParams[mt_rand(0, count($dhParams) - 1)];
+ }
+ function getL() {
+ return $this->len;
+ }
+ function getP() {
+ return $this->dhParams['p'];
+ }
+ function getG() {
+ return $this->dhParams['g'];
+ }
+ function getDHParams() {
+ return $this->dhParams;
+ }
+}
+?>
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/phpRPC/dhparams/1024.dhp b/ThinkPHP/Library/Vendor/phpRPC/dhparams/1024.dhp
new file mode 100644
index 0000000..ed32074
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/dhparams/1024.dhp
@@ -0,0 +1 @@
+a:50:{i:0;a:2:{s:1:"p";s:309:"129568058281196283485969852045082973240479662299833649655915078881064134837274587910680098630145331833314073809374103784577764371196941250131234226069290860531036282954125295253065782312888837858123565769812895344947719425674132117445174120829192037368513888110324906224313165146847550484828304476957369485661";s:1:"g";s:308:"74412411029812389060767064911429672552248323538380131684788386010483894594411356094583336355490245501438293594829741708592904979946709371629796413585578141928082616135469461600898538625232411795670398765206603348868016930193300395280159142433716706006511660846845763458752473756129210341944622900425176170770";}i:1;a:2:{s:1:"p";s:309:"146193716869508619647305139679263213856542375804651729246358043697244513997202825507519324367123148648281879781307709063806446534378531476829417062359168328754542266700915025319077860004928830404502692827043033744869104026437533251268433855993485126622032912525153084481026752912774722114259386768298899564303";s:1:"g";s:308:"69665008455351035902394440968350840909694548939696068493230686992883959134340037657032165407927257240961367927202156451938187477478359634699944054421395915668737939732656947241547267360211113199573477019756112574891965201688300035561288642801756915210306669313742136966503710236246509657858186512804588405518";}i:2;a:2:{s:1:"p";s:308:"95970011504465972968216025516056735009523168150391746798863350750628487022016558740903123981082492162615783238679595252201525891309321115574038283300200553527545213133632613244817126822324712292522172514337488336034824554888257812134279471335077413101896300746428316633744784706951717209185447418443121828621";s:1:"g";s:308:"32001234390591214193376879256032978095845138099384488396534938726527801485162551386074446838732561408327325537297587819822423354587910793955894800881058361532317172632826489329393036463815876353502280065088397376255064545313409639353330402859010245535643271582946371682731202352698451064261945530458419829640";}i:3;a:2:{s:1:"p";s:309:"107367948657744622403351910382294871172660886134042766184588950504191167376012553664832448482914453405627212505369017275057422865739635860055799977469867384589433510482716878025125735208146717913693754643825156388993040417089240042847866172996856390845604134659166867638714932484445695129717762215323852506223";s:1:"g";s:308:"35432052256872063868380956371395369446567951518895107007371489162979699703174160026603508244941666811604433385191485350533989707755652344700251327330272344163390347214659013791982459809652840042138137711943397019067880567618517864203333641800939772871309165704182113537048788646733770754235738140765119642861";}i:4;a:2:{s:1:"p";s:309:"165076179689180236399041719787853905509559840110034542544821025282142300182647737111192078636521696281849625331314634684082301307117056917096084810635909894266458257170816689088720750305011783930982287890608917322401215758373776087180348344303687659936705613789033223734686153637245444289163498175528538355183";s:1:"g";s:307:"7257097778465434411970060755441602617276464732216022873078841090902519498242797047568465618978053870338781634251702056843711528548879065633440550225057048183819140181212548735400876351188282105313257390821504822836725204187551346143027851261294592312829247674258710064400797532984515687719153634209645797992";}i:5;a:2:{s:1:"p";s:309:"138802088285708272974606443360541903346755775272625641090315912444740167056631682245175130288849653779718099745685973721625582881257253471469912033588275732534407812075504114028885001344754657979521240743598222852482713324944422564190132042911693426108095636266310291976312275051127638653255600619607748768161";s:1:"g";s:308:"68417768739254288613606538235899747640172953332166946096752518553591767961690284351247936702095359234884835162554920982218175460417056547752295163372680384373462615386345790712015724670852234108269209123765999335189635261342502383470729223332462342297600651014620539252087004543259974622328979031296782522180";}i:6;a:2:{s:1:"p";s:309:"143440408822834063256304001072379447612928758831014798604598968475998050944779945738610267109704057122027136269142323992275612512625193416837116502688466400091418946141409771130888652460438203432957802868229911319337716618772433262235445217129634258191904843258295950976235881931957544024858700764228870924421";s:1:"g";s:308:"61885916543751673602854962504624587475387355618874847004083364702999025366671327986702041494614967630576074420375515923449100469967023926671469204064186238960923581265396747860313554113531614635769731691080040797055303045109323006390999930220320481566672724416853132332620783770495166761662347109658807273598";}i:7;a:2:{s:1:"p";s:309:"157252810195046895262106972751573106014543521514519685514526312280470173673406217073362718196542447054177557777738853814564750348460292213548574898522849672157043162206681839289942712907178681480637456651237911559217788828984121397898667057591070954484991528199933918709759507489576582524237672309515073016337";s:1:"g";s:308:"88226515089489108825617534479543271381941380524155142801992166781725218337072902847660176074387609831777431786756574825615371213334332751708239568948591365196022411207206473125172401071031742000701493998811906302094840062532406089297779300213805172292794534054882548609113290200502606862814087039389398551133";}i:8;a:2:{s:1:"p";s:309:"114985530386639637192010327425709343494853838706808117399040944819410823551476787051890386585662495343435908127066317727387347589667037619326044414841194906165233165057587169819071837348100721622631027068393757028075105078368224325215567994990905693082132591256895393626358055498114303429757135090165754244597";s:1:"g";s:308:"91954658886623204543428135320064913668075738156343770210065195276894435619024576837084985906949383771834865278634709820758891770161134832009386328837080524363696464802456836386619858686421228303195226824855233384173023438331596052943262733993003608039164968687338024645722948542213129080275663447923469190543";}i:9;a:2:{s:1:"p";s:309:"109636871523409279767790340972634754329051398909884556956779733482149548929953420172455820185754193594396218755018820210816939914164446953253105835196134775430129532317887497749035659147652091944602377709986911544686721669749555303104118253472318080141451307479645737852211400120068770412867048403875625444929";s:1:"g";s:308:"37818248395638490196506083616037424071497042139318912208572715518335166153504034280853968065109925945696374241300596948545678886278292730681088749422984938877674324593818392935665057102238497543046661120593623474923808390078589110389438482877938086514382910775723604677940765395739691577027916901419974181668";}i:10;a:2:{s:1:"p";s:309:"171730493569370019376800099225484177890965402584439879262134362090208780017825875746914723522867989271423524805865035183047449735154919305905173130906979533370250036154805449250313007756615641578776997081126674385739513158578666666475902928085117932562730012747788409809904847316965666667562299267227963953209";s:1:"g";s:309:"108416022315624195962025023721429686956214474671377630577595792182130934651146546536934806785055934780756022131579568185897105910304336666966603269784935938299676652324388066306399902577207000810316610396941802565186861722182315811374339068009895153890079993046590210907050629248793523019275731677163852103278";}i:11;a:2:{s:1:"p";s:309:"122106850849876812974026248474577243429513625504577859983625726463984009864701112373037766966449574405643986501924059709161200764018639946475182619842398415505427880887419201361794547676397333516971649037394750916047253475385290090455656437086867354170238521151796557315029217026885863606073266370855712820719";s:1:"g";s:308:"24735148417562057840168476236802864525918787478183767549255404873115071566410820342975609285551159637301964099270689346814428231138259200159783611910129880506577636334045758775993631403235839108647573874932088398186329326859338337177512287828022266115337530677346513192023934283754416757903570244925408141124";}i:12;a:2:{s:1:"p";s:308:"98563064041855485547203709600999976616419318617005972312351844359425573674247265938234295573987429665676307716147248366503793293946473843863821094112041842163433187820029643571486513623012617552199332014038456603155834453649363234466831889556280793416223207898261294552530862813499919423410866004801362984157";s:1:"g";s:308:"59438969191433206885160654546800973338113955254155498154081588424773915117978710991458854168836846149574281831646696983304381311140860938963799520039261884497369538383372456178914971487015682793424582209855322967460266300754823895771337403292656106744806123861995705604402095631107844241722972208149696069901";}i:13;a:2:{s:1:"p";s:309:"178284570928419116251879511232308570183768336425183537983900704602870837188332981934665351235828833856090429560178119229215140472009400606724448162311527189376668655398871211015154270102539242482291841778242319866102591751437519616120511427151657963001938761731491181176323677631190765849664845153959486560283";s:1:"g";s:309:"148866999117635919417654566555696301710898017486560869603508728720369000308011510499499432872896469950541973497581527050700259381170969069051888183343314713029719431048716245290397673569650907200574767862492308652304273160426175251156907772789224555079381452284087020498494077430745587197689507967768857105956";}i:14;a:2:{s:1:"p";s:309:"116738580923175563597852946259942668774376741851243739225112168154299319378570097819002752583211279288010166314376092749452022693090749405496712595173427088219917593978092666816371487183342540185349140910668072044197068187531521505601089090756898828738261874761402398001673390547712523143844149045116052320447";s:1:"g";s:308:"40034019056813540582152025088875031301471554203237488324792191579491686866385133449374555241477936777633651939990968648667228424361281957258281751622971833684652653172758624480857897678112312636724089024553363699426562753044909465441006363024563493791311183967053810493340062539118031062536501032727371656556";}i:15;a:2:{s:1:"p";s:309:"126416923016504794892262733817762961386741581091282927102847048681387859009976911891213445835335683685961824220040945930186942069653866470565058006364859508113271188926837922616983429432971047367039856437192480727203019675679406394279531743601364712279259153955168108639232674771097755353305522755827224808783";s:1:"g";s:309:"115217983612815221807881039047616510833937677746347677762674420215129457029965858858381020879648451528607840750667922014522507961901103522126616783107408227640178996788031640423168737789746950166860880632363377442064306092590337543542962209423238876035647879264300565404605950968938772318148521663749673131099";}i:16;a:2:{s:1:"p";s:309:"143625235691679173790886628527372299203036999068004043049293157737498971333598566984526746417282853572231806173640623863668011175162069116291184420978114679218220215343843707983230876997357140567082288451238414474598947943184854685135804783998570746961957854573146698096808752435056693051401194762660928100291";s:1:"g";s:307:"2811906146542542544508099935802560496259761014277619841236735465830246544879946190087219311700423280133249036896828576018583549158462866232998364790129911777154099906740274868660919875297049045056201762749104047808011371830286824154334564178537171875355764504606152138545087944095720124720892297463471228703";}i:17;a:2:{s:1:"p";s:309:"121993314148770027219037424907576269470769429753193286495985674269623203562674630388975936634497963788324829621047210948121667489694438986232246907066349832212292491390918321554381941982921602817218049875411538677739007395791700194829322235503670960059494915298990576486708275549417539146086251251624135349939";s:1:"g";s:308:"76136756831073177744226997691236148872628027575601681328786412569385300051842743182050455179596968765127239279852680795886929553043311383681954887233978473067877172753495304640131160100079991048334006169655578631036144643965635995290531840054826540373743555549720623816740175043396340429759474512569110591151";}i:18;a:2:{s:1:"p";s:309:"124507994067600742618074869849502068365304040789212000487597154884662225035334860191210068989342872209246000032800019976883544484524411784905306951476799686163700601896271250346743329785269061645715826764256180887461136011848692557042253327916990782493758819566513663718823981060679554727596357143528871317029";s:1:"g";s:308:"35482091456711296536619960625191304461320385791007440302280000459820091544274446698718600582729456595724243302196867721560781247921581506087934961217320172517820436375036025679986744433993300325533389319578275768579785520050047676029798921290638765091850128922108253967600366949053220716093204424923866639659";}i:19;a:2:{s:1:"p";s:309:"109064911958670773649835739607804087660086265501176811018327103461487668225519906223353251760111190939688515131932304441638992866400411226029802671305803598781894196659707854750685867585938708782669538095831227041248283200630619059108032196443898570993622064280958838616123797547223348352709177595311511599127";s:1:"g";s:308:"19319085215957110536116059458132145601846897698032302263421502982575340197281074377754938122814767436026933811580737427951112223724536263615505177029727037084943699236718859061711113087160230654888547614277944690686053963024350436971089168545071233076652921578379142066648762537208150629974955548551496035508";}i:20;a:2:{s:1:"p";s:309:"152906937544903906500158994700987429025320104102810683664637770214766670911595774070719831089658199116354030446402893709562506135087569908102297576309390792224913162999986166517633590115811057491043292747990827411008636071214350838529749370926702854124191129277803120854478952648197409338821905891673530410583";s:1:"g";s:308:"91187914216528946835934502389977046892487031834663291019963344959483826794791886459334460883860381266880371274752391802612238136138804906007128976482853796298630067218594097450162858199508629386035676253140564960068420655423166899188074787874980346006766017039274380084312606630473497196077651554580178899620";}i:21;a:2:{s:1:"p";s:309:"120086911902590349366454763756514126237708714726873488009496335335637189915037279805404346623857583026128779203569864388549114527319559676012081995869302301188337042796528657367058068666482059979304786341533831397236939898922005010598725616120953311774451680404822020000603731144436784446124165276717107943767";s:1:"g";s:307:"4424877313153692455459160010045442376627290942868240892963899133364693215888804616996451658036573295042389069650630298172240061707271934897152643400497308474473895781338189295452861594891955327070306932371961613259631255464856486062618144044590877854971649831663385524916482609955557119733681027235051394932";}i:22;a:2:{s:1:"p";s:309:"114348651836506523500945935233374922736007775412847938214326113685832510534729952115503013208770982688991421802461695224699078655218430623713975694946030893977655752146594815185747948759946130185443646234087578887495356406232198663781066104307878855072887544156539853609255635001994884140842596116557739719339";s:1:"g";s:307:"3057093897497336474088939848688661425207560147177357671574081687524315743030139763595840116604296424154647944641166825852937323648159223225785426718349765948296485966934692317251464598254426752313531074560614623259760117723367044048992743223355384969321694573041256516497658853328140689287015483841963198485";}i:23;a:2:{s:1:"p";s:309:"151327650171178840752159959652360320262504680172183688626941326142323285313387175965893936843422387583059747539217294800332826680621899964529924259987091710340379569950289775771095947259209635172546634980224610800461576519968535309440918178046872340066339103756730010311335921411262306273623820892604544491083";s:1:"g";s:308:"93698947898542625080224999126897954039977816399726641263795164630099055943251781086266175948233460340162387832326085867234397994791219403143430000582587477992357941677427763758041941957575706031515765338579564903757662164614536867472674838978395200565535988130855861706547826534924631265525304939324782653714";}i:24;a:2:{s:1:"p";s:308:"93521349632285344521892805711041617086177867320264156006082942266085555239430140082892856429101554903795878410700096375285554712092378461187415152844263072615812187854557693901260441992278421683913551405640379450072927340627546240607073580365588955121454018383348564233577572631416908081675968109054718213651";s:1:"g";s:308:"72771444498359995710897378671512916022955775236629004788865109476298715383451615148812465275461129578179286998456555171089504695435937979981487681863800662090010955930732523942155243068394783205736383507489827275947913244113978685677151547805378500227336458209605695806261274104663472071017000731176318137622";}i:25;a:2:{s:1:"p";s:309:"154538027567571020051211849456110781402373992733880648830768917597755638265440933232881652059213857800411025814190629364180958088042486785080095848649421973721170250640044907161165782781498829401355213704798178816875963125988553036855252471477479214335533104910682313679864758691208754871335938134146570244233";s:1:"g";s:309:"151878268383910627178775626075769783354408670111552691713603803262208268504534598144185757441663543391767524850440098706725577284510706316706784129116482666131665290402058351722910804879096297592649548518592704064553732795220929615663992939631806717400234044169768626282218689487288304150755186241724898111829";}i:26;a:2:{s:1:"p";s:309:"101653566005311023925476332074740680760986376640227033128030649304832500364833045686179637239812634502064069571359223433072628429786421692593933101196289496232554055527830367596771381014857286540650623892767418966585533940466064017851317632676358364053937566259716232595107740160572362341096507417302692903861";s:1:"g";s:308:"74513607929035958667614526386443731970505034893688087329791851500228238599981508473298612939972711716486678692030303405741746145559282283162063549999965122587859070966516041155490470664682457776474615008916731802079841562892122761530124749566709348258961907082769282945089628529694000014717122454967698917460";}i:27;a:2:{s:1:"p";s:308:"95013960730537646945707930117033259716425250443303065109257923132885025742351896240153856832266522610218042023001720718571959026083577683594238991046216761447273850529095670800239812482889546714995990857314170023607531299056678286770352047754090948625051516504247244141244971934385607741647807871939423643417";s:1:"g";s:307:"8865118845127243015967838648938431880490166248417614215833772532595068334088382421370444972119810353915368575955429426679051753997676166286454497698339421653032306173169181980560322753725269776395160793563057913381832550741293157158306307662293960121073170223223526549325156207936691130571839423818348804874";}i:28;a:2:{s:1:"p";s:309:"165171568680967123886817133609555478777376451381185880118392760161526195696056154677234447980800025307869740068307389118220255165799524209662639178475579984315366245832285858100155088238540583941028875367935393602555119105296112422147861581513097413687377533516651030313147659549849822429529620533241957376461";s:1:"g";s:309:"125035932268322111740442907189656967999398670741804679117991185625792797440733765792321494160564108005199651911011206634432661255852804587565419942716241432891303926297868064874944963552504922882417912648147956818566297482440510358827099695306382023608097107907616454643867088476820708208837260972148368028666";}i:29;a:2:{s:1:"p";s:309:"149426789853068576691755408517052689479631486303474855851435537819356576423401695805659694193339781938404097894957535566502875170679660046587328388332483673210946843879963235153300984461866198864922318697292136026813009299028730482141451343653633845072186024898362005994170295241610203348654612524541396422397";s:1:"g";s:308:"73049073326296538965204086376153534487090415894032911283800130298629512997442525640837238968619479480629231884187445441225287944042744290713844591778499386520701583015778604634989765861327662774146166059025009694822186345094204748823299314036557275575979692921442204327068917190507323721173826594618769385979";}i:30;a:2:{s:1:"p";s:309:"135576329950386319783588278542132482993509697780105687913763037715299072538393798842105766084812653813647207393906971415039384965453861783642420021499035478002876073188931021393616989459213349405347142133542309416134384844351939543623768121011240069777383730773881088056874192238013050626270026174182267430717";s:1:"g";s:308:"60290997726824005308014865952860150036003597394047065883797290775765998303031531128172348476104602100923880751224159249009015002013080863909428509827722962421722642840399830757903808956875244743719288448455233739472345388057408045449495018163568905120714599842949385074246992032986074584000551188391542767463";}i:31;a:2:{s:1:"p";s:309:"159065776098323310441379296801791022455112191137870334479728771028751912269616629460900852200402421009307482473450428015915046824869147855243477769734130917997450446203411540494770348199589203378022151536992114137202513049016111036147137494187423144663693903693069118404837384424743130353522620387505597979359";s:1:"g";s:308:"43262178902448634370560334233060164330909659542673106272550614113862676255101507573561918404933225250124875942010295679192073921803863446466704825450009940939748827765323598689766356218791822315938651724944088733794097890759186493099112538275600413748100124980228285409612371429943359045997493847309113094420";}i:32;a:2:{s:1:"p";s:309:"160394941658450930276801031843077823785507821874720567147511483933208719668066705194765948461937550873363758297677780099637494770481353160979298177536248116532480392143334998523558523755864576621025753190170092723744034008237711325789361465741779607652217503455195004836525957182459455212695365562397642327793";s:1:"g";s:308:"80547204427645310086317970329606761433064424399921493097938200607767280488068285659681897406984483932897624033557910172823554540190625306750715210905207903368482988268690529944147507714249162654641932802591997206826192545609133886659250269751768696058736169665371823013501660148951330528409739051259717561690";}i:33;a:2:{s:1:"p";s:309:"177204881539784382588587844818041975965303560543162630455910056438154838593138830187319688900891313579137735937814467432633223178967482608482890993831012978464354436059856781658299553545037014282810727108082122588695746040219389387811199278574283486984537788675106695657576082357971493731577296175232034436141";s:1:"g";s:308:"69235053132347779619993662979522806857339437477106976840223821553847294669711048050675068877860119501392090174568568049659762185187804664573479845315366181247065012559547353319817063459644529835997237851200186729133930957640120723326425914499963919940154634598957978320326819438511948953408983404730431346679";}i:34;a:2:{s:1:"p";s:309:"170632450386449252892177651707784510677816625351105295529973803089643511952292071117487088243581854585627834705143965097010002760714509270510175372080209246944381024402704210823368565134636107733496734242350149868764032016679575323249886774833276221888180845935536877312614375117430059888272016549986096298381";s:1:"g";s:308:"24472385768968026997798980591786418974391665216646569808610375270769405972123783498459702414787564780388487976158770080827973184539797280411107573023349088116818340517293319973443760108032296957122632603976045312015768310687201612205589952908786210188329173621466708105183429140807264065028128471662573361600";}i:35;a:2:{s:1:"p";s:309:"106658122355520675039628277711696683144582739154934203137085123160221461841008030522414574684630155853821380331921319540272434071011591133318016562285627539130389090569115783107308483014499994503494308836196758225421785889774862524445335359696266057221770535448860053645733764498088036270185537882385482831183";s:1:"g";s:308:"39783652361002485670275466730672530969147764387968401456017775771979782025778665517161604038096192323204967577144624873089805078877923323600555536296131983877118252913078053205536795585717846083877586544103441059828092151865494642451758943378392029454891361242185344072415082423303093417563841046684352151448";}i:36;a:2:{s:1:"p";s:309:"103044743450356815717280629987073025863731845223317680836739897408078663728915414987974010186550546586595930233874188379117304132766900332673653606876214967343386204242329787067659113843205186608833761820128296608284953666985708091388382863740453928554110827130493742351284285532384147373799262231569250856959";s:1:"g";s:308:"90090058479749571428201045607912930124405620381996502603882386590496176073989569208448372732705389891721609719648629186673350918601783194334467381010968712369734326596190517082744138100466263787508381087402925634188635370622908873072815732169546219741518638971435909681793234308560167890325451296165583963178";}i:37;a:2:{s:1:"p";s:309:"125388209275868954338919318322433241106530307022343221377908573761945875896771826464040700182523361756959326040847908815078631193501532095938945095221093193286494713316096166068936244486440645154697824243384714912745011963991559904054699172169083499465381741721552580299869624834814200547479930954834702869467";s:1:"g";s:308:"88667109474041919409913794223971780303805302466161109886012349328724495178758113804709357734253441488703362846364137262391434253925210240752446097480963427198378575051635750668392116625679462417025783392797833504899554705232341840759599879188837609823053497744463005858819123144669211197475473256421788902998";}i:38;a:2:{s:1:"p";s:309:"143949768931086061604940118166532662934380945231267334574786086591887870050187582969268702068457305227173986915861510012707751007961140008160896148194781758723093984226682835875932742978257118050540576674378910935190769292316700539205182480917522964863427122871625517021839596567122012919478156411734686915977";s:1:"g";s:309:"138466632730009703263604483957935077591344930459555672237159749136157934320422889392131771025368995584492516955806991516958678527504262618479774885187067450769695885037834750726818277199698417657533016521761911424894327191784411447815745375877220891536113807184440318107567817825269486823752156243704505549697";}i:39;a:2:{s:1:"p";s:309:"175420727176478352783121714923416552881222745068680163347615288184223170132146515858071589662128422601876827315329015908922123050339231472535066426849260567046474903451891613375732255710996752666666429634222976593100111925186060523566568836985586751950683018244960710294161130739354264999973915392300513010669";s:1:"g";s:309:"102214296436553733388725636282118899490816111744922220769692374117300143278361415759909106009565248076781429421870924605232528811484830856869108078614870493726394947463288917149234179718831259015495904087236508316630128687330799396156049244218724291725012201270174939120336334613215053968238776073474709467334";}i:40;a:2:{s:1:"p";s:309:"159794800055348506571008906374836701462998540886533040353197135807163688421982933759743988362547882565601903919320227504216575700066744239387795654881352389673948479450887254384341226868981920609707096127165751516392484968378483701427198667309154393238401926688124380137237516707820272504228443061371360165201";s:1:"g";s:309:"125545954061807909213440974725673246010848665665902291111413828394758575587589962734315460601269956757971755540646548110374935166026100201454535822567189177241543789524176158023868303335124684764707826312875234354490525831170982282949580832090899553475185463231422993237487770186065056142320929583755264509339";}i:41;a:2:{s:1:"p";s:309:"100539882750827218683038523645435201793549230666573329915693212453304697477172915665745340230392862173855829201370306578877441376204178128180077679525298804707605907524492059908201893059201739409946592544808266797888266407195817995198097047681246712771143508501927477035153907568921002415521626713210871346043";s:1:"g";s:308:"35502053686226969950955336189827903558684377002850015450754413739937497087878601307174154780066555396845534338310205261283992241970794651452902383865029730265568871805501296029304576201222119877387937815777937271202653885649169466455244309442119655722851543473700201461896508440245001817562486228545596343608";}i:42;a:2:{s:1:"p";s:309:"163883088092169708750236298536140720039687203494799123680434192685621955270090430640683485012985988431013394323683780842964037507442368800026594927494950463285267496279525753657775606544352907707733174181132340012100157483379593750752972189141532209198932176506722571756928339227587633423995901120004952354761";s:1:"g";s:308:"21165897458274279623174933098408694536958819285248101600565840156627556793518769244526228428619827425694586345400323334844888827367491379029972237832974198947482513794112611577346475499184088771263690674973716665704216023869046245629889113229885861874638379352584818782358324175120814914412282487903605785953";}i:43;a:2:{s:1:"p";s:309:"158310278732715787022902619395810013339735267417224324445908572573513416852425846360209440725706619854191344489651342220702140566155238540802871753904947103638583986388285621112626977421886423502443003940413306887906083091475336779687502256926095204824702267835164082066519548090177807665844915376119641694361";s:1:"g";s:308:"10843632849807178081621701225073955336720497461666456417094069730548352280008748877225736209050583172763152571705900002329657804689214917415555838692658283058931020733361636160389821172444581043732406612290988648168803751381009032812842751877417489545282283613937636557019594975816844435163566172375045198580";}i:44;a:2:{s:1:"p";s:309:"153347735020776109672598090634216407499745284347480917300658818545198675701611122459685722367884460242515317436949386602816072625929743971764067680916616908761905707081856774209123031494295472642947392714965504325544410178836879029320131059764623341098464482119547364444225790414659989577180817023099747806219";s:1:"g";s:309:"122954310235084188725866074640958827281122476177323936387469275802984759490453353855653375904411138407476003678979649372393814463080666349613725044716044211530706906010081396524233937871139226812356391818759073899430860506374698518561365425436590854680442478600581253443022679747914324251713532666663803955266";}i:45;a:2:{s:1:"p";s:309:"105119383111574947555756749613427034115871685365338216999216182362104799407352348214405998777527422827499905338598543186574235633401319346122740730194104928531642469747870053113686583094237980081517574187423239107189826416021743315549437633596207434042084300173060678340091298306743614170285022383892833272317";s:1:"g";s:308:"67178980779596302685699276457331133093242115605891944037453156935974692034220792130263273292844686981258966134995193845401621693196880186953298375654676956749648419727313952831168688324511752698322454731426431593820106946644202118100133887201187978438871644005504337273486695678858525227931317595656959050814";}i:46;a:2:{s:1:"p";s:309:"103032591117379756539799688773679250452536252275580478745302392328252396825436802273785825761894063424135369686372016268918702883198596320220024055090905544130543248384556888996699089102078751994102466915262697550823095429698807867041857056199662639242062280833453801650111530359676277918138500762149217203791";s:1:"g";s:308:"77132801423319304165796207386958946320042494252108286515106992435042926191729318949722863127204416805833659339064969009910067600668843619911038984483433433617169906588079273102517397432168428053712322220890666083309668099651430019267046493644946772357567590144667581996075280334527222547528339859786299081931";}i:47;a:2:{s:1:"p";s:309:"102085155627955815095542920619146526387782679507307151846526493529130800012104779480514121921687848167194688460305927109149559545461691767269495772073701759547274290545646610000657936697419432724419115249685635339910931149030927018431690660081084386412665095805815028555042991555828923349280187447568942620549";s:1:"g";s:308:"27454324351455464224886256988337512968951014643818071525638765600705727743455262346758378628869548773191699219835696316409465156796657956179447196850180340548717017879359249274532768288404896887877489800526718802490569932601316656411893344856428111523823705865338040702336541777735189187460764613244420564133";}i:48;a:2:{s:1:"p";s:309:"139300783541692859595840908230318717324833616486825199849963109829727143946631572973434050282537779419439403310172134664925360812720995043013071012554656861162082506619208677576419320741818481236877774498337260619037804797461901823273337809052154052894849643006097478216997712928420055709178233445255308361101";s:1:"g";s:309:"110543956085772475876488567113525531945490203248111771432474506376282741746886768658898900409682098825014100780195520527561919350237842066983251165229178651412242741196039787820589590428519549154581837021452969522343352353534257888745437891875564792402023341678616463369894744400700376676910140567752536422210";}i:49;a:2:{s:1:"p";s:309:"140481282042623513171757047048340154221489789742748447730567837747883807070388996878704463331184460145505583061254384935268451450084968799400716266246866822185422597411114352295673685607245117959083546383457343144702896784371346366101512480777183669620433643591158243003892756293342479583829460630913480276589";s:1:"g";s:308:"75251167460967282352429912701249403706989070317963542102818801005423115111161788531265287611693282776684802138420198727319983028866819384860839081670321428144683302615744779867229499830239463688840840537403755994658696002903600035111943070257625695218188008419573921013401986992437874454517822788002411777111";}}
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/phpRPC/dhparams/128.dhp b/ThinkPHP/Library/Vendor/phpRPC/dhparams/128.dhp
new file mode 100644
index 0000000..12ab5fa
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/dhparams/128.dhp
@@ -0,0 +1 @@
+a:150:{i:0;a:2:{s:1:"p";s:39:"292056242036581752787140391622158091519";s:1:"g";s:38:"92195130631865270616756943775010543543";}i:1;a:2:{s:1:"p";s:39:"306974919588773364832090085053788336623";s:1:"g";s:39:"114777600433746811424326551581233247669";}i:2;a:2:{s:1:"p";s:39:"293639007200039809639032425563054392623";s:1:"g";s:39:"142581017277461467135688328294730434355";}i:3;a:2:{s:1:"p";s:39:"196846296865248186540320570524502677427";s:1:"g";s:39:"151521785256606845258315346858388704159";}i:4;a:2:{s:1:"p";s:39:"214058314731091729962462647631129015047";s:1:"g";s:39:"157657285759615277755120995221831770183";}i:5;a:2:{s:1:"p";s:39:"211544627828281195628005482334918005743";s:1:"g";s:39:"164526962259030671035597644393561273977";}i:6;a:2:{s:1:"p";s:39:"264374153248813750338546404933838455927";s:1:"g";s:39:"161889252888199530110939775462329045141";}i:7;a:2:{s:1:"p";s:39:"250744024384599107683215360741111008699";s:1:"g";s:39:"118285577307522764878235247551273436525";}i:8;a:2:{s:1:"p";s:39:"203253285951672991854853186118633154923";s:1:"g";s:39:"109635202434828818623372966675160073683";}i:9;a:2:{s:1:"p";s:39:"297230087236684619171820155222807526239";s:1:"g";s:39:"151698002932284917728519787908419298293";}i:10;a:2:{s:1:"p";s:39:"183928564855833010909727349867640971323";s:1:"g";s:39:"162553618575521753939201816833697743889";}i:11;a:2:{s:1:"p";s:39:"282116071387851542448859292585051222447";s:1:"g";s:38:"96195080035033034987512884449304800701";}i:12;a:2:{s:1:"p";s:39:"323821345162263657163869210284973385427";s:1:"g";s:39:"165647931357595553282108059453854618133";}i:13;a:2:{s:1:"p";s:39:"325782265605496815296945192046960828803";s:1:"g";s:39:"146673523487430798803433071896683677919";}i:14;a:2:{s:1:"p";s:39:"292656882446135308138325253216560626763";s:1:"g";s:39:"133750897967258475364439141350154768333";}i:15;a:2:{s:1:"p";s:39:"326502508934692287898138354588749827579";s:1:"g";s:38:"95055028992751783265751636323610219169";}i:16;a:2:{s:1:"p";s:39:"238737081982465824552117175513390104503";s:1:"g";s:39:"149717268104904047668959026140422455329";}i:17;a:2:{s:1:"p";s:39:"325520862010996140507951562729031642939";s:1:"g";s:39:"160750290369379144250044243773210944781";}i:18;a:2:{s:1:"p";s:39:"284660075545249738683462999870017380547";s:1:"g";s:38:"93610554989070752708257914727841862017";}i:19;a:2:{s:1:"p";s:39:"216624906373462199236239231733765471247";s:1:"g";s:39:"147533447450211848127450101532248247737";}i:20;a:2:{s:1:"p";s:39:"310957194217588922918999164668665752919";s:1:"g";s:39:"149940487727634664074703848896592397309";}i:21;a:2:{s:1:"p";s:39:"223668363326959021386397963580036366123";s:1:"g";s:39:"107617531844346373239590352039307075491";}i:22;a:2:{s:1:"p";s:39:"215978097038720595934062824264229612527";s:1:"g";s:39:"159683714362048234485774830980270810467";}i:23;a:2:{s:1:"p";s:39:"254574157135387128396125954269859179739";s:1:"g";s:39:"152701269536030391318337642370271369325";}i:24;a:2:{s:1:"p";s:39:"285631418265701142797921983323494263559";s:1:"g";s:39:"146069911336721121221056226300966199857";}i:25;a:2:{s:1:"p";s:39:"338159277198626832869677887277616180423";s:1:"g";s:39:"115921496078116668896708740833402711065";}i:26;a:2:{s:1:"p";s:39:"216947143156151209031346105444363017339";s:1:"g";s:39:"138824874907565129063997286858881153973";}i:27;a:2:{s:1:"p";s:39:"276066866652515571839979520442563284323";s:1:"g";s:39:"128901507729551455645968559013908755883";}i:28;a:2:{s:1:"p";s:39:"285669464286230064035191348420068105563";s:1:"g";s:39:"133687329906681409517596983499858741779";}i:29;a:2:{s:1:"p";s:39:"191091625204338316951536541367974663739";s:1:"g";s:39:"115858048207727468438106103077246560679";}i:30;a:2:{s:1:"p";s:39:"337515161669050885294632549226272979259";s:1:"g";s:39:"120854804811508331843161695166187664953";}i:31;a:2:{s:1:"p";s:39:"174917215197953698624444001586175836407";s:1:"g";s:39:"139145545032511871649890757539716139745";}i:32;a:2:{s:1:"p";s:39:"286385113219804783667463282575249335643";s:1:"g";s:39:"148416238100899996847378967300424921461";}i:33;a:2:{s:1:"p";s:39:"209708268755657765718168447424437273947";s:1:"g";s:38:"89390121362982706116847582116053792661";}i:34;a:2:{s:1:"p";s:39:"225466796807811837787826426622847748483";s:1:"g";s:39:"119671516376904551623274021751719706435";}i:35;a:2:{s:1:"p";s:39:"230641118913675753332052029881543537319";s:1:"g";s:39:"106904796246200906002843413808899345201";}i:36;a:2:{s:1:"p";s:39:"320356446694223075350802268074194516883";s:1:"g";s:39:"110058673619329486246922731333508660107";}i:37;a:2:{s:1:"p";s:39:"196818317043011000998928174914246107563";s:1:"g";s:39:"113324249626145305887996118612518826373";}i:38;a:2:{s:1:"p";s:39:"224525332386128175478101630046930189763";s:1:"g";s:39:"108794399937298102548174167123976936181";}i:39;a:2:{s:1:"p";s:39:"240020159051805416566835088425214246683";s:1:"g";s:39:"122682169319663959002558338806306526673";}i:40;a:2:{s:1:"p";s:39:"194462122760796075851727083710896064019";s:1:"g";s:39:"125773984560640978959501682731083867083";}i:41;a:2:{s:1:"p";s:39:"185409874317812986685079176545573532819";s:1:"g";s:38:"99333837867312477025526770551684789929";}i:42;a:2:{s:1:"p";s:39:"249577380183382163061926592594820452239";s:1:"g";s:39:"145358444229966857167759564629611560067";}i:43;a:2:{s:1:"p";s:39:"175893673428733191813784481998618328243";s:1:"g";s:39:"132841634307591201423154416956579429157";}i:44;a:2:{s:1:"p";s:39:"307677647975104863327346573139531157887";s:1:"g";s:39:"165281368579891364595473211906122097919";}i:45;a:2:{s:1:"p";s:39:"325531007121336077474467231244998934603";s:1:"g";s:39:"113453603821265113678470265129170917013";}i:46;a:2:{s:1:"p";s:39:"291853334277762332165460454523197195883";s:1:"g";s:39:"112304674628631114572271595370414970737";}i:47;a:2:{s:1:"p";s:39:"321095002670328264904742293131676711247";s:1:"g";s:39:"111234333539460488850936780994186665521";}i:48;a:2:{s:1:"p";s:39:"327904717403107858772768435620257823703";s:1:"g";s:39:"135928358598869100491972026891044903849";}i:49;a:2:{s:1:"p";s:39:"184167219998611207248355443296589162623";s:1:"g";s:39:"157493611435172681271008684759507092185";}i:50;a:2:{s:1:"p";s:39:"214547513104198035614282222084852692283";s:1:"g";s:39:"143129048934951872319248661290580415565";}i:51;a:2:{s:1:"p";s:39:"180935587267248385659347192451794341139";s:1:"g";s:38:"87403976648407948326670717447739794827";}i:52;a:2:{s:1:"p";s:39:"263818812910108424430492542012743121123";s:1:"g";s:39:"150521173398666971792260292936530681753";}i:53;a:2:{s:1:"p";s:39:"297105925338731622311494789834838923367";s:1:"g";s:39:"105412171901317536491270709831194772423";}i:54;a:2:{s:1:"p";s:39:"243477408509935222548750912761663403707";s:1:"g";s:39:"144281761591161263922410500392425300369";}i:55;a:2:{s:1:"p";s:39:"299510309907221406889358192415160524359";s:1:"g";s:38:"89872008322088932958761182838622988425";}i:56;a:2:{s:1:"p";s:39:"304910526413244884233459829695367833307";s:1:"g";s:39:"161607538803038797936035617030686594595";}i:57;a:2:{s:1:"p";s:39:"203291411173723738334374535456283611867";s:1:"g";s:38:"89443086632858787787237362893463069233";}i:58;a:2:{s:1:"p";s:39:"205944278815676907758242117465652266619";s:1:"g";s:39:"108018077395004037033024244150011486699";}i:59;a:2:{s:1:"p";s:39:"296687706241624223629592967033355602527";s:1:"g";s:38:"96745488554386356827679857768107368081";}i:60;a:2:{s:1:"p";s:39:"293550116043549804890822649451111414703";s:1:"g";s:39:"158806215400749784831080725121944668243";}i:61;a:2:{s:1:"p";s:39:"263428134653217195777465522428064821807";s:1:"g";s:39:"118547891080671339398050662124658121383";}i:62;a:2:{s:1:"p";s:39:"325923864457460442868064053037621833547";s:1:"g";s:39:"150617615016200927618807658935974292457";}i:63;a:2:{s:1:"p";s:39:"196476504632822117192236200421668858239";s:1:"g";s:39:"160523445701389768553272859591184805705";}i:64;a:2:{s:1:"p";s:39:"176583442445218673933803855316690739563";s:1:"g";s:39:"132111065569185005904201982609461776533";}i:65;a:2:{s:1:"p";s:39:"208026268064317066201094177474542461779";s:1:"g";s:39:"129201867469581710101028427020543597815";}i:66;a:2:{s:1:"p";s:39:"334723033531927024498400970288217064519";s:1:"g";s:39:"127487291993357723200673873414989528691";}i:67;a:2:{s:1:"p";s:39:"233829356466320610519071132649157616807";s:1:"g";s:38:"94860858528074519022402472317646994195";}i:68;a:2:{s:1:"p";s:39:"188691996182260359105060338959757354147";s:1:"g";s:39:"162385010597491525627389624230217003233";}i:69;a:2:{s:1:"p";s:39:"226897261159415273301339620896213232363";s:1:"g";s:39:"156442352209872496712773155991679649819";}i:70;a:2:{s:1:"p";s:39:"236583358352137488729569337157796756399";s:1:"g";s:39:"152581941462805442071888683283182954713";}i:71;a:2:{s:1:"p";s:39:"201191190567504115316899173583099194503";s:1:"g";s:39:"103194169583174226029359181901898862399";}i:72;a:2:{s:1:"p";s:39:"283922273486502260013681112736384903039";s:1:"g";s:39:"135753190954064714225129600901141433767";}i:73;a:2:{s:1:"p";s:39:"223678587798519865477081555130490930887";s:1:"g";s:39:"137587074669296278642987846569068217767";}i:74;a:2:{s:1:"p";s:39:"223668244430177551435115121204793146587";s:1:"g";s:39:"156320667147688293051263750282389084613";}i:75;a:2:{s:1:"p";s:39:"194289571790886902139380720985511224443";s:1:"g";s:39:"107945851243046988533476937950371933915";}i:76;a:2:{s:1:"p";s:39:"278775692009590991350111858729107596627";s:1:"g";s:39:"129657043560683363524105717085311868437";}i:77;a:2:{s:1:"p";s:39:"319979086847889596207807729864047286663";s:1:"g";s:39:"145322816086479761996731697936810408423";}i:78;a:2:{s:1:"p";s:39:"198304778645918608926012835033912241723";s:1:"g";s:38:"92721662469836619760966684666997323119";}i:79;a:2:{s:1:"p";s:39:"248958430506627478869847133684906264999";s:1:"g";s:39:"163946236115509075218677438118567021097";}i:80;a:2:{s:1:"p";s:39:"211126209972926688870595842369993071207";s:1:"g";s:39:"108563592364604435542369366145242235593";}i:81;a:2:{s:1:"p";s:39:"239692691796226521380036414431702787147";s:1:"g";s:39:"137476683692977742290483495678290382501";}i:82;a:2:{s:1:"p";s:39:"252311610716959305132008843115717379139";s:1:"g";s:39:"123328978402999139145213144352371439599";}i:83;a:2:{s:1:"p";s:39:"174047087138041833610836860678128035299";s:1:"g";s:39:"170009271577662203836398662496227735453";}i:84;a:2:{s:1:"p";s:39:"231348363522122086066280667498528389519";s:1:"g";s:39:"141093524922727559438821864373557385467";}i:85;a:2:{s:1:"p";s:39:"248864664933152526411279596376158030567";s:1:"g";s:39:"123889374381029290108579278155184768689";}i:86;a:2:{s:1:"p";s:39:"224462201405966083242230789750023192919";s:1:"g";s:39:"158021232799967127661274365236078929611";}i:87;a:2:{s:1:"p";s:39:"245879376734021512682830793285031923579";s:1:"g";s:39:"158046576746250718282268617313434731959";}i:88;a:2:{s:1:"p";s:39:"253637925905658982372489538655726599363";s:1:"g";s:39:"149864317488110155844324751701060009647";}i:89;a:2:{s:1:"p";s:39:"279412238023962995721371699198188829207";s:1:"g";s:39:"155598915764501153026223926768958705767";}i:90;a:2:{s:1:"p";s:39:"304106342193803880773594320966748339927";s:1:"g";s:38:"92322047090452031206421560601306928951";}i:91;a:2:{s:1:"p";s:39:"322913290480087002459462604003828469603";s:1:"g";s:38:"92524856578633519411437518532800131563";}i:92;a:2:{s:1:"p";s:39:"277089057388309352780642604697631788919";s:1:"g";s:39:"105249705735663037159358894119941901753";}i:93;a:2:{s:1:"p";s:39:"280236513995939039844557210758532708147";s:1:"g";s:39:"158306374689206241016162477506012836773";}i:94;a:2:{s:1:"p";s:39:"234719020513353193747658715815920552619";s:1:"g";s:38:"91223745999232718078741004083061517243";}i:95;a:2:{s:1:"p";s:39:"209990000707927251175406243525264022623";s:1:"g";s:39:"125642114179469428756488157507005128403";}i:96;a:2:{s:1:"p";s:39:"275737100760368939576948745650805280043";s:1:"g";s:39:"167145628416726604176821531341460996895";}i:97;a:2:{s:1:"p";s:39:"213783951740539117048794197148144657227";s:1:"g";s:39:"109417094981752227864776346864591549789";}i:98;a:2:{s:1:"p";s:39:"318677936852074604097023986317860558759";s:1:"g";s:39:"115037656438911641363193487524231340943";}i:99;a:2:{s:1:"p";s:39:"222750162478363691468158822602615735239";s:1:"g";s:39:"113556306002604103800443505592028066063";}i:100;a:2:{s:1:"p";s:39:"239051669069722927531642869778838542343";s:1:"g";s:39:"159620246209558910663028687970469241585";}i:101;a:2:{s:1:"p";s:39:"308867039809658627190349828399950839963";s:1:"g";s:39:"111777033404344242825393328519333723859";}i:102;a:2:{s:1:"p";s:39:"191578329058918619482978110290472855563";s:1:"g";s:38:"96920536616578690169019365830583899443";}i:103;a:2:{s:1:"p";s:39:"325447228570210752496684536118034998379";s:1:"g";s:39:"129437827816980982882065741607934187687";}i:104;a:2:{s:1:"p";s:39:"199496827021205922362423961503975322443";s:1:"g";s:38:"95449372423705665601914584672984436985";}i:105;a:2:{s:1:"p";s:39:"238204010443217252139505257991989127187";s:1:"g";s:38:"91317591567351091929487842436160672987";}i:106;a:2:{s:1:"p";s:39:"210575582741342359714046308724434638407";s:1:"g";s:39:"142543190721741958237717199151161265865";}i:107;a:2:{s:1:"p";s:39:"193835921830776847504350847922101912943";s:1:"g";s:39:"151813485796154943234684032504099327579";}i:108;a:2:{s:1:"p";s:39:"178427490906676735864591330886670926819";s:1:"g";s:39:"146413567376325921761866049795179195397";}i:109;a:2:{s:1:"p";s:39:"299716072306325255352875980371073738499";s:1:"g";s:39:"157210887501582163921135958059988460769";}i:110;a:2:{s:1:"p";s:39:"174501134484857074197927837838115864819";s:1:"g";s:39:"146752211101339794211955770327266075471";}i:111;a:2:{s:1:"p";s:39:"263141644198405815082265954631245057027";s:1:"g";s:38:"89010976094266637055743371326639574349";}i:112;a:2:{s:1:"p";s:39:"176466451619066725947852784079425521863";s:1:"g";s:39:"152509734985991674456496918102451358687";}i:113;a:2:{s:1:"p";s:39:"292682206572230534435344520034906633599";s:1:"g";s:39:"142874105165878163065284219612333009551";}i:114;a:2:{s:1:"p";s:39:"201328074386089494127672485138355071347";s:1:"g";s:39:"139056812479572385637122227340971141837";}i:115;a:2:{s:1:"p";s:39:"229826790296235981066004577347766874047";s:1:"g";s:39:"124485556392824999787963979933226961505";}i:116;a:2:{s:1:"p";s:39:"332795007680636342427162437048877824483";s:1:"g";s:39:"132371062218285402701784934167045475545";}i:117;a:2:{s:1:"p";s:39:"264128365565511611517695773592609678303";s:1:"g";s:39:"114615254022882630385756450073964824147";}i:118;a:2:{s:1:"p";s:39:"268698717748706869710939835298615927267";s:1:"g";s:39:"117152896705025823674979508347665141611";}i:119;a:2:{s:1:"p";s:39:"302105198709942553044124021979667091103";s:1:"g";s:39:"115210049253772003791162765412858545515";}i:120;a:2:{s:1:"p";s:39:"244101232788334692748605391991798485199";s:1:"g";s:39:"106653638158862023536690078428324579011";}i:121;a:2:{s:1:"p";s:39:"230273108057481536883566583583109559023";s:1:"g";s:39:"100481439316995264801026403022097167371";}i:122;a:2:{s:1:"p";s:39:"322984349144126882101119659857800338459";s:1:"g";s:39:"159007973907722446137944813244793447289";}i:123;a:2:{s:1:"p";s:39:"336551506278300215412128472087071431523";s:1:"g";s:38:"94575518869614444784555444648323179985";}i:124;a:2:{s:1:"p";s:39:"325853084786159562250150213907913293147";s:1:"g";s:39:"165854802536055673479990720116207791091";}i:125;a:2:{s:1:"p";s:39:"267169176591038828428461564163619391419";s:1:"g";s:39:"156305369077672218039563577497885459563";}i:126;a:2:{s:1:"p";s:39:"239647394471266396711562577661521640079";s:1:"g";s:39:"135150945658333061448039765686757664557";}i:127;a:2:{s:1:"p";s:39:"310272220468352202006936575621174675363";s:1:"g";s:39:"149183267477594191196034583076725103145";}i:128;a:2:{s:1:"p";s:39:"282045133469485047888914986480632943019";s:1:"g";s:39:"125711764274064417833132422105222333643";}i:129;a:2:{s:1:"p";s:39:"234599771405208353221227496890421334027";s:1:"g";s:39:"114241200628618711658613583227486232613";}i:130;a:2:{s:1:"p";s:39:"228152795513450511034942449472495573367";s:1:"g";s:39:"168398706283838543234401695778589281927";}i:131;a:2:{s:1:"p";s:39:"212097593073542307065347538486191261919";s:1:"g";s:39:"149940368580113076918890078852679018041";}i:132;a:2:{s:1:"p";s:39:"297412983264745482861745631486523413147";s:1:"g";s:39:"125354297262324596636132561377813415813";}i:133;a:2:{s:1:"p";s:39:"294153649598454137023569177048904340663";s:1:"g";s:39:"119618232671986101725255082853317991993";}i:134;a:2:{s:1:"p";s:39:"175487816341984471056566550210858970703";s:1:"g";s:39:"140601690952468213621103178853863520569";}i:135;a:2:{s:1:"p";s:39:"176180359739294489581394694681108500843";s:1:"g";s:38:"98077114592993318593790787139676895321";}i:136;a:2:{s:1:"p";s:39:"279572267891227674183294094072204319543";s:1:"g";s:39:"141474017873114223498048340610357082035";}i:137;a:2:{s:1:"p";s:39:"239629442130765299778978223853239788839";s:1:"g";s:38:"88754684643523546470289505769224285729";}i:138;a:2:{s:1:"p";s:39:"311261240312331479969447936407219323047";s:1:"g";s:39:"151343131310288676643199151763364576911";}i:139;a:2:{s:1:"p";s:39:"273396005392900911093204799067494731419";s:1:"g";s:39:"106778038879588069377890944288814468931";}i:140;a:2:{s:1:"p";s:39:"261721287666608603538123341686220061467";s:1:"g";s:39:"138711968008728462202723866189802040861";}i:141;a:2:{s:1:"p";s:39:"215937395349495995166858415892962367759";s:1:"g";s:39:"155398583112088458001793075753882872685";}i:142;a:2:{s:1:"p";s:39:"212936571128682845071308878878059010067";s:1:"g";s:39:"101442737521645273653232103903447910079";}i:143;a:2:{s:1:"p";s:39:"298838175786452844147867416306769452987";s:1:"g";s:39:"160565315644879191178274475105507742033";}i:144;a:2:{s:1:"p";s:39:"316176852999320912845222134672775131119";s:1:"g";s:38:"87523304206694080898971766076264143747";}i:145;a:2:{s:1:"p";s:39:"202013126308834551658071627160007872163";s:1:"g";s:38:"91110917788528883796996360661218204029";}i:146;a:2:{s:1:"p";s:39:"310457373590695815028028265615601682987";s:1:"g";s:39:"164392575017790858253925716306682762491";}i:147;a:2:{s:1:"p";s:39:"233494437113899933858624559487545643707";s:1:"g";s:39:"147087009669715116027793726225269012183";}i:148;a:2:{s:1:"p";s:39:"175158366760549586270815259855245814027";s:1:"g";s:39:"137880202528675896604634215375162273381";}i:149;a:2:{s:1:"p";s:39:"200440310559660779805280958200078988363";s:1:"g";s:39:"142805624090912627846213953550472112815";}}
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/phpRPC/dhparams/1536.dhp b/ThinkPHP/Library/Vendor/phpRPC/dhparams/1536.dhp
new file mode 100644
index 0000000..38ba414
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/dhparams/1536.dhp
@@ -0,0 +1 @@
+a:30:{i:0;a:2:{s:1:"p";s:463:"1484321112960587045156307044653452978091514252781732555377115872744370782753532223710520596651771862094580430622810781137079954026654443009773353316487869110581614335387257791372300366363986959520162727301094381504710539122423215449953773749566665075390663795515064927524541364929410161593571002665960511042368404720007227185351442857133729332461681414076545413251514012799785726764386304857603161524569772320497781834398411353556378812114248426854017223765792447";s:1:"g";s:462:"635774037287666756005286201992926844882049694229071109060527214859683349345634244908520777317972311779819169417124227454944478231493944538362566784762524159848118679198133615209134587519203999139059358147991164119330583496102138414754471736404205776201609984433151539366053179678590829297151308903314368108491194375955538280261511309639674764255718253005505707839857874962943779665415343296052187866967481027372096404738753403721555758189272826817559193637462120";}i:1;a:2:{s:1:"p";s:463:"1319436802072744870627529725982335407106255106838769259080484192948822006093801447135658971621913672383780818570900869846109477900474351617379125755158877287287443914503331845436479622427887788221295041360592939442869830231851542580082543738933690647798111929121232075109013051084277527846507106765265691741993543124300304586965031520186535035306131873674243292213566694074549356897012038902793605597813873772107032094774604447038888760851123996389333697066500089";s:1:"g";s:463:"1094948501651870927866408997875807332362132368280764746635102906522376980935616408160803921204390676267735235340675683774918584046129467358536658452112779035005246945500990564970828900915876183847784477372105600610181992912866134280979202520819598729274804910027149270482786962118597828865094775152221808068814764597063219931910461862798242682996856821691502783024562237507266046103319637879315130332069878279043189748255613212869917119499585630902196048518389141";}i:2;a:2:{s:1:"p";s:463:"1640222121300873590885740903711612856053216234718072467371799710030209040805232294429104366467106949818620126839460635110688960840211274066511897330827987110967763711157204318410155927749323139656115284192624456851102305115967064988358305606231181648345630705027165974291804661428533435957993527621517312013100947564241032286994712995946793397929587066127500563005307122895245755325339947878136458621529441597532795180908459053645027157995663081045092178737236951";s:1:"g";s:463:"1091699155014785793699927849492118315207217763778609939374849137247626111244977609635966506015908867479947153952351409289738203198557207594461117445750302094758880324908956395448076571856589921995881773374725119459511313687786646810555589375887009649909789659937861969554238484131951359065310736811264948846669566484058857698917573131819117850621387652382598432460267007035050505884971612126049437914803225531487958278531161911691953811685277239553704185614100254";}i:3;a:2:{s:1:"p";s:463:"2042201993843598159468568251727021381151204860153180105899105583856572114957522535810934397491695695827381512620409599315961608902985092050021488412358853723928122649403442200573138328100885455439417892396869322127744220101094644670053440714135390977909178803486242950685670919693087337352955059110458693240470974292348857021512713811450682539944478562513964203257401079664973633503395515416018593081165879055440039280270143172237165005252136496925734559160180063";s:1:"g";s:463:"1500442284667586192076348842045301367167296162953592222959388230854684580797148712288866802146615945078966804943095812267797017849054865779802801614224624014374538152627740263805739007646764205976963263146061122561909911419750642286362084298710720418238017005026967541716370169549583274076872905500601850314761635440475203807971054187862037414097487067989205898779614632989928913601024677346758843158175861275923151746018118718105464617356557647207655221747328074";}i:4;a:2:{s:1:"p";s:463:"1637153014024763059444878705223203780681858093138911571751979728838657707993054069819608775778753857062986551340167861371895956608008303443247254570296681365466843835598991865198789305509785381105738587250553832156097575877088631555130354903285869176634617910439198251693833897364578795592212671604970740451504483168483241814403323016500573560687048758004696815940230413780398956047311381874244761196793125330727878608765576917373701666692053785475387091211014381";s:1:"g";s:462:"253146196079304316266434733768872749372301038198365665590883109674350222564840862236916235404732761220504241323463873735246003784699325498867656640778717821729675220766842521488720124623809011690475912948904742512957103216664404537195645503873467006909218174832003149223675383918994291709588651481979088751673955939897523459289418812245730766260986806015360755507568343631994201583412347069821756072284985530614961162489684943738005917848451625837740216654238218";}i:5;a:2:{s:1:"p";s:463:"1219739395129421980986817581093875899847343408305888101989901813253982523812274106436433323689615865668476392367734814970480804904428414841429633998030501300762701392560716063753422306285174523408337113228268818879405961220480195573703497617321463271891741904278861642257906422159298231098658985526457662170038010292931860549511504497994128931079950747868651823087004354747165956919277426382129565650723679401668983210698395935172256570765605609849286691377452069";s:1:"g";s:462:"170749392644970811287030749108243672722681483625922470846523134882486580425232339780276174257909030458715830716692588702557598044687908844893420066097048011582288383239010520033914489804041483203577102579487035826567669554277956785062140672417410620876815360564263566630149415924467405717903800222598776815469568149017143892771598944636450610659476217733997741232959262233276018211413849373069396149673782042636144584577674185171593340362723828343131348119216530";}i:6;a:2:{s:1:"p";s:463:"1823795465713565701278315869400723495457475261130852713977770426795435140015065407392713025910005837170602206359208592843713477109036614911956946724377495049413103985503099433241790626512151502197550302263168341159195533492294383405632570116732818018836333704092194728943213064115454736812855110357810165024286142395540987558177053133376862609281101196043894433574854253390690930850852001602168837076660408735360137300780178764720747999733920473649502672753029133";s:1:"g";s:463:"1442839829947671234369496200676072588081612459677607985530300351859499357749262146238588298044263018187404783155947200807580123587074809026438733937831837276863552797962633391437862262487983073076526197006774206392599749277196760629805690702748736444555470229978387347874033267703600471989608673950742255064321002547976555706582185670106509022326628674460174579619942903604626192360640005219137811717889441546118271454105656302351748483598142884252491906462551344";}i:7;a:2:{s:1:"p";s:463:"2330987243466161089189453913980054878244548203271516593454871586865008572865835925509538466874454336703982083570636604988092181165159923670888163875699666429239768275554084525673152372358619029724159564367314059390020704727416486501641650913127442368735560126459032806262580912363799758293882503234653435264501039310901361922396293916077012477020084343090921096158915280800532439667442662661436491373212982496729726298927418474654567058464055252208378074662306911";s:1:"g";s:462:"386680618508384973423672062850508522397135947113284374965100744322646472653484962944409055998358573494424314461090206662182780860368561763485570382561152186069945568506098043823478071525306398614029486640941099890329530883797789468233801063149372300345673355594678489190792290553970578096255571413645141468699974372196819473802551597223213318243705334542362861643744710123296535080834831744256642683094762389663106543125584931608216839951706680087663895979524043";}i:8;a:2:{s:1:"p";s:463:"1262620669861477839190844459069625161157458691447808343984704184159371136895931239924491606146944991489400086233879378957339498118133191256004545753457451547013077389884363597994672087814969621667075874313137230455646979150907696693252095577556652543710779314562280787859056548289029664793556128094449637512640549596088042279135346001711726938677020098004905539793932511494769831294545941118419853855421666428039455145569228072097189891576088267457892585617327537";s:1:"g";s:462:"526663796116646673994851998981201669178713058539445963858436667089710552476905374236164705691170375947481081607610541303274006827378957464313549841097789508218946402515689199903038313446510101310473849351954858966871650717674123149287955406174093369789719324626912240862929635523839987379204148425806480078269046549263204392631011143098816027493919238398815279095074992826115644273740497748876160953621171789407359553722390062142143510560327171403556962711579228";}i:9;a:2:{s:1:"p";s:463:"1802806247618212052847139445190286650067259060192535756510698193625342451183591635366213416695234519378646880682633767718314783369603831326194387419926531041225952412795286571196321300818787263025582858179591437678991886851088704122896117267126236018088255041959547292291014433680944304432469776645236818313507336442478521079624340532244747798364495759367518444452373370920933200025543833730541849004863942871483124484895889874086358389451367377636915283155601279";s:1:"g";s:463:"1284641594416543525662036145628946288335762230298381205343844315244784563257207376136770309765261982199619179919538857693102793738277562060812035117250208559853314039706519792948991125592723028835849628618414032901893842763449637332613735729524022145278901762445067158581783058804762286976909689060845327084055603617159850945703843763012315352891860697254579455882005066597307381839438396573376674188203126522446102248606816032797012113930789171978183813977343611";}i:10;a:2:{s:1:"p";s:463:"1582811987242397018030371731694457345235827088681427679697116889089464714688234072738746320838265451104885880125066461941990856320096604611671565283402794876779139028522997427206721007041029858890516120432680771700972923994634541796145230018505355925572838476051871410554406298275632980176315170349424989011480109942413662675414441427096441297934858425355818410353360190492203797797818306162889687552448049037239909742012439530936824490474509059846737144151122589";s:1:"g";s:462:"904005487385713022379621349592992471612880301537581879253733082184761289667473824498027399895869972592947693035054381286316769789684527733801483110012752797833748591601744372689718751357647506175043276817062912956835261917728246198019654354323587119778378183866021920352464303862458402855590059151030218669892369596629436855331014343306882939528512800958166479957444885999360235000004595914301695408522151397314039624683984435249704259386328592373210860823431745";}i:11;a:2:{s:1:"p";s:463:"1751567140177216355913464714923925382303386077987286661087016520920361085694926448713658621586777889815549014628902654175565156184204401359255645222938554308180406673877599066706797648397605589808600115965605825074379462812206558724269393890032645033281680588349893461463965184465169874061908663284055226215854545962327006625887546931982197079318292414797922218674375886474872777173052121315637184932090274167091399081333368914449195411820479987084002907490075763";s:1:"g";s:463:"1728933896829190229135447673930534573193230270896317083457020113596793657167810111090059614779411353579891050636265959009334790354242367021222694211284484143733427402392439443059568114957827430341392137236643159465739007046315676182953770441979720779755837087984309128307509317093013153746661996696823485906207481328520018097291489862365101433457635101786564648836715943624165952560449579601292473841876104693571448114740692851519203213185026138219553941381566465";}i:12;a:2:{s:1:"p";s:463:"2151630423012647537844703576294810579565336708199678266911187790505880932879424817434691270964383838946482745460110687378195032802933406049645640068316727857023948732325344487226996291312649936737107355368206848804098606231594113432864566561818799062515941354699429199159774308376691772761126331126068157104422783733539530755190226719384389650570576991103463111113686035442716666605835661122272855402177927187769060522635806443701402511727404912236646468773112033";s:1:"g";s:463:"2121000333525367470091854954993095574153670551827036751868266597572256874667759117352446133965472453043969463344538546533166991278117936837955676339645546669209260506924224811209384588096653947044134595805874397580120514968802999183663119396415206905026521518610277469511452527761346355780035751949172413793085089893406122320590054677391074249022019433205414681586553029386620571667778599880374927413315499007958756221913701138872501077944472074702822713887024468";}i:13;a:2:{s:1:"p";s:463:"2205070084150365578520443567286113338063494441182286711879349386447420617550082998305163124583124659968411565696253507239750319335503844156433325217320099646707812531275013377115385880286002737298380907436927575080574058027459561347795249533536110306336676674626272337164368057238635634936325623385295555008743962525297432660594530824633717776372520550493992724995773138869871133949848960548326013413861077038851781317075929760883962338374431825689935375843218653";s:1:"g";s:463:"2164986491453150181997307394732315140614298464027330379977238121790004601675170871987978031576748094029228652746235016225704766983618671573830403937213847957627426849730795717992909097124266785777500451244045698059566929616174668460223079201751303173880459434689685322490463699023678343346462747706418014566753958287780845925077591239643442031042118280194530297714211983675755199763003168178308438929299250986345700682377534935196768002884135000786173463676024879";}i:14;a:2:{s:1:"p";s:463:"1521251664255354648387650579429147645003851430901308819073432965199333067089633939765298667366222286385404882515876653909529252398129005889801425507724811977996173982929147187904902391198280960871297119665598540835597034200064446205943817755106610845073388515419027205081211825491636302401445316595226697481153192188703355175647181368777041455082796264978831047550011469827974208535580950629540118699486070742792447196201207794623773356284583460065990997086238511";s:1:"g";s:462:"965193605452145797059670328874441819155298622619297053175552499937680640644666445940944882855932307148639941581084597423672394906108044956969878533384135603691286438773265879206361085382287378400275018398045193374212541331042637252930194708676430354898774667565187596063250380298789522845687589570438674857628002717877707884455323523299181393442629310322092655889918930430566295027767644067297428030033271832881357044821777678830457933953075655243142288927175592";}i:15;a:2:{s:1:"p";s:463:"2359088529688849695976172882354276186572333793676129238480483310356338119512834416470889516824103143013456265231779354325107949482185103514573493123174776224113354923823459005285100692068081219492746850787514937711005894611615247331157020496376924834185574122667041507752735016917771570908300383091007334114696800556196459897399050681446783294994048701546990851161672721128777031448669634022236634171162072443925053239893879803599386757951784662290977479728876099";s:1:"g";s:462:"531712821169676924995279008450573863171422718303644923801999592407585710289327315712811203262677550193268920385621678284963439199695456438890216930330152156118253891030820312933931857809080143365111231914817537856093519081740430912993465432826979612678871678391441229601885573783843423731588207120032647787887396014960941864835572694180911866701771212825132326338693544497332820354308355809281971835819585009137470469515712697555045631883330889364226786485235267";}i:16;a:2:{s:1:"p";s:463:"2263415250426790488990021998541593923985939453932066947986968571160941622802612177769141891039473489070175302867802751596946353154172125528234191468643981304299429091395959809710836541720420021923806062020453686237371369098960991935904732896776305367149806546520869591216966307337101655332797619207182444936519569732492987788087886323058898445366441139143155332695122745405143154390717222686607255170420221316368625610824961565878490680157211889540793859511314029";s:1:"g";s:463:"1592300040248123484343304872412609674278233000042429776065779160677830870546995470357954916165832640025797321967048755775627713204352714564717585266051163773689777402235485084734939182825652015026616241954245365070589307618851173791011445842933302480677887284019554610611546717089545421534402349743077171151964768597699449831915488170530900787436161510470323524667270065908642393725707849007244393660272712704257485664362080753091384435793689644134869046685439697";}i:17;a:2:{s:1:"p";s:463:"2140021758751023276840079207042484968828483938990224910948092870606013654041680930240672408316776269908489537157093230523921913791933713307571209743090663930053524182963000614494056181878721267909181559101467357866435493815183307483633613451238642152941855619490861935672760757676221198639329013244377526408249320935076623838134966951658604802937666471551992167087938734246741266040666007877163204679608400933144213094457105599599278002366948889603083533991484951";s:1:"g";s:463:"1100233131056620948296063080261400071657894915014156851614190078061725775652724042802252052520540922949797249690960522349654067595799262331593777556819278792085357168985669988636673921131639681240048032250759952721270517316659925423462247942806786822053233647319893585509026604836599081906066169311006342005206909012755218672694523070884738297514453530775609726869693934264786610643627147185023994300750387486846804192790799167713142235625081920945676492185259837";}i:18;a:2:{s:1:"p";s:463:"1551038949501222691978272893261175182106190568814977369412264479269203984617935284649271672983221996009702717185850835368097716239680362427876850240608711832907992991904207080846078476339794107796679682792702952426396050690103152939322069717802959355097917068461854377217432372587859666863879175341220281173708131767332774632477155184400678077766817498132455212226304905057355970071577431782390842748315762830917398894909591248369951918144444569327038256791412189";s:1:"g";s:463:"1122743139630282153879868251492800292369119837055724070863937958954275141004659287445630535750518696420133153588928570581644864109649651087502307048496388930886123022314248669533791822102495449596897585018024718364807118889886919617488854825417330211828450024519870873403366339898166468075791590348995064663082411049461483459672090493049746342023873181820458364596806245316113771672923399540575780554223789112003339156911840140412416044701352663673472942552084352";}i:19;a:2:{s:1:"p";s:463:"1356275386127542659017850102084213162793783886645454180765334717833233223399711893326242349980495053147731601929882665213599239957578370346016474113462672990475517633062742504791277452523124568556338228152297085410743499668547067578837155876739204833738979418284421167514815201003427454456488029773197444587939264563226841204796270250197007137759631209198185435416640354634993592234914740333637656688867749691551325073441320772525747422461099343214212606226782837";s:1:"g";s:462:"196158088095289507282635289372105179799925532380890601501328888911791240059921911676135260880026187732965333332154750913555772522540516226362849912153957919289972463443703634672828466780953764986723451520741685547186167518702308476173818830280887990050604198896217462931059031114540897431967632771864183496847755209674316498138796078477827464190973060848610335479452576965859000719469049864951119151409590349552233657722495217934957865156668731479214259056401619";}i:20;a:2:{s:1:"p";s:463:"1791472286915428465800935822692265439238355517646096021981341373610022332512685662672947071726756151791966985572565143427965511257073988222706151587711707922926145814850587537844646412281461515307166194779513849936528281689522221763047607949743506742487857989673563402712460260035284340298722075617413469890846240032571221443912374997991636958525327747208883933428540123519800669703170185597472417427612584127771897699916422137284895495208176450975703263813324361";s:1:"g";s:462:"812472889838316626876044476525910659797355846637807902006476703903476420879104141089450116597850471591854168698938145448631879864081920890692042259147592692842192344636910396472895957516670523402513152790835262569312900065055814220909837365727450527054620162030353510549825571076047117901301818937913974245991960708251362745962177597540916436370662595856237213188011429189642229756130467882589450794829062521138060916740805890466164921142302272783761185243603093";}i:21;a:2:{s:1:"p";s:463:"1366833399447889457775990207973615802619259554875634153621347812296968814287533898166660206284964915570047939236738102337370803059310419972815705036689363773719211310818018266452632959459163662445386701608870658012250012908275516846937941749608216814626236706133229312021626209945109912604144285299956864973471892748876868743616995712656203256727782738514688441353283479027877383331448042965099734616412228147115211289999408629682850400139227689027478749749643129";s:1:"g";s:462:"907557415940991513285090149273768674738060366453456203997124609929673130784634611327985434585529146305092377176336004581435837526756015176571782139094736301097343760037832143538056782557460948471665233952196990668005720646728143894341643654773015046788101057446846122595778433416647442456793837598177060389929898700066416155469357326609097459960392457609590714208063472803992682255477495194457805322420281681213623504075777095465460597665129371748683785603721006";}i:22;a:2:{s:1:"p";s:463:"2235728210829391857071877580387511359891390738738547942772210596588328209288888619866661081922620605650811252760893976945841607232634557684199493942964002252162424504613619431329645308417700225310454244837374950644090517139907683618729560064949837356919805580405898545089057377346475412311999128342123657940599847558896191574146322896441284187120358475517988223178353246518708051100480174846708707357073697915628723229994725004763047252056120943361187825791150229";s:1:"g";s:462:"637312041409355177411974853221109947515744101798389146528774548932214498916777092630192887092630101160548857054003728871186609001785761461978704016797748424302136028903368917925007154954833444321746626415766303651171977419175936950344617277881927411604172961404838392604376361557623813071848677171881812344396160401179223323005436600038362498640753349274380695107444847658991166255571478370115034110598577092991547493707110073804159767315333427952395510117923986";}i:23;a:2:{s:1:"p";s:463:"1230402277951024128207424741876734394235328971165405947947309299701490787264435301233695030361940893216739801304221858099834185444907555321212424523500469201287869965553274789652940874658275644861206255728959954319026799091669216522927588979607033270355519456618530483628821237748037726704478448642599776349590126053959737752737091372398004324976961760898043643776494456825641032767428880516321734928192412624057914470785381494106990379306675385876696847389286223";s:1:"g";s:462:"338337574239177317877461820340406296118689570674139174934980557907797512993831045015071764512723465929820824827380230251055682801255297225194129788221954886452049216535615519736643436909474283900148561820437578555501524700402534304860476771494314549265082281559541403101063023463350081318114948129018156823637901049100325822416263781450628275355097055535634266452391214951018991141462795558102155975109587453970354234061405806819338677858746939660250096487381222";}i:24;a:2:{s:1:"p";s:463:"1911767397217174389580635454501278451662399330679149216825063753986107516887627348972329152716670344012835523361399914204681188251842967025811126913965113226481849273439748670394027983781685504896105459795325034776516327708392082217034648247322633497779699909897101710745541317469488983418685560845904692510588194960780198750170837577339091255717698429947336017783990981810701228856804637301843263146401004874083727217362581520156327048282377140355341630648456103";s:1:"g";s:463:"1268080483672427216958224975801292383587547866099684747810305400482861740550272965009363034958263517021319762496237599899200861869592948185998662594716738084240326115111554194231937679759491622552543609081009157285370194938894887072173502498902751488787514342330471293536467270061388282245612044342368852132279034623689831591544404552563026490733134267915461931000181987531966569228462873362813573826868674356654050782457393475684373296479964951832380516920006289";}i:25;a:2:{s:1:"p";s:463:"2384935185013046067220035179863998606999812912034904502807061575246271675961542850429667517360449796538685788629608299911037304799677705521562064126448310662928476680131793925576111182979091807631918029238440547258773202993568005355415069181820061179910375968834527608205575122828826565040222250604808188617658493902058160064391648525420926805258250520000765029746606323909864960353779235018441612552606347709443678131979120380997560640005810607751789857065091451";s:1:"g";s:462:"230062907685243780452883658835151462600168821285212753199061160240952213288476497310814110927786162764424336746127033997732663996065843294573577068538063140935014911132098778420167116292666336310665075633034800774149967367198046709558691946018417849690027139977567315959230391862191299426094157615629906301773814641864682077331169324528132423969523713789011223825672691018959906797878940942325987433373308932869795904147206530299908785287056288995547797933032443";}i:26;a:2:{s:1:"p";s:463:"1663344306655279209292925933415166673010218801912608607453659111186281765127963906747334142803861207045175907185341633566803131965665187241347507240355184503320145325035527549916946203208831099788683360925692343298292440438383759779170710699485403197390947453941054427159513193680633041344238030245452902236794214288355312770188493677390972819610775968168652115902497717012047496016490638636145149167033047041445335801731491846790475339025877805955311338540934627";s:1:"g";s:463:"1348517767365160364561068532904450579389328908173180354117747600022821268147921395670753439266957892637547548008485068735206283651393859868620973098249719756384276748664816488024695266868296400105329740343009341872599721665814103616635578948648432158793708382891711073045093444826262905305696088996707838189289814208503263563885857974203581050042104854142464557342916467428964426721186094462371984492943151324037650392852237078007527006264829593973374800503511630";}i:27;a:2:{s:1:"p";s:463:"1848896919173844897115484621965301937359468417329851937907613498405516616011344671755604661971819633223199683969701205993540557973998057014209439444926623445981416341404885878413044311920287373049322289489438247126578629730258903184306797687934935350338100288227740150503007566329840870600743965247269417726969943195718972903432914079036061575699149971862372213649397422747198211710272236417380710992790034751870619005138531869354200728018277815675987411571131107";s:1:"g";s:462:"429289696470275857775530951197073972688947870516364972269559535627701213069259530612419679756895227063669544280791154240670740796327818039237257228266226324946015459066054920164656517497021576366860242621801116329987278409508133315146909097111808932821633739861288491142391412283558567587612085914476484689127470974041956005153680024608674762079992623386827477985783098347117926214711810179658634316931882010723029050458260674735096275563410284828547714615788587";}i:28;a:2:{s:1:"p";s:463:"1890627014913175910326850340749681958428380980658681063341993939499758659173497200321459369998720011914355660203102403990377765814366385664710421582183545804000705271168997410589122642202301568560127610873466167697468942968722497122944122708091225065758185048845958631514107208078217188714984825957124996155345718832704656526384220047044919842429499771982984326066654442486078088122441757917824305647778599411466539066279681960968021776697929069992812086995172789";s:1:"g";s:463:"1034169370222927208782825986578728083410858536450578282698009964268185939867622641861765948506913540342157742240963716977855562177703039976409349173614991743536434594022269319553704422130919086785254310146515389889792593033954067278811337387826083570183292948307563695335501352996895214719576396591180371565611649224388919323192934331934511203267468141351305137769380687345028766066767615175846034605155402960198555165557055819821481579985055010194120972583631597";}i:29;a:2:{s:1:"p";s:463:"1353376715698694849416351054567317097442253008810215280534973591952340453592336519345747889023649593465096755863361196728613726954884457107103432300908272357398779044553771760203942803845422237037780075398705912790942805326030680104878331383092211642487952263739901176183050028520343734351006071449564249238382691445895174993577066686591254578612760844748234214169371540250401278015897965301864679606231139850512645245671839049032702402176156740309810593611782337";s:1:"g";s:462:"305210523129475840536236800901702737664215769845725796264865453089967287991947101293919245527199033267819594245571745616219504679083065675697898466435089350029442525196013314642200460699909921210419450041030462063057375054885732135352452147932369599618025917306836513163880414992131359626837644091776191785661118303776333488611066656526575787363225807387004783769682322145335656768853220570786204450747084576926149782903428402575178991488369822354375043423248544";}}
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/phpRPC/dhparams/160.dhp b/ThinkPHP/Library/Vendor/phpRPC/dhparams/160.dhp
new file mode 100644
index 0000000..b038571
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/dhparams/160.dhp
@@ -0,0 +1 @@
+a:100:{i:0;a:2:{s:1:"p";s:49:"1305369760393067573903784608000086685092429430939";s:1:"g";s:48:"474563639061072388724737904946142937816029120423";}i:1;a:2:{s:1:"p";s:49:"1144635340808941051501659871557102316521726101183";s:1:"g";s:48:"619759652154730913011023153136163766014870982079";}i:2;a:2:{s:1:"p";s:48:"988955281135516012494592134176727394285740835259";s:1:"g";s:48:"661721534235998300528018590812024177782995358121";}i:3;a:2:{s:1:"p";s:48:"831054466535764214539847067184849497020622445943";s:1:"g";s:48:"602568635360210647114201968475098190709943951119";}i:4;a:2:{s:1:"p";s:49:"1273451162499824010415840310357006535387759756083";s:1:"g";s:48:"388940627425287673610018679790118209342077054037";}i:5;a:2:{s:1:"p";s:49:"1194158228146097682568743682506593014684819848887";s:1:"g";s:48:"580787644966973602366617775052430689914269385029";}i:6;a:2:{s:1:"p";s:49:"1250825835634860199205277909400801107314922391847";s:1:"g";s:48:"581587982876966650518121867963233577479897748201";}i:7;a:2:{s:1:"p";s:49:"1133337270744463694484988529020735933451408606039";s:1:"g";s:48:"631442441351111432384530483916287036387111747321";}i:8;a:2:{s:1:"p";s:48:"804221707628161205330927629041516333589063181087";s:1:"g";s:48:"631006589253137060927543237371342862321104607941";}i:9;a:2:{s:1:"p";s:49:"1002191724199846857337324294157355803232206888867";s:1:"g";s:48:"483655550172758115887335144054596363427233334927";}i:10;a:2:{s:1:"p";s:49:"1394184516879107196137044604429830692800149361183";s:1:"g";s:48:"683437286820195951723981107586029551808106506279";}i:11;a:2:{s:1:"p";s:48:"961405043336466250012279555201953463057072208663";s:1:"g";s:48:"548079459627278793375356546007540397027073822501";}i:12;a:2:{s:1:"p";s:49:"1386832263378811893090905015568465530933732830547";s:1:"g";s:48:"604192202606404180885679845081675292033551734613";}i:13;a:2:{s:1:"p";s:48:"783786288502740985223534835310606558783982116919";s:1:"g";s:48:"500926370623902489501579323312356666918032852369";}i:14;a:2:{s:1:"p";s:48:"782621235048592548743271821187900290544473673119";s:1:"g";s:48:"596692264293782688278359189116397439489932369599";}i:15;a:2:{s:1:"p";s:49:"1367746360017583392658813834721766340000578997379";s:1:"g";s:48:"538797978419712469408715343382303371532760124217";}i:16;a:2:{s:1:"p";s:49:"1135354155681947332382326494639504774124357656419";s:1:"g";s:48:"602214275291935588667865684153452385069344891247";}i:17;a:2:{s:1:"p";s:48:"790833869591119782666903580768794672968217564203";s:1:"g";s:48:"584158672869014766593166474252578740731182247631";}i:18;a:2:{s:1:"p";s:49:"1097291211491744018366481025948305908720865493439";s:1:"g";s:48:"439509359160916576695841620747699133810064517915";}i:19;a:2:{s:1:"p";s:48:"918692550503510060358872429607147446953066891283";s:1:"g";s:48:"654945249942805992787768128395123781115962625817";}i:20;a:2:{s:1:"p";s:49:"1332092254872377835477605844037036203458943086819";s:1:"g";s:48:"423679953504051996511091129522726961838960898025";}i:21;a:2:{s:1:"p";s:48:"933877274777927890528040884397656631578329276887";s:1:"g";s:48:"608217136583914041823260551340788541238317810097";}i:22;a:2:{s:1:"p";s:48:"859725203063513692512603341846423987592762126743";s:1:"g";s:48:"440919501974522445512311709528159976986712491187";}i:23;a:2:{s:1:"p";s:48:"837664251768125986868150132183481466127924307047";s:1:"g";s:48:"555285975589793727593496223597124870607008893367";}i:24;a:2:{s:1:"p";s:49:"1327569384563655583886043185949541133884438458323";s:1:"g";s:48:"613130346337979086911714027415445562125235878865";}i:25;a:2:{s:1:"p";s:49:"1428411692032230775295758088618237721277667517983";s:1:"g";s:48:"535225122050760327826451080434600817792628009249";}i:26;a:2:{s:1:"p";s:49:"1223896787241177872573145930611964429377687205323";s:1:"g";s:48:"595494123131028191906314657449402679736765235803";}i:27;a:2:{s:1:"p";s:49:"1086048631695619847613317770068005258168656629899";s:1:"g";s:48:"572284264033707549413957863779727001669628388815";}i:28;a:2:{s:1:"p";s:48:"822022638232373521110350304334064578294406009867";s:1:"g";s:48:"657635385587761135663653068076150080262596376919";}i:29;a:2:{s:1:"p";s:48:"874932399873633702319139314690832967223336821143";s:1:"g";s:48:"599534542056608408276116956516745768064851371255";}i:30;a:2:{s:1:"p";s:48:"843427967333716318343697147670009659629329073039";s:1:"g";s:48:"535889566902096730048601747743521871868718255559";}i:31;a:2:{s:1:"p";s:49:"1024009511101153299776517092199472217626850026127";s:1:"g";s:48:"466596086730216509212034465709587270534916154537";}i:32;a:2:{s:1:"p";s:49:"1320980696430805902000359363849168914081628941619";s:1:"g";s:48:"610718039359114569724584449995403893298609474271";}i:33;a:2:{s:1:"p";s:49:"1092432640209269431497453399910526986961082646847";s:1:"g";s:48:"463049212539097020105319388432709824833485998251";}i:34;a:2:{s:1:"p";s:49:"1379609959417773161390936687752808731631732084783";s:1:"g";s:48:"523798400483215508398847538082598935117370208797";}i:35;a:2:{s:1:"p";s:48:"921078024075785201943929096178126751669361769839";s:1:"g";s:48:"490512063141551178776615087664624573070816149093";}i:36;a:2:{s:1:"p";s:48:"989183702275163955646438143208065558843002781563";s:1:"g";s:48:"634089170820543168467541507246098164427596903717";}i:37;a:2:{s:1:"p";s:49:"1275967997029234336396643206755914224132707033899";s:1:"g";s:48:"640788943520119214196146942744877589585775435683";}i:38;a:2:{s:1:"p";s:48:"931840992701647448146789164397900838241044885903";s:1:"g";s:48:"534315128594159356486413265871709172887173141369";}i:39;a:2:{s:1:"p";s:48:"942069618564062766077167557363733874684068976927";s:1:"g";s:48:"485898747279783894692037240129360297792095013363";}i:40;a:2:{s:1:"p";s:49:"1001789339197699052355670128971121065627297992007";s:1:"g";s:48:"595155718255698292695322354602201327756898470131";}i:41;a:2:{s:1:"p";s:49:"1375600571680089498740013276064864072342162854983";s:1:"g";s:48:"498415279224520972219426394139746930392949512579";}i:42;a:2:{s:1:"p";s:49:"1303779257813293468830624797057168306311850997203";s:1:"g";s:48:"403451059131446434613889922097963893429478142833";}i:43;a:2:{s:1:"p";s:48:"800005908639641965569689452284039674108265369227";s:1:"g";s:48:"402323816163796613170618111976343104099001279247";}i:44;a:2:{s:1:"p";s:48:"844583281698326903788926899664249893532888110447";s:1:"g";s:48:"517528430635008553688766531790077155586957536869";}i:45;a:2:{s:1:"p";s:49:"1094285529414095396966242208681559809227871496263";s:1:"g";s:48:"551358249287881329263799188692784095718943179907";}i:46;a:2:{s:1:"p";s:48:"983660711222388249045315062345897636170761443663";s:1:"g";s:48:"530552213889630252659015358537515844230369285207";}i:47;a:2:{s:1:"p";s:49:"1351013775227766136479340311908217998210575835363";s:1:"g";s:48:"610369552440185821513978440751416631043249970137";}i:48;a:2:{s:1:"p";s:49:"1354563829742534304843697230885200452462665538439";s:1:"g";s:48:"406800662086513110930754334679064364192661267367";}i:49;a:2:{s:1:"p";s:49:"1398563347597624601077663460163417305420541555143";s:1:"g";s:48:"619655395370666441364849115839740936961386486543";}i:50;a:2:{s:1:"p";s:49:"1387517700339083788987800628137655557973366876907";s:1:"g";s:48:"538444384733151203412364008770185341348899980491";}i:51;a:2:{s:1:"p";s:48:"846173836479196853651659824753744331267546831199";s:1:"g";s:48:"650935589280629646805939830602148789608779985997";}i:52;a:2:{s:1:"p";s:48:"798285016588165120883258650093433041877186987219";s:1:"g";s:48:"441529709876893173588604889016439199867969459331";}i:53;a:2:{s:1:"p";s:48:"809397346401439086740185140566814806808684379967";s:1:"g";s:48:"538236957911425614153489245348547397710621101513";}i:54;a:2:{s:1:"p";s:48:"809952999200455191901540837089805778142345835223";s:1:"g";s:48:"487385441754309571397412911571477016204651475301";}i:55;a:2:{s:1:"p";s:49:"1237709265001243211076717714981240635777036971019";s:1:"g";s:48:"618784272482379871992008983619376563093070592813";}i:56;a:2:{s:1:"p";s:49:"1025700231883796313398360726901170861727266024483";s:1:"g";s:48:"598151296213247324217168913027595200303295217225";}i:57;a:2:{s:1:"p";s:48:"793327128551442023767444463890995300870522218687";s:1:"g";s:48:"539794565569805340039859573323545355484274999091";}i:58;a:2:{s:1:"p";s:49:"1147402390250712399306262523075499402015636746759";s:1:"g";s:48:"626507572659492347430889119427988244627761972155";}i:59;a:2:{s:1:"p";s:48:"757314137648932572630417643460920752998094447203";s:1:"g";s:48:"529283349041682923530633778652165533595093720655";}i:60;a:2:{s:1:"p";s:49:"1361950860510200593841383238144379709182596697347";s:1:"g";s:48:"584714604603156245090438264122564252115723640809";}i:61;a:2:{s:1:"p";s:48:"776225946963506180259175310291119749813149477423";s:1:"g";s:48:"383570041528464505301304825748078346935105119677";}i:62;a:2:{s:1:"p";s:49:"1095615178700277152695831820099513466482620295507";s:1:"g";s:48:"539625950517641194035243952302416933336756627853";}i:63;a:2:{s:1:"p";s:49:"1347136297248479737442676121297888888430630212907";s:1:"g";s:48:"566059213942829857928591483029870033388619728299";}i:64;a:2:{s:1:"p";s:49:"1093293569259645131193126647642958931622598722387";s:1:"g";s:48:"594343997827841315653770570204548979906235062547";}i:65;a:2:{s:1:"p";s:48:"887602414535217945702184615603540100183295065747";s:1:"g";s:48:"662347294674167895627463959587876305268045160149";}i:66;a:2:{s:1:"p";s:49:"1010557038806704847526311588973776853554356024247";s:1:"g";s:48:"532893541909339954576938979713865521494468007783";}i:67;a:2:{s:1:"p";s:48:"829844939396446076032841069668619300178067878587";s:1:"g";s:48:"631998266108121979610799989316873576683309167661";}i:68;a:2:{s:1:"p";s:49:"1046494928460345758716197297416292696746658575579";s:1:"g";s:48:"615891927105300226068825732290141791815544028735";}i:69;a:2:{s:1:"p";s:48:"834135728048076165111266946917275399239031768439";s:1:"g";s:48:"389213395234196335590445606749808103986455524927";}i:70;a:2:{s:1:"p";s:49:"1154700011458848510187096294835728566622120955159";s:1:"g";s:48:"548503798393624074154942230942131583774664088813";}i:71;a:2:{s:1:"p";s:48:"978672053754186026248750553289218329620184542299";s:1:"g";s:48:"641055835629088201611166793394301543897343093531";}i:72;a:2:{s:1:"p";s:49:"1070102503643189144647061857723130426933962673999";s:1:"g";s:48:"711869563468284271638708344931033641934315745625";}i:73;a:2:{s:1:"p";s:49:"1323812811328381869130694828828061281852276002319";s:1:"g";s:48:"487053656886806410763695828754103165927486554599";}i:74;a:2:{s:1:"p";s:49:"1169329801421612423199318261807267948752947753967";s:1:"g";s:48:"408680246627811380564801297727106398902783872371";}i:75;a:2:{s:1:"p";s:49:"1384652955769809627275543328404332791741666272363";s:1:"g";s:48:"449672474457280124868466963066446412571192105159";}i:76;a:2:{s:1:"p";s:49:"1350000196205739429961458014370965793276931747667";s:1:"g";s:48:"505425622396261383117666278099826061597545042231";}i:77;a:2:{s:1:"p";s:48:"894705447065273442961638823541618192797889809703";s:1:"g";s:48:"510741338778056615339728592753920772472096642561";}i:78;a:2:{s:1:"p";s:48:"891337116692625714018605359651236312842104375007";s:1:"g";s:48:"413522626116106665014504432665726545091134259373";}i:79;a:2:{s:1:"p";s:49:"1297939713670228460811861978176871752377877828999";s:1:"g";s:48:"647298056544131270364838136232559701869206992523";}i:80;a:2:{s:1:"p";s:48:"976351259950759294642978741592083950506931483539";s:1:"g";s:48:"481165731343196004629915370853114428787031678927";}i:81;a:2:{s:1:"p";s:48:"980764218473209598929377503670805572400056847187";s:1:"g";s:48:"462874955150610793645950273938064092414395927293";}i:82;a:2:{s:1:"p";s:49:"1078402246449839832492595497686341465770525338447";s:1:"g";s:48:"510022575873437628725501442440267016121819348391";}i:83;a:2:{s:1:"p";s:48:"822926078477097486444962323277458446756022978259";s:1:"g";s:48:"589910875783545994219126942930975255660655801503";}i:84;a:2:{s:1:"p";s:49:"1431038025067691058996244066273531476107919268967";s:1:"g";s:48:"646932847368644396052277873258548552204273847065";}i:85;a:2:{s:1:"p";s:48:"748914983317514213116978697376736239495039622199";s:1:"g";s:48:"380231440226574322623857841433603704817502783043";}i:86;a:2:{s:1:"p";s:48:"746072024360294846456065926995318746311968317499";s:1:"g";s:48:"447450101636477251499694410520804920618515586095";}i:87;a:2:{s:1:"p";s:49:"1187131965479053580515236709652828301619620145103";s:1:"g";s:48:"497069754034640342738232452898528527704513730253";}i:88;a:2:{s:1:"p";s:48:"960772791831553183940713554045441733504839855479";s:1:"g";s:48:"467189892742053032374040989028169931254382194485";}i:89;a:2:{s:1:"p";s:48:"744720969935722391016885990661932354762971107847";s:1:"g";s:48:"672892260298249149453889871675067812728254959745";}i:90;a:2:{s:1:"p";s:49:"1284138085754206095984621825714666759051533360447";s:1:"g";s:48:"670680653213753375576284488437938207972423819365";}i:91;a:2:{s:1:"p";s:49:"1219703410168163907606714523859829978847615579703";s:1:"g";s:48:"677566000162233783460796007673293061475277168933";}i:92;a:2:{s:1:"p";s:48:"758709279959164862900864570318174449302613241339";s:1:"g";s:48:"452090953215317329319057610469368245672033968833";}i:93;a:2:{s:1:"p";s:49:"1071627691050988181827045931713008063023490617507";s:1:"g";s:48:"395161002059489287272140658032643593929127864197";}i:94;a:2:{s:1:"p";s:48:"747205427461860752092585693183163490214259858423";s:1:"g";s:48:"417612284638201080293586217380241875657446616109";}i:95;a:2:{s:1:"p";s:49:"1006525224732904380987702972930703364127273860867";s:1:"g";s:48:"577545982783186527062549787160719734065840781741";}i:96;a:2:{s:1:"p";s:48:"913028069291155898874907016169442803156338579159";s:1:"g";s:48:"382328749628965365180053208087496476372826871403";}i:97;a:2:{s:1:"p";s:49:"1180257192448033707067808765981766151872541980359";s:1:"g";s:48:"614672147155176708479881170756885404265660714751";}i:98;a:2:{s:1:"p";s:49:"1131049454834123578538951980844254468954332837143";s:1:"g";s:48:"516237691590580412638232604519378047537778117673";}i:99;a:2:{s:1:"p";s:49:"1237424753161543304728304439687733366979209986923";s:1:"g";s:48:"443245341306104571668320672937798146976581923033";}}
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/phpRPC/dhparams/192.dhp b/ThinkPHP/Library/Vendor/phpRPC/dhparams/192.dhp
new file mode 100644
index 0000000..b5707e4
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/dhparams/192.dhp
@@ -0,0 +1 @@
+a:80:{i:0;a:2:{s:1:"p";s:58:"5079153797574224533127650903566678124394292110246160120503";s:1:"g";s:58:"1775655624786036047244981958605679297671494641475669966087";}i:1;a:2:{s:1:"p";s:58:"5280951490903349944274113198979805160361532116756714331587";s:1:"g";s:58:"2750563206691870569645796674371212328334419605349825272301";}i:2;a:2:{s:1:"p";s:58:"4908566683395613935027848474793864939536478635831425790279";s:1:"g";s:58:"2217539231350728286886430339426948674052631001859542132203";}i:3;a:2:{s:1:"p";s:58:"5703624436271395096304848287817139341138468504063713187679";s:1:"g";s:58:"3022750833775105018689926348454114058182309558353388910967";}i:4;a:2:{s:1:"p";s:58:"3408373670273337858591681243643970689646571912179487614519";s:1:"g";s:58:"1758856341362672700409627738845335577349659073518321527443";}i:5;a:2:{s:1:"p";s:58:"4287320311873603445306168782852197886252881409583514378587";s:1:"g";s:58:"2443195977736559684026176246109530132630326857948446510283";}i:6;a:2:{s:1:"p";s:58:"4761797641028563107617146852177956262274271252575050657847";s:1:"g";s:58:"1967905564901738530971339075129813513598845172896595290077";}i:7;a:2:{s:1:"p";s:58:"3404255621100712761608995448456580112050385881116515218743";s:1:"g";s:58:"3120045944636737237456921814814946983811560917318686693791";}i:8;a:2:{s:1:"p";s:58:"3518512132339784039367856376100548636855822828484663862139";s:1:"g";s:58:"2936406192235066242230149165110575455148803961090995968809";}i:9;a:2:{s:1:"p";s:58:"4520842854376900535800877686817612397649559103675227962403";s:1:"g";s:58:"1874657377100137046702279108249554882052905843093324820341";}i:10;a:2:{s:1:"p";s:58:"6203733978483113711573047161762684887620736693334966038399";s:1:"g";s:58:"2281917699991259331857077643208127496786819947163020051699";}i:11;a:2:{s:1:"p";s:58:"5214094012046521402304871473025167219554075012879966514639";s:1:"g";s:58:"3088934086307430848999804849857781760708880102815101369475";}i:12;a:2:{s:1:"p";s:58:"5265787227241273761511382896841225398989161548919690936399";s:1:"g";s:58:"1712679489582782094723102988233060994358404878702641326991";}i:13;a:2:{s:1:"p";s:58:"5067782971873137269486362087896632172119409421624139384687";s:1:"g";s:58:"1957215522412301847352896019837878268005516128183054332167";}i:14;a:2:{s:1:"p";s:58:"3879943934531405521219894064328899150202248043781792741163";s:1:"g";s:58:"2689322241684381372458698909603283328674743428685220509813";}i:15;a:2:{s:1:"p";s:58:"4120056568851266360689374732995900645396167325280679087463";s:1:"g";s:58:"2739056964678871613984984850786368930553006484449754894415";}i:16;a:2:{s:1:"p";s:58:"5290823285697561402595250303494270872946043138293779317867";s:1:"g";s:58:"2999800290205863127707463942846916629036584233489088821049";}i:17;a:2:{s:1:"p";s:58:"4696296982773151008599445288256643884813021679236448495543";s:1:"g";s:58:"2408594073193339386366580971829213213076930843022656561407";}i:18;a:2:{s:1:"p";s:58:"3998268366250968840287647928335220016278201614040738565227";s:1:"g";s:58:"2595910859797751097123521430486225763957170171506802652187";}i:19;a:2:{s:1:"p";s:58:"5105069304661883494321382458240500613472126523513595557707";s:1:"g";s:58:"2825214821736761039502493498877270698148881800422346821893";}i:20;a:2:{s:1:"p";s:58:"5939529852124350341005590253411362002186693503432217871263";s:1:"g";s:58:"3137030337042042092888657799036721412663511814250070150533";}i:21;a:2:{s:1:"p";s:58:"3735981060035319331704321434148243550135576868950902098459";s:1:"g";s:58:"2989931789688807377997994070703231972926299933593627385837";}i:22;a:2:{s:1:"p";s:58:"5230792378968521455498964433594802701706868629126441715183";s:1:"g";s:58:"2992268420669971207665248346210532238175082330707685959423";}i:23;a:2:{s:1:"p";s:58:"5749526646585270332971754516348605824542707999962994742387";s:1:"g";s:58:"2573170301376768608263799013605480737285869306043252438563";}i:24;a:2:{s:1:"p";s:58:"3699527020894248790756291220971126715267429809359417078203";s:1:"g";s:58:"2021241263496862637571247756030282715635367895206297981837";}i:25;a:2:{s:1:"p";s:58:"5427626576291640178697581041470814432676853894644639708223";s:1:"g";s:58:"1848499510997690637725982471703590963955757498487817240199";}i:26;a:2:{s:1:"p";s:58:"5452425390533601550543539501601743784582084084867811688443";s:1:"g";s:58:"2199548899998832053779931991591849993353619475860404941523";}i:27;a:2:{s:1:"p";s:58:"5878470339621492376906133148257205717408902857792669244327";s:1:"g";s:58:"2910743244761101832680480464052389046853832954372521194003";}i:28;a:2:{s:1:"p";s:58:"3587801443783379284860115673588846335881679053068010151367";s:1:"g";s:58:"2315160945585969381035789749922662556153810767582805204681";}i:29;a:2:{s:1:"p";s:58:"5653795417450857251329458236472236527706349566486470589027";s:1:"g";s:58:"2802943059453712266640356788067020589920472674707906596571";}i:30;a:2:{s:1:"p";s:58:"3457732635912905545926589910894036857464442278032296155323";s:1:"g";s:58:"1903129017479274520911249166986172071538526145448641719123";}i:31;a:2:{s:1:"p";s:58:"3273859658245405519746765698873884234918875187826838068579";s:1:"g";s:58:"2929782824160658072753520803173577956848457241680756520565";}i:32;a:2:{s:1:"p";s:58:"4761700036076133445360827240122621071147714758522838080359";s:1:"g";s:58:"3119507520206605362692770863344057997665729918422544613457";}i:33;a:2:{s:1:"p";s:58:"4405233922665692538904792642661732972090380014017234871299";s:1:"g";s:58:"2156108555163829703349347996634361253078629587693591085311";}i:34;a:2:{s:1:"p";s:58:"5434930531607967663872622555642175923042733006024997147363";s:1:"g";s:58:"2390628958788389539882354377548156413067155083898369544581";}i:35;a:2:{s:1:"p";s:58:"4344406185108632577312980841629309659365783238791736671263";s:1:"g";s:58:"2647210942852956042972151850238629788613813461130912113809";}i:36;a:2:{s:1:"p";s:58:"5278098580436144905030665703594552427147893589111423504363";s:1:"g";s:58:"2814874609333584535379357984744374068073324062962155810123";}i:37;a:2:{s:1:"p";s:58:"5508427450523598806685760544636322560098559536697021132747";s:1:"g";s:58:"2761184507918258267367204938499934170019870825853641891507";}i:38;a:2:{s:1:"p";s:58:"3197969999493675106847802004872388076312076345632578632803";s:1:"g";s:58:"2764533290029322821411173465515504778592964392854621620083";}i:39;a:2:{s:1:"p";s:58:"3568017303357088501066971162950692936521340156006663981979";s:1:"g";s:58:"2462095370676111544085426676206766871866947565184370207309";}i:40;a:2:{s:1:"p";s:58:"5008365436214491146872187578253187471375499980831929272867";s:1:"g";s:58:"2004937842465852411676297045663569672559418220307277093907";}i:41;a:2:{s:1:"p";s:58:"3660373588674338114259459300737035072550434338346265097359";s:1:"g";s:58:"2991636412905001507296739812030759919233136578804181824709";}i:42;a:2:{s:1:"p";s:58:"6157975818295494991242524096807318074150442170944799777487";s:1:"g";s:58:"1912881834041571656233505839143523520426242139511439944719";}i:43;a:2:{s:1:"p";s:58:"5337235345895474227895552498603823319310250209297678658503";s:1:"g";s:58:"2004866565219588730716376725495942807885729550763014887077";}i:44;a:2:{s:1:"p";s:58:"4371864179460543040008442352670502630060546908322397366867";s:1:"g";s:58:"1935388976841885638579286522024434829194894520675959876927";}i:45;a:2:{s:1:"p";s:58:"3414083549094939748645823179851604517084752156079674932167";s:1:"g";s:58:"1816546965247162148701261384470515149792513541950434437581";}i:46;a:2:{s:1:"p";s:58:"5536741182273059380739258337848493476934305752266586238483";s:1:"g";s:58:"2634952255041246307511360974017554325693333324673254108479";}i:47;a:2:{s:1:"p";s:58:"5775171283053461281137695211327289107677094643699899519647";s:1:"g";s:58:"3031757045742291978953154643467910261283123063435248617143";}i:48;a:2:{s:1:"p";s:58:"3660370278097827798512899847051044607487572010565769322563";s:1:"g";s:58:"1871171166775120299644215319226940768117395474691743314505";}i:49;a:2:{s:1:"p";s:58:"5912814201192481980980973291370859137726857826993424267459";s:1:"g";s:58:"1957331954178238262489699534050120077442696109610799864601";}i:50;a:2:{s:1:"p";s:58:"5184758634017280989737969096729809423029735654784172479563";s:1:"g";s:58:"2747826512297974451893717897444511651643434922118473813467";}i:51;a:2:{s:1:"p";s:58:"5016554360555320960358874145319693037228385506831515688167";s:1:"g";s:58:"1784356253939847363273820130798312708011366157682845326497";}i:52;a:2:{s:1:"p";s:58:"4824111221728894496275833910627403059802694666016696093139";s:1:"g";s:58:"2662092108701388387028814515342811320842361286171226121265";}i:53;a:2:{s:1:"p";s:58:"3542653376711233154532437989275009789150906759425833977107";s:1:"g";s:58:"2993413985944641497043043994022562701684915788578786069553";}i:54;a:2:{s:1:"p";s:58:"4187665199221743303574139512590690486755802614141320341839";s:1:"g";s:58:"2510543985310768653707854276415093099545041552566817022349";}i:55;a:2:{s:1:"p";s:58:"4346276948576799819411680068399983993443471275733281789763";s:1:"g";s:58:"2442402785838021648812881999905665222333408565418673938453";}i:56;a:2:{s:1:"p";s:58:"5941963164742000720764400502847295414251200623156896167063";s:1:"g";s:58:"3109075742957968243564487898153518334570588261995161851867";}i:57;a:2:{s:1:"p";s:58:"4968360668694082055763517916799832503511627402142244841019";s:1:"g";s:58:"1631103685513385955188695844999787805548545198875281032329";}i:58;a:2:{s:1:"p";s:58:"5352110123307966463863605353613413090377648808052386739639";s:1:"g";s:58:"2750049649165087696925391766691408509531457761506337220083";}i:59;a:2:{s:1:"p";s:58:"3492541419748637892497432009505335534778776020683091511999";s:1:"g";s:58:"3049208593127223291568667028585263138784341270026974399485";}i:60;a:2:{s:1:"p";s:58:"4861492597654350078184874961008205492784601986955728398347";s:1:"g";s:58:"1749429043719289142747830392455920053316428401625067853441";}i:61;a:2:{s:1:"p";s:58:"3409541503404917386768832654354691273018080275627195068863";s:1:"g";s:58:"2845917921644585587482900072159268135689400842569349846455";}i:62;a:2:{s:1:"p";s:58:"5001587109106537100754211008462547142888306106754962133079";s:1:"g";s:58:"1736190567706663129392257076867802867666208577891613530111";}i:63;a:2:{s:1:"p";s:58:"4671631568303408929313557979933219261990730864997882387607";s:1:"g";s:58:"1583827872809517491425531274727857065425946452716427187595";}i:64;a:2:{s:1:"p";s:58:"6146891969648692994042239520945566269789751886818035128903";s:1:"g";s:58:"2727147900282056053406651420169531118678689909616560664319";}i:65;a:2:{s:1:"p";s:58:"4691567770908195706485352720805469781946194453032677202383";s:1:"g";s:58:"2236768896068337176672581634512929610734819856751870275011";}i:66;a:2:{s:1:"p";s:58:"3872368398279580027726321029226746610541428160314301688863";s:1:"g";s:58:"1608040030265058297534235316667763045728366641295263678285";}i:67;a:2:{s:1:"p";s:58:"3203632401065450194024989211370201773029103146907460791907";s:1:"g";s:58:"3108490534046256038320616158880085899798273995837799898229";}i:68;a:2:{s:1:"p";s:58:"6073671011810509460429303954978560171127887337149697533643";s:1:"g";s:58:"2957181103947316246707372225424441718695563269317354251891";}i:69;a:2:{s:1:"p";s:58:"5074938515907596155271435330326725395033521551806939456543";s:1:"g";s:58:"2485585061148875179271778918652789326197814093765863878501";}i:70;a:2:{s:1:"p";s:58:"3597117650406458524784844736459676469944049182578914376967";s:1:"g";s:58:"2257773347341600753179198090802149292787501545042330325401";}i:71;a:2:{s:1:"p";s:58:"3692791074237392866630655248999144283662143204054214329563";s:1:"g";s:58:"2534194325117231881996721493067203343094197216768153045559";}i:72;a:2:{s:1:"p";s:58:"6135290864129465394143806935986184464296313272645041006623";s:1:"g";s:58:"2285613745291849023050799771859696833587607166899781802297";}i:73;a:2:{s:1:"p";s:58:"5106945177113923512700853358787168136230226375108347673543";s:1:"g";s:58:"2936475085379719192967479751088291541575787778419060330529";}i:74;a:2:{s:1:"p";s:58:"5181718537893973578476916094185424173615729216146516666819";s:1:"g";s:58:"1865764650967895204996751102080042379553463091437317170481";}i:75;a:2:{s:1:"p";s:58:"3531421829504016980971043040659044882221181410827188828199";s:1:"g";s:58:"1754788776989782747965652935525104074154211520611110481407";}i:76;a:2:{s:1:"p";s:58:"4161793909460184982769028720635087392704116618587096387343";s:1:"g";s:58:"1981894828271550034470871640268847167031481222081314887149";}i:77;a:2:{s:1:"p";s:58:"4649508772336796680142675195864617980598769529445092576119";s:1:"g";s:58:"2060260193469253389049874052470270879843305419455903720777";}i:78;a:2:{s:1:"p";s:58:"3794461735620721528002956624730277693135123278831773787983";s:1:"g";s:58:"2189746373719240792072113566225714440698072247775237220387";}i:79;a:2:{s:1:"p";s:58:"4259297905676945125094110840005802642699827572246773326227";s:1:"g";s:58:"2109550980417331068335665282608229962431326830969146948525";}}
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/phpRPC/dhparams/2048.dhp b/ThinkPHP/Library/Vendor/phpRPC/dhparams/2048.dhp
new file mode 100644
index 0000000..2b42490
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/dhparams/2048.dhp
@@ -0,0 +1 @@
+a:20:{i:0;a:2:{s:1:"p";s:617:"26119538730417652824386042875531065645936518917298962859898441526145920544648057315613454013347891735147825801670444929736964945371870320839420114081211312040311426747341924926796064326790154135416828824406498127049192207991150849791263466384758021041373648403002021019670485486194422368037809226590462008768240610399792452398657398016040828114270291337378645720426235644484515722968943627611602608942224415247853186618238500673174946668053663930012369427127054431907175454668091517702372418355188739885994249239971879046563843965996805199808782303607940929503059770051997236902131942802683449268228989972965647643569";s:1:"g";s:617:"21692939338493471757047070972142857798654655518644033814839259110511954364805167016395345229599656727059168581562814761049085679655778308409884937999942260287379782711541364254190475889453590033170167544793765866452374932516116637879718064465014425017927830556064617293664040306920668006143308702764719183733796439597113613238493154190242995109778425085299465944352613372309093551104453581823748016505746665915971846990430996971870763550674830590105744057158734865757657025005213833571438489370197722184401250800148831017627655890275298519934855829463439326391192412757063584883487921219859606832338748797027614904402";}i:1;a:2:{s:1:"p";s:617:"17494852415029253500263451635519645209848793831494844994025633838817687049071127640459187917644787835777597552920325283395311336348831223620733928313170193589173111165038138057869913225151019592978760413756939078573486040073633063605591180413506497786330721001074819795357862986504220202400959786152850399991084732854557124231380109637676272229893604175498706260833666050908881082936323794606250012464077347589487455541114492420426914154675480402370321252743256114353020297093701386337644658626048585971064205107100595069003802366933563435053584207760412338330625134515253507734839954484610005303585268020855550319783";s:1:"g";s:616:"2357536766000763120599640303735871022142042544950223627657783713207355119762671384828323528942597724321262315162871435756768680295649894617172738865491552395499945910352628711737711459272586894150019111123607450240818973582127295016918052347511023159480848100006890622723727515688121279961377206539154059916280008591560324035228208297543602421189229162987642842188359302005359697956742412268879330969306518512079332500066243775980282601895703673233538458812861112392269922097185505956010310178122235450911471276428561302761444822273287825322542011844279562807283571980685665180825337747868563602172878452348907437991";}i:2;a:2:{s:1:"p";s:617:"25780867781251628440065459712673652906933462699778652742815597485375302663371634433740749781750744136364458591061494303870283828393634179033789064740550017980781317260925771538480299931323791768420861462236431178976601993346954114130438797677012654484168409283271118338570398965911311009082335022460593522080995913669261644367315202030128086666255165421549254127930200196693366384905335244383579750798169063385118039839822333156433252043549232431896238765093602816646193711914401964588912145258045516400610180499330382140474862865622175503314183207026529522245115643165204301739301808240344047865206921844783110493619";s:1:"g";s:617:"22913453542498739351587679639664856992870400001370134675523784914387955771143444917571437755672602988500046796113264805842672819918732572442945319891001413155624746874608973595637299150443023015326933062381925416214430378088998324213270254493852316912687655115745315976037232162037286469731505569162296708698849815888917345038284831130181824975228023218421467353208181389358811631765874415954696258724127120397639098550964799825663331326239274792397246407429506415811807258362151079599569033578071919173833344990717848768176043897116549506982186347999780034352488975732137271158144830900377154823625267922843930480163";}i:3;a:2:{s:1:"p";s:617:"17108582037564624674917207799802832391965005846368564001912347974821312076704202022935078231527320828683510069559020007567337030036847653897258184670166659043776952835342581597567057883537012431671450166955634401920313853950838958877425157189757276240508367052156667477216311297002905488180123637261690402759380674542437629380601702878071821789801803270225500263470954518609603257770968427427507711325567168791246523926693942270053153316006073740979789299514536832553631600448872021864884160673857409747182631139916196743438986143545276713429020032900149638305213353651861654548990616900439392404675443312771396640963";s:1:"g";s:616:"5975220509433032675041067739982972692919188487073925726726373313534662751942478165577276960038244273703352381665589951065977292053614500099134443316919840135540845038879240858995341120504930299860699717125398702129847883991122790294702383642451156914176785997702247519476072621264654943534650803561957687965391725682747412106679696055298814300614513661600544039166554398548785771944233727265781414899110258870106277094923042460709047677122331805345608634843554102871371939362771130643332944065664751524937870301121933464463246140428792009737393899405409293013771077653754980109244592589837015805450647805669046754032";}i:4;a:2:{s:1:"p";s:617:"30717950753282822134060274292481360551691413121828212175823741839241549781801345288079837278336315658072275041792278917609278903215044319053321254942912283926424925303165388602101369690100151597114979236011549040048767798924665432539893102285148132138243288344387551553735318445920954909506524809009977259661816549852869076545111065438920376549122286806153480198930510896590461984138938291299620745126683744010164416765756555097048566964051391776874919866198779721078725961148626312942109765123843522548437856492683402243565586864304705385604772276167357697786949526357219442530907854345605378292997710443788101928509";s:1:"g";s:617:"10664565789660490202298837070717675886736269910227069585599819283749390051779567448569637299937235265670862351367215197727816605187136471289814225238589787798288892630743957045107552613020882669254784592049108026598927346597271935204885557927508364640631111649815601503280096710752780360644355184069964880671356047707747432831698299934227246554005301084080880453975468135327329091037112567370668621377232969391777852701506421877424723612998254707022420880929038255877994522028632025963236345524733702080124131982159125526983451439267827560813655547710499889559501382446978742844869796195915570043693514343922418952540";}i:5;a:2:{s:1:"p";s:617:"17824540401688806758789771896071225083587012319363998191617936849653181551389106695047499662667967291625581739247113239792813655844528068687604946381553759091614945221410205365009632299490330030743034592873488196530343761271503174068102203374839746210075299309889318599726887738428054051601011972157572579321140979949387997453722974702415785332940537370596257985385177683159554405404123424672225807041157719414211000240941151112149989476447852776665859451162933640847402800234226474660637032612891723759060756931730283712399193482935639272951418485408140391847864492821971660080653487293932836946944136521465404250497";s:1:"g";s:617:"16270475540244008116184585752778689991248014144157341857630851928118586042015777493384925564647551896410840985215558245916363762734559266526213847217597869257247057011178185341066439942025102868024300290055851586251224372269673506910096840729969115630538026953603715119989120184962065253802795940639181332522689973724641004788079105051116542692460473554873410716389242666154728393218313118118406398989884581832628532396195574914320097464158289655615576483587557151914583877087002898507007877917751525353738520926876932264221223270925546352675517006263788102948929514039399067600275172739530270181974973828950452821163";}i:6;a:2:{s:1:"p";s:617:"26296541223964919760168059530334570885931534159346927274646606919982025952484337186039418912581476534463653561216509719479381053176684855749980449821690634103712306845089639450245895681254698231346381048999674311066168967221836809132774033058479473511929613700963171492882041969658471628084862296614689763559416767420597105445926395306014712602368798792070456787547357402852952716350973192781222867061265663188204551121616232196786533549406074301166048247937522415623504126765142089891926736558098921482439332224715081568035947703433373054349275731306378072487032600877157066181584066648043385348780258366341381039503";s:1:"g";s:617:"20245064513421081672907499417270373165374993596361839579769428949180631359713525104278983408046767381549351368804724075603972313718652589273580418726681940935429978945328837517669894683202567520983954981482700658614407104539781496091529019707970808126673481202951901341090515405122549648668564031419070573673075692741103463991210517062086632857878380093746773630605663125442075610285516428487568040493243899961471715606477290256637803334729918901038097438118954412644360440903940454111104955970051371388583374743634476943068102699066226605163496367446957915588429891698437584852521630657930214723677944070438116045469";}i:7;a:2:{s:1:"p";s:617:"24022994888213612729867097153159489863796760878636990746219660205649898621390642573759009418891804310813653013832818801183450912563726218725349021897580704338568278000019615459132633821605975626413805907014019193876676494728190737866777588109580505401823207283091078285105989405265851649576741649994378038616418347053183638209158265693304947428873206654237011507823308167792632150344918598864834554245939189283437720190979383402835863441249830065088109408522132789686163566158101743287893869880671902412445418124423229540545176428391408627743403931489063787699934557486715229490493258244148224520887812506822249429539";s:1:"g";s:617:"15678480265412800733944492186437037182707529884326735097121447410399826968420553856830859651354914793482794886843456562720138670995286947463967042610750193460296792282058991180863764589693616599436896718205171675944873415284970267586420972091500234700259041314722311096697012899487002459357488089950393843625900001981078241171710748533509781217310128183350756575104004773859267324503648554413357662859641282012089994022788874891032192582004035250870868552993001550637269383026801304603350993608652909153403397051874534815752300653963021337866508400173775688584459109409363861081393338196432750140305711090376705911521";}i:8;a:2:{s:1:"p";s:617:"17083955432364090280533366102746720945982105621761336600070465958323396972881469403519543155239819620859194370028989288057523170198820482837073270689355245228512567098603210383977491443914341618615645725451024486051612004217893492714245981039604396229635631751833639174614993002993629374228068268504356303017948571496867771413891972482336248648581356279979915549622011422496674683139397429048285638804862404243827650990125026074135379573526469868687788484267220583145333135102887002688284926311346027425969194262182288607685222886823791242675124535943766023129987374186943906004265733055482162823032404897008638709489";s:1:"g";s:617:"12261234691674641709407438861728481101674950650359345083238884715719434368649199286826020022876464290948119474546308321123254175100004821757208768631686271471283892085404640045175987297679723014286459620532482282374024512847784380353023734692492663279003858305861949005817377728600448722524457618798241008130944601573891808345338306588166841117840949087313506761214152652649864023892781683429143355875872143036089635390231181686164167199603978001780011953093051148910850001653642083816866537367199013814853150666286608827942041850714980974747352884836972297673635076130465096348662086839526317882823690060833316121518";}i:9;a:2:{s:1:"p";s:617:"25204476138284467855670453742205091544206927935811391970379875845925341542816814592972482175517776292877803060312282683057673887280171863404039620181938052133263739488514572047094655954023089583401121552716825102824245089603523869015914976008594784258015509292801626580908040067127059423251656372753685608747171457530204828520955350885774522412118938249637383726640228002691450698618877022629430660597324647064876949362319041249591609232234716766223276932543328705703598431803088575036192723955330976791603168213443104658956110289005145211221506492748124722595764125541652261925897188877632144503729500847899162487293";s:1:"g";s:617:"24470380828092171830607640675307269842934271351057990119472060393765189808175375460336691328427923943061209748614966054260866042030491028094628330791617270491451679586070624647214669151124663462616816618278458332102224612471875661847572035426271967106152871750183790750472633379980457073939646744071844097027505130835932272606999975749253911402372736522468536931939555983440411944997387444842287619087631352802755805134214227572364500740868338334180446779244274684101127564951437506337872796885243225511197939032115243566176064416399644452111639287953151152283661969561179612761064215331184337200817410228013012815215";}i:10;a:2:{s:1:"p";s:617:"22849460047804632398448747334192571885220871329972534210954947581951666060547985334167486681856357757460114635134954573658082358845539735278580423082123931373208796139732802045985276620997127798853678505071244613000934377737859392412691661273736740375485316991267484188256664287312744138816442964815805473226385201474782318459805435125108038706696302574616946459702959134346029698514766348904241077025385404804431202010332555268586051143130818532183288892073337677669462830398135627462917042631034659974404647502885769859349150518263217937151139653745940505432896722087326115128679012867920678944411418261860631429193";s:1:"g";s:617:"13348138446721657089630012558844652910382267316024344211317185221773269246392374758072029526288163619976687471148401063666650529131734387772547277912767019892091405085546024081290166317121965135731523404800558013020137490216776128824652409837770063691312561489888304473140055749560988718836503040853002145255793919808930722368419221663001775239907136704227153865398879262468691524381141127515887196789195504406217373337864420211704031143442387747687436399787007564064433407818094211670914708907567291746261122103561160648080311292253951964886079196911189940359203107056306519670126645661147468673028841078212599422387";}i:11;a:2:{s:1:"p";s:617:"31338823808328910030039189736747412767934749985120979774750656232315188517412996431869533670874523236506095344486318916128738510547271487301629733012645126112498494837873510962613906720395105423345696133501168531267479752944739576745897553250620501347859376611724762320770615408466753235707776687064856460812255814585002695810118730421429331410377462334339309659699186654268542620852088199397227812555782980142369915873664366261623799237710733709363641919324417365535560523680225962259801453373866070142295896144627383558885424151975989188203272862741597698359922271892774527924814448590085332431320643929061731101951";s:1:"g";s:616:"9244265426989189771814939991669243957748740903183842164268478744253017075992473802044696109071297007354420472625602806611080450814213109420239453967309288617745014104035838027804629485250918376876630332625045211500185584005538683904806015146917080419014138452138676952964670289110065893199216408172970617769948958057624438113114785977222898946940751719007529545723841152648078690343209939496342721851948377226748909719230993095239015507357234175387231426890464735514048452739457488549618437769362624641802065425556060699697034837970299896246378714455325609840424540997999174950970499493632310488630948722459761331238";}i:12;a:2:{s:1:"p";s:617:"16720011003255706113542533606567817550154977290327341685222505526573898977078683119417076323927302182238875008774846510300284799199809076765861588224343304072595369156757416312139864889452521559749463663197267698729151348390397049479376093343572901918439800962638271229803825595288317054627390900627955191106470683028331619882250925001777457287598880159325943026403028710302505474738862997006103128487776056340534495054468394659034381740575225073994349667872488974021301049946013876074350344727733532691108462203697035662350166633970402791313885464164756357492157962521289407696476321940071562093155602895661489660727";s:1:"g";s:616:"8392549857641312164454309373940435723590421663279978069555127083582677257780262498752161403608771364645564865559596200803263820963402481442852937071497875582873453734524770401215851485463814913260581874888729922114937703348851445066316990994716597429391207315680448738459977536648358752488744579272567717490797318379401666836389388815269231571648020465125802739997512741984174379317449696467694331951860453172686792834397700517360054637428943005447586488819050418799440935988665824222808271742893820938468194415642476156380577849705310979308145356389925732064483915429084436934935530619828894853018765861416844776438";}i:13;a:2:{s:1:"p";s:617:"18875760971083209961885190059598721536385876257385725374837530129382586086243382935243973016095834416470415049985931441352969506342859331487451321440644185970762508184028359569305280339801922408612236736096586209436455066098437157049757171836542290377568267264629176969075668301397417797762391880806604540802358357273422189043950195254062471915353959389101213594915524766080852049810468225847178041179462795804709284087874701166025765058651052595190693164918437491064045608634977527209186371829864710057268355405434016180724414588828894423442390301185665478042155226826512674948772583334977420644109748745496717956161";s:1:"g";s:616:"7831956897688961168585556861828822320686818447121831468325331650719661818670456229905256692890429862578945073402841774396892137360518705835947989741723445501270103038310934960720438693310516616091846310929399159391021583737179951182014058853520535002225341000259003057782221326379046777635654033845038695143831406214163177624050429118303678368949300283954340675165271848269749284009942183037928288215934744269230891498878411296154350712230783593506210329194220505403024776317988240018183929230323644668404305143872615370553030474103851064003677655379017189993119048579440984740754303375459978660957509505078490657995";}i:14;a:2:{s:1:"p";s:617:"28395820039579334836161387898649960674439247233622326211768280334782373271489931817979170890916055413302754245705557686741053065719308409823785829762995052524756698071971324411047312398267937917755702206261019714309083266666414013819615504480631886547648812227018792688441405307391232086908175633468071220469138604413592100312699652255608890441454528772318259437737566237789142089147587149245666808919002145823882578568437856570025104248895416549110129209195950707772095941939502533593689204857946981366537873479013251033128358611814923150665511824175891786378056975816035141738553582850943558631898695157518195312479";s:1:"g";s:617:"16427696982631268353903581225487755231705825946830980554789105372858716026038249111748904084081293969196895304847211869328781733531414281143425893004105097751232768970984365526090081727509403174570678697235610442079339105174193043899078868617483572838448847050555823164133758660962030044720163750716900891345546349794702104874846983027182159351657363294959859277476894577221808034066234414030408976510603071601513517363788768298684299375453231513250932016545163534328516215349904742837283723209984958135686659791911743400514495756511965490801110027623968106155034268853690378943253875810016843764682678137792177387441";}i:15;a:2:{s:1:"p";s:617:"16895876560966846422580484060632250344028279991597239700516020270083505598828800684402957155723638097932477009949561754503437018270655438745051104890013072510900387354248033926081481144447977165881754984892587524293467054670099323627271126243617375076230412683004370870720615709833281491587978704142630411596015418966637316097621942031121320633348486629505904113642825954743114590462937823539960421789947873999540484355570332714664178766388598601416594705788731741720803815778148149915425982758373977150668814201314016383576950334588270980042692711517774085697988618241677212947115800722377405490644578427754272325391";s:1:"g";s:617:"12562425989524907011004691194930986388586219858834665734575703272928936583401256775823265404348532608420240136127635564158186788142328847636504871057962904215117688239061667196573670142209844922877950379017542816985916147729138565271594417564432973234862372784752905433168074513343092968302846347041479914197331038856875369435991929275281451056919524358717865600391488606051625691960488484376362242765534345818340338768105915246819027304718641846705039474566934921726821449830829026173348866560596158471286618187646399500911928214808061786090706638481164230762304017836419687357912810324817426437138236086098747016365";}i:16;a:2:{s:1:"p";s:617:"23592516043230669381503209490463912141922639479894331542046867222724097666751148038610606011023871126488378139347032265001525086624363691819566899874833940140774643220129869846896515297232189140046162539824550174277368181841675294015687041610499572801215455220349891926229111228496773169280096432503725426296044037202286060887783039639522594117165502962065742480408868757768838322362817278441563946363935999706919254014616515903798417454432404825037513060873405178641053793336989996203721941343359406537926727709530631693065497367776349495501129472988620241004182664916330461587088288889551735860187055513147589776493";s:1:"g";s:617:"17357673844145177985350497915290742733468722287987801951177917367151312063340417933200596968143253358846521516037627485604196935838705991263693782128577977709815774507145803116356994495454865663246386089298609158258807885879398788921730122192063919930212770027132626149464443611825908303647374448825352684868098359426367908573139014507718513977629877766985377237524984172786250947660639174591036609831051955804915387372318428626310296812710753916023514838653465725580626928490042758170754692218386311983461067928388581645238515980737145748441346604551781747077785610383458653905239486828967469096880969795814241762575";}i:17;a:2:{s:1:"p";s:617:"21562752817967258993738108906070579852039284843199885400956208534323430625671418204128340587893746628147431644603790908199613136574754933913669343614603320177523451846097320277092600327653947194375390514003381380358695023465638052714820184091922966583876523596682349437357201109301308068214108864523456588480732651538356551882147183933343705677706433918043334160712384815884738870777020254836544550884904493519865517553323545274678672504574933053194683269178875640249625236659968381130308537583795589786484046391067710957489457666862306475754083459177269427077232481488264522791483632575447236274170676788449453054921";s:1:"g";s:617:"13279794357248225509268913538229148538165475069688936294580710760692619281482036517026872782539307727254420990210098545082069190602873006562154189669783694568358461408837175649218652220054674691087268179615232683465153579526387421315074008948599907085908216891149444162354267958924947208835973759341257881529439709224745462220138240933234290694196662053395846738948018071824632382236962943562507267190805674962625665753157699500275526405757056345749165899750806752377097857904380121265291644313347878017446362553944043862600781821033710406992613690878474651267128632826192153111804588684259077012631873975836172554671";}i:18;a:2:{s:1:"p";s:617:"23417496789833357562672978663019776511350475549993441033999842954607242935212201031177981126608192726681624256142944646964904043397803054432307081104126067134609549096882870571668507906471183209340875647777583501325231659669003773894230363951801663030831715910008600763835254655919490884334756073413369232416903958581403112233968734299630803767064369833523088084720247752560471992092988134943153629918414448683818715382811469577322425419540944846275781757188812631747645756254548348427432379275629846811194041724729581004054697881971598136398819432205891530514514726611596081712980455525677515953671132309404250071199";s:1:"g";s:617:"20801071262499851595618900578716319162176934003597174772636998352276398183882683316341580810228964692272006726151949111073090755703941623831598136461709241110761094009335679988218697376766403851957621931308873298652901263458555140525167016139424806902200273871261469449585864822112230671772272721833668808110440729098213448660334235171526815362020901986446409677613239293176635891891319223839386130383508566659068285370921370541204738605732883427996902307444317957800998331868014970214411060587106746040466748722317070439516836852348646076122345442869711806916396726025974030365623397644963075893322652883715123188707";}i:19;a:2:{s:1:"p";s:617:"26655296424058595179986310167103331472267584754721747665583558010617583798047063548558461532129138907195342606110500349726687564826777141466985678647752168685567480284858181931720530105350597193647594741653262467426123591472855807433972434979985325772504767253260906629707641042348493651989852298534933743195004975569908108431911918638926288237978982598438700759037925271408599142662922835078178738643272649728478247566871859792919842613041352050717122901728364945875378901071105043291927088234618466029720808811991185259823221295116563650637764805660046730198012519725055260313657762658163200991646911578427368876981";s:1:"g";s:616:"3450823033011284474361537763550411076975443192933065649612167536169211540041636498142282627876628156505178333636935643072260250740502145734190044105686943952320477597940678735631410435736451636301010458696341853562923909108829395191132711128551212911250649213549680593026315051719575199856616040525994791083856219112881366064925789959328272385929709200935493143170907071110731944588385661252268822128197419702714537239233622482980084952685844765339934318859731546823250794044127845644768022363051861287357902125164259399180047661173479655586363283681496036348778999849460527637675466013111833098388040937586686177315";}}
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/phpRPC/dhparams/256.dhp b/ThinkPHP/Library/Vendor/phpRPC/dhparams/256.dhp
new file mode 100644
index 0000000..f03b53c
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/dhparams/256.dhp
@@ -0,0 +1 @@
+a:50:{i:0;a:2:{s:1:"p";s:77:"73832814678298170902979872884647941029284901545874925549746124366827544612339";s:1:"g";s:77:"51476058807219506610998206277345283936107915931731587440850063953203701691435";}i:1;a:2:{s:1:"p";s:77:"76972593405890136659846148581539967395400916262754679122033512090683295261283";s:1:"g";s:77:"40536177953614732865121461574338976193053929823454386769938537329223229736419";}i:2;a:2:{s:1:"p";s:77:"90678222772517737182669060100267690524517282587753173849354776070207136203987";s:1:"g";s:77:"51295217023324020085270197655410071441653549099982249142115152656556847133535";}i:3;a:2:{s:1:"p";s:78:"112035122549801288782735656181280913656716016217876691011809129186010432958739";s:1:"g";s:77:"54371647042380146023378995284862875333915973077834564744526683766342076225283";}i:4;a:2:{s:1:"p";s:77:"62194158582069859477188305359117210570164466813769290906395340312924423091867";s:1:"g";s:77:"45661079503690430027932894824979383218303184398768700725140595279401162955627";}i:5;a:2:{s:1:"p";s:78:"109887746949716562289488448980116120835960943658798588241040366306248937186427";s:1:"g";s:77:"40672948438740970862493667894582355273445817592820961034026786923017405088605";}i:6;a:2:{s:1:"p";s:77:"82856294712020982243609092866618447605083422559355627663514629271554457332707";s:1:"g";s:77:"34416040662169956671456751385517722858193479998165430251652844004160138167335";}i:7;a:2:{s:1:"p";s:77:"91504228250396371847303553559751396185779666715439286732407466045990416051879";s:1:"g";s:77:"39857698433618226727810093242453642286951247805632328011233975273133854259843";}i:8;a:2:{s:1:"p";s:77:"78914515436533736321800021501068621041000513624431796114155043029970882928863";s:1:"g";s:77:"37699575057133597258692445612773858685876622718395748221455772617196222142535";}i:9;a:2:{s:1:"p";s:77:"99887264459001756020085033457071600892669533881405206061916150024685965253607";s:1:"g";s:77:"38578248010462555085958074389688939528012418780656386569766828292349114252043";}i:10;a:2:{s:1:"p";s:77:"71982351514272312570866502020135229955879457662805899747226636086639670593607";s:1:"g";s:77:"54577099835257042103340960450024007160493073561557576008109301120391117266123";}i:11;a:2:{s:1:"p";s:78:"111348005627100700173841228663272359096490475124040160395478639652684669000219";s:1:"g";s:77:"31457852095708016675951983917720277445060540653267088126635758197134362138891";}i:12;a:2:{s:1:"p";s:77:"92953401211845673182089220656569865148723807400500147073569037899535512033323";s:1:"g";s:77:"41697366699394586852286014598140272134473146487972754852099109223623378584697";}i:13;a:2:{s:1:"p";s:78:"115301894620266352952032164020027501572840286962376521701145557816371554998767";s:1:"g";s:77:"32871160431857151288198737173860718706139469895659824990992316603505757759857";}i:14;a:2:{s:1:"p";s:77:"96343471923498879084781358157613313091411861663579598008154784412360514421723";s:1:"g";s:77:"55471240482349354180574404954922529811817125590976473056110888054444317488871";}i:15;a:2:{s:1:"p";s:77:"60729504492067278584961924278016428606161139264005501826188762335152973539579";s:1:"g";s:77:"56444400025969977990713140047023590088408912184719130874280347851728019320481";}i:16;a:2:{s:1:"p";s:78:"113900325385355187838261275529566875388679911394853338488557608315621335675047";s:1:"g";s:77:"30375972193127924942262888540925064582100876646765197303659879193919125525653";}i:17;a:2:{s:1:"p";s:77:"81095496549283199450987632777601843345505533571552820491363946821274768596407";s:1:"g";s:77:"51869176606892317236374313168422430251338346091156761852451813909920509557627";}i:18;a:2:{s:1:"p";s:78:"101594484068704391452871318220948198964937558656012060633086457558349057524139";s:1:"g";s:77:"36521940857765148936706502186673044141636067645496695747248640910066892220227";}i:19;a:2:{s:1:"p";s:78:"113344409968890085710229548598885666582507318886231068563168211690913303412443";s:1:"g";s:77:"32565192853647007661066738760059232931455020519838477513190586740622229447869";}i:20;a:2:{s:1:"p";s:78:"100865157741942714006835672578320572215808688934162933948109189253969530975559";s:1:"g";s:77:"31353399506013880294099022097074882435311645322088758615920268562945159134875";}i:21;a:2:{s:1:"p";s:77:"58987748040478408081756831145947205673749409643180447005095787056716058221367";s:1:"g";s:77:"54681552249621678212318335368320692079388532771163109014194315264322059702023";}i:22;a:2:{s:1:"p";s:77:"66835016684038007440000941566894284049036931784409949699003105152793759605219";s:1:"g";s:77:"50881796590678410195198715025013574158095573900962476288005944437157669965905";}i:23;a:2:{s:1:"p";s:77:"68569773570402015506975522611411067971033537591125717654141616891912891462379";s:1:"g";s:77:"32084061487875388589170475560472261801957843058408561030464427927344624397317";}i:24;a:2:{s:1:"p";s:77:"89041088472716011536983496934725702392491528482708037595583928300741866320783";s:1:"g";s:77:"38064663462733312563721773041650262730115051360751432386782313487662169550555";}i:25;a:2:{s:1:"p";s:77:"63506885046592167433260234006962661577294376048832300254801217057060187778567";s:1:"g";s:77:"49889663046133352178991367103241000151089916129350960530695272841039003186923";}i:26;a:2:{s:1:"p";s:78:"112849893518043495404513869737282700616865089034331683427155137156329228907867";s:1:"g";s:77:"51198963761086864384430773699594339100576142234411897622813713340298644162715";}i:27;a:2:{s:1:"p";s:77:"81379543081685837790443157894616584141037060815155365981883579985363608950463";s:1:"g";s:77:"42614776409195525157609422485492905089299192373448738791332101819922775909431";}i:28;a:2:{s:1:"p";s:77:"73245936509718941037107456038166801410799170427973092989082747001086626266419";s:1:"g";s:77:"50625914415280232833987886929254839755338573972368676118496496226311022209679";}i:29;a:2:{s:1:"p";s:78:"113777768884465651623652520617441431650397695440681571689213021935525307889207";s:1:"g";s:77:"53230261964441050208664489018248680823016821086100228556881376058274887677429";}i:30;a:2:{s:1:"p";s:77:"64182686965111979612624371637207151576388157490672453099264795411237003991127";s:1:"g";s:77:"42739113605751145415527077990412533655324276070946090181609734493453094017981";}i:31;a:2:{s:1:"p";s:77:"64389758512247996595870401541350246623588091081581706581580796562736474659979";s:1:"g";s:77:"35027570949311106951646776724538831430146702160360275048978033699268366887959";}i:32;a:2:{s:1:"p";s:77:"80171209426362772759848178439308899617715023764855386038084235620615003353847";s:1:"g";s:77:"43695422597465267267136734648314440541023062173689900067656462758471318476127";}i:33;a:2:{s:1:"p";s:77:"78661796419493527928157412810459909523754144396497390147701511341329482510003";s:1:"g";s:77:"49752898964251876428709802877726537855856916332152631351710777602902687301333";}i:34;a:2:{s:1:"p";s:78:"115526308257340400930726289164227427500977970696409840065400171497064778851303";s:1:"g";s:77:"57455831142226363977301804360103763384570180363822590025633870121824156777509";}i:35;a:2:{s:1:"p";s:77:"99895854914975530338182226257990200078997854990974668036162249218262310892223";s:1:"g";s:77:"35234291282377508941734996504627025488242912267279150273638077828536817312337";}i:36;a:2:{s:1:"p";s:77:"89463065045661035231551266606118011957564752892942638731336758478484586730727";s:1:"g";s:77:"34476840145197409328284674202809241607868307470606051731302010755191365289489";}i:37;a:2:{s:1:"p";s:77:"64624582433843940196782532037106474516282625858188798258052359753710163749987";s:1:"g";s:77:"51907637552590521292421620324219346043776599340727611728777487195410015119421";}i:38;a:2:{s:1:"p";s:77:"78551241184092016983148992408241606401944659592242270145850487925990724687479";s:1:"g";s:77:"46347657232133823282496986294357257279901578280128017968110374222063339245955";}i:39;a:2:{s:1:"p";s:78:"110454815842135026622014358618557565054874733818955200746804642117317104098319";s:1:"g";s:77:"36484417303211228180239343081660681048447119211446094732347020240865174121193";}i:40;a:2:{s:1:"p";s:78:"108632820637647054517954687133925163880485688322613052629730339391168797942159";s:1:"g";s:77:"40936112635569071530887793547822555014118053761125242378490069684895929829529";}i:41;a:2:{s:1:"p";s:77:"77384308083436791525512502830035429654641530154237012658177043914982366384567";s:1:"g";s:77:"55266239559717320485762938784631604896441023536093197675797124339337266057181";}i:42;a:2:{s:1:"p";s:77:"91486076718429369045114077207029983275174180496205286263890757368244392884903";s:1:"g";s:77:"48796657615906031864159766245092760843396983449401480155814650683131578645867";}i:43;a:2:{s:1:"p";s:77:"72102224509363634446570802115759927713162729477388965613331493695110367533179";s:1:"g";s:77:"41338353646772388776408143300172508262741803968432848378357177766068794408805";}i:44;a:2:{s:1:"p";s:77:"94893543718943583226837269269711919605950724153318813366438966165684305916159";s:1:"g";s:77:"38199282927838495009291933322760804607026986374974299862170665602978303904209";}i:45;a:2:{s:1:"p";s:77:"80059845045249334967430326313246226499113423192254298079034172260496369580447";s:1:"g";s:77:"45202772573555806321013920339438762194895562399493007564473327311269546531823";}i:46;a:2:{s:1:"p";s:77:"64583990953768472760679459616315123765296280162588354436500849819674609757387";s:1:"g";s:77:"44955507918033524308531963911022162716703307186357435333598757289790265527719";}i:47;a:2:{s:1:"p";s:77:"83254860662706746455845571422799438616170338867584794032169432243745310866483";s:1:"g";s:77:"45685643686930303771863160720615786661752116869179660967345997698324429835601";}i:48;a:2:{s:1:"p";s:78:"111129822697130897903264343602791707637087284640784825057418415411648814509787";s:1:"g";s:77:"33126138893831271012720592684933302917306863243253992047196592803506800432571";}i:49;a:2:{s:1:"p";s:78:"112628096381776405952312106536719522382375429360429462017871313236853832958303";s:1:"g";s:77:"51091975906557044918432083900571651694499066453285507781185412784968687363375";}}
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/phpRPC/dhparams/3072.dhp b/ThinkPHP/Library/Vendor/phpRPC/dhparams/3072.dhp
new file mode 100644
index 0000000..424a881
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/dhparams/3072.dhp
@@ -0,0 +1 @@
+a:15:{i:0;a:2:{s:1:"p";s:925:"4315132667335984456963558712492060257344696532540937013667412533700786332247247258786444946331529425538693841794686692621963051684018984641660725584842468599352742337722223201982634595644711492725368912027507353121978199347820593108558415379514513595105258771165222489083806690898826212723823447178708312310015373887298513452146950026717495376030244091940242203446809569885630514161505356898334636153936070047367220821769019996145996674921856277925251065184565233969540332955418598061766148428574177493374340178989369402930754868614979883166971458256934371493708837542870985695478010233708013626835966959313713197362623356634272123467707869487094589087968990428445989462460406369348689022330895916889128558466106229221162192180749978628677142243021374310742307679557586483044238163020079196922979237255175192476288945150100440813256326420527963791569079099711040208151967784056080661234151722826312967586919459049069544595121";s:1:"g";s:925:"2350119018539224581317183252415847335247362909293949583819480136047741271969210563596649306799079103843283712608283697540038743924120135958735013054518494349752063516955891717508379841175911890322417721338576512047885798171488037467431031588786174344182791056606242306674694663506097118828767635753167597448122585958034103275031127729578917036246768917035692891012572814906540367640104398319921957224941616190939982690849656828763901639933734397922127816773424555700200021019174059057777026847966427467057235198647389332182881908470536626080808572135189622957429698028030428044157396315681162976893222692006884962413038607537527910664266091051241366061457243810458757721091006903760284025909160005959237519051794063104050293099371887370635729203845201869557256890658540204361928706031866241870843244741068763076973016656112599802181801697016020371090086607874674384529955316111291655883982681716521633771282897455399026015616";}i:1;a:2:{s:1:"p";s:925:"3661665842190298063828176732846293640919222353827795349002605449065557880062145536666215271148836094458623660611328032195792228919690193380500724986215448719904848955793022993600439169495143330203461054069338359490025694157088096493504605335762051029513597551864863947693713477128581978728520431114298665949113705627108090586184073139382258224813404010706205790642551006296863042075254071665147777776707740858091301988442189198081921256690114717697424548845597164325066843431117108985133946191000161228877154348382442536080406753876146079547573447857543506316262040659783540306099921979385195412728403628469824785302447054055747600216083577156808284736341326726682474972377807552581603315824036960973343372464052392517539250145685441328689733886997264420951036267016242264588569127122203684662610471625628303236191647272486039447610039980545441951351603094273112696986635159781389581049218077713772074296953986550297559008921";s:1:"g";s:925:"2330013033015140718105580780000814417623950544622555681637035317524295725985949517727962022017580560547563293597480791009886152631504784946677322944135615155582592846014602079733324813222482088145642952216221395168852932599656493754737300222260887305133391964292346610726404829045255391259296098591725039219968328706584519797363720774340423627001446486074699770450134070947337857854387198789919314090619138465361996989373011459061160925315340539701819845358607233491365039690895811239620227497070217116286298965147073584201527403505009593615264975257954666738146127058521902348882467540296125841019084888051918146042420278637339312514698888677245842128922453684441718030263138973029024870038115729105821493725577229509289318197508146609933674599620814192772205023194161979027879633561410655349209310980358414894722460169598481382405650803898146510326139881914420114730680235864699472699337179513801157570860074154514000403217";}i:2;a:2:{s:1:"p";s:925:"4620590045169368554532593574486202350245249389315730607028389240974807061808989952188740674157236839851469650650497483374139797687030615339039402226480050369784359208554913778269157347633279686389091589520171218211153475774540415272645552458706556134264327307561935711474110720994428353060180736512077595956321907309914463979874348215571655054910359837251879109577142329727462223158307264068910944642564267328731048817042467565187797605740572389597584518183277729416430429630091936961437746628672624310534088245570212333926703546043476499624595458682817300820597092118377346583224950405123201291176579571288281289104180962553921641572678604773303321625513910966201143598343781696119013034400887449687812871458717959883805006700972858977252426902453658446267639459438200247621387492006492376809433765553636040874894552140340528827784386517413645617181947670553072125045523316044242271231323303187364368484947845489395421734929";s:1:"g";s:925:"4366118718728026129585368339757372747812283277679825792704429091458791780869289357307128615576667018996813659099222894673691023756762981972867802440998213988459504727363294037678614751628490500713830852051760642762831242205244282977478949802790510566492875314319012587861033111945258477032234584165020634787063563060226904559488259306239403942858014394292642228798899319433517328106045603152714304240613974941203373109764879019335121960200008382571226974231358956539289857770194403260628288818158346951295856345578190002005441993276348035896883906778534112627726343274478915237297608006692168477579982259987288186346003808143068013463951511936961124877635383555597808864932642690164727423911499878793170724403696380993997906824723746511442380237096215284266757159081815684624425650789580133463950720950707773341517945032379999366468344661073766262067221609371947035046592874149724312790523190033822151871604750768215833346301";}i:3;a:2:{s:1:"p";s:925:"2938996187439733278190929622522349944345060330946373463011322239057071445903273028665349335001895437955186644060767951101216675384067312297743697834773338556625400217742556174036456199954355031134394408805378315265066615370777047296269669781228365702751437327044218920674379042960278113164522885597710245635397480146223856309389521917307236756459113545853621634950936911142251242228542261800588746461446890339913379337949235490176799076102212171841211590921810552092147568351052877446522006565330079402644310865663450779556049843233202465628767590866799950861383808769840495381903661354708277489471381562306610182683334111925952147645515746482205266484657014142278865721433985338001729049063402403614948416123352207951387320155475974153744398545712952250022395899483389410938264851959185383988391347681515064735631000919755110370081239209119611210717600091760641914294069945948628410388786450298574688846037117458099372003627";s:1:"g";s:925:"2188180360592475474255511510558254820951280142973747406967025596302429430733726484610414308155762329822727719986011952045080143567144989598532990383934540349664426078338531224748892840652053289950123010405619591397905078626903456138814817195006903802298782223061589795938940654403773897504364770149759015558282613426827768639469348445280997717425425821254531982205265979720559293842189517050726819531061697207390209500076548816157640005607651402255706562491859135623242147151448088299859950249040363472544692449982136960186451329556524342413573462314348428383404582280827585580746192926542393278725777224013196865983526484755349857827193710465770127820637602199711325838042273973465637657021369104329753017416777442203610305126338263203859718497497033721924008342606583384236874030750708458957210268975685066365072240616441632985559271286231364010642310503874912295276279464065613912114646430165631609556704960606196917356495";}i:4;a:2:{s:1:"p";s:925:"3204962240800723816455471772500630089000997534792113265087913534933976812754741314152333161722136535323947418298993649955012010494800707515359305183271567204804336793561943241504957646985792902563473357563351154295683729740121421751902177385001324509438971655716930862114523297055235704266831648792801588667356727807779911488187335905720474875954132537802816473672247617675497279606357395091411459187790088423865644531157986398649668993393419306383003614731055174134147265802542990950181076842959362090886536566361672744257109196212197301596711897255025124713698133763282484725224264158953521633609828865037504253513222648530444623441214553533356064814153695805473899049725283546166491312381083067579387836842892134578905238980750575603676463825053338003879697106285582414982603208225997483259925008443212949824045922036211598364431099546267769245715271619696571301564489744087831121278703474351166052668283302487804660723399";s:1:"g";s:925:"2478210824019551512320915125791813539617224957203021574806979249207018870886399224961077393046503339639638016501910140228410535010543227950645082702730670128355633599633043853389737970884200828312283306402427477457013888098152394453630875646221684016198476297387503877720665978254224708974837278936309165678785757023904855038581289350871058547109434639163447822004571482221163644264512696822041373244545734333000574397644794101152145506432007404691930795867589553966229970199464105294872145069453531632860004871327511300984654195341632795521954496300167312104321888325452986799014818028629496909381762367856301721729884500546156599040930590095260641171169582643120839660452666595703196302210006721682874519760535561899529892956153506747158975716774130631381604630449687840599933523401758295813794558297239292235091793389815370710029502740492588285871904916835615638686399306444319652719565021842372271724191724564878652899605";}i:5;a:2:{s:1:"p";s:925:"3858495699596293898688375773110502441666969420477863823398805799498715509641562514051656731242905221702517081547027427844096728462563747228147262855326430782781133768087051811345578632161234632529176390004908409005592450781741043991144437364416255263991536844100492335985214082240310081219687923906385177494626411448945508588432558284500479260995206412930429039508366816784869690714512146751344758083063138616759346381314079908598351217466487073343070055106516938750299547561712449231665818370557327336756144407998326862734127162566508972390201780064268781728836864341723391269404459991801391241300508727898273827505495076344038735675175327462642474409362152783304320466458748710388940666897294271020065195620828010332760249112589154219333978627293681202156105282137065180043669859728816043574692794562625562528990196961932065149331559939634377062532299875002483921931262911101879746604320555198841530133860397746299378909171";s:1:"g";s:925:"2886770992828075697537865453212345955877233763458923987749867122711936037323569999431920041463158985162167680556614923476438031572260453739278044543413267437317254963067126570493942182096870591545209873122677040821918637446656321776278694479543818356320243755830549186685055812353557718440720576848387587878449845543328582856033075009617490657544568050050627565735736537270305317220182851115960039436216682573899064906440041083076258169673094384007249539021638076358510803567039584750818577942782544780707619050944193479637205469754870583309276257546564407814918646615385884198525006539391582468689218016193841581859343402584321850321179203289140890633308745187336976456718386359814499595610986638615944560401277989413598915531901666808033711396337479563958570717739601600436466348932010006348163460342190614134424271117916987578687455994528258348706062007249333872007231347444454900634426076055451830224745288581360845627478";}i:6;a:2:{s:1:"p";s:925:"5130943436634738151705983389375848779869639921630081642526416959069902317114236046229660665455811266490019114464604946115159213191020031168168934260240370208638654661224411266801294059930023003906358110167332559834781729140290434226060866720241002885723300338170136670588251919750642109993266694093638580072006610971738091420452065294660969649783031963891317158100456532483035292435217535729908840133045505215372042519294173893500103351214593883943376369844040124039643965754086308458900341243079112441910048778603970492763910684557407948355396339668534357389653826573386393829228181277223985599852219898165629315031588362818823320107829227064897785017442539383052775003927202548433739462447033947909704568378992953469486988508785729088846061201035920027461970780780005619342436344516177296666848839057209008013560985064308437927467930182007480635819670195139144192726361522119994919747844325562336361309373139438239770340527";s:1:"g";s:924:"260934354532320981603346232635496122387716858013756396769540150915775328937528977396744326608481588479441907495821544047901506468212289539823406565234667220744710916377135092907432145546725586575114564276697681144703692013998160742003993464829802606364074051703138197052383691108529469174089994578471577368442017913387128969303763416195571202078647334505305658123832338834320953526264258001677880912206470170147306962815949002226615725629876836187127422017883188599155347419412766452003248835237735383926323738507826527365200159082942467837860566008919490947094664770207577205258215568849415857873018813254495827577038620419781260925766984307393735044861803885064315173715497646285752656365376330908367814242240442396593775595814974738181268072163021064089047877008188717956674409081793607850233146167883025620608270429316190958126029128628146623463833608957824959491480916435770824635224049032746305841209922133966435713575";}i:7;a:2:{s:1:"p";s:925:"3998840508039755798914320501014490629633052238467381119305554316434989486292068483947090716493975560622301669729373235071025195401078218707185420229393875101630399207091215056995992392328139307281469826040928322742255751493207399051987012084305120865669683305722438138119183724588731142858758353815441063774921032770684639251029994539546020279344296398617212421068732532036375421965908920123116181078143585688105962725633632132975138406008174984532184852949383093432062210148181318477580417338770460510155595650601653410411127159435659493085820168746161620985855719309306349364850268313653433450566430609172187269909560999133704305458710444090927702514998592430411602512950950677351211101786937984336899535946914086866004703969257088260831279147313068118927684780067602116963127114169381639014582713965741737756250918519458049220786586497590905817765259053986430610205459529957290191421398536494800885250298043501610812086059";s:1:"g";s:925:"2057658023315995837814244302674473620221265305450883707220933348948320037525210388745649180389426087096994265870161669866990950147659456065103511412373045200462918715811677244100468295446635609971623835314211125623908520420064733901198155337704396419102815759539371784037536019669543759503815444881029800352829496591835802768152878613096427522151951742326629173003090596367204419211777304661019230236712647127510964074174767247775500850831099969972081398582452465813485109958498709530160165023164241692106229959616650039604984445666426834802188289028501595761306529808221137567116017979084922372919440488146672329182636452142505034221383623140884633533656641179188863902408723787496018605874598641384694800760826997534273409829898340972241507784345241343119164153030997554682570323583980126844499905435883099703450893660347945613657017744862281043902594543525498698273068656471269751607765332642113390293039115043238564103012";}i:8;a:2:{s:1:"p";s:925:"3052587646542902635517226086530951609778282038835979836249050671063535821665881064115534194204580934832939396328177556330734842749443237143248792953029921041776669549143453117786515142880425148009081292117059998939563969347201402547392105917250085128493129385727535383102647220914444263467589044844337906239611382825797699113671584199753687591287631042586031195659928551456680508412407670669265264088757923152615347875842767338023502709093266175409535257184444620178546734871467900590765277006865565930758293589914804946915189387085191740529942130147830492793703181070245326162092621723033190789966782425551751916096436898391698804721111476077819753921137870698340323664493890573693833039924707736103693436805757466587652144690484910903191505956908906533026489365552879965712849384865313762910366975745166199472841164150446248515130746369706711873108862393430213900655618183304463659316938365139115981162958182988581222516927";s:1:"g";s:925:"1528970316478521813353997032259747601735191992648561865246322395311799713363100683965723354220895113167576481333105953735058063391855371198236588067407381815001036506237172664629862905959335540447703914728848630930034014414897925940698068311756073899855838490954565219020692805027055726873359828123353015856374380126481052959369002908628607232632399137305471086503099495978391740843530399808236564911758061281813986256460744423707435462682152330795942459476567607367164628721363594929691377187884244564552802877253956518878163768915048398159522668854881683427429061145351151903554349930235654986427715339756801878218559049944808960309764150281309751390601707948395300869715492190359748972888505045582622937580005700313037128036774300920485981598441497630716284566747825244929014090865919371992307502418429354359868713615948277531724520475602562297248371114923521826670568579338836795789101865793989006496968085530346267918952";}i:9;a:2:{s:1:"p";s:925:"5531849879715624114545398644990869738005678685505540581620042935370633299520260313401427768894146216872345400617660584943174470760956880835234467871497601411655568407303235347829600176104883692713487675318046495160134259363627993949633466784575181041587431530962681787466582441133960809822774283217984130286952934282805180703291046761605129877507724814121136198583199545178203257717235268348901238327943885189227904444196292052543399633947624052389642080706804402135633670642032342495348069576043782932720813101062926203420693682305253390383204671688886280531577438389453577025982803872867504594741277557443656199282929180417954184489501788428410224813973812875429988763466872540945881435267196803982267101116870704184342151713958770562162236127406870017210783442933149316190678070324462159427454290303869639001018013226081887979930030978578604010432508341116317743577984812733454143165340372816341180317379877319200301319667";s:1:"g";s:925:"2917203507661957440212871046481478943727282842611244779763790996317687687796653644637232299359266378464863671571808560817232238482565725501100973646925473408457779074219592120515053181961738402943826605763153695887609945228222137505734408414619308585763571774670754039876344991582623796377907891591585728148008903192190841789422084781332813849714793603695928341589810634401241616185097559026709733935153380643027522004141273257092132215475778754534758221475473429898883941849856488515465149480083332210865241632308051267913594510037802419825916838542556176217263933025009075909913259028976931672933709617760701659850089187121050442463220999583880976029754820397051904842386028835760327721598037944871605455638114393194929619554005022189733574969109237418204065654064456677392819888022252866367583881778675828738176280257941491838252446519301369815272120687557955763759094560889666704564956244599447217316300475463318513732796";}i:10;a:2:{s:1:"p";s:925:"3780562069767071462751322994770531351248326639139746208661386875034130015506630130354418097645520065657264914599050724477554706479661847220716768382857055005905302806412621168013005582588626824922052982755725555701387925243647831685319030524024371191569096439197899084877369353216936786922609541760719345429409766670866201565199261221853312704476568218496413509455308603318378296585201025188261985236431551746143598777692007988149131442040972036431906297580587606656327482072932384415225423905971270901365306034795404320749074843351064279683995518828679129623086949200669166019135890040877501907773598692818560350813670479817846008080880279105959456444566616656244687337953491906818279020434273168222187571812479012408132683674329632467563988095817585564356500304964862642571724722567217202489476816879092879112960700569233233874053585011615125908594694514165251341082992440179577254889736354944330288242522604298568218134263";s:1:"g";s:925:"1133287961193943111940342976118103953191957737288544130733159585583521695386538531116451012469637228291577079786129597894401720014158983191228672539807231618254286238108067446684551660646160650174057287185737727852149737778835119754106612692045654868897144051639321003403494071891433447103764027502646743853264024332835367920307722291151158519944255275084346803184632183174584156874227281521959717127362792889493841915783229452311712061737832597541029083298577988701022878289226661362663559803846378086132409935377291038042135005772565193607513077196748107849775169080596426552738120866831206312518873271453348551519887940616728190459956271984259492893170174757364668932703190921245410930261770880416605148022192685817806998238703799851284384393863608999974068468543901987557271301629525606959098052879304707973115293685698041864520817193468017063053778347860274934684964825463007204444869127699425044400604879544466093146713";}i:11;a:2:{s:1:"p";s:925:"3068095411998188584974295316826692234024209804719859764484108486572281679715071972548018617288096813401480545524367104865019364141719603211985383019388112559693792867918673138698433559285788103941407025538360390102089759681221369654397361044046355244026937545760739874039629458690284054831150144185217308188816082422196756222298053288160968786145333347037314844621246589018144013343953044545365352430766116812302013752255034493601043513298413210051345468193554254405709248085595245129593291443750091309171217758403287393835473936600741503786458631805856224113637086263988893632533383451766915290972161134332112947134792182158732064375840274215592185596628615489952577220097912306990091072175658705356067742048210386333029866371918286690399669681268420581708391550751044332001829026704722537807437823148325746846108596888514608080975020725871152050625645593846665828851876972185832543501226148782144492486632994901478570353477";s:1:"g";s:924:"159646077674815541181898471066991220537923963782148392287829832362514240966969525519270080706227499541479736397774272092871694088307637303456504900062713028949632514722351864440063698772176239061729207464996707945061729052663143361100233236046404449925208877350949615956983649392618970848410825873036033300136570007232661091399138793011759863976689419880440899963172456623782321164251274211971525927466329495674836200825606797638605022890014528854855363018329634481021113432968961232928182204812380173656975430286379350298654148640494598755820163775986641678506596595022674979754860369451813519030992570439885496972635686145130069609803924536847652164217943217391745627063861047656164990738165079744545323407641370244403751048259215795551277457068123515482374905320163065825080982452050801388367845963408590818221498979145321370138496712399590229047470037324389568512410801751728974904386709610858450879303893490586965176715";}i:12;a:2:{s:1:"p";s:925:"3367777398549863878345148780352792636611560568521571798049082045574910180885005793793126728459986561469235955566557139518336437368333358883318717635927678803535695555323846136098940080055660899782228359404434364204499739606477885672504384363680596103574952129514920432473116170872538969443310045437643992750804155246600739318381291924919382044092161074120741040663613761033649123287522847647043591147210241686928207042782865374261029266594448565161093433189705423188761808597916029005700389907296602885569165456302470201268341211857068535407463170382217821960728467862059761591092988384122498077996964718801898349667875615762194002904054620568439838282971943978910671633779795730872091204472155035861162792711306166527620004280453286569709407237219146368163001733562186610372433135202274242049506939264129559752737618658036336838247421419934890192209984634346973630788615414331951553807993311827232462663277269893274834815771";s:1:"g";s:924:"282566234821537490920271629731450751791326010830798582697602986370304196814692766945954814860495621040028265936431536156879768298268960424693075179327931900024792860752655474492139099296487961820716320660945382657603902779098216755977959044903615939284313278343537748123737565833900347186254806630856242758854544959974682405386328237045158616666490226285723259258560242438631173878709623850577125771772686579589896392478577404691200860585558677662940672521119454346512864214396333163525262056860462309077414777119126023696154521154184782004242582268895380068841711410787973048412003387723653218024570006248657732179556204944548185385219665849088495644860518610339322248090941354949187351195497168258030226507789218244254891196207707938136301397036071407986259710377170196867939904460166199673807049914536675707863908920489544130315256957639292300855511885137578488817087453901342539712110297865118918707118619415424775167895";}i:13;a:2:{s:1:"p";s:925:"3535384272507739371390456127135809600186371214324741418254646290954611392001303754670712294728733042167012780609017296164756809496173833266096270418632868985081715544299268631523609112391637166781088782274258141895327019496527187074403033663813523275310386981896554353497215916757908905790000167941188609984283480670859772957173439728154801756764969458163972781505343070182164319814653992820925111164323411776021534453827602054973434524749158514070173127495515407230002708401984918054805901149617888660796149248646762329259738670964578005232274408294658881682648095451587024978642353217735565744329057331274791772257390900108305959207275594924505491121911140571784508204909027105532907233569037974155947733655073558194831009338166409805336375694237481350665052137267368520421694282722206354086277014005346758155612783267077100275255177466584853168927390561841803896678741077551600950305942328420975221043027695073323234751603";s:1:"g";s:925:"1119627094127766829772500517036991083568576798245595498908286128578771869310573796614318558965773296738305720838059734422117498175277568498453999381892211638822962310789626180531534551448940276333857738877417497428774052153210839843293436387816119465485788462895141683934018108493106429309515246847317086612993115379179025962781724441313149237529166235928244893851718231946382751850142392414570892539596941566408655018573202199515090796201983901641953539712987904042812508073257182740282233206806436874681946401374885573281075164038391538943538739188358560267747478564509764088420575072117739801179730824156119304707225171826233403806127524192427836830907025371222786328472434381076462861211218005577398906174154337267095852996974622601430030358592190085397222144581217030220082685020732184769583309535060349556169532211738543599588804873402286879771608421072017103605372843541753819986226059435555938653678169271805135072704";}i:14;a:2:{s:1:"p";s:925:"4562194176144915101277745005681642835798897873495474402608365237746498633370539910997482478061801133410931468922790595608494725996965036959348492966696919596490096103508729764011492174796198191791155909955522446405625791491856359473844755837078803270025112823181994772241566047803179666255388737745465556951461374666502425494234403038996248077021695256107962233981604735599024291065871109632150139360918869800254974719289688500762129016450664740707011409451726661221355954521623690646442803371069043169161235234437004307481376146993512198303964849240704679431973961042676250710936961739893678332170744300669566464498778887300216296271182576972042027189458709055591030587939226922668108333380026928880780276365283307970658783557815994186092589841511323470715371300115114933930080499531110461367639031194670553552560568219145338631131587315044373227862105549876394176147796261524892767754722603204009262024345120417781993357987";s:1:"g";s:925:"1783063526443200787273402874050505315277582361331137583023716558174565654507897825561438236925691082458055937563291294701190532975370225129732306964365080034548430202086336886848043161734619160097756477070297570704155217306045516212846557646681696236719960634662894256288317478659187183031232562007126356278206248186444217073475086995834637378490918740251676685852817074972991205125364956751685343096061867387727716656368534256629567828308240954068285866099855203072022472167988681527977696446376869763607960806831605221190526541560948897865708484402569295854151464572749555731165228888295734781820361816426917777384572381759890872795386961361866080348000867683127021931442615911255342253637272123698141261912663138878997606751018377263447620039560096755190075892714993610328525690603097687100475706668399890981671741816861639279982388272019437387929568855179248661068150537105516997412483935882350464469157999820932346920856";}}
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/phpRPC/dhparams/4096.dhp b/ThinkPHP/Library/Vendor/phpRPC/dhparams/4096.dhp
new file mode 100644
index 0000000..501ad34
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/dhparams/4096.dhp
@@ -0,0 +1 @@
+a:10:{i:0;a:2:{s:1:"p";s:1233:"583497364515534144620769172000044730923697202031727504127123210239564479942377515134918927524784673980579074340461063538391526339824976232063025052904924470995749954074102702957089466315511530623356782205508248825740639624859740089902822135926045166645045437903927933697296195582696814881142738510663498379289235009495727479310527226263007320787605409676476477501993212002640038117065851293829333612131166916933716569722193363513937135458901235668624388058292432629862283052489837307563350505877460138509873965637006792230289674917658023203501223032739662361448420491881958859596930485891068704262657955024300362541802845350103517222898174052640851695040454504836166630292948661375262574940854275967111471071853533381721303713908516806907549838677153020196484939843082018694927379607360137717235291722860519561948094257242530620881851290634352815110863032193710545113797755493485240688912927875280880745272135687311489219235308680262020676069196477067527653004361116497758712463399308993868628203477781594080634974306163916058933220903803140690960293459749358282932918972189491185206934138125324705008321948673334974315329955486619636903641180912157388909885148546517263298358704668849000317658586232775537242080876793052575872164717";s:1:"g";s:1233:"127968319472475344331077898173865318243419891774158869711828718403058272519395942847739630843783440496570407521226003155993983926846566690798874858577718455391682455892223888282652593207801696315984482994206748236808639469753159247631285968088512433340338448500647218310014726139052545519914995413409746565031526159760387848380067349701191760120575688747503588506736225221765446130332518196101187986453740722500270894816925266412425389536471469381597650467785082390406765429913443213494185648481561518743324935186205282661338295676001165228783434910786281187086626642658036158298936580926944325449474152492970083106102594548633509876112245624678116554682380902585210405140435485164389739462713596222796737961866604089345760320729771435028743520537401721331612703333892591161293038864926815371098779656090361303929418714804579407604727579892304347250984412867344708385548522005435390223733841611446899929639968855580274150749251312698516786442922382658632826376729122687489867685434294153633514532824081517876628181473257432770817442813124369799504124961040791138045479518041848867260535046612877228124634309948497345074597014995577791207765501863118075962822337166339167526666330102483819574318799006786826531261489174152125772534202";}i:1;a:2:{s:1:"p";s:1233:"644095053480099091939297858118510986022393648400040771848173413661472143191699322140393580778380090670032891398559036461541070211706428701541351601818900768330398818096052423231077739122485148413641340967644528288501235057628326779619886675978303145968323618694464033676551692515615682460530416294904707165146157144987891911761808025802411091538918844009954268729819844953069874476050900529268165258481055331546080631033547922767585983393765655588560322256827506194710671637768772870769834318509381421150469657835696842562300393152113399655413282551477993943983874755875008370601615893956270286590833324338386236912861203288076957651978605993345863806728255193575092771952494482786247355235879276588474691115246553942882015825194543304753856233378559305533559337703203990700312254477385660339915073329148910781131702800669269692100691711240004144672213498457817651708910320204007053298973019806994514666211161604549258750171462260682389646997128719501642785472857904319090448452035015310192384694472666994345420665249463182056689421284257367184727426519626237050683000133883319859749913454557109977645943797147207761088834575973395913233371630670280400262776509177911655348771924491186387978628358113653228880012165121850781835748133";s:1:"g";s:1232:"89768691123282200273250835302117971048482773917025710167907764833444870099082491710125785724737126849201414977998097793428716907619355631215464414042029665794351873443581002311352342070262811635855982355133446221245675640049081025694562439753757674961542906344974660712521171173708467699171410627857113329247881584047267375568447173390760619832999450149891575517887784502344444374191979674278777530444755493588772031447750816361643891131010868034955637938063643040258792797050121847588179905543200414522189803497522647940506521080392705055063912326461962382542669924669626783892289923537801933181809583637334195726536873813665338365672744499977500454824015782399115735050243010932135563292304832389356097634421958844359608592817067687298260497048355701221546321392944037624125460251388411565536044959602093101251148713082901120310712110250945846908369537893593889855910577138915381937493103881427691939365101855663162968517484827254803505472068266675648883873179408126913733762685173740771676195913722840849674515884752692489338505861489008608258410033759076296295109067248910573099437033937947587453092321168613438797472805045901054080309928241664811040669679366909370512498557773486141885686117459727194901102461845307908569317600";}i:2;a:2:{s:1:"p";s:1233:"532066646043903430528531198799450191282175598742954618921250001448735653262660514078933937412646564856328300432618349074670575210471137479308656599676782686029867744041341499987217319442585733211108770872807629457693551738273743163912712947991902397196643426249471123290349309622852982951431128523211363481720767632275409727094997652747425555700771203910408057673037946948980015289661972528916471071786814695958220834200499919631633188207596644932186099425834405442983403992952942254049551275570962621513810901783576680109840078393906038555579747674469371579619364205996024551188123841158209735986236108133045601317981547026784181436533153185277324288880485646894594421478688603459165479261860263389086018757182921909991153043223366670612538754356707473045271074357478392653202116322497521243644316279469134695450721130875739701496153521607873295760755658643712384624306497896190995965732533939539036696648605012419766798899358151978186058585681072604170889939882081887687877039553196786539987847117171555789374202715508790677648591509775834020846216973047985050084777424619778972017460676420407835912828488139160909012797820681272024981216651882886167197915950461158262571666050162064889928434160092071622433349237717394286981570903";s:1:"g";s:1232:"88019875487376264806598595177212842685348996819137453891069396270876361332627678497976776584898521161583263213197650880795825901107200678516836793986000818559956235836401420020977196840780591296240289055489684623759281051849436675569974566414464349186834037665098011067297024633109006155906972081508954416530556429749768193864239792490253166528742357729061562213019250198539794737195535209094996535044158932610816334246967178866460038531092201721314640872055917692442887757298906896573704281644069767924051562056098464867189799317199958325251056019942124663808656713656134457210444039223292181732025000379136084470942258525079649944952250491152670202869296763020890767014531251289534932496252825710973791866862020857292162810797821091684253912935784170079547394373669953308727375174305241288914357603751765176389654002208740589896011833020113850756049943560630211773283686863803328093696753873577409164572030208865429768237857155625447721967446539430209254438537200859359258164821236947828318320963877520932615943026573345162336913924436395993083326298556575480690128602849466373950375115049719716275590942926575038366658317860397980294415354782753673696615563230160745561136671629331140944061868442787441624612522802729893757283467";}i:3;a:2:{s:1:"p";s:1233:"624640865987867767216987778458789932847491075900224719877838311942749587191696555082537209810057247919185478634348223780741315957546909458090180531717911688191999329526846600555962065000508819021170102714756948429438721648737316448601804780420441612158994209226255131770594803399997288996003939416523946117016867530503628253748816823450873875385453973144581900301687739073722987515945552803443310402531595814541545187577977368505796408386197398340547063464250373460631392626155464052978092560822082540325765365576339965842818719306496724608929188363903261414902415556654006254232801406980895747585041808294354531554348429999919862150877020145670979592596848846447075213356249432578869930774335639823617193789610082309896552192367995866012240549883616345621459568480420037929052913195278081936958815044325239544082449262392188319862353535913518387672568198494110767287509097955588954933063386463158308071591805893477233574065816771174268570465832008357759812349254524175799285519545046477977667617505357579209790247796018912987245094247419473335965201710883238258536291075156906339370737434861404241686509780076365867254408634199338970593379961068090472072015144456114974956845793333134680626115671837639002307409714290088642141822749";s:1:"g";s:1232:"35191597041194826078562114780735309741604982985754459309396498875763019560692191173444976369639938166654451464209462496790872478339726389561848827197210702807234266970285528968148481205090704325620718921392127415038829344379920313399999013610665878283652899909643113809669797186334512616600176863374919988913482054118933708571797485328542935271364769590869366320928740568596567333625016938554865984246979429032911993244701343036076327077895570105943801518710651167585799950694909721052593057462356318582261615716693241644865070852894386957557579428336821004901863993150157499885441315836629140378243424067292782630058302855623369897584166680378736284119663412143881742140461361306675672118375561684500807533830524476726884266191054694962751113539655435727972521329610732240909280735708228480750930150226583351737696182711639764958097426099554995921762324764968387367006643004037013593837742552778489101189681998263134753899520604701313718970176018289465390649251732561908034755392979210100206706354006448135056428690542195439592042574114357901559386110762176368326458844181123228590640318361686697305408158142536747065528132296806468209807840457105675518612470245610776694393440418377981015311170038436924081564055374311557417607093";}i:4;a:2:{s:1:"p";s:1233:"779953292877005240445360456315811451093989451217452508030860903937948632517232564194001045906512442404742197613232702463671198472445385875490629026457545647187005442021788241311030738017425249356890025141343078528260496749924672452406075112878301736302556131136239278896535599312350677308329009917219230134305610628444344974394549039153542562509186659886824632357316157354854634051235545971442610744661953164839483107009009346767308487792275155082094139336899974160251049700780808146182664975496208843797554327815374841177775475470753571939373950219057601827618515306432330286536605787954416979600982555100385472096930721178791752512391165009133875211243325504566536842828926470993456873318478637441852889757460147342402972838846960221083308995652368217350359415335244963047436742701143102588024677465021067291625650479124825035107916165897366503641946561566575735977405500547013903880111234392336910724291341358824517576159101324393315463915516386113738376991694655518288249372828957784415843462949902880245560891397892739131312020213605637230016009180022550903701034602194339314782797872803409177330851533187493953193297474038559751525473131866371264573532977654516287334052810240609848244155997212833756639636272174820013396312043";s:1:"g";s:1233:"294584733932594868401273947792664024465639212321256126491249920101434779155955057195485698239924329017461116880418431580860690198256687586504932112771781527472902014259770658191419896802154650562294560755398906238871084453999743924751028154628422747846829629577342744556227521070771812923096114099805415935489724190764717281018532343462505964115811767991916636980116921636821712757318995497860585675395280337515465551865043288028388574578233488702804947437573881111837814063218842724966602537516781639806659721586014263202580079042963974436751247205517597185932576168824250675087889692132232635851385770662503832152064206896620142668420989011972190212487528435737892772025331837080715980029846159723498651207016895785824663915902233384231216633900413873894642363848877283294953641356035768665921262293701560382755702158565436541711046082853970334353019909184715426280874888137220636901674190665606039457943452297962490049336271214221544690306494924629862233459637759750174777290138782233739753168070900498570457956229850707058644987113995715716956163428588853996972713370837440713495127681927259759778516099666631791678009695621161317044066516618587362656131183202101424543589024791455207942352815475983543287919183904371032203398339";}i:5;a:2:{s:1:"p";s:1233:"873380532309522498799467076047576421250122925013979664660390100404370691501616536937612181194210215385094308810935516453355032436029463448084830096699391779359746245438975644149556989758362910981654674205999214419876320686094257700096069549948049688283122733439454755828610162659438827932114026255697266960943047298243914159409829140192254875858839248819066768167056622706529514987599954487323063574290224195367474347078198738515038011001166838478656586521264779718412671705536875203786037169126817703863736311251017581772657197321869901340255518927881204882068953687123405069334086588782698178808285142618320087139859152633355749618171526326904396259187880016434290866497808868783791697806208073482750736837746588717407322376245045837690624895530548374670357643053563615977343334778531626732690936180455182800428340931549713296236365125878591019218639946060377486219755483934599502713465029361440021225215190440316806913581079429713281130920337109109968340294505380581259509433693746584299063405276989634968695476794323908106754680577112440836162750947562118744950062391998865341718636027261902570877972713001428190326234549687999438140714044285074849887079302464721442624737482631924677458635638691593298803949298092379596527831341";s:1:"g";s:1233:"758266979649634750053202088910057283279263674287329988444340052724311389269193009783562375537401202888776496447338931775147711904920703696827537283963175676021760865387600870343858294395979209162411359873732107330784778462979646046298376965266583951503187441920319736964543046884576005781229328830643625640871783366283976625042564380610348916186645415586569404224977599824833363040472887288347263098569508253342424423209373267649416084905412233426458631222763815788848444066371125839088516151679822191407136660334337085286564713698597688507583147689563443525745241725604049001370465316856947442952510085242436423219864605864763869175481815324893258776941928679506214789932269935689301480992417308141107873076609787962472466286175746092824143957343107665553282526810645239903262112859746320942900955250909496627942784608117271955850658074366406923494387446533368326132090056539030150773913311392872050216434914799631303309024899984742422197090631532551201284028292062615924708408971882417466702084021943910519367667033612963460400727150084937048056426226974685862850060010300637268188682632116677120260511128669920683716643222316216784775954581071726728409507558648533136253212792396324990814732244668277612263108239074228022837043532";}i:6;a:2:{s:1:"p";s:1233:"820540721170757832244069162337471103623476021288701868127073481020518513764059295767556478640853661563409236622968593726091778348462161731928507571220398659730404245516726938439362479434547886117679293434155700084261057742021144960140652439772307624387556511736993557966682791065844618716738649097502276329615062219346852005641718697097097782883420200607919883986913139144488591155433090758531204379002847725666813781986224875075525417662853261153741581543945607777600697564688846706055314188654847180395320729670567990844583186709378281514284364374502984746208421004209976855078742522453310734735737052136742501777211668640816493194978901543793480749997538280229075960668940280718549909630114855675970884623264971311921109961141316437324535007215935055397677052785648645456667555930612714054437409386635240482069841343284036219292970440424707137408141216995364660839297129208485540357564963189115710411734704844257579489044129249646178130436474309823211871068594090095315504146217773952155598284329651162900872622016533557355773655411235665998996830829344059040931938851410102323668534202404592220853769884490376176406448321479680685841476647314282691628643791285643103333090834485277249291561189117394793678546127171798204363654999";s:1:"g";s:1233:"118438406554222995490123100896296072284476073031088381488498100505936955217546145811103101447658588862960079461001008094514531078825948036459975111330154054589791767944033714605441782562062020628113612970028611082098688775801631829875718508746607497972977201262883699047004148818835420663835134558082957066615924062809011642757377022828878035666649119894745815340510628666091903865601281505273374757023093390516848399591138012630325640069208002561071381333590271743989866484109505989403140432055596491271598758797334321842809180542487085303934698164071964097112522597852061996053697857136401134388466996155470013029782309435510931657620253973452521674683005646717477525282015675525891059896139716992911364488297600566543965925779727906128807922294910498484009364961002440413479277055779323055505652009751985075907895769541993201483122796667893573417690154430534732977024551262494631887093900032773648298216606625817339752505700287724821088277921064166742115930436091595435627279838726210384248484480417510561899496786492261565385112614452310735454140962760476036700738713148978258062283302094173393505567783695903421445729783145650782376241212257460283721766165927127583979756408547158718516467907168314631126296626106399012896760922";}i:7;a:2:{s:1:"p";s:1233:"548880106916124787718235316361844096017242216603144403144526114223097660636847718806216931324619711022631163106062959212363723195381526736692774612020061813829653306315587138945343717432435992013532097990394527621633009800856598983072366070314358447119040980012948724628709116117189707683723307181824637091772814755053282879511298615833481306573426566522411619387127602920750040423798107009014518741868275044792965816427462488022038905991612182102118898508410762260881010537117030246596093467647073714239550895596975301156766220816241309120866613668394836626003142720617951812627374838731012619830807432088483035236114552081985134001686616174564504848954594625921009676332389570256971117088453225374248443883042402429145636745540299177416612931459661220551034168122804916804973490302014018421895277362958656026655451235268564523782734034433508796366066821960530130189148245225555293455679309843404439477749993477957986644877057108538055208598606328427797655589145872355278700781305267826336108224166381248845658241915723389086597462010302103075341521420559474409270384789400219607597088319673340147157104022103303355849529821376234368920767987306905602181039769947710244590335945964599542795685010716255387218781537486891263221112927";s:1:"g";s:1232:"20223802225175087390897343320850575259412414582365900258163921641616379893820296366341965682900284907062971541417669673457029912905561753659662613613090408043698061279146209902763900423769234184733822405191473776496356217897290585702815784533532924728422271924212069389174850591443519005141285468141936966795748739746034248358086369040187336416304433089873610665670760525566546042619321022059403832424205289997775771777077392551377964858245304204808213786438590268481000586378941835211494995867689519660734121997341333890748026237318380388536238585862179559150130910003868306933185293566103091846923761609579853197184300628029650990023543293857997327465196890887099397843846926207481876351313608621717072924306713736639971952766086054530863325280899405617010066755700194504014455444107107295775375562685525186934121122525113890027141897356852125711989263516247264495095845712242968433910070550732088599140024829886653846928059492507359211886677228369134480549783244558011064095569606042620727213670092676737971036510295651529169480281747758154694909538028297129220048405979644814548919795425345058267606850114959452152274444230498221536709933406148397862354884914628348944049381266955798315160936114361289570654433854369533954705453";}i:8;a:2:{s:1:"p";s:1233:"859827209309634451406960567644664073608247843009655590438711626451994237792146991300287173183043087832637627357885878113425166419391451008964253017859106980949574755089062271358548272263403399922978216835737548298249861310607947556415556034302868558998860823948248446165422188547363376777494491479001516098330954311057697326851394720625724257100394328957986761641854606124802840570257773148816822354261738259531039998883429898993869241428003530214497814160450219313370173133235288963953099531623951947942169808487031628056100171564239864604031521909623635333747729708835356234693587117939763260100382872254128184803886900010111804500416269361475869077112596601699591963646940856023853064774037109855507020286576768786457719852203457601105292701917411355358360008180915826892620146216804079957668181231970467450738195144959372918201556192737905591268849748076849450465624438990383848388275522080203010234806683065220626452401491930502782559647732413722125655004274543457237315659249933066729897683797374439150414939169958117731633454400030620745723935086781132522371020701818644268478312923624781333343945370055592257510945893105577926435083566227773496745193530155189970622341845201168222461416348334380933548210599367604096086090031";s:1:"g";s:1233:"230387772378953200845430198621167578746427053857106869552960647982050572318224374962229729318382112349267315650146357511077064239693374841128343219797847769239939047378499174746908607350206935258194400647418437285235785666209175674200174882847856952420858925389347085326991590694347827200509909061693873973915463890445184012205857463974897571179795852429001622101699601936358287818840162748385632350581228272919083408646468775495034986097390583012810402185490450971630710284503910731398608923153350898329021751448849831559422869933412530221683796013852820003288717846727373190487598011276739172626606757714413110493418580840734528671851885868087367383538346546521370562466473234525297808335768819817289553483678988238007207218147310439910350927886998040664415744527590859368946235772414353195300301484941043822716434443980686904246525697288828638259424314558719281240513234226046446424926580782853900132686543224891646005449948001898781977906166963632765136243677729469730024277517040955568038819858727398039755661112182198876426968341181157078405926004559691091955506127027570276433391539963453802988248330864677240591327448955479631777762550975509046811958142442397739295068221957839946052657640258744394034254689987292652633118456";}i:9;a:2:{s:1:"p";s:1233:"888312033166526127955988426442422678810001433938919113768864201691207447938480718447651596351146287878452273934665645649043859986405865705632170182974121295125900973569951205769031511097530139546014516646694527186005154450959470448708609704385453144250688731002305363223573960088284188348397281059466430645442685657932089330915980881062245603052940096217287240951726953877714773688854411975063331656887351628173396825718989000406598772820517406925327492499704674327124273792263395692578753695346195761559571297125107450248914179643699672490810996603297769572128091365013688121379583975298121444209456702623405799745174906419004760101184026174045940728766575978641441869213635347993806018811545320063737880875998517629287431368427977011917627530837172234644438473851135151107087912257495260349195961101296828898638793317970645342060752102752379914647648982128417274843039283608661648219026592816346785321387167878817414981419419109227388794463755064739517746832189499096571596122425045771877069000145569547426530405158751547675856005170654409360257831905487455222746315928001559373872546190045505532925733851120210509137898153408570417636527268501290792622044295041907691504394440632534766052125617415332728563802110065175938856406169";s:1:"g";s:1233:"179940007155666987540991580117873048905237006140702783008925780163608019168731404115337759870972800567200300584668821703145485990166058723838370280255537348989331971098418891506333674538143418541493307265504601442115644860526047208656065911053559381591829532675505389980301754938963454618057645963093135745943859171388965425195072355354734862364577087825126597061480149259128737757766041549277714314756340773240381942891036795710496353770795880255238193193675461414418611062068106108271650728114837783741653035474438882611428736402606930331744059645109969995029237833676333163067205389180550109628679575668654874209389529098631801939745991166555358616979680709353058264948062368326747488955208117566150951474211785455860405703903272401304341357674522616532901106765444186621390538280943833741378449548964875421462545231416352716424331619372720208068714785982701636016598679429739914643836865937850288574299335867496560628657668315502567636043263564061553699381494881150855325182573643444832676577058036350069847284842579105276011204912451316096773591061234269638903316146162987031233087675096574076556129770577395455575930879255275337135879635066597533030050445119968176495966420634121515158768748603982389691514447198255614191166257";}}
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/phpRPC/dhparams/512.dhp b/ThinkPHP/Library/Vendor/phpRPC/dhparams/512.dhp
new file mode 100644
index 0000000..68bc1b3
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/dhparams/512.dhp
@@ -0,0 +1 @@
+a:100:{i:0;a:2:{s:1:"p";s:155:"12635450358293578591800910479487777169852570312773787057842183813945647605523761696818335430966522345697375443936716089896542284956173599541622185697564549";s:1:"g";s:154:"1090854334822591173512321403882655677941000410006358584565839627906165764285596682714148816933751400742491135486102083999660532436748158623509010992217103";}i:1;a:2:{s:1:"p";s:154:"8330760522092340606922532684920340313503428366729540863298817169536290179928809471721822951210171987458145792759861910013392392898179284657620886263899271";s:1:"g";s:154:"6322863474611806100787478309308593694232218046926780926157713238112945658789791537699650366897949272407498804399412240425281933264987477691262814155841388";}i:2;a:2:{s:1:"p";s:154:"8467874047342751270076186270294407678529363428805356804220110177077751064916093040050731559077353309166409798407787828591262171218833842208747332259453521";s:1:"g";s:154:"5298156252329153668622137014101607775181856989956252615676334754324796406326471396781499484185229408185326895046610970301850604221548807384662295609490180";}i:3;a:2:{s:1:"p";s:155:"10026784872744220323680724914118782861052640191389047036503601439573675679926077705354387433852018744814013072404781629568137348655795687816934596058584847";s:1:"g";s:152:"10063798484541132819515158210832792982361584205561672291343208772351650842776011486282636652726979910012481237423361696310602577790362811857800630406902";}i:4;a:2:{s:1:"p";s:154:"7500541218184559328485097477496345783681177646248979806799560614429932165977127468017169371472813198043940205643917781543605453184159881626674120202563821";s:1:"g";s:154:"1020503261486206285757006767534006757324059372861763647088747846559779377341132189129602840152879970678542409250058810084771680171886011520305323008135467";}i:5;a:2:{s:1:"p";s:154:"9421424414532091516477140058802411356679254508253599986943994499257134018040507972559527177142254594456040810388699415500836699209428775701629705371860561";s:1:"g";s:154:"6848477778913663314918103728441691200537498044773698707353425996552338816856928517120881637989820983228451343864443751233482918115252865173481588049824707";}i:6;a:2:{s:1:"p";s:155:"12625090184529797788931372343452146117342437828850959777918103886810506314889293815712889526766165497221632236033223851827026122988601152832751089193361883";s:1:"g";s:155:"10727140325921866071434631280644720707882009137514697813586556234846801257052393459470630845660422299001774260577487303758752061121714260768222777853141984";}i:7;a:2:{s:1:"p";s:155:"12898044345941449918247148733336961514367567256908845520876783894282207825874366689032248149016261412283181183189727919676912955124747513289770528539211973";s:1:"g";s:155:"10413358542022125014673481723329455076572467663802388402671853913744650796933624754409034882623123290639423561484943927800989572190732045719446742609758671";}i:8;a:2:{s:1:"p";s:154:"6777052041803887915352631631866770331853268073456153981835163788577587447533080824375565106867410180683860624984416024143310816156045498552624818782848227";s:1:"g";s:154:"4744373199110323775270810304030071313547127720868525858779013596635157802120581249858087010372177600991104126554407085337043555855358684723544564659511053";}i:9;a:2:{s:1:"p";s:154:"9769160763507178719431472328465896638866070854349262585438598729016988304121111106981091374450169009893186974644229636740814505506061744049970923730299363";s:1:"g";s:154:"5306950778367740573813655888374071857932353520721926940261594787573952929063307075086373819957150491162555430648336446419164220175136517200280804575851945";}i:10;a:2:{s:1:"p";s:154:"9423922356452712235926431203949703505484363837432274466344263270397520246404630427344391380890647616716224065056313395456217365823611766528652509334779731";s:1:"g";s:154:"7284089318298927178369679475673984622736731890983895175801568163798062623992936160960700756266264018534324483109833512513653743438058543564254601022875131";}i:11;a:2:{s:1:"p";s:155:"12158697138595912393903417958876572941964664917580175572374295322020219160425436741258520156480547924156012167437702643658539038327940197818126321370919717";s:1:"g";s:155:"10485764511219481318245074108282617920786103320852119973254883572198484400820180431398785006356928094262884549838937090554887145629516730528770021601199635";}i:12;a:2:{s:1:"p";s:155:"11288262951687963487272915907738107756098899363507394921290195349495485564247336439679451732281925028547373038129368449917374094191854311957106769832324739";s:1:"g";s:155:"10795654841855911955259186695756995006845641223782829032357886836809228255968988341551185869422037966120448459311717587218376381600148084639558977870096502";}i:13;a:2:{s:1:"p";s:154:"8258013926861608902693666790435473901190984397470193086801654424096172395830149441450824019934937921913900532126490754455661483636320695940894486309100319";s:1:"g";s:154:"3008616177637279133031542021757712428009438095597380460281736563913664528107115803598843251661751953577080050168764629090444516020745052468254714596181839";}i:14;a:2:{s:1:"p";s:155:"11160199081808027573810092136307692486080233663688728390187641807815696851217963593844145812064574876563510827726742554179620355048682142887956081871867257";s:1:"g";s:154:"1619837079954439123886151787080634070642968038154229204074646704930777938542872128065694227567105405734861674388284235427031786560892701529567221392315960";}i:15;a:2:{s:1:"p";s:155:"13374835067080888087044052135412597686006650587670271902738259960071812996976288241935082708129322038538611064744176497997876042066574823204776272831138301";s:1:"g";s:155:"13340606588501124076628104969616489544340701319544045041774387943804131532921423414596496104136847181815135596116949133855703919233075041766993096626479925";}i:16;a:2:{s:1:"p";s:155:"10259417180829818855720989528633519911845188087062317995276209738349065624107483004472651091961152483138484988620800791800438426039507470091955049905098653";s:1:"g";s:154:"1049652929312544377789554948223774743652295892011706941762476151999449680073160873173568005327063467021157128914200838440820265756300864573046947221185244";}i:17;a:2:{s:1:"p";s:155:"12197220246712313066260567471862904022363676477669859142286893009035744818051867274541212248368880572818329283821354454749617732729091957316225342433619041";s:1:"g";s:154:"9195882220497133783800026095688409134361538650124393293576388284972490669069409211646836028007865847926082128016363741865516430294771664900425136610454335";}i:18;a:2:{s:1:"p";s:154:"9407346240609426328525325968151151707707014342802748859768109084981503050961487104011635924975034655436053968429389536104159388654521942683831677615143401";s:1:"g";s:153:"269136289076872637342985277973758915672118214120214013887252427702020902794047992188076991724974378053740684811995916618340797583549069883395774393139072";}i:19;a:2:{s:1:"p";s:154:"7198840437082474958207241444655495440658341081388025505383172136119655067017904561231782672226505829024686555846885360605543609008217831214021594962047499";s:1:"g";s:154:"5788294064840240997000762465796620865513656066684696204990143434694734867188136493805370539272824995064240621448505859749288014816751791686163112546388721";}i:20;a:2:{s:1:"p";s:154:"6866194853453717341652339305994187321675925277246174296458603441198214649943543117403779339651067547283653344557161527531330217059862310916864636517316593";s:1:"g";s:154:"5759497540822961789157724255057129836025195265915136491003288014804506784127978064787500439359522257641902804614292542461889892712639086813735742843987220";}i:21;a:2:{s:1:"p";s:155:"13177952285079954289288219353117192697114703824741144116451428873571791737905505015012885197099252856045557518662942292101548687388076187108958765866077683";s:1:"g";s:154:"9673226746946894107616895821956872413994230660337172037720955022401762991975117923943964348541091994823989550807194860840353142963521466169754804620360804";}i:22;a:2:{s:1:"p";s:154:"9726690844491319103464486780397647954048751456431741632228743401184876861409583494228681662837684390382414485868883077196073018443343045173438676499145757";s:1:"g";s:154:"5966967110739915435125301545444105458697696178343475816618093998403883224416672950999788756580845547713539753295669176121976165846909930535567762639907762";}i:23;a:2:{s:1:"p";s:154:"7538490325284511136438120514170901332660801432732962496569525567553027443874560165216900989420584310969224440183000809313672232345892876810847904438727641";s:1:"g";s:154:"7398588641647314497767960339642029855458293475276281320039206004717386057103164853206187216154556795890067697653797260673588174257620930150234941115115435";}i:24;a:2:{s:1:"p";s:154:"8227511957622243129017210866215270808821806440628186306320707299109228484124050243443975192083115132467163269110566007486521957831863442617410859421555047";s:1:"g";s:154:"4645421224570784791175061679645751599175479926670667316335993032125249320593256905424556589769574858326427536748350447673974863425217426168147452888822540";}i:25;a:2:{s:1:"p";s:155:"12969731233552734399451955813691983006489496437250879046404503333930582291424470873903975608202652169345016278675568320752211824525170925811649178464352817";s:1:"g";s:153:"938872877916962648295701614574225970657013623191360283377917514779152480150022786122976960582953179872490158223294764793608858216085744934431578995451202";}i:26;a:2:{s:1:"p";s:154:"7065101156612109850175396041310880729801403367529402357084968849490927526243609086812440603700483174051775685576622326237843679578065068993344357800448217";s:1:"g";s:154:"4937530350574774053213016732051414773210465511366329302510484430930527647927154764700569414698805939709289334712316369800090809356945979615643622500590944";}i:27;a:2:{s:1:"p";s:154:"9253655433153614643720842168059271343705755485679437008857639916129766802372631673001875065759695231827514244486797815745404273060777672453756043236262029";s:1:"g";s:154:"1154118437300934998774227250622044065593929966410917431580654245142293172499153040764142683392788982103025598341743372297052182135492043939517398219789131";}i:28;a:2:{s:1:"p";s:155:"10848941227439606569547554892393736362241960615699022840700246817110328822098080048132085826242837084787893781138643085998469452494458843729328332326851689";s:1:"g";s:154:"6902859949879581005679923246898018564599068520211447542005819640293730028077262822771725498401630419852070831081835541856719611229878798733541142943533883";}i:29;a:2:{s:1:"p";s:154:"9200077333219147793521004610524679062674643522045639269053512698250176480683986701289170789423917221585133322649795623553739174854764029015889572200454847";s:1:"g";s:154:"8977651412120081362159327030461431226433763741949269801239273477011043868326857881822604759965174367075681004085055927709618738280729348684607803671789563";}i:30;a:2:{s:1:"p";s:154:"9845889841943809768314162240613991788670164846635075878467926914087289824203165472268700243871440856079801440647968535378326278137434266496758552114149441";s:1:"g";s:153:"768380127191918588451951538282124996101009829676972691355190870417233807246391392262749483247926691107794065287711515912136355133371195330982913655254406";}i:31;a:2:{s:1:"p";s:155:"10851556038116464699070134743443581537292976439813478958179597826025549256396071124532860998691993456204739775754896353442062816032468483695456073098224443";s:1:"g";s:154:"7154655821774317099112947480129446469943441624481944724248657240117509097398430349434092257615286785331672319149988169019804485357174356309508341925581460";}i:32;a:2:{s:1:"p";s:155:"10869657909548234771846150650291496878012840512716551698067888848900961777039246759408527968486607410691927237604274521227153796970138251173504729332398789";s:1:"g";s:155:"10291105559439086106068351955856024921898095091811071928018974509667715608106121602415100275088724582034560187196479349479678559477870893719603456159195978";}i:33;a:2:{s:1:"p";s:155:"10573437696614927150153411773598147086432503243232815275356047074061503243825728675078417236624432478965385334323514782803366272650302790803029448946823233";s:1:"g";s:154:"7936375668886672118414744836005695357413671975252348835029285378278952434975164206158622984806431933596144888246146817078922796519730755404856725404012843";}i:34;a:2:{s:1:"p";s:155:"13143171580350380026719039436106973235892599539038891512396032568425711518490270801218225503291537102818964594215730219661054646928963320816487254976744691";s:1:"g";s:154:"1836103769949406432524468270712251041529485560856485759774657103122616493367981405292392684433227262493977758149124464359857054953465532851417935109678443";}i:35;a:2:{s:1:"p";s:154:"7817302659432711774678271020951750661333508545555444370199324820069061693710307039108112542055446182951630431053517684537459614899603725855479805738841609";s:1:"g";s:154:"7757617168595337488906483183749388091400069439975888530757208331533789508118297894470372310437202386279701677376282517267115753765256668381319564910810130";}i:36;a:2:{s:1:"p";s:155:"10267638897003329507809180547127091069117459439131395063369822073974994025258244541686493148512939652836981483431348406971826886416596041868882198252892619";s:1:"g";s:154:"6318982256606638444633601562064159489075575174603097104256876934574261058223900542813762735674188095550436482427083800544277529320265932517969479395835823";}i:37;a:2:{s:1:"p";s:155:"12782270167325061135937860317489559265180586717318292561188420849531526268171146656351667953024693325314361045908253754108944361348578267392530709664122899";s:1:"g";s:154:"6991882797209611054389481268465012367881121070327860241481617497353801116278255059623760999675401035064358235967669879053837015278936160705861718207391121";}i:38;a:2:{s:1:"p";s:154:"6731746378775926601744707878575045310304903984312892750608776725022937461467670920174839890356560754884661025202766992467602158995844691889008414344224541";s:1:"g";s:154:"3107823960825199229883719178521718215890020223638296208432989834142924789012938848961473436854962539008488662480251097171768707780434454808586850672001591";}i:39;a:2:{s:1:"p";s:155:"12936328803238672147187839312904518164662082232222521593614447250268808716877423911517851087146464538417134244477088458475508392413636215020245161324258907";s:1:"g";s:154:"7447543722174178404892869118079799709872555147821056050425166323624947980165009189566361641678758361204234599663455436346048698885722709733355889383997433";}i:40;a:2:{s:1:"p";s:154:"6805235710264138935232477664965736357729175546690091123374832408969916363561953404703570650183363313073842129895601843542765271167068143846210532109518801";s:1:"g";s:153:"241967790688726611630572098692470914343503786718983020603841862948415175119950819174453647688760067799745498226298934246248652993245529368369008676676018";}i:41;a:2:{s:1:"p";s:155:"11925844197021754713938625724053020079683404084430371438453593710522808327354502713382757227379820472738869202369687644194388842222036179834354431378938783";s:1:"g";s:154:"7528176863391682294380713557224125923359959500435147592233747105062733195022505163011428173748825139929898679320548103280305894663549403454721549617429358";}i:42;a:2:{s:1:"p";s:154:"9382690276990287517827126224244262351114680532057242635224428485844700880422684769081831064853813380043190717893849784787292907965292841355010043199008079";s:1:"g";s:154:"4417964586244527620278956236372028881588988136518683014571128129892304376472643463030713416286758895907125650825241924308538473496809076762137861615651529";}i:43;a:2:{s:1:"p";s:154:"9471154462532162517766328483693871604313875211507659394402991024218819931898363174393334319225827831532975054544822369032247496657955428463380077541101259";s:1:"g";s:154:"5965538882821744183392517506266542138569200983176623099845801353014368375173891122156750085268413198483559096542177405738857144779702351290712050408559721";}i:44;a:2:{s:1:"p";s:155:"13072215397944695079140981714451652254088635540701039783436079695923305049093068379991778701466866177972543194919692105571905528567819232740033043049638673";s:1:"g";s:155:"10905047221675573837388440719936929080266693676579154214910634308080954138288436777167832801892265852331340567765314113894641600068009717791667699348623183";}i:45;a:2:{s:1:"p";s:154:"7480285736902516363853550609483667417682147640058517333104942696093838232353278893275640726749652243578126305790444323950427003985719449351376634278699607";s:1:"g";s:154:"5759202574113108282378074864789677515288689767373583038782636582841406886112443573385070089778091622751224484977426735366091834116401247133594381805961184";}i:46;a:2:{s:1:"p";s:155:"11210622732047339404024840714095057225603221198681717167542047064110330442742534046349520884675080911296315861922768327935094937187075265506822940835040491";s:1:"g";s:154:"9937445355915956411250765024373279892128473056016564280984522288370978119816479851683244809355434342145980557652327529849111557653417852722522293792146120";}i:47;a:2:{s:1:"p";s:155:"11801310588884178766890310177272733983571198144791811277406602857753312000312219119681403573834767631910269527394416551781151894475252738903890058726926057";s:1:"g";s:153:"115233390078503737760155084175025767812358241323488230712385298533454103554091397194104748384437484257038379362772264874126271752877697308310940114682694";}i:48;a:2:{s:1:"p";s:155:"11529048347164441615241543804181726496687154791825255459491001491738712611956789755646436546778690115202840049658389496893606046846968559040105761862357833";s:1:"g";s:154:"8676718751750512425139622349225124856609904480931707180008538338879230401203724388724735695303409750333477100875898619258877552431088298574108470256276651";}i:49;a:2:{s:1:"p";s:154:"8827072361630078640503677481298714879520924565274494318798943013516047380949992422868188730738867101711789222674209108748980222387508987065854715881696721";s:1:"g";s:153:"710141650554525884265578176992152766513903299812535725888133858445135487452789266334613419128201502959244491496639163675200761790924208942231383545162770";}i:50;a:2:{s:1:"p";s:154:"8630916941594181725869358635738342312528620650119957199177838952748463935323817770626013179178189281017124138873993517599531749107153800962022777179165821";s:1:"g";s:154:"1986336010793498690402481692272896313437282310385967728046494523738961523190690879475912743848248541173027205997086416780584203636037838333529483182130644";}i:51;a:2:{s:1:"p";s:155:"11212951383442456895282126037644720256410394797566689500132827435994463195592391547284657499757312898540967392508953032317946768141214910975547388177983241";s:1:"g";s:154:"9102763753785975341238925269544891354476061894654740774463306793322852969775784700232809270884694129158803996346082108913891287705031439828185656228063664";}i:52;a:2:{s:1:"p";s:155:"12767327655173767525498878790016442622970607684484683803036559177746978436941358536992037285959314311977766975796863190178719754731248258583037178093445689";s:1:"g";s:154:"2321508310733831420610044896604432882237136641393324233389255445534691813740197943289557007047153528108310525898070249540038163869248765133282278627312806";}i:53;a:2:{s:1:"p";s:154:"9392193574475555116112128582962411207901765366075980992046837483678270815467145329834399000077307436597284520617068141836081640163188636250835029441308703";s:1:"g";s:154:"2053414734576510953913507168402536572703774315964363121175715888088663285442201329865875872679876866070636146795229156844380127153406257025394411611466483";}i:54;a:2:{s:1:"p";s:155:"10376053565026787172160955177540422890317275023121997466989774697279488503166878624289513515797363103732517258578762034755462542106414254692746603234671043";s:1:"g";s:154:"3091638708604907776624878044604867414422955026474038166435429554732769040827969143023705222880907519792943547859810547871406751310288694469049761930481334";}i:55;a:2:{s:1:"p";s:155:"12127207345651068820086441964683009352696585515224185465037336419371181638231683584846771580814035091125796069601976365004662474480234541458668882739890721";s:1:"g";s:154:"4438836866160593665451702269753991637431308452920369244447683669705293185053449743730564137227007292403789550790345961175603642284391097450268685443319770";}i:56;a:2:{s:1:"p";s:154:"7611469932440564952211781130439214876690796015869296504681999249251840940704296297777681008004821652510091526923191561988463222032574639564147602004747471";s:1:"g";s:154:"2159962031347381166014669527596408113229438638278373884502632954091486600988300593639831501800781269214755396360742040873940950396505283507866134558622775";}i:57;a:2:{s:1:"p";s:155:"10333552284492177347867767760312106573829849938537225897708798295607254551687795282788443586091756110932272161971955610887088234617195976811351238892296089";s:1:"g";s:154:"9432120129743475799160225256016334679238139039814424474076543995916056734666699428293793667992690869643795593704757276260398200754011455643399669925569067";}i:58;a:2:{s:1:"p";s:154:"9186129481949759777879325927009938672103591565760527415665011657111222110694633491007638694742477745970521733215626485356625921552251305212419767357335373";s:1:"g";s:154:"2964982199072437563747659648788199572625987178442645806407700614788045759520791282226234744641146133332755273683835703308793243169629688414830111305979008";}i:59;a:2:{s:1:"p";s:155:"10797613104193760920872576604739145039329493525174523870041853152276384156721978899427111721321741929488686066256034450841507862907390410840826008764757899";s:1:"g";s:154:"6035241474954122155355449752310815638886484205153452965392586944818152870488968107547112916728102929919731151220028636538954686722015297434712965657407685";}i:60;a:2:{s:1:"p";s:155:"10869947620920150461498689213804104931914857611354385578667238439616260825731378948972250757311923193938060849629181090857995395344904289508598143935730533";s:1:"g";s:153:"481312849012587203492378145862322149972797039844724273303827814567785210878799018651223527634096916030584780553484801818224446855755022386359742338412793";}i:61;a:2:{s:1:"p";s:154:"9231592881895960498562751568063478751369509815551906815114331855768090862166893258661806160199329317482836122183454449679798480059718481696000432015512777";s:1:"g";s:154:"2829892719013480169078067114400764737378051603195046862786323332593085589593735084661704693548639293287833918450999392896600385474647941243068301494417304";}i:62;a:2:{s:1:"p";s:155:"11535970726511268187759588980352242649579274403126372273895202586422537522913796551110927374939006827092569052666629425089018374179426876981117710901583973";s:1:"g";s:153:"720418139015023065849163498841056558473934556153974761688050291079916546264726704214062787471591074325994224916038425383512487158259629457204721553853210";}i:63;a:2:{s:1:"p";s:154:"9861250489623369880082921468628592177502408573205130594265711247497202978021917937037715397969536963237006852718089567889086256038105803931322547406120933";s:1:"g";s:154:"7928607398515301999160672014700122456116839205946040598055281578888827533359690175257847840316486463480345797985196608946959190295352354947490060567259474";}i:64;a:2:{s:1:"p";s:154:"7037162688438216114665334358856972752028696375118432431917708234857066416666136221875422755517254911565532179808653486394916493658234167039740176267876757";s:1:"g";s:154:"2561520364124680347691025622126585934254249847396300180215790279361782291723253986299677678320409185303548420368698893869095720049051592101538317786377366";}i:65;a:2:{s:1:"p";s:154:"7839643405862034358064924109902483930026968378388305680529567643551318111486398801706102322537326685360160402095895265466777644277194315986891593712906963";s:1:"g";s:154:"1754075447965545218123602315590932259411312929973677438266981091131327486934951256423337377824430217299559456308536359696603306575468489620694606039087055";}i:66;a:2:{s:1:"p";s:155:"12276557742146258743545700501290339960587405224847731100110687472244791172620101100818159279506090655569815738514019088680091703230258555911540799511122167";s:1:"g";s:154:"9763861375914985702545750159977496193065161335864817824882497327027580874802416052039447133239579968682408646209369969884977946436819534940176606699371008";}i:67;a:2:{s:1:"p";s:155:"12230683487619319961944453143151691985882065041735379665065641906865391780863710859120672643315553046872854392378120553560533025057025603898136116862293441";s:1:"g";s:154:"6820995666984101001799315333640660517853397812362325663701783101362074754987943224840937197351438492534345149997665796889093780332154865629423497020827741";}i:68;a:2:{s:1:"p";s:155:"11000033292226348930593094035262737806366027110884679994121757708192645734655143882773568769558594544920179117149359550596513178815154309868775410035186063";s:1:"g";s:154:"4136862529753947481457983021388601715848766598496715256706293038171121046049608132082841396600193873750375804495745944144901236241777071843379368664154275";}i:69;a:2:{s:1:"p";s:154:"7932184591100186238463385027146880324850417985223577208693360112110160571988870890366119973622332640258222800907861231078259268751127722069064114137860677";s:1:"g";s:154:"1554704138876266517226317671429037357546114985405447916960643643463787594693776634564098027315293480200461149296363025299708818954818475510231838798211630";}i:70;a:2:{s:1:"p";s:154:"7247101322282048034402027899872237624187875581686127113817087170324333761059623129858201374439632028757144826193998183802269340811926184660871601027538329";s:1:"g";s:153:"419876311823553421268573169216133898499120781788412225525682613256066295537141806360606590621846965864647042488385611805166485002563960603496293345101151";}i:71;a:2:{s:1:"p";s:155:"11142911398132179783773554123504917208536218755896547125640354767247161949984883149299386304638615888680135284173520903886505390416092111250431821534935139";s:1:"g";s:154:"9421238208594055151718951084399404180843115860565558346086952546158235884494503159881996700939897153949279617132763495108273288888130277440160448079145244";}i:72;a:2:{s:1:"p";s:154:"8422680718159927137259727024146506754367065291787361031410637379107607885590191645491292131243858308336644590049873216313480699042782181741026895310726173";s:1:"g";s:154:"3037225857906067024969405118120869481652099716781816854621639587769381797676248760487654420923330399046475888790029324331786276809507475888474809786093936";}i:73;a:2:{s:1:"p";s:154:"7528768306671922054208185893735786263892447977854351454834071543608211520188226424532595091748227597163991455896141393802353880913727252686305028424161729";s:1:"g";s:154:"3931350151921122314780347621781962310133031238916497178404726881167123558977180174914812344106371470279071072405540448395936097566056878790069126677394020";}i:74;a:2:{s:1:"p";s:155:"12030526433315035140469306931173541509436590353351614316003049833737604937265864191109079597264155746863781242435386938773196553243129970574108647558122719";s:1:"g";s:154:"5262551105713048931818840437133090849709297129874432211503996380201846241562025926981819972075908236266338069212044270892600622047959414321970797115421273";}i:75;a:2:{s:1:"p";s:154:"9080171192643214261502891314642398886325946367848695539813162167683393701564678191652727167179846621803625336395576968061663125749886477301402476057199011";s:1:"g";s:153:"709789037747438551471403268717923397174465497703413510328687265086023430744334341908605956975980410030779626052223052305886135189506754645049360807055388";}i:76;a:2:{s:1:"p";s:155:"13357314213295536619231005838964463646886546298482519410136443596212432187577086765634310652333808405384086750529280259788935338817609169763288472875576053";s:1:"g";s:154:"3008308424927763972465840465972683289043134099712501524187518687952997991630181328065646578654263728776643235789250693981259674530838112112997801930783959";}i:77;a:2:{s:1:"p";s:155:"13306050297284487023040709070162991797222204615032140186218147999553682592488789343049675744599654166735159045082795547527989076358395782301307563843028977";s:1:"g";s:155:"10586434249601338827897130612953689058628048902344954419096716484144284946171236587914481571624702816408228904538974499497771977827631330618983799976606289";}i:78;a:2:{s:1:"p";s:154:"9366504107760787554107889797349668086646215031128274756817605248155100041596743704559665807463008332333531511834473256899818275789020152578564909838966939";s:1:"g";s:154:"1296890521931304524803874647584175069243347320269646405477433715522011568052186590990840829333541256081030481999426230636941661307954606245382960948452042";}i:79;a:2:{s:1:"p";s:155:"12370801442581130353098080816654066418563119020397739942200418473089819692358661047391874663049174382551577117787540448439844491154738143099045780558055617";s:1:"g";s:154:"6842040296510517190110590627840671391670907107513510853159788693248967480920130462096308897538750871495832060995658519648610074675887202669120166694080542";}i:80;a:2:{s:1:"p";s:155:"11077894732742539228461178737611889036810177914415299462002747018598080996762211677501351595137719755735664120371063604922683564552553799605879666676828107";s:1:"g";s:154:"6225665728035878018071502041848578377966752563525174352306433083719321102952407547688689903755913174694857601501432370542759467220859644790183397797684019";}i:81;a:2:{s:1:"p";s:155:"13145416241730004319539031165266146823267243986800900249243141299249692643707823654148739035496268454712317187086057636031267290835062035878246528419253971";s:1:"g";s:155:"11050160386771600486586208130647596663138967212707349660963449143590468628618046744668548025343868972693894338641508038837575295198723184300502415519901282";}i:82;a:2:{s:1:"p";s:155:"11611568192755848405358023732007679695516806149908855592995993275357312141733012806119815203057519665797881047495560403615048245840900249485135048857817973";s:1:"g";s:154:"2172894898451447223505998543289583996691401210736051190210176057916495037526136335918007793521262073068109566941968675779870206983436603928903594965384965";}i:83;a:2:{s:1:"p";s:155:"11081251290209313486762589003942067507294386109493000614708203861884888898398271826165859824008399524198445364973890440885137811409580589713737316428932921";s:1:"g";s:154:"2341203960244595837213070499094603366869960798002532578372599738831741047504816215572635049607899579047269831194426528602744165709752396574329560197504887";}i:84;a:2:{s:1:"p";s:154:"9794529356504350260404907807235199976002130997823212274470101635208030092724642485892237240499775678153498741626506100441198709272408997435145522469814611";s:1:"g";s:154:"4344904416955182816773869473067344211044878507239085540617345084857514867492182044106545330382179727507839983152349813760661281772974710240204268429761579";}i:85;a:2:{s:1:"p";s:154:"8179725484707820411949587770938632194412056798385983337040993681088549942564780789402826043416929282601970567097871918694564510170940044087117293841610513";s:1:"g";s:154:"1968397542995586956640270479775802044571639049081148217555793019585806722702582989925336399488001038506518632099733588396335941761339893103671679996093428";}i:86;a:2:{s:1:"p";s:155:"12087064726834740661902750716902641652260658517688573518871909700616089898549798686986902911827362620660139382723084805850119084200144363662168266918678043";s:1:"g";s:155:"10143128949548754892164655340639862222487020558978119369114321136539759978238238549616976854216342914704256587847974237107728402138497359582900931753150340";}i:87;a:2:{s:1:"p";s:154:"7029682085043851174454067777276288756188737504360927396230568096724183584772341319344047251994723113430875282707294543179001234168984646917770014120959747";s:1:"g";s:154:"4793425727317897442176619553703271341958074640466020143773480645279277087286489116954664501609095871678716832290085599924471974813175615478171487329912038";}i:88;a:2:{s:1:"p";s:155:"11751944887853172690320837788719217620434712863775635748903292970090933885012275919749911820430855929141981640859493347105230323356063850671233945242412501";s:1:"g";s:154:"9582409285060411792170252952646051889530300334780762047880884513762363910409695547459901317732986407473204516314483633161449064045710936889521255288095464";}i:89;a:2:{s:1:"p";s:154:"6857242503272628812624198660871703450024969140119354771706428426493307506557602183087871260836964690607891275115676620226659587257083437212153260711770279";s:1:"g";s:154:"4154176614636529038047455462840427597900131364691514918565903217730506684392008642129862713125121528379202819818759480813600225543386651723083282463528910";}i:90;a:2:{s:1:"p";s:155:"13115086998220969838551534574336259426013013813655672434628036372288827799419576677363079570500421375377429272681906309654330290360291887877051639171311351";s:1:"g";s:154:"6891448071394823240466483662164181607435055970033730150995462293778784684581116262176470853429712481202017088873582225144821918813814521448443862620219142";}i:91;a:2:{s:1:"p";s:154:"8510893906328846244399198669826810612145463386143494241344898024159008867802113613038506831355149788338718550470445775096341446065194196232469619078573713";s:1:"g";s:154:"4719394317458501452628803829232227857042955736811107024588547171771101148737656411606180861478202429084115956817397010715814289972388887344042708309814233";}i:92;a:2:{s:1:"p";s:154:"8196571472465634150710357092777366857982237408029060560236952461265863131959217332523315458373970512148516043820292260787541295332849890579530595347949703";s:1:"g";s:154:"3437715159187221214391366230360038167885711577338021347106416964488193295288404157463558405404279208235567951416122490240147818951965891782937248453137469";}i:93;a:2:{s:1:"p";s:154:"8450294490269241183361812103611893228339652390157337597894872109035465793517753716542229018535050043417505545852639183614639954904116126769099901623714911";s:1:"g";s:154:"2888014306503502758072496640166596674896406120299827826475830676072466087934865509880125697107944254828014207864859572201140883165205473601065103936013655";}i:94;a:2:{s:1:"p";s:155:"11703024906185298810265683615912076101571205851245019004095853861674944958540779094519988491697428205927709507267814990927761125062629298343090366806859713";s:1:"g";s:155:"11125881782324660340685567056782318502630553007218646702194031293015361721973968471899663504370476122752833733771740023378392848654883871239424202536963707";}i:95;a:2:{s:1:"p";s:155:"11633995063491596974992159233441627337491540537056061974579863559637399000043290646127303473958433521042069509695166002929024179229815912787160500228543933";s:1:"g";s:154:"5779716859933543679336004575891528709661168013484215512953570366477029110037380705269852102039382480691593905861950267640597260471662190053628708944293792";}i:96;a:2:{s:1:"p";s:155:"10667411102370081426209854218278625522500220146272991772930143668007669641923818842838987021376423579429682884160787015271663155792992067237050696610802803";s:1:"g";s:154:"3279140280644715139321247161992749403889139000835115394739495331799618231418338265792754929717649735647981445732899278350937379309464302481950856909469903";}i:97;a:2:{s:1:"p";s:155:"12262245462256089092233173409023375655175021466746738975484018042510893911713337463824358605982014894541303198417182824980800641603290435497640012365351457";s:1:"g";s:154:"6330963621362363210369473585040347344278962099805211292047845261983817579073921701279060419242132775223605691558296991488834271200429761204699646704066949";}i:98;a:2:{s:1:"p";s:154:"8411654103823275724025827646019581791360301812783543923051336819177700468260635956242747720616517561011101815431131324637960310731981069286216133688130173";s:1:"g";s:154:"1684947649509417239135260806264943252268526876769637194735757909661839491299132255354516845127033345104113796896495486662449701718944268945929267825040670";}i:99;a:2:{s:1:"p";s:154:"7994373833628150530849560920652401745121012535777349068601400269551607703280823889354692441372173043657158510740536487181611790985457287325461732674487519";s:1:"g";s:154:"2448220787443437832886976788088760055780466231459849980968718478131876017940927162384725064179838850731540842678866145729291113545181168269781059181980456";}}
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/phpRPC/dhparams/768.dhp b/ThinkPHP/Library/Vendor/phpRPC/dhparams/768.dhp
new file mode 100644
index 0000000..9ecaa89
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/dhparams/768.dhp
@@ -0,0 +1 @@
+a:80:{i:0;a:2:{s:1:"p";s:232:"1175701041445302708884945410438770138623067783317783382134975004979727959704321238474087887774649148807392806869952586373772996619822483837057669783131284061360637806319674004728682099113918536008368232973412864321898274530817968189";s:1:"g";s:231:"241059629172068314126293770290309301680725940677268507448005614612902261835370942874314458647451521037890594260859348356283043421942966080214069747884768462092667557211293978755476816099194220284716669499047268771469853565628917328";}i:1;a:2:{s:1:"p";s:232:"1160463397158849527701815009148900197203162958966145645294147435088801477477484675803756332910607813978135261745343212153393703549631957403377304943392443243634274835161523289211102958000522891895552407402369897099778261147415171269";s:1:"g";s:231:"980156576150670554745272209446093662673949888301777582456786615364967955309470589404357349856716186753632817170498703268152900072938066234439475476067541450491769594850768658457448054108176835484453712576430139797796209265772663336";}i:2;a:2:{s:1:"p";s:231:"869999655052790320182350879045566736728057927646570055315646015266889408464221761823392111747178285002452996028958821825296263253477667770414607110824676682799212933666255993136017460383512392289933438630148121391233061157366871701";s:1:"g";s:231:"531763689104538271465553319393201608727104812448097152771133836552981504434572817723821778434687427886222311184464695443966276476945314413633593925811893001531543956477544738605170657319973614928713461347939896531084690457109650538";}i:3;a:2:{s:1:"p";s:232:"1104471889917750884804303993065688883460119170192152304973430999181490471008618869217014529124101277320656445061298881090946549506374431201142490220604127775680178415983020357612677183004453511304179415112545948191905746719765023971";s:1:"g";s:231:"719561347460516300588925619954785617290282281788521291729567441358628645361645381334837281113198173842448560915544949877434810676286698239725433272740122624262661895167489136995799620964581060100972409665350810198636958786254747490";}i:4;a:2:{s:1:"p";s:232:"1349145662078107774697800025503472204512905629848848700956023551865702249533990270152932113986569777681227891868121513976119300639330914333691142005444358532420890176900408029727790838187380605103464551821327354724729985768270850191";s:1:"g";s:231:"817085937396555832326475670220555563843648577688094711201174384260146179381647529871294528787843636664507424097114669660596077372446980941338825278574512780193224362876869434622142663392849627956987124787736307353546621253742287509";}i:5;a:2:{s:1:"p";s:232:"1170084364716675098903795547318887975237486234252129979677466784031218735736488597399497927160715706835015347990348654937293942669164759764598645992563931384215893539087431665099853189753569853096609453066475645389548368518437588197";s:1:"g";s:231:"498080361880592469439063638713191901297721661284941285022996514959223564776280647472546017014715813809968461324738999250055959772268068142135772249196678702445566155036883056146139967731957697436506541599654345718063563028972250369";}i:6;a:2:{s:1:"p";s:232:"1147544738129335691604098236730065784788828984596526639862250998945585078140238290443084080683130116915329899951133515821647678968164144342335104557165878713295306253892140879535183775025459645089161687541667257366152969117453678941";s:1:"g";s:231:"412298807319586531927775096039364269362622496539129056371296014789130977236073468174577767813493223094260356964839594735360408897706250447147501482137328257143660304924424450171953125212533826943218368301407163603147920282182596717";}i:7;a:2:{s:1:"p";s:232:"1251459840625677580659022626732309463308468834562009677880364632310999147527635865483353995214612742318909034188785280532570232794971791642859147218442516084809570095064546523413155269683156065581632009652278258806379535582737762439";s:1:"g";s:231:"369275760058498636550821251653721941442653004141698753680557607690072573886381652126744134536579494435975916488308172082808894369383211230497977817487039647983869030944776494172985030680988398447132958596730936802066575679222110687";}i:8;a:2:{s:1:"p";s:232:"1535344116805682251385675308663093365934297896066448534028022589326515570217831815544787810722606137484824036899107844848252172542880816122541957184557662658297375641247937132253125479510107374276342886367827644575164585705594531127";s:1:"g";s:231:"202836557466759687825659737460642134720697159050648974083932411076616195737116617071191469532222258845229927616307896158504996120614481673047823109046745202089921378952041816061571352779203853628752794105619209196352667523917697914";}i:9;a:2:{s:1:"p";s:231:"801113943908138806999867337723460760488142199250918895058021150316660815957495356670553887727269523631199056949598706103957872673978280763594133212715877891856789747790840641401586443741231064114368395492185857995949962876303129819";s:1:"g";s:231:"694309839379795774267237792764059999533089749547084673316777130906803928668917048001170478345436377296099759955259854815454970932669888732648849422308339634969926182612207089556708827147823506521805267697148146750261179747100470567";}i:10;a:2:{s:1:"p";s:232:"1436624515829922564180170325068347664639760966514249926047688645549597081524232509986327946145949801557430435901646275377697865257323915842905395151585185690389154314744548082422917984187888469919698940546837871940455457802508004277";s:1:"g";s:231:"205325877335834092709861971701407633902492068979291865149734239121982052938975442395908996863058497445726401815399250375047854878980218929298866937343194631341284412844415869883011288058945445382098951175546809496258592828861049123";}i:11;a:2:{s:1:"p";s:231:"799258661369648923916854481905584467963020662311600047520263122726594370519134294878197242897014434488291639184983931668610540662986407313612714348657216832542836246974474679372913895615147392935709768202139559220362017676087042633";s:1:"g";s:231:"357496241504622526695256924227070348312584166065591818310495130471771371727676319252239046969554923144431824429107063633022798934376238009863920419615976338892569518919491671554567567595071601125434766044367945437812431577687923968";}i:12;a:2:{s:1:"p";s:232:"1051408107621350416126926966389976088507487923772801072190786195092112727024301845321543595601559395183495596751958829496260061355920165832559530362684335151735209162390479085930229489502392686579399803214956499703143786196204087613";s:1:"g";s:231:"403603290181277813589663904398385576089358601023743478467711998534924767309275480053287177322410214951726276870415986964145557802768512709681770978620460340923362599910613902980015730554712218603641991712678463309015038515702944505";}i:13;a:2:{s:1:"p";s:232:"1383051313976534974297187974892829648111401197280398169875907668864794188173011090159574779998626193323101562395390896954895253755334899465699105444492348571629049556431145697351760735250630906738856446907072009269784313512185855579";s:1:"g";s:232:"1199735749926534010840481862177421035685177726400143336339476245380207334625197545055011590389537565182644918991313407815516855958991889145001076248919695783887819360092481535762046310624503499974634928082949333536057916703190347670";}i:14;a:2:{s:1:"p";s:231:"910410410031466046008336894253730842559542140395295979211229205768982423176207332543996039251025283987942650159091803684000366302121506053327876979040128253072248521267759503496367422588289312994916213434282179649133744633212663987";s:1:"g";s:231:"395333968233767507918263855813385365725937802861175996425345239417614560831767568032540531242363110450207527777984721790110784642570120251382701537646699019465645659295689919040974065325120806449585538344380252947524183463505710118";}i:15;a:2:{s:1:"p";s:232:"1529776512580798243176095530405074419290713556314880892947927990554803460910611713935840752123509682810306593293156433397002521425768945733982728045250387111578481164344007611587021198066250169964931138878655459215861198402408752241";s:1:"g";s:232:"1519445383034831931517483004442912436628806433888857538825450472920479943253898537957628551027851368648480607418026659708334282843471559480798797256421924871804179230900235354724271167196448484462496628734555064125761767269533924788";}i:16;a:2:{s:1:"p";s:232:"1055268106948316845820037199650696972262803907698438854383595488438595533496939565236257936526517867592674209529034768116657200825044331454286057391906528610312326048723296678566840409480856556538022261783249175274722313496460997393";s:1:"g";s:231:"206199432446954854501155354593104258705023646498347422866452068277855761599832823029544119042795306106607255641870488124946938722987479414009442558427811133307239255777567609322375398053036527630800505594868640804750267329497212019";}i:17;a:2:{s:1:"p";s:231:"927107232904572327802253196907414522890401198741432957033542471901660060735503741345053740426201523001385615965320925417307275335888742645568035113779553434911899954660857153019756367569217075991771367419354564510954569387686781801";s:1:"g";s:231:"151190234644925654338468905080174282428312425171620491840896135001550552505285467270405831837663599636842153464661142497087602166399039180218595856073426378582252819789107700342324125115418517879031733765651876530588736801131823295";}i:18;a:2:{s:1:"p";s:232:"1230406903627596355429630307357961966927902661330733966048912828726210489203733166524900751937788479926740629911174130814981095818248169716756507268089985544967870065234054865704635592765032821889963045586853603924313034646459830073";s:1:"g";s:231:"668999769164149606396391905469702907438198195801890018257916180836998246805109153504822600959837956452433436824239329746422896185329845719328738674560224401963220334020504352748647213145516787548177208958659785899244375716592236867";}i:19;a:2:{s:1:"p";s:232:"1343141590028980421073350570601903280290621008374784318649055603896772206627855071664874368580315902485143692539969771358809943653645023853698628652795134155359182055321034854859987485434971478105676770508757702487134643905697728033";s:1:"g";s:232:"1062492326293435934559743139342998676882453034582556699457385659062085223848520214771625029649875938957628105282196786328457477581581392517919765722570685022794786407108203606530037801222131349049104920985866100522223483258865794132";}i:20;a:2:{s:1:"p";s:232:"1098403501638594864875213493901656255041240203343882113522482831939345936346184333653406769548850735726528069984539165555039980566126422074768571246067148292089464329701721589403155070691338254029973734622567828509785817071950605917";s:1:"g";s:231:"310707833062544531467216844645561943098962370578916742760756974233153684446241745616739754688573566249846346213810020620706035698631735705193177208634153280990743680897033291523201037446504027887000748503867934381496920835149838635";}i:21;a:2:{s:1:"p";s:232:"1043838138616929138101811508697535923531994446448500728653891901609619113945535663253153367104375297723741585045382617087805586145467240001020812882375523417325765257159570623394415973410607015885926973240245828769638767158939735823";s:1:"g";s:231:"211284959053982880949257420097104560359997038327161027485101114225857008653586904671967082110943338617508039824126355934406108355113694160236445963650468176887494420082682469687380851945881864137800975727598046593748961975872182006";}i:22;a:2:{s:1:"p";s:231:"909481145780067907589091924270230177315783422840482719065855137220873943019392515645706882821956626647690572635519707871148396286852157642254684138616573098568906464473751784860772188993297829955265667930698434525595917268839160831";s:1:"g";s:231:"411306373730682918768088046461658053886047523482256086504433211926229153450331574028979947269836313494655588335578201035994494545773927011311403549789887334144260346261933762436411397706540542779238658495048143846325391633700408339";}i:23;a:2:{s:1:"p";s:231:"998772161604674730427208474561632709989449061544052364704570742358230797373567794007176639781433176998472046787230276993430790779126524790324206509581430785260876043040417441909101570474744218186298119505360616581421482343304505361";s:1:"g";s:231:"184733937063612803361298769841757157417723900158741181107006790853944625842943795481039244412016877898192770990773813962037207347519355631352186315162236644592559703304341212558034558069171398380113273099853523626005475129103034636";}i:24;a:2:{s:1:"p";s:232:"1211631790987909065279106290645741658732666570591761876339218049687009689063703460852927094478436804703232418641595286790833128247242322236659720330399908817197999763125434214867786755513779482406322331051070406373162250047920250789";s:1:"g";s:231:"133464538617751712105475405020034283166510480141148453432578028498474033289040983933470799356156378878000022691320750490030719324585709132852224359186694804553298879192734852754173248762941163867013509089588026892511564829994204431";}i:25;a:2:{s:1:"p";s:232:"1480888488064451833774956808070244282669247589809971713206520764621641705446162614681155410627412992481879670199414987542533382624645029313151496617517954653413410026066284178008253584891588852045810626847039641755473089536554922773";s:1:"g";s:231:"913189690685537274491321511987396961330148258005655893526179749241633423973343337308946510334297747881793256525675559159610647568566050735753323597640433431964439800847620009583803481087410232791728210821760728996331203279213947272";}i:26;a:2:{s:1:"p";s:232:"1226836596566030285671888769672320821039004799655006554366618638637080790239128907289006853315149550819913671825983025640271041255260358294952167094606385035928653956687684571574517682208206011184632341554573212143424439340894536707";s:1:"g";s:232:"1165167826252532206764102608676934821873844628569091073440126408824517260489370607025426954145855274315912579810136126737938857566389260232456536101214898786965422243604428182899785175865041677120867451350549315484291937166136764004";}i:27;a:2:{s:1:"p";s:232:"1299126867636766047256602510774249303897946838507797326381539542959828986746355819063983912580034597435296309466632887629584754859249612032021106825967545400294837414879858419551447679126128541532092139202509474234237614792211320507";s:1:"g";s:231:"557454771562979112928503109388852680893435316641935992058431451772623760588666541249846163311300085316181790874633653741197111690133694320561807770330887656762203562703745220895210253776537073041329766823041746432316834986737922878";}i:28;a:2:{s:1:"p";s:232:"1126348355679296469364456200534190821415558122462203950222173903971316162001039245110015744494619630001307006082897548431481233236573807001400784395505656822302868325141067593935428572148431711769877790056770349398782273732033932543";s:1:"g";s:231:"992021673708868582769366906807993213154273305041047666103200722689673139917893393228140356075089227443283350105873567260204733321860706890148864345986528697202036125039604459943243445725478860982681407323820119155437657100371338526";}i:29;a:2:{s:1:"p";s:232:"1008634401758053187128277736528417410192034136519415574669256634516119096233828450468977538112572526973392323180933841232544505680400539244347395331585330307268440666331715982213274229183991204285522535330619906085375274079227768459";s:1:"g";s:229:"8760572556759866083474396024852617365462326797230737921542173365405997497535302354545906342115080155661950187754873201977061047090180215735138055522021787946051807192598998411896616854579180955223805032820165391468693386400272571";}i:30;a:2:{s:1:"p";s:232:"1166978258595089617844403001173506915012122138015839804357937568870367230913358081275686767951974838107971386291410611977806257745948360325814106870379818730302342961515325103533493599551258196409588500690548494831769467819283926657";s:1:"g";s:231:"812710962266620243090428292895471184148359621440469875551097327425018412500712903590238262376264809756735213909943793204442223237431481867379981948700612089289422272562312522419823664998813366865358855830307271676644906505385900486";}i:31;a:2:{s:1:"p";s:232:"1302298468784249119897859605635105295493385466221287850101629491320472840125840398596019110842184371846880449698083893020753859720550094093407591344533647559507312410611357312646674683805014786093994912628676036696224037212157184447";s:1:"g";s:231:"554178797388666049055219638833783155765529248078367747326034365212425526271152990752929505555825569368390318252869310697577810339822779922460591657816810807115780260523476282093078547455605388274840263108672842888701583560113414480";}i:32;a:2:{s:1:"p";s:232:"1442931000879495418147830571703209032868629219398975970234579619558717538766726952628317588601304783460127319543298710724327794361540627879606358857914590949147783774965728031895515384676429380074454381434982743851365372673084575821";s:1:"g";s:232:"1243370638952605893651352051161751789940342061323296322682621985360092310205841028660332063743955170031003140637380278930009235738429325643370078390617842484869594029175229248055914742953616388093671357850175664014116837534257901300";}i:33;a:2:{s:1:"p";s:232:"1148631939654604996206773214574552575711307896990934696385104190030217192296044952385521649166190675676640218110404003177982075271795264830578900777976949290319265960261829395103171222603537402278457239415980314123796770451452349777";s:1:"g";s:231:"448023484821032996636639996750542199189362181239231401153219754636555491419612590302217492863117647800708873851242669804470761410341377037489017852304408246918090055485282225739486541777100726481671909427004627146773220357766465353";}i:34;a:2:{s:1:"p";s:232:"1393523907386733639196096063316267020192297325243477671179771572687950474193652521299745572736639931999553943306828133031329380137072125223794530447655767869824129331827371927406431824314926409286092407615670679430786622997473343069";s:1:"g";s:231:"158382239332012361059586498468810507761951071253874327107989888294225407513544700530720873616427478949372862299790858389591473207674049859637536330846828044918745064598396795657590498426743196990965328660346415613444898158459599150";}i:35;a:2:{s:1:"p";s:232:"1222102521241577470283074206070854512365381505703044952665199901251711264414931392126084324385248931164740262398980646038543572389444975748645047292454791849985041434539105121366323608243589248572317936672902512257895791961279944753";s:1:"g";s:231:"169474809564989953084527210878254013750630191626979057975836242572371875202170178801841933921565732612820027939995759973638573492141523255284416678413548269429265856232357410256501085766083506944544506248899177627896120912756013303";}i:36;a:2:{s:1:"p";s:232:"1538598708742095545080369228198463718092167812089180539057575039024868762502691630260434517572758932344173922950898274079386406523439552919172580086565148679698253538312693842622352860900237758454513286076544847373869014109979321933";s:1:"g";s:231:"487925873109303632774725988789554372098246151110994418866475560449103780481232838975655743841665990844058650418668869837797071102539887131618290573262237167406538025787225706255030517039749286358613977923363625043888262053791745638";}i:37;a:2:{s:1:"p";s:232:"1097899884450506484051905559182453553026916821622290305706630776055467106423904840844285706479146578446144665891581111216357975998894809415473529916388666801399881277039020074770237098134085307809567159080620682178430449377712188961";s:1:"g";s:231:"713299421426006881519029802202576054402261377160137162915585056231624159229306230285934068619440801936519514470570753298571802541176133350536243875118339091016873336372808782754280946665027375040616208507565862750376128043447148301";}i:38;a:2:{s:1:"p";s:232:"1444512863731935483894008702225378125585842694087894886366183274520771087738191267827986626161760688063530784261619654246386352435824102332177609005234887329162299752906328015345611754396942570774934472072201469346813666592126095319";s:1:"g";s:230:"71022242294633908238161350667189909739686489589295601215049118314301866007824223582964959139713235801443895454852929563171050201408606095135442608708015241740051890609221031027343612271279397254089991308258936096567240934245572172";}i:39;a:2:{s:1:"p";s:232:"1273921505529135134619471445603766730070275266833637077209371997021121191847495299878557836242176015913055701620097068240553902757712424908402825274359798411845571574397305804394784399551447648769938063688585195177797469676117292707";s:1:"g";s:231:"172283541835681082917921474708343318584309604663465791287861400143479265703505789482265599399730053181227908951029046784839847417910485792238689678397452497349792694795337120509247353125741777608749797251283134349847071985419946945";}i:40;a:2:{s:1:"p";s:232:"1391094208269651754228863172916777407766029968601221814793322964684263639354664514894064147017556309431689085598248754658855730462315479244796403513137082524919056979840050289629913330468113348066024861551070516586953578831954940287";s:1:"g";s:232:"1064795025524333155217046316426725709816790957250825507504827677074388754937495371228984429697045350593451967952162867994241570961967536898334578217100559209235672050677519860167586961789899607637975559733514499823460278430037576476";}i:41;a:2:{s:1:"p";s:232:"1326936468445641417245559449259189655277275904688276735759218876459280665414495776416728982820158299493847435395556882477708348526659451871434133327657573829220249539269158877916024342331304627334533741000563961956005708488896022881";s:1:"g";s:231:"560160325520918160311489004538756330652584142975803146221680066558825151966681835216098707623810048671320310293566100399843705481307636868232976533478296776776351705941749079437351750375489046635461241491940079270860197965945416491";}i:42;a:2:{s:1:"p";s:232:"1218560238812030632047384946207677724376675891003367919894642606676193534699851752823852750039116695047951403361183030635500544410234555075253604602470552567206345873731073012853104591337510965587671909822763481187950084516458148541";s:1:"g";s:232:"1116212605793882361334980508554999764613524510673113925014454336067379611972575174811960004123114872049074376846221629670991490051690110183964326474055506681823977538787010733251705995435908223148341012046785733295266820798998534733";}i:43;a:2:{s:1:"p";s:232:"1217497188427651645518008010219704097963219997072947918220282510627445392004815995384575298457524395356495753067496167745895373477700386523537698186007914458939259790774208461717994689738008876315744224012847133799009218346684830859";s:1:"g";s:231:"770511130507901438600412006983112284630991371571710484001330082877838444871356535886313179170160624860637206210159889225802967508583219897305328840950801900907190541603972767759028215668443657472137164937170393059374657350234172588";}i:44;a:2:{s:1:"p";s:232:"1384805737644402001602699295819222115889640213864823739426626748938803637018791449954061797401595116354246963498875102004687010135881571778446362154004089583318355206463990307092106845161235823666584330910755849289622581381706219763";s:1:"g";s:231:"300549098900728120997184377962666801713866244121245602255994692891031308924882229511798285554574949183744241271474954854124567793780282055959022388578786674058503642047846767669358674513850356363710515458249831883431353751436640473";}i:45;a:2:{s:1:"p";s:232:"1492587067635046724641688792619770082885080916623128596190835123187399555409237704094491882424098429004582220181182619740784070606699855534865664985479518843768489466772177132445303667209841765020506725096570944526583342827976693139";s:1:"g";s:232:"1325875501024611168460651086120280057597417113099909975171178841675907943309975119263343672690373708947175682795213117068208929462717160334883318825145705113989022565051297121267153447173858992622609588411242729579874123397975266138";}i:46;a:2:{s:1:"p";s:231:"906847226862001776111816505493768281038044494397978048283918521997355784196400638087866270344123622589898850349070632444514905302691870958199771371762471423025985936761842533697767348529899029836077448253984658354566967653666300291";s:1:"g";s:231:"736322087778788782539692146029647707897059850806268174498405656773634130296338358454597944410361988992697524598389896851941261557414721510027421303659079837206638916639575833006393233205754151775657992256732326725637747229302979816";}i:47;a:2:{s:1:"p";s:231:"890185901266080927782491491465517354612445249578323933865882607342218018045827339044063305815560761455409394432525412061214187429139579299492400591506581665066538172120639471965430764234311453555561931633194236909247720214805118073";s:1:"g";s:231:"124603950693163204561006130618370613293543114866078188752893479503564944442854829116472795873813395868608031842115370116074318303022427922128279623081129104975610062908095108555177761931096196714149047005610934112009256489171764836";}i:48;a:2:{s:1:"p";s:232:"1022859944913338265513498287914025160760413428632788273312840355167309743967660343293231033751474736710985228291770444169425283751203244350644086644312399632846696705942260278260962694665474670638153088334885364597590329213855838821";s:1:"g";s:226:"9300900657434489047696932947576507254742485851137640945740833346773894336289041369843665650418554527779923950617936614501875553729924367471021774760018370202907818481345597919412260900264979732317184833567650883567557893375062";}i:49;a:2:{s:1:"p";s:231:"847503998296101285006099790915650900236373726614141033690527723241117720398089645943375054063733472277302479655583554156249145819849151070540753896248678323721722706542142778548044002424582998724519091068547416460817463290942699611";s:1:"g";s:231:"331234074300921661629671326001536898454736192468494763379095145727215648933648617862566547316445817232073025874507971645175373540892437914378209189920515870658932521438504082293358796446613855932588162795845812833576149004264344863";}i:50;a:2:{s:1:"p";s:231:"776854996694680870329679766090923197499320601174183889649293954753262824403489810262166219938884720481651530046864995498795712155925117242820332769004044593138155353839210071553589166493553905531071130000245175488500608606205250473";s:1:"g";s:231:"122615309163484352435178123040514525950693264760022890223935351486389853053969215583729800598436270172453250408297048292547495756555972940864549104698760360917270926737887015081447655824274035565458153166275374845431297392097414896";}i:51;a:2:{s:1:"p";s:232:"1014670995663321290921359608373778357137361583080950879880689089887602978213452338329707495620559212973320829485461881514443972718327580018986415671475880393790411550869335287644265510938928754450088809257531645018845849163898576281";s:1:"g";s:231:"226285175444234122973784619180694638633082167482716005469342385327449875897886239234305738740923272773737253575122862208019661137330217557014525226385441537374271233018325429043614739444592408722828918457330769483139912858752454089";}i:52;a:2:{s:1:"p";s:232:"1513169936271423788180663828796897482214859916394590058813086550258563947455823332252203732874362687681400458889518212204992499000169381984431868914565922342454309296824550072503920915320186996860296769236804812815276715833511954449";s:1:"g";s:232:"1245465226405785393052937621442782210068505909794754716840697886490038597351985032447069389595318254694322269386159967688303058763948595197780433162530139509421500448636935611542180856628655340298116911739813872332241561279520583037";}i:53;a:2:{s:1:"p";s:231:"856013253876479059165623628305975849448863358527134908680506386730475791772900044328912984363736340417917938534652131715858635313983806851931477692304414025858982778155821878443831228714625883654404089352024899372025088563084316869";s:1:"g";s:231:"552321690037661308598423371621414370654966204550026610831501356822096243392290173211006773925495007312637920045552352583841618385583528133106087248629846785238349605708729343227241184823126680553458580263594415232887609278033875784";}i:54;a:2:{s:1:"p";s:232:"1334480887559536589949159249692733945384620792290589721623105750400119965602313717796597363544359710470206140367740972924185775527922974878933291445658045025445697156766756880651352317344857640429287980516377747569226931211212491243";s:1:"g";s:231:"831886041645277013617989310710106338581632774794225204139049756217555884181929382441547915129521121883033469509223234782099800019424095140055702151953921493983956381659390147459758077951959258488692700947152076829209345127239827417";}i:55;a:2:{s:1:"p";s:232:"1409778745614943123059960637458872383143362660474711587361838099172264328103771279599449433452471625362257540153827777349113762556225898756006249367026194953264828964987050273980148263779979224131073491468700936532944198371641899977";s:1:"g";s:231:"209776098029275436626677833731169078886117278885071715114505435642385983294326851305920611380028615674022483844583563627952192347687309821075096153883293433371184894010144321609833671939957316414645692604141259818517456628329910873";}i:56;a:2:{s:1:"p";s:231:"987430516189578827941284205088054611661620082263300587768516778434122699181082412846271052727003571281820389873181317063990985395433365942896367875649986698124817476989968806919034781078588254781147833741809007727914947756658579719";s:1:"g";s:231:"698200987352603681412105271807898748738354178489091119603323819681401784039318713333863338169737494530635558313935752562046668296212183293510873749175392352219364557252076204906131397081041002324767066945164857926826022730881675404";}i:57;a:2:{s:1:"p";s:231:"911040560362970417223048893768139389628988085687664013086009222099987221610406175395791423343767969898453296762333521288463623371559741795220949359469991966317300173096203451768448458436821759854332302902207049123095122563165328307";s:1:"g";s:231:"812594270498848930761688601344147752029772770381862776843635538689863728582355800020232123686093611039261541242167974286295835132480307822937387971672370687322097986874325541469317368635346834600976441766125378899144114323921195586";}i:58;a:2:{s:1:"p";s:231:"842219267974145775932989123792894671784125999773632266618794032004279619619519039224988473356968580745314383284533399642966645022341924016346852389496721864434033649276503114432343392698641490910905241779155079674669501466846833029";s:1:"g";s:231:"782544487507669192797122586247172939394023717046277995090644632052579755536328116096809168402110105266197800519534245921413986378461638788404319078240480929658281653750321747004440253112416813029050528374146052783221176298960313565";}i:59;a:2:{s:1:"p";s:232:"1525092809935288563055571570345820919524510847559774771965057561434975140299144568375358794076795210329084288787580378624089653481424466572254329602363278560207486423630141957923693225949486458225166351939026738254383383758746550647";s:1:"g";s:231:"263159922809445009879913179233924861644960413198762736113157873838038016723475464951892708348898454780740614412260641141522795265620349407440290686043887300757338238371334215462378864319590332417281238178704191943671667823961166359";}i:60;a:2:{s:1:"p";s:232:"1028460944421678739403869648025955612818770271689302644136310102933827246458867980827164258058168388339497134835171980844721573217633367276896282397205968182286615164389206641861298761008845793572995845616202743253555140748983244893";s:1:"g";s:231:"819672765703199092579137249865392990239671440769336584897585625379019575251829873924916934853746122876727468334182965088796386124896485109134891396778358088857805529756796787244840685815947720996926500076399919959153319935883154000";}i:61;a:2:{s:1:"p";s:232:"1116618938793971635251620742212333252084112686089695775091783024606337481417063400046973984308140430505905270470079059953893854704527630489326325210312207750227881050817557461457444716365677910986604362917828660471351341858494096857";s:1:"g";s:231:"886495389264431043361764083003188433619726956091423072234161147317167112643474214952357022594163640185279213659123211404675499610319150780444047197146211575454186803578750421194177193308281034306938461424526451109993556092290605627";}i:62;a:2:{s:1:"p";s:231:"797968355931248443337687572785194531681078668525894869616504982246134880136103339282591195913229534010078819186752873549484555106465378939218557464942306392378439519858664609681412161147401140973953299911521409960106976112377369951";s:1:"g";s:231:"640761121637205911582584925273104207639077147629241246006735106298865340150464943301800944597332710902710744600875720127926074244717989293323153036139147904419148401305887127992654239622527132611342941954632024239990149310032901493";}i:63;a:2:{s:1:"p";s:232:"1149737784597196134539684844606836077174184511853637046817912791784871386886645941003768607272989916774461791399081844778712220484980184567429117869606255891575455994880709403094980089125184082083924323339390199617654884285790410503";s:1:"g";s:232:"1039603101125034957436037513842799552783264469564219071603467222335050285123983992701815389502802987632956762276871132501712957623514952496732752114440497953627338896088394375658021187362290850795614408283008309971686190025693722153";}i:64;a:2:{s:1:"p";s:232:"1329797930634761192880862076059880539596186910848560549671049265461292267955242454490202990291540780566466579950852416159337549496195757247640919986667450812966261394943118725669861905621692926696165004880010479874148373172971610213";s:1:"g";s:231:"635837337839928249217276793990419059939905043474162074919430227356353695989613476295402258138887032051601585713030286174494298044263992707036482422495872394392828704770207161110057952905919230753270304119362774387785321873795683546";}i:65;a:2:{s:1:"p";s:232:"1448623913900261434798685222085379218669160577429273882531357393528490254936279125033819527984087800012125045586904590500187521846246409655319426639918743490196370521969556745886851634696767082843480238683377832803357594808338808789";s:1:"g";s:232:"1242441591251870653887844129258287272477292810570170069081695319311953376562545356798018649099374884003456979182728581452667824918519630973802906602011582350683406354751790448752315826286714466252353285493390468597894860032976159350";}i:66;a:2:{s:1:"p";s:232:"1529668939507791128869844490648290764124365901674422927387106692234341029103618077258533057496186461743031022527500511541916188830355814266429015729983198098357862460965845074171515400861687303837201652935516988746262569004563481137";s:1:"g";s:231:"360660974134492254118200341405376185297344709314085805544303296461805947453282575608141632805937006031503783222427477376904080696378020878384062503501827900451149127843292557616537602904756471733366682875566612490823990596275677543";}i:67;a:2:{s:1:"p";s:231:"964349802834715627091836311947560216190347334606515569347370133774200574976490727345212588410713504041991155364894697098411252472334205496527965699231720356863841683017206080615358842110850143586011962642589946348492970286665407969";s:1:"g";s:231:"929730835796228663589459296460175286247231890720354407494506948655435307304668112405072832284354983725176870181434323215671241174830416791009058499007576373683247657428144973843695554591048285334385411320546482122096833997170957438";}i:68;a:2:{s:1:"p";s:232:"1200697114919552440328212662493330951577090633392906181267524661711427686156563810555704977987849019161562995566572698389243095893050851873199166970487411925149684342035613532992590627108705912648804940551798506465761008844124620843";s:1:"g";s:231:"210840229717284786647061522612464250122170021966599147979091696189226789454714560674351814215640043731623851038273701713941465042304615442622261378902191416557966885769781607850757337283990327310991779274500108940892706318414163737";}i:69;a:2:{s:1:"p";s:232:"1505605269824790243792831609706828893984166952005042857668330387295629646099176754803575647869364684706773658989884573187558931362886298063556945978444360603261808118452381586301369212317883353307812109682258121601862761142502891243";s:1:"g";s:232:"1084946940052009414079442134492764126131699233360610931749616742969406318399538846909634709781884746606435633696011708795848205691494703339546378266099151348812964157880959214875332081239995818554049622469426669215553286217171990197";}i:70;a:2:{s:1:"p";s:231:"816293659194156584393426852964866212253294848481848239113280525200956078812795725547016870053079733390521590030205302119472344262085862246534098409593188906922670398233793986685054688205359526482886045473996570950709767907766332287";s:1:"g";s:231:"125543207479359049664289679776762548350219021118060184776896419904091327416143098271532647423069203715703939418436750054904161036732607263073370671224895462307089820071515048928316155155106995471046247116304202948872057424249829306";}i:71;a:2:{s:1:"p";s:231:"937909358947516337782226369107329834813267396990696800064373114984017087896265925553479913936810219544596193425124759913401224821463162739445133029127703779747659708487741259835192876317663968642084022533197690267855480324556527529";s:1:"g";s:231:"578517033963429110326177951658909289407442324189047815722917009976102126212418383103468613086046773738909381129731628643776381606497183416474147511436721740867586571298578391173413176636727370915614428453897927588536871545070706826";}i:72;a:2:{s:1:"p";s:231:"911550272168591326631587048781719864290181926192452902515376445349683296263628887572901987291151834516528416694948433228654143979995488104146391642798141995369742621984998796392603683788185226673225012070762425265022227280304690457";s:1:"g";s:231:"435611523987279849779799983928466846964355559414907696183238122605651893912177175547925756858491577574088472465417508238273767046169709657388574379877072876851067175453958959942263115528642058698110491508470757333448223479152968166";}i:73;a:2:{s:1:"p";s:232:"1402332241612496649303040369601818876241754896465490665184937776221374345017898846195563177922807182568607634848789855347331333564677335684945270608142923662833369689062726669830621769891269806986781199834351242524607209182727362697";s:1:"g";s:231:"788295437611846442150468706453593520179759913221608649431645370830934491660511057392020327584205620415434194214357441850022798625239262202825957968879464188504280320734830085023023361870953080951460626858564454404757439725700161728";}i:74;a:2:{s:1:"p";s:232:"1385588118482316945637342314640019438423845714093498454736894992477851611815122782181701750401675268595756082471037251485773810390075324501594034728931640633416343793046633227949070383016793194462388968861476522738244028507831412807";s:1:"g";s:232:"1051407953951842293497025880784993624653296083738495150909318042975954326467188611760483303718017506605889424046908175461440744704653882860969939760977844939897006735758164931979823290042430064727472581445761138927834062800381857331";}i:75;a:2:{s:1:"p";s:231:"978710653878765138245032780973262837628048824442834741766271800856407798633040866018143219855860066364565173258532133152860794957108413774041864442703022361098911014546932838970841896265536654441302583704650549691544524094461072893";s:1:"g";s:231:"828596696507489340388194242739437030691368481839839233808126012449055532045083652206448595030469705312890921141157727976947093518174537867725716826615058275916344778889368940911120325529008412131628881439241085844298695161516320553";}i:76;a:2:{s:1:"p";s:232:"1207869050442265806743029955005671272145050338468895879407536822447006913893944092569221761456800766031110931886064737811279146170983187046931749573257412308812343263137605940218514764728941135936260457381443965473446727029606288087";s:1:"g";s:231:"901689553109755299724889749491986982699260680669362599014476634410057613935478700557783089065666154315108435551124047123019756359394197131705864747694817007428554108935506622319753907531599531406412261181040137293635457527629166928";}i:77;a:2:{s:1:"p";s:232:"1253843053454842191496073929229960442713137064902092063097530760375305147828977522103815652822832423852327957157323143291242551095036701741131995598289925801806713520933881311587031812516333248233614882790453878318165294686629013069";s:1:"g";s:231:"792544431306829255892236222953864313824441744771937100881849165125912187035049340690583274721296595436406556486333849801845868860653775711166921783066039453091902252131197402979987834131940589379261131585088009418040811296418479470";}i:78;a:2:{s:1:"p";s:231:"888292115983090727383050041245510071901205022923621728740399250824091752574901194082071159280092849203038477423626851997364728759797869144784736703853891927718345111493348065946995574844270360480831713923673933284454590573945117963";s:1:"g";s:230:"33696947092788556772122343063346211890011409922110209522470356049181924373620706813436426151964317250350038187149729733343587721985790920558911543375733639941083283192766726820247487603481905775948491707522483335714118785605159459";}i:79;a:2:{s:1:"p";s:232:"1065050883104106794605549148848582174187670490934739354153582360382562310727039426519192822266718204976225715166151783557831632711336128952563917986548082358394005487114249579063266368998061115536978960094975378583758814372365078093";s:1:"g";s:231:"502815052869438460385725830457308481580545642069196745882872961945446262964900004194947659458399804093287259814745811856081827167061262636484787575169488738796518181394798689913840456698243916045055951843096761093530731109148515060";}}
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/phpRPC/dhparams/96.dhp b/ThinkPHP/Library/Vendor/phpRPC/dhparams/96.dhp
new file mode 100644
index 0000000..9234967
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/dhparams/96.dhp
@@ -0,0 +1 @@
+a:200:{i:0;a:2:{s:1:"p";s:29:"47738868853409368611448259423";s:1:"g";s:29:"35731344447278389373151857379";}i:1;a:2:{s:1:"p";s:29:"54398515560371522763020384303";s:1:"g";s:29:"20945390328056174207502186797";}i:2;a:2:{s:1:"p";s:29:"67021188426992950294948561547";s:1:"g";s:29:"36939587946899170933046198189";}i:3;a:2:{s:1:"p";s:29:"39859896287770890834674542079";s:1:"g";s:29:"19966841823306563175123220931";}i:4;a:2:{s:1:"p";s:29:"76657699145424535679587536947";s:1:"g";s:29:"20742767732542452380807121413";}i:5;a:2:{s:1:"p";s:29:"65654697177391396856160066287";s:1:"g";s:29:"35809879532657391287512652743";}i:6;a:2:{s:1:"p";s:29:"71927430958542190463081134799";s:1:"g";s:29:"26380996146846587208902265941";}i:7;a:2:{s:1:"p";s:29:"73851341904947983664623532507";s:1:"g";s:29:"39064041849461247852710130779";}i:8;a:2:{s:1:"p";s:29:"75150031586910716586432162263";s:1:"g";s:29:"35111296103975510649443456551";}i:9;a:2:{s:1:"p";s:29:"48280401911664030048950789063";s:1:"g";s:29:"38708265162164817606775753013";}i:10;a:2:{s:1:"p";s:29:"46486903440519245437076708207";s:1:"g";s:29:"36853353883341331838222365225";}i:11;a:2:{s:1:"p";s:29:"71350463299297291211905999367";s:1:"g";s:29:"30011679077810814610369448397";}i:12;a:2:{s:1:"p";s:29:"49244741619315455361043774787";s:1:"g";s:29:"24808662195374590974786927029";}i:13;a:2:{s:1:"p";s:29:"75868764131932808789305748303";s:1:"g";s:29:"23008143271859447381803035283";}i:14;a:2:{s:1:"p";s:29:"43420198456255910520716195903";s:1:"g";s:29:"31396179578286978229414861957";}i:15;a:2:{s:1:"p";s:29:"65808217191785471358210112163";s:1:"g";s:29:"23010755437237062565991743601";}i:16;a:2:{s:1:"p";s:29:"46342915312221934564147401683";s:1:"g";s:29:"32030125422857259700058924785";}i:17;a:2:{s:1:"p";s:29:"64829190293054464121774784203";s:1:"g";s:29:"36833856892751915776286945241";}i:18;a:2:{s:1:"p";s:29:"45607701182765248395197208983";s:1:"g";s:29:"21399768901521056627247192929";}i:19;a:2:{s:1:"p";s:29:"44017242699060517442490417347";s:1:"g";s:29:"34633247284653303079399909831";}i:20;a:2:{s:1:"p";s:29:"53625999794377826447198971007";s:1:"g";s:29:"32287604526928583732085092887";}i:21;a:2:{s:1:"p";s:29:"63810410075798796194546009783";s:1:"g";s:29:"33103148562186353466279530571";}i:22;a:2:{s:1:"p";s:29:"55031538359753114159858892227";s:1:"g";s:29:"23141307673487499531413743651";}i:23;a:2:{s:1:"p";s:29:"69434150571492934132889103167";s:1:"g";s:29:"30086360725418560877456120447";}i:24;a:2:{s:1:"p";s:29:"74441928984373159899495560039";s:1:"g";s:29:"34511570476422028933751385293";}i:25;a:2:{s:1:"p";s:29:"59997318947177039408737791407";s:1:"g";s:29:"37250192862910145086661507129";}i:26;a:2:{s:1:"p";s:29:"64196128255368851154005218607";s:1:"g";s:29:"34000495373771857887090742069";}i:27;a:2:{s:1:"p";s:29:"59826698978200053030157188599";s:1:"g";s:29:"19964494685757012065098346707";}i:28;a:2:{s:1:"p";s:29:"62765736078018217621299172847";s:1:"g";s:29:"24033335135747484383237117689";}i:29;a:2:{s:1:"p";s:29:"51371314509993113368964576327";s:1:"g";s:29:"19894806293471511838941838425";}i:30;a:2:{s:1:"p";s:29:"62760444033308002378100678207";s:1:"g";s:29:"30291867805192457401765510895";}i:31;a:2:{s:1:"p";s:29:"53582209453070233186745035043";s:1:"g";s:29:"23236665247142302972696051523";}i:32;a:2:{s:1:"p";s:29:"58994643014783385857138676539";s:1:"g";s:29:"19937877643250391176571531199";}i:33;a:2:{s:1:"p";s:29:"48263329442960242226140798283";s:1:"g";s:29:"21427830008975221643678133239";}i:34;a:2:{s:1:"p";s:29:"62366601843842296162395153527";s:1:"g";s:29:"35945985312870131030534711981";}i:35;a:2:{s:1:"p";s:29:"72347374730426653226589947339";s:1:"g";s:29:"30316686633846692480439000229";}i:36;a:2:{s:1:"p";s:29:"66889481667385002256595238959";s:1:"g";s:29:"21467091715498685802445826655";}i:37;a:2:{s:1:"p";s:29:"57562601577612410905954202807";s:1:"g";s:29:"34758405076210401215630410679";}i:38;a:2:{s:1:"p";s:29:"63417186170491909088356422467";s:1:"g";s:29:"27136886202422383743778098461";}i:39;a:2:{s:1:"p";s:29:"76651191206554712261477581379";s:1:"g";s:29:"25399251868035504726174067835";}i:40;a:2:{s:1:"p";s:29:"39742911256893192535752596183";s:1:"g";s:29:"29759759175624969510221105241";}i:41;a:2:{s:1:"p";s:29:"53063241966256162112521986887";s:1:"g";s:29:"35220272870226041301738969745";}i:42;a:2:{s:1:"p";s:29:"64221489119473367767687041863";s:1:"g";s:29:"25840669648472436001824430091";}i:43;a:2:{s:1:"p";s:29:"60401269853569313228801931947";s:1:"g";s:29:"22842216079852083701198138345";}i:44;a:2:{s:1:"p";s:29:"50500264110803784895147849703";s:1:"g";s:29:"24516065342693939347117828967";}i:45;a:2:{s:1:"p";s:29:"61164830232419619474067092239";s:1:"g";s:29:"26352350231033249314852022313";}i:46;a:2:{s:1:"p";s:29:"51716169310525088129202326267";s:1:"g";s:29:"26869080532546514878512382181";}i:47;a:2:{s:1:"p";s:29:"62926434851243291755574116583";s:1:"g";s:29:"24702135412242925509885609547";}i:48;a:2:{s:1:"p";s:29:"63865341648786748578166981199";s:1:"g";s:29:"23148109461305702871386177549";}i:49;a:2:{s:1:"p";s:29:"72789069432219090760968655247";s:1:"g";s:29:"31725421034580831033290406407";}i:50;a:2:{s:1:"p";s:29:"70756969409504536529184861863";s:1:"g";s:29:"28734343666595496719979874355";}i:51;a:2:{s:1:"p";s:29:"50630182889501928368854656923";s:1:"g";s:29:"34567091595676569937103243609";}i:52;a:2:{s:1:"p";s:29:"45952510148678487096747574079";s:1:"g";s:29:"37518021674485079101709627061";}i:53;a:2:{s:1:"p";s:29:"42882857287768186855451631287";s:1:"g";s:29:"20526360990737333692515113039";}i:54;a:2:{s:1:"p";s:29:"50265722213854880338572192803";s:1:"g";s:29:"22320422205561467172183532507";}i:55;a:2:{s:1:"p";s:29:"52651538115728879925737034179";s:1:"g";s:29:"36248623767834351043173573133";}i:56;a:2:{s:1:"p";s:29:"71243579853974324810676006923";s:1:"g";s:29:"28678521167624470859587537987";}i:57;a:2:{s:1:"p";s:29:"44881273335703542822440685359";s:1:"g";s:29:"27890696956822713079463093069";}i:58;a:2:{s:1:"p";s:29:"54067724646431918836093765487";s:1:"g";s:29:"38671671346100133896621817829";}i:59;a:2:{s:1:"p";s:29:"77981751845097915350841714947";s:1:"g";s:29:"34109084447631028515541501111";}i:60;a:2:{s:1:"p";s:29:"41299579464656790538826461979";s:1:"g";s:29:"31559494063913514065552276299";}i:61;a:2:{s:1:"p";s:29:"43809367168096446620100258383";s:1:"g";s:29:"31617324402125986291976766901";}i:62;a:2:{s:1:"p";s:29:"41629110951264885953120606759";s:1:"g";s:29:"38406161804958433253138577097";}i:63;a:2:{s:1:"p";s:29:"63026171442062660193639618179";s:1:"g";s:29:"29507934963099337261103958697";}i:64;a:2:{s:1:"p";s:29:"76474084729118955201130431203";s:1:"g";s:29:"32171898945197339371170458907";}i:65;a:2:{s:1:"p";s:29:"78323059288301101312881667667";s:1:"g";s:29:"22199981962969777045604457961";}i:66;a:2:{s:1:"p";s:29:"48377222972554009039385650679";s:1:"g";s:29:"32614444658520497932785811087";}i:67;a:2:{s:1:"p";s:29:"49886103871936238106545100479";s:1:"g";s:29:"21092123691132028297201513947";}i:68;a:2:{s:1:"p";s:29:"43221299503205009879216909999";s:1:"g";s:29:"31490999503942396032305773621";}i:69;a:2:{s:1:"p";s:29:"72675669525257658331735232279";s:1:"g";s:29:"21625394843226904733988215413";}i:70;a:2:{s:1:"p";s:29:"60912699550998182788325971487";s:1:"g";s:29:"37125028105990641824493370751";}i:71;a:2:{s:1:"p";s:29:"41376435625834360066302056723";s:1:"g";s:29:"29184639342437770947343070079";}i:72;a:2:{s:1:"p";s:29:"75911859552795531794906334383";s:1:"g";s:29:"25591480945916785626340759655";}i:73;a:2:{s:1:"p";s:29:"65759239204590801774612362339";s:1:"g";s:29:"26155114179438446049102644089";}i:74;a:2:{s:1:"p";s:29:"65527216814120877501471071123";s:1:"g";s:29:"27930568859450263902637044387";}i:75;a:2:{s:1:"p";s:29:"70810182985925809810433127539";s:1:"g";s:29:"31957160993262417032979556405";}i:76;a:2:{s:1:"p";s:29:"57492899402310837998263313603";s:1:"g";s:29:"35724553374810107964858445377";}i:77;a:2:{s:1:"p";s:29:"43758636413285999568429004427";s:1:"g";s:29:"30488837552241539903120979149";}i:78;a:2:{s:1:"p";s:29:"56692097963982709200889953419";s:1:"g";s:29:"26271804900529999524482515699";}i:79;a:2:{s:1:"p";s:29:"77974047092081361669361958459";s:1:"g";s:29:"39126929749021168284193878989";}i:80;a:2:{s:1:"p";s:29:"78229682156975988879624724559";s:1:"g";s:29:"27911368145178527289382607881";}i:81;a:2:{s:1:"p";s:29:"62126252016749015886820739027";s:1:"g";s:29:"34055396134921086870545958899";}i:82;a:2:{s:1:"p";s:29:"67563355896875957624545837703";s:1:"g";s:29:"37486398928881331284746874917";}i:83;a:2:{s:1:"p";s:29:"50132370870533665921627496387";s:1:"g";s:29:"26059455883840798859750499105";}i:84;a:2:{s:1:"p";s:29:"39725206923751271728960689383";s:1:"g";s:29:"24609684584536618635376545477";}i:85;a:2:{s:1:"p";s:29:"51792948921405546760270684967";s:1:"g";s:29:"25995693514438136367087526063";}i:86;a:2:{s:1:"p";s:29:"55288338303675688577407630103";s:1:"g";s:29:"24223163922736270455212400515";}i:87;a:2:{s:1:"p";s:29:"52150198885087539120531512267";s:1:"g";s:29:"28166775980799901204464193159";}i:88;a:2:{s:1:"p";s:29:"64967370257521870837395382187";s:1:"g";s:29:"30197948617065071104206085765";}i:89;a:2:{s:1:"p";s:29:"57267259723766408733673540247";s:1:"g";s:29:"23386967103059011857791870243";}i:90;a:2:{s:1:"p";s:29:"52627911824296402395179157203";s:1:"g";s:29:"33293309894237358066888235147";}i:91;a:2:{s:1:"p";s:29:"71861809192052150172370739147";s:1:"g";s:29:"31044213605020388625039824137";}i:92;a:2:{s:1:"p";s:29:"70254513909085824681053192543";s:1:"g";s:29:"28798349198845097401709269813";}i:93;a:2:{s:1:"p";s:29:"41403540291961233368774818919";s:1:"g";s:29:"28798985963850612805220493955";}i:94;a:2:{s:1:"p";s:29:"48430431805183902912293107223";s:1:"g";s:29:"31404742280166410839686792815";}i:95;a:2:{s:1:"p";s:29:"51473404191184755474663299999";s:1:"g";s:29:"33843389600977412378505334397";}i:96;a:2:{s:1:"p";s:29:"70565571849996199202961193307";s:1:"g";s:29:"21716627740009390905807789193";}i:97;a:2:{s:1:"p";s:29:"78437005746991951735505214167";s:1:"g";s:29:"26924323797938784922617646411";}i:98;a:2:{s:1:"p";s:29:"43843055850061764331501276463";s:1:"g";s:29:"31987298334225618123314578601";}i:99;a:2:{s:1:"p";s:29:"53682770566445504403330150107";s:1:"g";s:29:"38927064063740890597015961647";}i:100;a:2:{s:1:"p";s:29:"48994954423636463292887914919";s:1:"g";s:29:"32652856528784949016397405041";}i:101;a:2:{s:1:"p";s:29:"44897157586817342996019100247";s:1:"g";s:29:"38840533683921393467308020649";}i:102;a:2:{s:1:"p";s:29:"67538483715108583872805797647";s:1:"g";s:29:"29919536376822345692569617879";}i:103;a:2:{s:1:"p";s:29:"50717592467559574799527034903";s:1:"g";s:29:"21517893190499507102203033779";}i:104;a:2:{s:1:"p";s:29:"70772395177637170507552342367";s:1:"g";s:29:"39434308756454820138634504439";}i:105;a:2:{s:1:"p";s:29:"53445905772090528659325390647";s:1:"g";s:29:"22551665344611641752027006601";}i:106;a:2:{s:1:"p";s:29:"52474468077274345269151992383";s:1:"g";s:29:"33352638404672259758390964327";}i:107;a:2:{s:1:"p";s:29:"67114005106800452560101178583";s:1:"g";s:29:"33084264118243593357598139587";}i:108;a:2:{s:1:"p";s:29:"58754852803087648151383432619";s:1:"g";s:29:"29086302567025374338700003541";}i:109;a:2:{s:1:"p";s:29:"63212231552431384571059657007";s:1:"g";s:29:"35530559402100927792425660111";}i:110;a:2:{s:1:"p";s:29:"42196611473333337298462210787";s:1:"g";s:29:"24592858785758227363491641241";}i:111;a:2:{s:1:"p";s:29:"44047438903651919269497203819";s:1:"g";s:29:"33075102551287629845592080029";}i:112;a:2:{s:1:"p";s:29:"52434265050670307985847764863";s:1:"g";s:29:"29887639044793235583920349563";}i:113;a:2:{s:1:"p";s:29:"54506429692472361223143536003";s:1:"g";s:29:"27693480481313114708529170763";}i:114;a:2:{s:1:"p";s:29:"72845129316148286033002738187";s:1:"g";s:29:"22179932387795580737090272661";}i:115;a:2:{s:1:"p";s:29:"71067088953897971478659333927";s:1:"g";s:29:"21865125582832109553224763593";}i:116;a:2:{s:1:"p";s:29:"50765915006154815563652014379";s:1:"g";s:29:"24925324101591485419008597689";}i:117;a:2:{s:1:"p";s:29:"41796273330675329512689479027";s:1:"g";s:29:"34498285623103961201616530779";}i:118;a:2:{s:1:"p";s:29:"71667652951249290315789870947";s:1:"g";s:29:"28597584821952440893599410119";}i:119;a:2:{s:1:"p";s:29:"40661876296207694113479633203";s:1:"g";s:29:"34618495347559751713231561811";}i:120;a:2:{s:1:"p";s:29:"75584625760448598854619320747";s:1:"g";s:29:"33825371145156064291302499673";}i:121;a:2:{s:1:"p";s:29:"72900646949748701155153254023";s:1:"g";s:29:"39056661372189487534797810227";}i:122;a:2:{s:1:"p";s:29:"39725262448989342209900586647";s:1:"g";s:29:"27012300571607327239173217505";}i:123;a:2:{s:1:"p";s:29:"70291076132593834744489638659";s:1:"g";s:29:"28287870352495913858579279891";}i:124;a:2:{s:1:"p";s:29:"68223492838054012745867773019";s:1:"g";s:29:"29812634632059772397466036447";}i:125;a:2:{s:1:"p";s:29:"53346092907654611928569785007";s:1:"g";s:29:"20380231076764775013716891749";}i:126;a:2:{s:1:"p";s:29:"42269250412327988046698168879";s:1:"g";s:29:"22359387614414132557852459585";}i:127;a:2:{s:1:"p";s:29:"57320431477944067979431873019";s:1:"g";s:29:"36389842917475191481639469737";}i:128;a:2:{s:1:"p";s:29:"53385052160780507951010260483";s:1:"g";s:29:"24906742945156753228249405845";}i:129;a:2:{s:1:"p";s:29:"77319125713145958575993682839";s:1:"g";s:29:"32250111047089288670189735029";}i:130;a:2:{s:1:"p";s:29:"75162993662684965129714771847";s:1:"g";s:29:"25661752946886423597912692337";}i:131;a:2:{s:1:"p";s:29:"45405625268025110880402518087";s:1:"g";s:29:"36319773469129114154499369695";}i:132;a:2:{s:1:"p";s:29:"59088448884756478306290294419";s:1:"g";s:29:"32191641691724471525681426191";}i:133;a:2:{s:1:"p";s:29:"48391361101895671980136152047";s:1:"g";s:29:"28674669966387337925758056971";}i:134;a:2:{s:1:"p";s:29:"60566037922797273575059507943";s:1:"g";s:29:"34215739467127691572238119127";}i:135;a:2:{s:1:"p";s:29:"59514789385135504034490479963";s:1:"g";s:29:"34710883816976378062106378581";}i:136;a:2:{s:1:"p";s:29:"72245746528041664913295702167";s:1:"g";s:29:"38377548355684432345447431019";}i:137;a:2:{s:1:"p";s:29:"77057467563788368450273635347";s:1:"g";s:29:"24241201973162188054931592279";}i:138;a:2:{s:1:"p";s:29:"43584371382806814935291636579";s:1:"g";s:29:"36659077432871194105682472635";}i:139;a:2:{s:1:"p";s:29:"53005996620921200751055268363";s:1:"g";s:29:"39257201959355896039903321299";}i:140;a:2:{s:1:"p";s:29:"42597100015430501275680415787";s:1:"g";s:29:"32728428281570006218679496853";}i:141;a:2:{s:1:"p";s:29:"57712518549539943687407899799";s:1:"g";s:29:"28523188239456579421576097165";}i:142;a:2:{s:1:"p";s:29:"57597321462679122556677087827";s:1:"g";s:29:"24238811025555864703506297729";}i:143;a:2:{s:1:"p";s:29:"52694154096382067677036327499";s:1:"g";s:29:"33003354138724083947013916347";}i:144;a:2:{s:1:"p";s:29:"49168587190281246808731914159";s:1:"g";s:29:"24787429202019511436089021743";}i:145;a:2:{s:1:"p";s:29:"64119909108206836355870531579";s:1:"g";s:29:"32491957206216938161091275705";}i:146;a:2:{s:1:"p";s:29:"50467793876433382124768013347";s:1:"g";s:29:"25130214130640956081967953409";}i:147;a:2:{s:1:"p";s:29:"58411160562120944539229614679";s:1:"g";s:29:"26984522061879150564144369855";}i:148;a:2:{s:1:"p";s:29:"40009347006163207215081987803";s:1:"g";s:29:"35770013420048480039829342671";}i:149;a:2:{s:1:"p";s:29:"70624660658773357720766101463";s:1:"g";s:29:"35824369666376333976531890557";}i:150;a:2:{s:1:"p";s:29:"64341975464068240469532696503";s:1:"g";s:29:"32530921439798458540338308785";}i:151;a:2:{s:1:"p";s:29:"50960275061167921310203607999";s:1:"g";s:29:"32132617625550502941234012677";}i:152;a:2:{s:1:"p";s:29:"56797267799962419081951774167";s:1:"g";s:29:"34288942257253430908202805755";}i:153;a:2:{s:1:"p";s:29:"58074017368865007334964216003";s:1:"g";s:29:"35729271862311203945689979405";}i:154;a:2:{s:1:"p";s:29:"40223717844890578002433478807";s:1:"g";s:29:"29589708703140870455838217981";}i:155;a:2:{s:1:"p";s:29:"46164472770902986360821507539";s:1:"g";s:29:"33305967083143761363730485247";}i:156;a:2:{s:1:"p";s:29:"51440898823119489454011434939";s:1:"g";s:29:"23297809258485493478497527275";}i:157;a:2:{s:1:"p";s:29:"69137161537503320226750697643";s:1:"g";s:29:"29057927675001690950633562415";}i:158;a:2:{s:1:"p";s:29:"70368416471670772916685973187";s:1:"g";s:29:"26999604070693000537404791371";}i:159;a:2:{s:1:"p";s:29:"63337430803646519385776522267";s:1:"g";s:29:"39568994791668376175953012565";}i:160;a:2:{s:1:"p";s:29:"44701686190263648211731573419";s:1:"g";s:29:"37932575585630911059257354979";}i:161;a:2:{s:1:"p";s:29:"67061963534677418365284083843";s:1:"g";s:29:"34424441366959344012129849399";}i:162;a:2:{s:1:"p";s:29:"73686066909490063572068902667";s:1:"g";s:29:"28555084362370984960397877705";}i:163;a:2:{s:1:"p";s:29:"67527858922200909359786778983";s:1:"g";s:29:"30749239501627454371477786151";}i:164;a:2:{s:1:"p";s:29:"61043739066730320355165466543";s:1:"g";s:29:"21595545896109312433802159723";}i:165;a:2:{s:1:"p";s:29:"45334723448893279488516029423";s:1:"g";s:29:"37137146908205066290903839065";}i:166;a:2:{s:1:"p";s:29:"56308214005582002693555810227";s:1:"g";s:29:"24843791296725163102719345885";}i:167;a:2:{s:1:"p";s:29:"67533150567370173925041652007";s:1:"g";s:29:"30782893351115458792404891185";}i:168;a:2:{s:1:"p";s:29:"77141896439196678834655501223";s:1:"g";s:29:"36061461453268822310804404211";}i:169;a:2:{s:1:"p";s:29:"53464136308124898869051497703";s:1:"g";s:29:"21070840867138524281210954559";}i:170;a:2:{s:1:"p";s:29:"43906866776363067808866128183";s:1:"g";s:29:"31371970727448398345771909917";}i:171;a:2:{s:1:"p";s:29:"42951929549489979042061459067";s:1:"g";s:29:"35303481350375126063754180319";}i:172;a:2:{s:1:"p";s:29:"55584206157809351576484752699";s:1:"g";s:29:"27521324978891503871880098457";}i:173;a:2:{s:1:"p";s:29:"64082684138871018024834206363";s:1:"g";s:29:"35430132693162906364375555257";}i:174;a:2:{s:1:"p";s:29:"72274680235256183639513224187";s:1:"g";s:29:"39323298720223462507539214629";}i:175;a:2:{s:1:"p";s:29:"50270465159644897332267799847";s:1:"g";s:29:"32162138971239505380120254023";}i:176;a:2:{s:1:"p";s:29:"71172742562279238052232728379";s:1:"g";s:29:"28087698829250168062118773909";}i:177;a:2:{s:1:"p";s:29:"58279975107815369320968409643";s:1:"g";s:29:"37477871871950017488642962513";}i:178;a:2:{s:1:"p";s:29:"76149833977762808075325714263";s:1:"g";s:29:"33495819233171658198843244729";}i:179;a:2:{s:1:"p";s:29:"78903549728711268080275522043";s:1:"g";s:29:"35575753121439896828664997439";}i:180;a:2:{s:1:"p";s:29:"50246227352468831277581528819";s:1:"g";s:29:"22165161926944506968934210845";}i:181;a:2:{s:1:"p";s:29:"40366543204773291628848006179";s:1:"g";s:29:"37491409231401195990400236255";}i:182;a:2:{s:1:"p";s:29:"52485686141888680631881366979";s:1:"g";s:29:"25008339028119954369958601375";}i:183;a:2:{s:1:"p";s:29:"75310123834070506632175194923";s:1:"g";s:29:"24911739307945577462298528211";}i:184;a:2:{s:1:"p";s:29:"43287453884743355180493459983";s:1:"g";s:29:"37431226064016553223888614739";}i:185;a:2:{s:1:"p";s:29:"72668048134235584782124599179";s:1:"g";s:29:"36083914805133754503902359713";}i:186;a:2:{s:1:"p";s:29:"42587035483492360208542295483";s:1:"g";s:29:"29425547602658008334973977237";}i:187;a:2:{s:1:"p";s:29:"48660742813847790093577802723";s:1:"g";s:29:"22181696030381210296639395281";}i:188;a:2:{s:1:"p";s:29:"43358224144805388273357480587";s:1:"g";s:29:"39214031095936595183935153561";}i:189;a:2:{s:1:"p";s:29:"78569919398561957497150141427";s:1:"g";s:29:"27386092272055272984209278553";}i:190;a:2:{s:1:"p";s:29:"71756187727640118653252286707";s:1:"g";s:29:"23705829101416778657726552921";}i:191;a:2:{s:1:"p";s:29:"51779331839710276181002026347";s:1:"g";s:29:"25380613792873774698286228915";}i:192;a:2:{s:1:"p";s:29:"57342881303922666441386957279";s:1:"g";s:29:"20848819641117789823622350199";}i:193;a:2:{s:1:"p";s:29:"70002251023023159545354683883";s:1:"g";s:29:"36610934624864460295158944359";}i:194;a:2:{s:1:"p";s:29:"44910825886538421594132535403";s:1:"g";s:29:"30512121148739912553086530975";}i:195;a:2:{s:1:"p";s:29:"75997480947050915451016792487";s:1:"g";s:29:"25177189795127991088001819331";}i:196;a:2:{s:1:"p";s:29:"71210454010817147751246783827";s:1:"g";s:29:"24081482543177517821419798409";}i:197;a:2:{s:1:"p";s:29:"48178222020174159336951481379";s:1:"g";s:29:"23875634060583990786793373517";}i:198;a:2:{s:1:"p";s:29:"41053972333108758025596811307";s:1:"g";s:29:"23250518637280344226689511927";}i:199;a:2:{s:1:"p";s:29:"65532547845146082502279866959";s:1:"g";s:29:"21702436153057868635835641145";}}
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/CREDITS b/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/CREDITS
new file mode 100644
index 0000000..4698d54
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/CREDITS
@@ -0,0 +1,2 @@
+XXTEA PHP extension
+Ma Bingyao (andot@coolcode.cn)
diff --git a/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/INSTALL b/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/INSTALL
new file mode 100644
index 0000000..258fc8a
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/INSTALL
@@ -0,0 +1,66 @@
+Installing of XXTEA PHP package.
+
+There are many ways to build the package. Below you can find details for most
+useful ways of package building:
+
+1. with PHP
+2. with phpize utility
+3. under Windows using Microsoft Visual C (.NET or VC6)
+
+-----------------------------------------------------------------------------
+Way 1: Building the package with PHP
+-----------------------------------------------------------------------------
+
+1. Create ext/xxtea folder in the php-source-folder. Copy all files
+ from the package into created folder.
+
+2. Run
+ ./buildconf
+ to rebuild PHP's configure script.
+
+3. Compile php with option:
+ --enable-xxtea to build bundled into PHP module
+ --enable-xxtea=shared to build dinamycally loadable module
+
+-----------------------------------------------------------------------------
+Way 2: Building the package with phpize utility
+-----------------------------------------------------------------------------
+
+1. Unpack contents of the package.
+
+2. Run
+ phpize
+ script, which will prepare environment for building XXTEA package.
+
+3. Run
+ ./configure --enable-xxtea=shared
+ to generate makefile
+
+4. Run
+ make
+ to build XXTEA extension library. It will be placed into
+ ./modules folder.
+
+5. Run
+ make install
+ to install XXTEA extension library into PHP
+
+-----------------------------------------------------------------------------
+Way 3: Building the package under Windows using Microsoft Visual C (.NET or VC6)
+-----------------------------------------------------------------------------
+1. Create ext/xxtea folder in the php-source-folder. Copy all files
+ from the package into created folder.
+
+2. Copy php4ts.lib (for PHP4) or php5ts.lib (for PHP5) static library from
+ your version of PHP into ext/xxtea folder.
+
+3. Open php_xxtea.sln - solution file under MSVC.NET or php_xxtea.dsw -
+ workspace file under MSVC6. Try to build Release_php4 (for PHP4) or Release_php5
+ (for PHP5) configuration.
+
+4. Copy php_xxtea.dll from ext/xxtea/Release_php4 or ext/xxtea/Release_php5
+ into {extension_dir} folder. Path to {extension_dir} can be found in php.ini
+
+5. Add line
+ extension=php_xxtea.dll
+ into php.ini
diff --git a/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/LICENSE b/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/LICENSE
new file mode 100644
index 0000000..8d3fa07
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/LICENSE
@@ -0,0 +1,68 @@
+--------------------------------------------------------------------
+ The PHP License, version 3.01
+Copyright (c) 1999 - 2006 The PHP Group. All rights reserved.
+--------------------------------------------------------------------
+
+Redistribution and use in source and binary forms, with or without
+modification, is permitted provided that the following conditions
+are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ 3. The name "PHP" must not be used to endorse or promote products
+ derived from this software without prior written permission. For
+ written permission, please contact group@php.net.
+
+ 4. Products derived from this software may not be called "PHP", nor
+ may "PHP" appear in their name, without prior written permission
+ from group@php.net. You may indicate that your software works in
+ conjunction with PHP by saying "Foo for PHP" instead of calling
+ it "PHP Foo" or "phpfoo"
+
+ 5. The PHP Group may publish revised and/or new versions of the
+ license from time to time. Each version will be given a
+ distinguishing version number.
+ Once covered code has been published under a particular version
+ of the license, you may always continue to use it under the terms
+ of that version. You may also choose to use such covered code
+ under the terms of any subsequent version of the license
+ published by the PHP Group. No one other than the PHP Group has
+ the right to modify the terms applicable to covered code created
+ under this License.
+
+ 6. Redistributions of any form whatsoever must retain the following
+ acknowledgment:
+ "This product includes PHP software, freely available from
+ ".
+
+THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND
+ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP
+DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+OF THE POSSIBILITY OF SUCH DAMAGE.
+
+--------------------------------------------------------------------
+
+This software consists of voluntary contributions made by many
+individuals on behalf of the PHP Group.
+
+The PHP Group can be contacted via Email at group@php.net.
+
+For more information on the PHP Group and the PHP project,
+please see .
+
+PHP includes the Zend Engine, freely available at
+.
diff --git a/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/README b/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/README
new file mode 100644
index 0000000..4a771bb
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/README
@@ -0,0 +1,28 @@
+XXTEA PHP extension
+
+What is it?
+-----------------------------------------------
+This extension based on xxtea library, which provides a set of functions
+for encrypt or decrypt data with XXTEA algorithm.
+
+
+
+How to install it?
+-----------------------------------------------
+See INSTALL for installation instructions.
+
+
+
+How to use it?
+-----------------------------------------------
+string xxtea_encrypt(string data, string key)
+
+Encrypt data using XXTEA algorithm. The key is a 16 bytes(128 bits) string.
+
+string xxtea_decrypt(string data, string key)
+
+Decrypt data using XXTEA algorithm. The key is a 16 bytes(128 bits) string.
+
+string xxtea_info()
+
+Get the version information.
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/config.m4 b/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/config.m4
new file mode 100644
index 0000000..b9a24e6
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/config.m4
@@ -0,0 +1,7 @@
+PHP_ARG_ENABLE(xxtea, xxtea module,
+[ --enable-xxtea Enable xxtea module.])
+
+if test "$PHP_XXTEA" != "no"; then
+ PHP_NEW_EXTENSION(xxtea, php_xxtea.c xxtea.c, $ext_shared)
+ AC_DEFINE(HAVE_XXTEA, 1, [Have XXTEA library])
+fi
diff --git a/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/config.w32 b/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/config.w32
new file mode 100644
index 0000000..63ad716
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/config.w32
@@ -0,0 +1,6 @@
+ARG_ENABLE("xxtea", "xxtea module", "no");
+
+if (PHP_XXTEA != "no") {
+ EXTENSION("xxtea", "php_xxtea.c xxtea.c");
+}
+
diff --git a/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/php_xxtea.c b/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/php_xxtea.c
new file mode 100644
index 0000000..cf0da4b
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/php_xxtea.c
@@ -0,0 +1,193 @@
+/***********************************************************************
+
+ Copyright 2006-2007 Ma Bingyao
+
+ These sources is free software. Redistributions of source code must
+ retain the above copyright notice. Redistributions in binary form
+ must reproduce the above copyright notice. You can redistribute it
+ freely. You can use it with any free or commercial software.
+
+ These sources is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY. Without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ You may contact the author by:
+ e-mail: andot@coolcode.cn
+
+*************************************************************************/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php.h"
+
+#if HAVE_XXTEA
+#include "php_xxtea.h"
+#include "ext/standard/info.h" /* for phpinfo() functions */
+#include "xxtea.h"
+
+/* compiled function list so Zend knows what's in this module */
+zend_function_entry xxtea_functions[] =
+{
+ ZEND_FE(xxtea_encrypt, NULL)
+ ZEND_FE(xxtea_decrypt, NULL)
+ ZEND_FE(xxtea_info, NULL)
+ {NULL, NULL, NULL}
+};
+
+/* compiled module information */
+zend_module_entry xxtea_module_entry =
+{
+ STANDARD_MODULE_HEADER,
+ XXTEA_MODULE_NAME,
+ xxtea_functions,
+ ZEND_MINIT(xxtea),
+ ZEND_MSHUTDOWN(xxtea),
+ NULL,
+ NULL,
+ ZEND_MINFO(xxtea),
+ XXTEA_VERSION,
+ STANDARD_MODULE_PROPERTIES
+};
+
+/* implement standard "stub" routine to introduce ourselves to Zend */
+#if defined(COMPILE_DL_XXTEA)
+ZEND_GET_MODULE(xxtea)
+#endif
+
+static xxtea_long *xxtea_to_long_array(unsigned char *data, xxtea_long len, int include_length, xxtea_long *ret_len) {
+ xxtea_long i, n, *result;
+ n = len >> 2;
+ n = (((len & 3) == 0) ? n : n + 1);
+ if (include_length) {
+ result = (xxtea_long *)emalloc((n + 1) << 2);
+ result[n] = len;
+ *ret_len = n + 1;
+ } else {
+ result = (xxtea_long *)emalloc(n << 2);
+ *ret_len = n;
+ }
+ memset(result, 0, n << 2);
+ for (i = 0; i < len; i++) {
+ result[i >> 2] |= (xxtea_long)data[i] << ((i & 3) << 3);
+ }
+ return result;
+}
+
+static unsigned char *xxtea_to_byte_array(xxtea_long *data, xxtea_long len, int include_length, xxtea_long *ret_len) {
+ xxtea_long i, n, m;
+ unsigned char *result;
+ n = len << 2;
+ if (include_length) {
+ m = data[len - 1];
+ if ((m < n - 7) || (m > n - 4)) return NULL;
+ n = m;
+ }
+ result = (unsigned char *)emalloc(n + 1);
+ for (i = 0; i < n; i++) {
+ result[i] = (unsigned char)((data[i >> 2] >> ((i & 3) << 3)) & 0xff);
+ }
+ result[n] = '\0';
+ *ret_len = n;
+ return result;
+}
+
+static unsigned char *php_xxtea_encrypt(unsigned char *data, xxtea_long len, unsigned char *key, xxtea_long *ret_len) {
+ unsigned char *result;
+ xxtea_long *v, *k, v_len, k_len;
+ v = xxtea_to_long_array(data, len, 1, &v_len);
+ k = xxtea_to_long_array(key, 16, 0, &k_len);
+ xxtea_long_encrypt(v, v_len, k);
+ result = xxtea_to_byte_array(v, v_len, 0, ret_len);
+ efree(v);
+ efree(k);
+ return result;
+}
+
+static unsigned char *php_xxtea_decrypt(unsigned char *data, xxtea_long len, unsigned char *key, xxtea_long *ret_len) {
+ unsigned char *result;
+ xxtea_long *v, *k, v_len, k_len;
+ v = xxtea_to_long_array(data, len, 0, &v_len);
+ k = xxtea_to_long_array(key, 16, 0, &k_len);
+ xxtea_long_decrypt(v, v_len, k);
+ result = xxtea_to_byte_array(v, v_len, 1, ret_len);
+ efree(v);
+ efree(k);
+ return result;
+}
+
+/* {{{ proto string xxtea_encrypt(string data, string key)
+ Encrypt string using XXTEA algorithm */
+ZEND_FUNCTION(xxtea_encrypt)
+{
+ unsigned char *data, *key;
+ unsigned char *result;
+ xxtea_long data_len, key_len, ret_length;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &data, &data_len, &key, &key_len) == FAILURE) {
+ return;
+ }
+ if (data_len == 0) RETVAL_STRINGL(NULL, 0, 0);
+ if (key_len != 16) RETURN_FALSE;
+ result = php_xxtea_encrypt(data, data_len, key, &ret_length);
+ if (result != NULL) {
+ RETVAL_STRINGL((char *)result, ret_length, 0);
+ } else {
+ RETURN_FALSE;
+ }
+}
+/* }}} */
+
+
+/* {{{ proto string xxtea_decrypt(string data, string key)
+ Decrypt string using XXTEA algorithm */
+ZEND_FUNCTION(xxtea_decrypt)
+{
+ unsigned char *data, *key;
+ unsigned char *result;
+ xxtea_long data_len, key_len, ret_length;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &data, &data_len, &key, &key_len) == FAILURE) {
+ return;
+ }
+ if (data_len == 0) RETVAL_STRINGL(NULL, 0, 0);
+ if (key_len != 16) RETURN_FALSE;
+ result = php_xxtea_decrypt(data, data_len, key, &ret_length);
+ if (result != NULL) {
+ RETVAL_STRINGL((char *)result, ret_length, 0);
+ } else {
+ RETURN_FALSE;
+ }
+}
+/* }}} */
+
+ZEND_MINIT_FUNCTION(xxtea)
+{
+ return SUCCESS;
+}
+
+ZEND_MSHUTDOWN_FUNCTION(xxtea)
+{
+ return SUCCESS;
+}
+
+ZEND_MINFO_FUNCTION(xxtea)
+{
+ php_info_print_table_start();
+ php_info_print_table_row(2, "xxtea support", "enabled");
+ php_info_print_table_row(2, "xxtea module version", XXTEA_VERSION);
+ php_info_print_table_row(2, "xxtea author", XXTEA_AUTHOR);
+ php_info_print_table_row(2, "xxtea homepage", XXTEA_HOMEPAGE);
+ php_info_print_table_end();
+}
+
+ZEND_FUNCTION(xxtea_info)
+{
+ array_init(return_value);
+ add_assoc_string(return_value, "ext_version", XXTEA_VERSION, 1);
+ add_assoc_string(return_value, "ext_build_date", XXTEA_BUILD_DATE, 1);
+ add_assoc_string(return_value, "ext_author", XXTEA_AUTHOR, 1);
+ add_assoc_string(return_value, "ext_homepage", XXTEA_HOMEPAGE, 1);
+}
+
+#endif /* if HAVE_XXTEA */
diff --git a/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/php_xxtea.dsp b/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/php_xxtea.dsp
new file mode 100644
index 0000000..1554b90
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/php_xxtea.dsp
@@ -0,0 +1,179 @@
+# Microsoft Developer Studio Project File - Name="php_xxtea" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=php_xxtea - Win32 Debug_php5
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "php_xxtea.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "php_xxtea.mak" CFG="php_xxtea - Win32 Debug_php5"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "php_xxtea - Win32 Debug_php5" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "php_xxtea - Win32 Release_php5" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "php_xxtea - Win32 Debug_php4" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "php_xxtea - Win32 Release_php4" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "php_xxtea - Win32 Debug_php5"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug_php5"
+# PROP BASE Intermediate_Dir "Debug_php5"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_php5"
+# PROP Intermediate_Dir "Debug_php5"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /I "../.." /I "../../main" /I "../../Zend" /I "../../TSRM" /ZI /W3 /Od /D "HAVE_XXTEA" /D "COMPILE_DL_XXTEA" /D "ZTS" /D "NDEBUG" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "ZEND_DEBUG=1" /D "_MBCS" /Gm /GZ /c /GX
+# ADD CPP /nologo /MTd /I "../.." /I "../../main" /I "../../Zend" /I "../../TSRM" /ZI /W3 /Od /D "HAVE_XXTEA" /D "COMPILE_DL_XXTEA" /D "ZTS" /D "NDEBUG" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "ZEND_DEBUG=1" /D "_MBCS" /Gm /GZ /c /GX
+# ADD BASE MTL /nologo /win32
+# ADD MTL /nologo /win32
+# ADD BASE RSC /l 1033
+# ADD RSC /l 1033
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /out:"Debug_php5\php_xxtea.dll" /incremental:yes /libpath:"../../Release_TS" /debug /pdb:"Debug_php5\php_xxtea.pdb" /pdbtype:sept /subsystem:windows /implib:"$(OutDir)/php_xxtea.lib" /machine:ix86
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /out:"Debug_php5\php_xxtea.dll" /incremental:yes /libpath:"../../Release_TS" /debug /pdb:"Debug_php5\php_xxtea.pdb" /pdbtype:sept /subsystem:windows /implib:"$(OutDir)/php_xxtea.lib" /machine:ix86
+
+!ELSEIF "$(CFG)" == "php_xxtea - Win32 Release_php5"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release_php5"
+# PROP BASE Intermediate_Dir "Release_php5"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_php5"
+# PROP Intermediate_Dir "Release_php5"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /I "../.." /I "../../main" /I "../../Zend" /I "../../TSRM" /W3 /O1 /Og /Oi /Os /Oy /GT /G6 /GA /D "HAVE_XXTEA" /D "COMPILE_DL_XXTEA" /D "ZTS" /D "NDEBUG" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "ZEND_DEBUG=0" /D "_MBCS" /GF /Gy /TC /c /GX
+# ADD CPP /nologo /MD /I "../.." /I "../../main" /I "../../Zend" /I "../../TSRM" /W3 /O1 /Og /Oi /Os /Oy /GT /G6 /GA /D "HAVE_XXTEA" /D "COMPILE_DL_XXTEA" /D "ZTS" /D "NDEBUG" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "ZEND_DEBUG=0" /D "_MBCS" /GF /Gy /TC /c /GX
+# ADD BASE MTL /nologo /win32
+# ADD MTL /nologo /win32
+# ADD BASE RSC /l 1033
+# ADD RSC /l 1033
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /out:"Release_php5\php_xxtea.dll" /incremental:no /libpath:"../../Release_TS" /pdbtype:sept /subsystem:windows /opt:ref /opt:icf /implib:"$(OutDir)/php_xxtea.lib" /machine:ix86
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib /nologo /dll /out:"Release_php5\php_xxtea.dll" /incremental:no /libpath:"../../Release_TS" /pdbtype:sept /subsystem:windows /opt:ref /opt:icf /implib:"$(OutDir)/php_xxtea.lib" /machine:ix86
+
+!ELSEIF "$(CFG)" == "php_xxtea - Win32 Debug_php4"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug_php4"
+# PROP BASE Intermediate_Dir "Debug_php4"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_php4"
+# PROP Intermediate_Dir "Debug_php4"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /I "../.." /I "../../main" /I "../../Zend" /I "../../TSRM" /ZI /W3 /Od /D "HAVE_XXTEA" /D "COMPILE_DL_XXTEA" /D "ZTS" /D "NDEBUG" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "ZEND_DEBUG=1" /D "_MBCS" /Gm /GZ /c /GX
+# ADD CPP /nologo /MTd /I "../.." /I "../../main" /I "../../Zend" /I "../../TSRM" /ZI /W3 /Od /D "HAVE_XXTEA" /D "COMPILE_DL_XXTEA" /D "ZTS" /D "NDEBUG" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "ZEND_DEBUG=1" /D "_MBCS" /Gm /GZ /c /GX
+# ADD BASE MTL /nologo /win32
+# ADD MTL /nologo /win32
+# ADD BASE RSC /l 1033
+# ADD RSC /l 1033
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /out:"Debug_php4\php_xxtea.dll" /incremental:yes /libpath:"../../Release_TS" /debug /pdb:"Debug_php4\php_xxtea.pdb" /pdbtype:sept /subsystem:windows /implib:"$(OutDir)/php_xxtea.lib" /machine:ix86
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /out:"Debug_php4\php_xxtea.dll" /incremental:yes /libpath:"../../Release_TS" /debug /pdb:"Debug_php4\php_xxtea.pdb" /pdbtype:sept /subsystem:windows /implib:"$(OutDir)/php_xxtea.lib" /machine:ix86
+
+!ELSEIF "$(CFG)" == "php_xxtea - Win32 Release_php4"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release_php4"
+# PROP BASE Intermediate_Dir "Release_php4"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_php4"
+# PROP Intermediate_Dir "Release_php4"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /I "../.." /I "../../main" /I "../../Zend" /I "../../TSRM" /W3 /O1 /Og /Oi /Os /Oy /GT /G6 /GA /D "HAVE_XXTEA" /D "COMPILE_DL_XXTEA" /D "ZTS" /D "NDEBUG" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "ZEND_DEBUG=0" /D "_MBCS" /GF /Gy /TC /c /GX
+# ADD CPP /nologo /MD /I "../.." /I "../../main" /I "../../Zend" /I "../../TSRM" /W3 /O1 /Og /Oi /Os /Oy /GT /G6 /GA /D "HAVE_XXTEA" /D "COMPILE_DL_XXTEA" /D "ZTS" /D "NDEBUG" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "ZEND_DEBUG=0" /D "_MBCS" /GF /Gy /TC /c /GX
+# ADD BASE MTL /nologo /win32
+# ADD MTL /nologo /win32
+# ADD BASE RSC /l 1033
+# ADD RSC /l 1033
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /out:"Release_php4\php_xxtea.dll" /incremental:no /libpath:"../../Release_TS" /pdbtype:sept /subsystem:windows /opt:ref /opt:icf /implib:"$(OutDir)/php_xxtea.lib" /machine:ix86
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /out:"Release_php4\php_xxtea.dll" /incremental:no /libpath:"../../Release_TS" /pdbtype:sept /subsystem:windows /opt:ref /opt:icf /implib:"$(OutDir)/php_xxtea.lib" /machine:ix86
+
+!ENDIF
+
+# Begin Target
+
+# Name "php_xxtea - Win32 Debug_php5"
+# Name "php_xxtea - Win32 Release_php5"
+# Name "php_xxtea - Win32 Debug_php4"
+# Name "php_xxtea - Win32 Release_php4"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+# Begin Source File
+
+SOURCE=php_xxtea.c
+# End Source File
+# Begin Group "lib_xxtea"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=xxtea.c
+# End Source File
+# End Group
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl;inc"
+# Begin Source File
+
+SOURCE=php_xxtea.h
+# End Source File
+# Begin Group "lib_xxtea"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=xxtea.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/php_xxtea.h b/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/php_xxtea.h
new file mode 100644
index 0000000..080c380
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/php_xxtea.h
@@ -0,0 +1,49 @@
+/***********************************************************************
+
+ Copyright 2006-2007 Ma Bingyao
+
+ These sources is free software. Redistributions of source code must
+ retain the above copyright notice. Redistributions in binary form
+ must reproduce the above copyright notice. You can redistribute it
+ freely. You can use it with any free or commercial software.
+
+ These sources is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY. Without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ You may contact the author by:
+ e-mail: andot@coolcode.cn
+
+*************************************************************************/
+
+#ifndef PHP_XXTEA_H
+#define PHP_XXTEA_H
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#if HAVE_XXTEA
+extern zend_module_entry xxtea_module_entry;
+#define phpext_xxtea_ptr &xxtea_module_entry
+
+#define XXTEA_MODULE_NAME "xxtea"
+#define XXTEA_BUILD_DATE __DATE__ " " __TIME__
+#define XXTEA_VERSION "1.0.3"
+#define XXTEA_AUTHOR "Ma Bingyao"
+#define XXTEA_HOMEPAGE "http://www.coolcode.cn/?p=209"
+
+ZEND_MINIT_FUNCTION(xxtea);
+ZEND_MSHUTDOWN_FUNCTION(xxtea);
+ZEND_MINFO_FUNCTION(xxtea);
+
+/* declaration of functions to be exported */
+ZEND_FUNCTION(xxtea_encrypt);
+ZEND_FUNCTION(xxtea_decrypt);
+ZEND_FUNCTION(xxtea_info);
+
+#else /* if HAVE_XXTEA */
+#define phpext_xxtea_ptr NULL
+#endif
+
+#endif /* ifndef PHP_XXTEA_H */
diff --git a/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/php_xxtea.sln b/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/php_xxtea.sln
new file mode 100644
index 0000000..5f5a5c2
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/php_xxtea.sln
@@ -0,0 +1,25 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "php_xxtea", "php_xxtea.vcproj", "{71165FA5-1EBC-4021-AA17-0CCBC7CD5204}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug_php4|Win32 = Debug_php4|Win32
+ Debug_php5|Win32 = Debug_php5|Win32
+ Release_php4|Win32 = Release_php4|Win32
+ Release_php5|Win32 = Release_php5|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {71165FA5-1EBC-4021-AA17-0CCBC7CD5204}.Debug_php4|Win32.ActiveCfg = Debug_php4|Win32
+ {71165FA5-1EBC-4021-AA17-0CCBC7CD5204}.Debug_php4|Win32.Build.0 = Debug_php4|Win32
+ {71165FA5-1EBC-4021-AA17-0CCBC7CD5204}.Debug_php5|Win32.ActiveCfg = Debug_php5|Win32
+ {71165FA5-1EBC-4021-AA17-0CCBC7CD5204}.Debug_php5|Win32.Build.0 = Debug_php5|Win32
+ {71165FA5-1EBC-4021-AA17-0CCBC7CD5204}.Release_php4|Win32.ActiveCfg = Release_php4|Win32
+ {71165FA5-1EBC-4021-AA17-0CCBC7CD5204}.Release_php4|Win32.Build.0 = Release_php4|Win32
+ {71165FA5-1EBC-4021-AA17-0CCBC7CD5204}.Release_php5|Win32.ActiveCfg = Release_php5|Win32
+ {71165FA5-1EBC-4021-AA17-0CCBC7CD5204}.Release_php5|Win32.Build.0 = Release_php5|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/php_xxtea.vcproj b/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/php_xxtea.vcproj
new file mode 100644
index 0000000..aedf004
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/php_xxtea.vcproj
@@ -0,0 +1,520 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/test/test.php b/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/test/test.php
new file mode 100644
index 0000000..071b178
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/test/test.php
@@ -0,0 +1,8 @@
+
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/xxtea.c b/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/xxtea.c
new file mode 100644
index 0000000..a3d956d
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/xxtea.c
@@ -0,0 +1,54 @@
+/***********************************************************************
+
+ Copyright 2006-2007 Ma Bingyao
+
+ These sources is free software. Redistributions of source code must
+ retain the above copyright notice. Redistributions in binary form
+ must reproduce the above copyright notice. You can redistribute it
+ freely. You can use it with any free or commercial software.
+
+ These sources is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY. Without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ You may contact the author by:
+ e-mail: andot@coolcode.cn
+
+*************************************************************************/
+#include "xxtea.h"
+
+void xxtea_long_encrypt(xxtea_long *v, xxtea_long len, xxtea_long *k) {
+ xxtea_long n = len - 1;
+ xxtea_long z = v[n], y = v[0], p, q = 6 + 52 / (n + 1), sum = 0, e;
+ if (n < 1) {
+ return;
+ }
+ while (0 < q--) {
+ sum += XXTEA_DELTA;
+ e = sum >> 2 & 3;
+ for (p = 0; p < n; p++) {
+ y = v[p + 1];
+ z = v[p] += XXTEA_MX;
+ }
+ y = v[0];
+ z = v[n] += XXTEA_MX;
+ }
+}
+
+void xxtea_long_decrypt(xxtea_long *v, xxtea_long len, xxtea_long *k) {
+ xxtea_long n = len - 1;
+ xxtea_long z = v[n], y = v[0], p, q = 6 + 52 / (n + 1), sum = q * XXTEA_DELTA, e;
+ if (n < 1) {
+ return;
+ }
+ while (sum != 0) {
+ e = sum >> 2 & 3;
+ for (p = n; p > 0; p--) {
+ z = v[p - 1];
+ y = v[p] -= XXTEA_MX;
+ }
+ z = v[n];
+ y = v[0] -= XXTEA_MX;
+ sum -= XXTEA_DELTA;
+ }
+}
diff --git a/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/xxtea.h b/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/xxtea.h
new file mode 100644
index 0000000..bcc2067
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/pecl/xxtea/xxtea.h
@@ -0,0 +1,47 @@
+/***********************************************************************
+
+ Copyright 2006-2007 Ma Bingyao
+
+ These sources is free software. Redistributions of source code must
+ retain the above copyright notice. Redistributions in binary form
+ must reproduce the above copyright notice. You can redistribute it
+ freely. You can use it with any free or commercial software.
+
+ These sources is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY. Without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ You may contact the author by:
+ e-mail: andot@coolcode.cn
+
+*************************************************************************/
+
+#ifndef XXTEA_H
+#define XXTEA_H
+
+#include /* for size_t & NULL declarations */
+
+#if defined(_MSC_VER)
+
+typedef unsigned __int32 xxtea_long;
+
+#else
+
+#if defined(__FreeBSD__) && __FreeBSD__ < 5
+/* FreeBSD 4 doesn't have stdint.h file */
+#include
+#else
+#include
+#endif
+
+typedef uint32_t xxtea_long;
+
+#endif /* end of if defined(_MSC_VER) */
+
+#define XXTEA_MX (z >> 5 ^ y << 2) + (y >> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z)
+#define XXTEA_DELTA 0x9e3779b9
+
+void xxtea_long_encrypt(xxtea_long *v, xxtea_long len, xxtea_long *k);
+void xxtea_long_decrypt(xxtea_long *v, xxtea_long len, xxtea_long *k);
+
+#endif
diff --git a/ThinkPHP/Library/Vendor/phpRPC/phprpc_client.php b/ThinkPHP/Library/Vendor/phpRPC/phprpc_client.php
new file mode 100644
index 0000000..569681b
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/phprpc_client.php
@@ -0,0 +1,583 @@
+ |
+| |
+| This file may be distributed and/or modified under the |
+| terms of the GNU General Public License (GPL) version |
+| 2.0 as published by the Free Software Foundation and |
+| appearing in the included file LICENSE. |
+| |
+\**********************************************************/
+
+/* PHPRPC Client for PHP.
+ *
+ * Copyright: Ma Bingyao
+ * Version: 3.0
+ * LastModified: Apr 12, 2010
+ * This library is free. You can redistribute it and/or modify it under GPL.
+ *
+/*
+ * Interfaces
+ *
+ * $rpc_client = new PHPRPC_Client();
+ * $rpc_client->setProxy(NULL);
+ * $rpc_client->useService('http://www.phprpc.org/server.php');
+ * $rpc_client->setKeyLength(1024);
+ * $rpc_client->setEncryptMode(3);
+ * $args = array(1, 2);
+ * echo $rpc_client->invoke('add', &$args);
+ * echo "
";
+ * $n = 3;
+ * $args = array(&$n);
+ * echo $rpc_client->invoke('inc', &$args, true);
+ * echo "
";
+ * echo $rpc_client->sub(3, 2);
+ * echo "
";
+ * // error handle
+ * $result = $rpc_client->mul(1, 2); // no mul function
+ * if (is_a($result, "PHPRPC_Error")) {
+ * echo $result->toString();
+ * }
+ */
+
+
+$_PHPRPC_COOKIES = array();
+$_PHPRPC_COOKIE = '';
+$_PHPRPC_SID = 0;
+
+if (defined('KEEP_PHPRPC_COOKIE_IN_SESSION')) {
+ if (isset($_SESSION['phprpc_cookies']) and isset($_SESSION['phprpc_cookie'])) {
+ $_PHPRPC_COOKIES = $_SESSION['phprpc_cookies'];
+ $_PHPRPC_COOKIE = $_SESSION['phprpc_cookie'];
+ }
+ function keep_phprpc_cookie_in_session() {
+ global $_PHPRPC_COOKIES, $_PHPRPC_COOKIE;
+ $_SESSION['phprpc_cookies'] = $_PHPRPC_COOKIES;
+ $_SESSION['phprpc_cookie'] = $_PHPRPC_COOKIE;
+ }
+ register_shutdown_function('keep_phprpc_cookie_in_session');
+}
+
+class PHPRPC_Error {
+ var $Number;
+ var $Message;
+ function PHPRPC_Error($errno, $errstr) {
+ $this->Number = $errno;
+ $this->Message = $errstr;
+ }
+ function toString() {
+ return $this->Number . ":" . $this->Message;
+ }
+ function __toString() {
+ return $this->toString();
+ }
+ function getNumber() {
+ return $this->Number;
+ }
+ function getMessage() {
+ return $this->Message;
+ }
+}
+
+class _PHPRPC_Client {
+ var $_server;
+ var $_timeout;
+ var $_output;
+ var $_warning;
+ var $_proxy;
+ var $_key;
+ var $_keylen;
+ var $_encryptMode;
+ var $_charset;
+ var $_socket;
+ var $_clientid;
+ var $_http_version;
+ var $_keep_alive;
+ // Public Methods
+ function _PHPRPC_Client($serverURL = '') {
+ global $_PHPRPC_SID;
+ require_once('compat.php');
+ //register_shutdown_function(array(&$this, "_disconnect"));
+ $this->_proxy = NULL;
+ $this->_timeout = 30;
+ $this->_clientid = 'php' . rand(1 << 30, 1 << 31) . time() . $_PHPRPC_SID;
+ $_PHPRPC_SID++;
+ $this->_socket = false;
+ if ($serverURL != '') {
+ $this->useService($serverURL);
+ }
+ }
+ function useService($serverURL, $username = NULL, $password = NULL) {
+ $this->_disconnect();
+ $this->_http_version = "1.1";
+ $this->_keep_alive = true;
+ $this->_server = array();
+ $this->_key = NULL;
+ $this->_keylen = 128;
+ $this->_encryptMode = 0;
+ $this->_charset = 'utf-8';
+ $urlparts = parse_url($serverURL);
+ if (!isset($urlparts['host'])) {
+ if (isset($_SERVER["HTTP_HOST"])) {
+ $urlparts['host'] = $_SERVER["HTTP_HOST"];
+ }
+ else if (isset($_SERVER["SERVER_NAME"])) {
+ $urlparts['host'] = $_SERVER["SERVER_NAME"];
+ }
+ else {
+ $urlparts['host'] = "localhost";
+ }
+ if (!isset($_SERVER["HTTPS"]) ||
+ $_SERVER["HTTPS"] == "off" ||
+ $_SERVER["HTTPS"] == "") {
+ $urlparts['scheme'] = "http";
+ }
+ else {
+ $urlparts['scheme'] = "https";
+ }
+ $urlparts['port'] = $_SERVER["SERVER_PORT"];
+ }
+
+ if (!isset($urlparts['port'])) {
+ if ($urlparts['scheme'] == "https") {
+ $urlparts['port'] = 443;
+ }
+ else {
+ $urlparts['port'] = 80;
+ }
+ }
+
+ if (!isset($urlparts['path'])) {
+ $urlparts['path'] = "/";
+ }
+ else if (($urlparts['path']{0} != '/') && ($_SERVER["PHP_SELF"]{0} == '/')) {
+ $urlparts['path'] = substr($_SERVER["PHP_SELF"], 0, strrpos($_SERVER["PHP_SELF"], '/') + 1) . $urlparts['path'];
+ }
+
+ if (isset($urlparts['query'])) {
+ $urlparts['path'] .= '?' . $urlparts['query'];
+ }
+
+ if (!isset($urlparts['user']) || !is_null($username)) {
+ $urlparts['user'] = $username;
+ }
+
+ if (!isset($urlparts['pass']) || !is_null($password)) {
+ $urlparts['pass'] = $password;
+ }
+
+ $this->_server['scheme'] = $urlparts['scheme'];
+ $this->_server['host'] = $urlparts['host'];
+ $this->_server['port'] = $urlparts['port'];
+ $this->_server['path'] = $urlparts['path'];
+ $this->_server['user'] = $urlparts['user'];
+ $this->_server['pass'] = $urlparts['pass'];
+ }
+ function setProxy($host, $port = NULL, $username = NULL, $password = NULL) {
+ if (is_null($host)) {
+ $this->_proxy = NULL;
+ }
+ else {
+ if (is_null($port)) {
+ $urlparts = parse_url($host);
+ if (isset($urlparts['host'])) {
+ $host = $urlparts['host'];
+ }
+ if (isset($urlparts['port'])) {
+ $port = $urlparts['port'];
+ }
+ else {
+ $port = 80;
+ }
+ if (isset($urlparts['user']) && is_null($username)) {
+ $username = $urlparts['user'];
+ }
+ if (isset($urlparts['pass']) && is_null($password)) {
+ $password = $urlparts['pass'];
+ }
+ }
+ $this->_proxy = array();
+ $this->_proxy['host'] = $host;
+ $this->_proxy['port'] = $port;
+ $this->_proxy['user'] = $username;
+ $this->_proxy['pass'] = $password;
+ }
+ }
+ function setKeyLength($keylen) {
+ if (!is_null($this->_key)) {
+ return false;
+ }
+ else {
+ $this->_keylen = $keylen;
+ return true;
+ }
+ }
+ function getKeyLength() {
+ return $this->_keylen;
+ }
+ function setEncryptMode($encryptMode) {
+ if (($encryptMode >= 0) && ($encryptMode <= 3)) {
+ $this->_encryptMode = (int)($encryptMode);
+ return true;
+ }
+ else {
+ $this->_encryptMode = 0;
+ return false;
+ }
+ }
+ function getEncryptMode() {
+ return $this->_encryptMode;
+ }
+ function setCharset($charset) {
+ $this->_charset = $charset;
+ }
+ function getCharset() {
+ return $this->_charset;
+ }
+ function setTimeout($timeout) {
+ $this->_timeout = $timeout;
+ }
+ function getTimeout() {
+ return $this->_timeout;
+ }
+ function invoke($funcname, &$args, $byRef = false) {
+ $result = $this->_key_exchange();
+ if (is_a($result, 'PHPRPC_Error')) {
+ return $result;
+ }
+ $request = "phprpc_func=$funcname";
+ if (count($args) > 0) {
+ $request .= "&phprpc_args=" . base64_encode($this->_encrypt(serialize_fix($args), 1));
+ }
+ $request .= "&phprpc_encrypt={$this->_encryptMode}";
+ if (!$byRef) {
+ $request .= "&phprpc_ref=false";
+ }
+ $request = str_replace('+', '%2B', $request);
+ $result = $this->_post($request);
+ if (is_a($result, 'PHPRPC_Error')) {
+ return $result;
+ }
+ $phprpc_errno = 0;
+ $phprpc_errstr = NULL;
+ if (isset($result['phprpc_errno'])) {
+ $phprpc_errno = intval($result['phprpc_errno']);
+ }
+ if (isset($result['phprpc_errstr'])) {
+ $phprpc_errstr = base64_decode($result['phprpc_errstr']);
+ }
+ $this->_warning = new PHPRPC_Error($phprpc_errno, $phprpc_errstr);
+ if (array_key_exists('phprpc_output', $result)) {
+ $this->_output = base64_decode($result['phprpc_output']);
+ if ($this->_server['version'] >= 3) {
+ $this->_output = $this->_decrypt($this->_output, 3);
+ }
+ }
+ else {
+ $this->_output = '';
+ }
+ if (array_key_exists('phprpc_result', $result)) {
+ if (array_key_exists('phprpc_args', $result)) {
+ $arguments = unserialize($this->_decrypt(base64_decode($result['phprpc_args']), 1));
+ for ($i = 0; $i < count($arguments); $i++) {
+ $args[$i] = $arguments[$i];
+ }
+ }
+ $result = unserialize($this->_decrypt(base64_decode($result['phprpc_result']), 2));
+ }
+ else {
+ $result = $this->_warning;
+ }
+ return $result;
+ }
+
+ function getOutput() {
+ return $this->_output;
+ }
+
+ function getWarning() {
+ return $this->_warning;
+ }
+
+ function _connect() {
+ if (is_null($this->_proxy)) {
+ $host = (($this->_server['scheme'] == "https") ? "ssl://" : "") . $this->_server['host'];
+ $this->_socket = @pfsockopen($host, $this->_server['port'], $errno, $errstr, $this->_timeout);
+ }
+ else {
+ $host = (($this->_server['scheme'] == "https") ? "ssl://" : "") . $this->_proxy['host'];
+ $this->_socket = @pfsockopen($host, $this->_proxy['port'], $errno, $errstr, $this->_timeout);
+ }
+ if ($this->_socket === false) {
+ return new PHPRPC_Error($errno, $errstr);
+ }
+ stream_set_write_buffer($this->_socket, 0);
+ socket_set_timeout($this->_socket, $this->_timeout);
+ return true;
+ }
+
+ function _disconnect() {
+ if ($this->_socket !== false) {
+ fclose($this->_socket);
+ $this->_socket = false;
+ }
+ }
+
+ function _socket_read($size) {
+ $content = "";
+ while (!feof($this->_socket) && ($size > 0)) {
+ $str = fread($this->_socket, $size);
+ $content .= $str;
+ $size -= strlen($str);
+ }
+ return $content;
+ }
+ function _post($request_body) {
+ global $_PHPRPC_COOKIE;
+ $request_body = 'phprpc_id=' . $this->_clientid . '&' . $request_body;
+ if ($this->_socket === false) {
+ $error = $this->_connect();
+ if (is_a($error, 'PHPRPC_Error')) {
+ return $error;
+ }
+ }
+ if (is_null($this->_proxy)) {
+ $url = $this->_server['path'];
+ $connection = "Connection: " . ($this->_keep_alive ? 'Keep-Alive' : 'Close') . "\r\n" .
+ "Cache-Control: no-cache\r\n";
+ }
+ else {
+ $url = "{$this->_server['scheme']}://{$this->_server['host']}:{$this->_server['port']}{$this->_server['path']}";
+ $connection = "Proxy-Connection: " . ($this->_keep_alive ? 'keep-alive' : 'close') . "\r\n";
+ if (!is_null($this->_proxy['user'])) {
+ $connection .= "Proxy-Authorization: Basic " . base64_encode($this->_proxy['user'] . ":" . $this->_proxy['pass']) . "\r\n";
+ }
+ }
+ $auth = '';
+ if (!is_null($this->_server['user'])) {
+ $auth = "Authorization: Basic " . base64_encode($this->_server['user'] . ":" . $this->_server['pass']) . "\r\n";
+ }
+ $cookie = '';
+ if ($_PHPRPC_COOKIE) {
+ $cookie = "Cookie: " . $_PHPRPC_COOKIE . "\r\n";
+ }
+ $content_len = strlen($request_body);
+ $request =
+ "POST $url HTTP/{$this->_http_version}\r\n" .
+ "Host: {$this->_server['host']}:{$this->_server['port']}\r\n" .
+ "User-Agent: PHPRPC Client 3.0 for PHP\r\n" .
+ $auth .
+ $connection .
+ $cookie .
+ "Accept: */*\r\n" .
+ "Accept-Encoding: gzip,deflate\r\n" .
+ "Content-Type: application/x-www-form-urlencoded; charset={$this->_charset}\r\n" .
+ "Content-Length: {$content_len}\r\n" .
+ "\r\n" .
+ $request_body;
+ fputs($this->_socket, $request, strlen($request));
+ while (!feof($this->_socket)) {
+ $line = fgets($this->_socket);
+ if (preg_match('/HTTP\/(\d\.\d)\s+(\d+)([^(\r|\n)]*)(\r\n|$)/i', $line, $match)) {
+ $this->_http_version = $match[1];
+ $status = (int)$match[2];
+ $status_message = trim($match[3]);
+ if ($status != 100 && $status != 200) {
+ $this->_disconnect();
+ return new PHPRPC_Error($status, $status_message);
+ }
+ }
+ else {
+ $this->_disconnect();
+ return new PHPRPC_Error(E_ERROR, "Illegal HTTP server.");
+ }
+ $header = array();
+ while (!feof($this->_socket) && (($line = fgets($this->_socket)) != "\r\n")) {
+ $line = explode(':', $line, 2);
+ $header[strtolower($line[0])][] =trim($line[1]);
+ }
+ if ($status == 100) continue;
+ $response_header = $this->_parseHeader($header);
+ if (is_a($response_header, 'PHPRPC_Error')) {
+ $this->_disconnect();
+ return $response_header;
+ }
+ break;
+ }
+ $response_body = '';
+ if (isset($response_header['transfer_encoding']) && (strtolower($response_header['transfer_encoding']) == 'chunked')) {
+ $s = fgets($this->_socket);
+ if ($s == "") {
+ $this->_disconnect();
+ return array();
+ }
+ $chunk_size = (int)hexdec($s);
+ while ($chunk_size > 0) {
+ $response_body .= $this->_socket_read($chunk_size);
+ if (fgets($this->_socket) != "\r\n") {
+ $this->_disconnect();
+ return new PHPRPC_Error(1, "Response is incorrect.");
+ }
+ $chunk_size = (int)hexdec(fgets($this->_socket));
+ }
+ fgets($this->_socket);
+ }
+ elseif (isset($response_header['content_length']) && !is_null($response_header['content_length'])) {
+ $response_body = $this->_socket_read($response_header['content_length']);
+ }
+ else {
+ while (!feof($this->_socket)) {
+ $response_body .= fread($this->_socket, 4096);
+ }
+ $this->_keep_alive = false;
+ $this->_disconnect();
+ }
+ if (isset($response_header['content_encoding']) && (strtolower($response_header['content_encoding']) == 'gzip')) {
+ $response_body = gzdecode($response_body);
+ }
+ if (!$this->_keep_alive) $this->_disconnect();
+ if ($this->_keep_alive && strtolower($response_header['connection']) == 'close') {
+ $this->_keep_alive = false;
+ $this->_disconnect();
+ }
+ return $this->_parseBody($response_body);
+ }
+ function _parseHeader($header) {
+ global $_PHPRPC_COOKIE, $_PHPRPC_COOKIES;
+ if (preg_match('/PHPRPC Server\/([^,]*)(,|$)/i', implode(',', $header['x-powered-by']), $match)) {
+ $this->_server['version'] = (float)$match[1];
+ }
+ else {
+ return new PHPRPC_Error(E_ERROR, "Illegal PHPRPC server.");
+ }
+ if (preg_match('/text\/plain\; charset\=([^,;]*)([,;]|$)/i', $header['content-type'][0], $match)) {
+ $this->_charset = $match[1];
+ }
+ if (isset($header['set-cookie'])) {
+ foreach ($header['set-cookie'] as $cookie) {
+ foreach (preg_split('/[;,]\s?/', $cookie) as $c) {
+ list($name, $value) = explode('=', $c, 2);
+ if (!in_array($name, array('domain', 'expires', 'path', 'secure'))) {
+ $_PHPRPC_COOKIES[$name] = $value;
+ }
+ }
+ }
+ $cookies = array();
+ foreach ($_PHPRPC_COOKIES as $name => $value) {
+ $cookies[] = "$name=$value";
+ }
+ $_PHPRPC_COOKIE = join('; ', $cookies);
+ }
+ if (isset($header['content-length'])) {
+ $content_length = (int)$header['content-length'][0];
+ }
+ else {
+ $content_length = NULL;
+ }
+ $transfer_encoding = isset($header['transfer-encoding']) ? $header['transfer-encoding'][0] : '';
+ $content_encoding = isset($header['content-encoding']) ? $header['content-encoding'][0] : '';
+ $connection = isset($header['connection']) ? $header['connection'][0] : 'close';
+ return array('transfer_encoding' => $transfer_encoding,
+ 'content_encoding' => $content_encoding,
+ 'content_length' => $content_length,
+ 'connection' => $connection);
+ }
+ function _parseBody($body) {
+ $body = explode(";\r\n", $body);
+ $result = array();
+ $n = count($body);
+ for ($i = 0; $i < $n; $i++) {
+ $p = strpos($body[$i], '=');
+ if ($p !== false) {
+ $l = substr($body[$i], 0, $p);
+ $r = substr($body[$i], $p + 1);
+ $result[$l] = trim($r, '"');
+ }
+ }
+ return $result;
+ }
+ function _key_exchange() {
+ if (!is_null($this->_key) || ($this->_encryptMode == 0)) return true;
+ $request = "phprpc_encrypt=true&phprpc_keylen={$this->_keylen}";
+ $result = $this->_post($request);
+ if (is_a($result, 'PHPRPC_Error')) {
+ return $result;
+ }
+ if (array_key_exists('phprpc_keylen', $result)) {
+ $this->_keylen = (int)$result['phprpc_keylen'];
+ }
+ else {
+ $this->_keylen = 128;
+ }
+ if (array_key_exists('phprpc_encrypt', $result)) {
+ $encrypt = unserialize(base64_decode($result['phprpc_encrypt']));
+ require_once('bigint.php');
+ require_once('xxtea.php');
+ $x = bigint_random($this->_keylen - 1, true);
+ $key = bigint_powmod(bigint_dec2num($encrypt['y']), $x, bigint_dec2num($encrypt['p']));
+ if ($this->_keylen == 128) {
+ $key = bigint_num2str($key);
+ }
+ else {
+ $key = pack('H*', md5(bigint_num2dec($key)));
+ }
+ $this->_key = str_pad($key, 16, "\0", STR_PAD_LEFT);
+ $encrypt = bigint_num2dec(bigint_powmod(bigint_dec2num($encrypt['g']), $x, bigint_dec2num($encrypt['p'])));
+ $request = "phprpc_encrypt=$encrypt";
+ $result = $this->_post($request);
+ if (is_a($result, 'PHPRPC_Error')) {
+ return $result;
+ }
+ }
+ else {
+ $this->_key = NULL;
+ $this->_encryptMode = 0;
+ }
+ return true;
+ }
+ function _encrypt($str, $level) {
+ if (!is_null($this->_key) && ($this->_encryptMode >= $level)) {
+ $str = xxtea_encrypt($str, $this->_key);
+ }
+ return $str;
+ }
+ function _decrypt($str, $level) {
+ if (!is_null($this->_key) && ($this->_encryptMode >= $level)) {
+ $str = xxtea_decrypt($str, $this->_key);
+ }
+ return $str;
+ }
+}
+
+if (function_exists("overload") && version_compare(phpversion(), "5", "<")) {
+ eval('
+ class PHPRPC_Client extends _PHPRPC_Client {
+ function __call($function, $arguments, &$return) {
+ $return = $this->invoke($function, $arguments);
+ return true;
+ }
+ }
+ overload("phprpc_client");
+ ');
+}
+else {
+ class PHPRPC_Client extends _PHPRPC_Client {
+ function __call($function, $arguments) {
+ return $this->invoke($function, $arguments);
+ }
+ }
+}
+?>
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/phpRPC/phprpc_date.php b/ThinkPHP/Library/Vendor/phpRPC/phprpc_date.php
new file mode 100644
index 0000000..cb9a280
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/phprpc_date.php
@@ -0,0 +1,522 @@
+ |
+| |
+| This file may be distributed and/or modified under the |
+| terms of the GNU General Public License (GPL) version |
+| 2.0 as published by the Free Software Foundation and |
+| appearing in the included file LICENSE. |
+| |
+\**********************************************************/
+
+/* PHPRPC_Date Class for PHP.
+ *
+ * Copyright: Ma Bingyao
+ * Version: 1.2
+ * LastModified: Apr 12, 2010
+ * This library is free. You can redistribute it and/or modify it under GPL.
+ */
+
+class PHPRPC_Date {
+
+// public fields
+
+ var $year = 1;
+ var $month = 1;
+ var $day = 1;
+ var $hour = 0;
+ var $minute = 0;
+ var $second = 0;
+ var $millisecond = 0;
+
+// constructor
+
+ function PHPRPC_Date() {
+ $num = func_num_args();
+ $time = false;
+ if ($num == 0) {
+ $time = getdate();
+ }
+ if ($num == 1) {
+ $arg = func_get_arg(0);
+ if (is_int($arg)) {
+ $time = getdate($arg);
+ }
+ elseif (is_string($arg)) {
+ $time = getdate(strtotime($arg));
+ }
+ }
+ if (is_array($time)) {
+ $this->year = $time['year'];
+ $this->month = $time['mon'];
+ $this->day = $time['mday'];
+ $this->hour = $time['hours'];
+ $this->minute = $time['minutes'];
+ $this->second = $time['seconds'];
+ }
+ }
+
+// public instance methods
+
+ function addMilliseconds($milliseconds) {
+ if (!is_int($milliseconds)) return false;
+ if ($milliseconds == 0) return true;
+ $millisecond = $this->millisecond + $milliseconds;
+ $milliseconds = $millisecond % 1000;
+ if ($milliseconds < 0) {
+ $milliseconds += 1000;
+ }
+ $seconds = (int)(($millisecond - $milliseconds) / 1000);
+ $millisecond = (int)$milliseconds;
+ if ($this->addSeconds($seconds)) {
+ $this->millisecond = (int)$milliseconds;
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+
+ function addSeconds($seconds) {
+ if (!is_int($seconds)) return false;
+ if ($seconds == 0) return true;
+ $second = $this->second + $seconds;
+ $seconds = $second % 60;
+ if ($seconds < 0) {
+ $seconds += 60;
+ }
+ $minutes = (int)(($second - $seconds) / 60);
+ if ($this->addMinutes($minutes)) {
+ $this->second = (int)$seconds;
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+
+ function addMinutes($minutes) {
+ if (!is_int($minutes)) return false;
+ if ($minutes == 0) return true;
+ $minute = $this->minute + $minutes;
+ $minutes = $minute % 60;
+ if ($minutes < 0) {
+ $minutes += 60;
+ }
+ $hours = (int)(($minute - $minutes) / 60);
+ if ($this->addHours($hours)) {
+ $this->minute = (int)$minutes;
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+
+ function addHours($hours) {
+ if (!is_int($hours)) return false;
+ if ($hours == 0) return true;
+ $hour = $this->hour + $hours;
+ $hours = $hour % 24;
+ if ($hours < 0) {
+ $hours += 24;
+ }
+ $days = (int)(($hour - $hours) / 24);
+ if ($this->addDays($days)) {
+ $this->hour = (int)$hours;
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+
+ function addDays($days) {
+ if (!is_int($days)) return false;
+ $year = $this->year;
+ if ($days == 0) return true;
+ if ($days >= 146097 || $days <= -146097) {
+ $remainder = $days % 146097;
+ if ($remainder < 0) {
+ $remainder += 146097;
+ }
+ $years = 400 * (int)(($days - $remainder) / 146097);
+ $year += $years;
+ if ($year < 1 || $year > 9999) return false;
+ $days = $remainder;
+ }
+ if ($days >= 36524 || $days <= -36524) {
+ $remainder = $days % 36524;
+ if ($remainder < 0) {
+ $remainder += 36524;
+ }
+ $years = 100 * (int)(($days - $remainder) / 36524);
+ $year += $years;
+ if ($year < 1 || $year > 9999) return false;
+ $days = $remainder;
+ }
+ if ($days >= 1461 || $days <= -1461) {
+ $remainder = $days % 1461;
+ if ($remainder < 0) {
+ $remainder += 1461;
+ }
+ $years = 4 * (int)(($days - $remainder) / 1461);
+ $year += $years;
+ if ($year < 1 || $year > 9999) return false;
+ $days = $remainder;
+ }
+ $month = $this->month;
+ while ($days >= 365) {
+ if ($year >= 9999) return false;
+ if ($month <= 2) {
+ if ((($year % 4) == 0) ? (($year % 100) == 0) ? (($year % 400) == 0) : true : false) {
+ $days -= 366;
+ }
+ else {
+ $days -= 365;
+ }
+ $year++;
+ }
+ else {
+ $year++;
+ if ((($year % 4) == 0) ? (($year % 100) == 0) ? (($year % 400) == 0) : true : false) {
+ $days -= 366;
+ }
+ else {
+ $days -= 365;
+ }
+ }
+ }
+ while ($days < 0) {
+ if ($year <= 1) return false;
+ if ($month <= 2) {
+ $year--;
+ if ((($year % 4) == 0) ? (($year % 100) == 0) ? (($year % 400) == 0) : true : false) {
+ $days += 366;
+ }
+ else {
+ $days += 365;
+ }
+ }
+ else {
+ if ((($year % 4) == 0) ? (($year % 100) == 0) ? (($year % 400) == 0) : true : false) {
+ $days += 366;
+ }
+ else {
+ $days += 365;
+ }
+ $year--;
+ }
+ }
+ $daysInMonth = cal_days_in_month(CAL_GREGORIAN, $month, $year);
+ $day = $this->day;
+ while ($day + $days > $daysInMonth) {
+ $days -= $daysInMonth - $day + 1;
+ $month++;
+ if ($month > 12) {
+ if ($year >= 9999) return false;
+ $year++;
+ $month = 1;
+ }
+ $day = 1;
+ $daysInMonth = cal_days_in_month(CAL_GREGORIAN, $month, $year);
+ }
+ $day += $days;
+ $this->year = $year;
+ $this->month = $month;
+ $this->day = $day;
+ return true;
+ }
+
+ function addMonths($months) {
+ if (!is_int($months)) return false;
+ if ($months == 0) return true;
+ $month = $this->month + $months;
+ $months = ($month - 1) % 12 + 1;
+ if ($months < 1) {
+ $months += 12;
+ }
+ $years = (int)(($month - $months) / 12);
+ if ($this->addYears($years)) {
+ $daysInMonth = cal_days_in_month(CAL_GREGORIAN, $months, $this->year);
+ if ($this->day > $daysInMonth) {
+ $months++;
+ $this->day -= $daysInMonth;
+ }
+ $this->month = (int)$months;
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+
+ function addYears($years) {
+ if (!is_int($years)) return false;
+ if ($years == 0) return true;
+ $year = $this->year + $years;
+ if ($year < 1 || $year > 9999) return false;
+ $this->year = $year;
+ return true;
+ }
+
+ function after($when) {
+ if (!is_a($when, 'PHPRPC_Date')) {
+ $when = PHPRPC_Date::parse($when);
+ }
+ if ($this->year < $when->year) return false;
+ if ($this->year > $when->year) return true;
+ if ($this->month < $when->month) return false;
+ if ($this->month > $when->month) return true;
+ if ($this->day < $when->day) return false;
+ if ($this->day > $when->day) return true;
+ if ($this->hour < $when->hour) return false;
+ if ($this->hour > $when->hour) return true;
+ if ($this->minute < $when->minute) return false;
+ if ($this->minute > $when->minute) return true;
+ if ($this->second < $when->second) return false;
+ if ($this->second > $when->second) return true;
+ if ($this->millisecond < $when->millisecond) return false;
+ if ($this->millisecond > $when->millisecond) return true;
+ return false;
+ }
+
+ function before($when) {
+ if (!is_a($when, 'PHPRPC_Date')) {
+ $when = new PHPRPC_Date($when);
+ }
+ if ($this->year < $when->year) return true;
+ if ($this->year > $when->year) return false;
+ if ($this->month < $when->month) return true;
+ if ($this->month > $when->month) return false;
+ if ($this->day < $when->day) return true;
+ if ($this->day > $when->day) return false;
+ if ($this->hour < $when->hour) return true;
+ if ($this->hour > $when->hour) return false;
+ if ($this->minute < $when->minute) return true;
+ if ($this->minute > $when->minute) return false;
+ if ($this->second < $when->second) return true;
+ if ($this->second > $when->second) return false;
+ if ($this->millisecond < $when->millisecond) return true;
+ if ($this->millisecond > $when->millisecond) return false;
+ return false;
+ }
+
+ function equals($when) {
+ if (!is_a($when, 'PHPRPC_Date')) {
+ $when = new PHPRPC_Date($when);
+ }
+ return (($this->year == $when->year) &&
+ ($this->month == $when->month) &&
+ ($this->day == $when->day) &&
+ ($this->hour == $when->hour) &&
+ ($this->minute == $when->minute) &&
+ ($this->second == $when->second) &&
+ ($this->millisecond == $when->millisecond));
+ }
+
+ function set() {
+ $num = func_num_args();
+ $args = func_get_args();
+ if ($num >= 3) {
+ if (!PHPRPC_Date::isValidDate($args[0], $args[1], $args[2])) {
+ return false;
+ }
+ $this->year = (int)$args[0];
+ $this->month = (int)$args[1];
+ $this->day = (int)$args[2];
+ if ($num == 3) {
+ return true;
+ }
+ }
+ if ($num >= 6) {
+ if (!PHPRPC_Date::isValidTime($args[3], $args[4], $args[5])) {
+ return false;
+ }
+ $this->hour = (int)$args[3];
+ $this->minute = (int)$args[4];
+ $this->second = (int)$args[5];
+ if ($num == 6) {
+ return true;
+ }
+ }
+ if (($num == 7) && ($args[6] >= 0 && $args[6] <= 999)) {
+ $this->millisecond = (int)$args[6];
+ return true;
+ }
+ return false;
+ }
+
+ function time() {
+ return mktime($this->hour, $this->minute, $this->second, $this->month, $this->day, $this->year);
+ }
+
+ function toString() {
+ return sprintf('%04d-%02d-%02d %02d:%02d:%02d.%03d',
+ $this->year, $this->month, $this->day,
+ $this->hour, $this->minute, $this->second,
+ $this->millisecond);
+ }
+
+// magic method for PHP 5
+
+ function __toString() {
+ return $this->toString();
+ }
+
+// public instance & static methods
+
+ function dayOfWeek() {
+ $num = func_num_args();
+ if ($num == 3) {
+ $args = func_get_args();
+ $y = $args[0];
+ $m = $args[1];
+ $d = $args[2];
+ }
+ else {
+ $y = $this->year;
+ $m = $this->month;
+ $d = $this->day;
+ }
+ $d += $m < 3 ? $y-- : $y - 2;
+ return ((int)(23 * $m / 9) + $d + 4 + (int)($y / 4) - (int)($y / 100) + (int)($y / 400)) % 7;
+ }
+
+ function dayOfYear() {
+ static $daysToMonth365 = array(0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365);
+ static $daysToMonth366 = array(0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366);
+ $num = func_num_args();
+ if ($num == 3) {
+ $args = func_get_args();
+ $y = $args[0];
+ $m = $args[1];
+ $d = $args[2];
+ }
+ else {
+ $y = $this->year;
+ $m = $this->month;
+ $d = $this->day;
+ }
+ $days = PHPRPC_Date::isLeapYear($y) ? $daysToMonth365 : $daysToMonth366;
+ return $days[$m - 1] + $d;
+ }
+
+// public static methods
+
+ function now() {
+ $date = new PHPRPC_Date();
+ return $date;
+ }
+
+ function today() {
+ $date = PHPRPC_Date::now();
+ $date->hour = 0;
+ $date->minute = 0;
+ $date->second = 0;
+ return $date;
+ }
+
+ function parse($dt) {
+ if (is_a($dt, 'PHPRPC_Date')) {
+ return $dt;
+ }
+ if (is_int($dt)) {
+ return new PHPRPC_Date($dt);
+ }
+ $shortFormat = '(\d|\d{2}|\d{3}|\d{4})-([1-9]|0[1-9]|1[012])-([1-9]|0[1-9]|[12]\d|3[01])';
+ if (preg_match("/^$shortFormat$/", $dt, $match)) {
+ $year = intval($match[1]);
+ $month = intval($match[2]);
+ $day = intval($match[3]);
+ if (PHPRPC_Date::isValidDate($year, $month, $day)) {
+ $date = new PHPRPC_Date(false);
+ $date->year = $year;
+ $date->month = $month;
+ $date->day = $day;
+ return $date;
+ }
+ else {
+ return false;
+ }
+ }
+ $longFormat = $shortFormat . ' (\d|0\d|1\d|2[0-3]):(\d|[0-5]\d):(\d|[0-5]\d)';
+ if (preg_match("/^$longFormat$/", $dt, $match)) {
+ $year = intval($match[1]);
+ $month = intval($match[2]);
+ $day = intval($match[3]);
+ if (PHPRPC_Date::isValidDate($year, $month, $day)) {
+ $date = new PHPRPC_Date(false);
+ $date->year = $year;
+ $date->month = $month;
+ $date->day = $day;
+ $date->hour = intval($match[4]);
+ $date->minute = intval($match[5]);
+ $date->second = intval($match[6]);
+ return $date;
+ }
+ else {
+ return false;
+ }
+ }
+ $fullFormat = $longFormat . '\.(\d|\d{2}|\d{3})';
+ if (preg_match("/^$fullFormat$/", $dt, $match)) {
+ $year = intval($match[1]);
+ $month = intval($match[2]);
+ $day = intval($match[3]);
+ if (PHPRPC_Date::isValidDate($year, $month, $day)) {
+ $date = new PHPRPC_Date(false);
+ $date->year = $year;
+ $date->month = $month;
+ $date->day = $day;
+ $date->hour = intval($match[4]);
+ $date->minute = intval($match[5]);
+ $date->second = intval($match[6]);
+ $date->millisecond = intval($match[7]);
+ return $date;
+ }
+ else {
+ return false;
+ }
+ }
+ return false;
+ }
+
+ function isLeapYear($year) {
+ return (($year % 4) == 0) ? (($year % 100) == 0) ? (($year % 400) == 0) : true : false;
+ }
+
+ function daysInMonth($year, $month) {
+ if (($month < 1) || ($month > 12)) {
+ return false;
+ }
+ return cal_days_in_month(CAL_GREGORIAN, $month, $year);
+ }
+
+ function isValidDate($year, $month, $day) {
+ if (($year >= 1) && ($year <= 9999)) {
+ return checkdate($month, $day, $year);
+ }
+ return false;
+ }
+
+ function isValidTime($hour, $minute, $second) {
+ return !(($hour < 0) || ($hour > 23) ||
+ ($minute < 0) || ($minute > 59) ||
+ ($second < 0) || ($second > 59));
+ }
+}
+?>
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/phpRPC/phprpc_server.php b/ThinkPHP/Library/Vendor/phpRPC/phprpc_server.php
new file mode 100644
index 0000000..22eebf5
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/phprpc_server.php
@@ -0,0 +1,496 @@
+ |
+| |
+| This file may be distributed and/or modified under the |
+| terms of the GNU General Public License (GPL) version |
+| 2.0 as published by the Free Software Foundation and |
+| appearing in the included file LICENSE. |
+| |
+\**********************************************************/
+
+/* PHPRPC Server for PHP.
+ *
+ * Copyright: Ma Bingyao
+ * Version: 3.0
+ * LastModified: Apr 12, 2010
+ * This library is free. You can redistribute it and/or modify it under GPL.
+ *
+/*
+ * Interfaces
+ *
+ * function add($a, $b) {
+ * return $a + $b;
+ * }
+ * function sub($a, $b) {
+ * return $a - $b;
+ * }
+ * function inc(&$n) {
+ * return $n++;
+ * }
+ * include('phprpc_server.php');
+ * $server = new PHPRPC_Server();
+ * $server->add(array('add', 'sub'));
+ * $server->add('inc');
+ * $server->setCharset('UTF-8');
+ * $server->setDebugMode(true);
+ * $server->start();
+ *
+ */
+
+class PHPRPC_Server {
+ var $callback;
+ var $charset;
+ var $encode;
+ var $ref;
+ var $encrypt;
+ var $enableGZIP;
+ var $debug;
+ var $keylen;
+ var $key;
+ var $errno;
+ var $errstr;
+ var $functions;
+ var $cid;
+ var $buffer;
+ // Private Methods
+ function addJsSlashes($str, $flag) {
+ if ($flag) {
+ $str = addcslashes($str, "\0..\006\010..\012\014..\037\042\047\134\177..\377");
+ }
+ else {
+ $str = addcslashes($str, "\0..\006\010..\012\014..\037\042\047\134\177");
+ }
+ return str_replace(array(chr(7), chr(11)), array('\007', '\013'), $str);
+ }
+ function encodeString($str, $flag = true) {
+ if ($this->encode) {
+ return base64_encode($str);
+ }
+ else {
+ return $this->addJsSlashes($str, $flag);
+ }
+ }
+ function encryptString($str, $level) {
+ if ($this->encrypt >= $level) {
+ $str = xxtea_encrypt($str, $this->key);
+ }
+ return $str;
+ }
+ function decryptString($str, $level) {
+ if ($this->encrypt >= $level) {
+ $str = xxtea_decrypt($str, $this->key);
+ }
+ return $str;
+ }
+ function sendHeader() {
+ header("HTTP/1.1 200 OK");
+ header("Content-Type: text/plain; charset={$this->charset}");
+ header("X-Powered-By: PHPRPC Server/3.0");
+ header('P3P: CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE GOV"');
+ header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
+ header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
+ }
+ function getRequestURL() {
+ if (!isset($_SERVER['HTTPS']) ||
+ $_SERVER['HTTPS'] == 'off' ||
+ $_SERVER['HTTPS'] == '') {
+ $scheme = 'http';
+ }
+ else {
+ $scheme = 'https';
+ }
+ $host = $_SERVER['SERVER_NAME'];
+ $port = $_SERVER['SERVER_PORT'];
+ $path = $_SERVER['SCRIPT_NAME'];
+ return $scheme . '://' . $host . (($port == 80) ? '' : ':' . $port) . $path;
+ }
+ function sendURL() {
+ if (SID != "") {
+ $url = $this->getRequestURL();
+ if (count($_GET) > 0) {
+ $url .= '?' . strip_tags(SID);
+ foreach ($_GET as $key => $value) {
+ if (strpos(strtolower($key), 'phprpc_') !== 0) {
+ $url .= '&' . $key . '=' . urlencode($value);
+ }
+ }
+ }
+ $this->buffer .= "phprpc_url=\"" . $this->encodeString($url) . "\";\r\n";
+ }
+ }
+ function gzip($buffer) {
+ $len = strlen($buffer);
+ if ($this->enableGZIP && strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip,deflate')) {
+ $gzbuffer = gzencode($buffer);
+ $gzlen = strlen($gzbuffer);
+ if ($len > $gzlen) {
+ header("Content-Length: $gzlen");
+ header("Content-Encoding: gzip");
+ return $gzbuffer;
+ }
+ }
+ header("Content-Length: $len");
+ return $buffer;
+ }
+ function sendCallback() {
+ $this->buffer .= $this->callback;
+ echo $this->gzip($this->buffer);
+ ob_end_flush();
+ restore_error_handler();
+ if (function_exists('restore_exception_handler')) {
+ restore_exception_handler();
+ }
+ exit();
+ }
+ function sendFunctions() {
+ $this->buffer .= "phprpc_functions=\"" . $this->encodeString(serialize_fix(array_keys($this->functions))) . "\";\r\n";
+ $this->sendCallback();
+ }
+ function sendOutput($output) {
+ if ($this->encrypt >= 3) {
+ $this->buffer .= "phprpc_output=\"" . $this->encodeString(xxtea_encrypt($output, $this->key)) . "\";\r\n";
+ }
+ else {
+ $this->buffer .= "phprpc_output=\"" . $this->encodeString($output, false) . "\";\r\n";
+ }
+ }
+ function sendError($output = NULL) {
+ if (is_null($output)) {
+ $output = ob_get_clean();
+ }
+ $this->buffer .= "phprpc_errno=\"{$this->errno}\";\r\n";
+ $this->buffer .= "phprpc_errstr=\"" . $this->encodeString($this->errstr, false) . "\";\r\n";
+ $this->sendOutput($output);
+ $this->sendCallback();
+ }
+ function fatalErrorHandler($buffer) {
+ if (preg_match('/(.*?) error<\/b>:(.*?)
debug) {
+ $errstr = preg_replace('/<.*?>/', '', $match[2]);
+ }
+ else {
+ $errstr = preg_replace('/ in .*<\/b>$/', '', $match[2]);
+ }
+
+ $buffer = "phprpc_errno=\"{$errno}\";\r\n" .
+ "phprpc_errstr=\"" . $this->encodeString(trim($errstr), false) . "\";\r\n" .
+ "phprpc_output=\"\";\r\n" .
+ $this->callback;
+ $buffer = $this->gzip($buffer);
+ }
+ return $buffer;
+ }
+ function errorHandler($errno, $errstr, $errfile, $errline) {
+ if ($this->debug) {
+ $errstr .= " in $errfile on line $errline";
+ }
+ if (($errno == E_ERROR) or ($errno == E_CORE_ERROR) or
+ ($errno == E_COMPILE_ERROR) or ($errno == E_USER_ERROR)) {
+ $this->errno = $errno;
+ $this->errstr = $errstr;
+ $this->sendError();
+ }
+ else {
+ if (($errno == E_NOTICE) or ($errno == E_USER_NOTICE)) {
+ if ($this->errno == 0) {
+ $this->errno = $errno;
+ $this->errstr = $errstr;
+ }
+ }
+ else {
+ if (($this->errno == 0) or
+ ($this->errno == E_NOTICE) or
+ ($this->errno == E_USER_NOTICE)) {
+ $this->errno = $errno;
+ $this->errstr = $errstr;
+ }
+ }
+ }
+ return true;
+ }
+ function exceptionHandler($exception) {
+ $this->errno = $exception->getCode();
+ $this->errstr = $exception->getMessage();
+ if ($this->debug) {
+ $this->errstr .= "\nfile: " . $exception->getFile() .
+ "\nline: " . $exception->getLine() .
+ "\ntrace: " . $exception->getTraceAsString();
+ }
+ $this->sendError();
+ }
+ function initErrorHandler() {
+ $this->errno = 0;
+ $this->errstr = "";
+ set_error_handler(array(&$this, 'errorHandler'));
+ if (function_exists('set_exception_handler')) {
+ set_exception_handler(array(&$this, 'exceptionHandler'));
+ }
+ }
+ function call($function, &$args) {
+ if ($this->ref) {
+ $arguments = array();
+ for ($i = 0; $i < count($args); $i++) {
+ $arguments[$i] = &$args[$i];
+ }
+ }
+ else {
+ $arguments = $args;
+ }
+ return call_user_func_array($function, $arguments);
+ }
+ function getRequest($name) {
+ $result = $_REQUEST[$name];
+ if (get_magic_quotes_gpc()) {
+ $result = stripslashes($result);
+ }
+ return $result;
+ }
+ function getBooleanRequest($name) {
+ $var = true;
+ if (isset($_REQUEST[$name])) {
+ $var = strtolower($this->getRequest($name));
+ if ($var == "false") {
+ $var = false;
+ }
+ }
+ return $var;
+ }
+ function initEncode() {
+ $this->encode = $this->getBooleanRequest('phprpc_encode');
+ }
+ function initRef() {
+ $this->ref = $this->getBooleanRequest('phprpc_ref');
+ }
+ function initCallback() {
+ if (isset($_REQUEST['phprpc_callback'])) {
+ $this->callback = base64_decode($this->getRequest('phprpc_callback'));
+ }
+ else {
+ $this->callback = "";
+ }
+ }
+ function initKeylen() {
+ if (isset($_REQUEST['phprpc_keylen'])) {
+ $this->keylen = (int)$this->getRequest('phprpc_keylen');
+ }
+ else if (isset($_SESSION[$this->cid])) {
+ $session = unserialize(base64_decode($_SESSION[$this->cid]));
+ if (isset($session['keylen'])) {
+ $this->keylen = $session['keylen'];
+ }
+ else {
+ $this->keylen = 128;
+ }
+ }
+ else {
+ $this->keylen = 128;
+ }
+ }
+ function initClientID() {
+ $this->cid = 0;
+ if (isset($_REQUEST['phprpc_id'])) {
+ $this->cid = $this->getRequest('phprpc_id');
+ }
+ $this->cid = "phprpc_" . $this->cid;
+ }
+ function initEncrypt() {
+ $this->encrypt = false;
+ if (isset($_REQUEST['phprpc_encrypt'])) {
+ $this->encrypt = $this->getRequest('phprpc_encrypt');
+ if ($this->encrypt === "true") $this->encrypt = true;
+ if ($this->encrypt === "false") $this->encrypt = false;
+ }
+ }
+ function initKey() {
+ if ($this->encrypt == 0) {
+ return;
+ }
+ else if (isset($_SESSION[$this->cid])) {
+ $session = unserialize(base64_decode($_SESSION[$this->cid]));
+ if (isset($session['key'])) {
+ $this->key = $session['key'];
+ require_once('xxtea.php');
+ return;
+ }
+ }
+ $this->errno = E_ERROR;
+ $this->errstr = "Can't find the key for decryption.";
+ $this->encrypt = 0;
+ $this->sendError();
+ }
+ function getArguments() {
+ if (isset($_REQUEST['phprpc_args'])) {
+ $arguments = unserialize($this->decryptString(base64_decode($this->getRequest('phprpc_args')), 1));
+ ksort($arguments);
+ }
+ else {
+ $arguments = array();
+ }
+ return $arguments;
+ }
+ function callFunction() {
+ $this->initKey();
+ $function = strtolower($this->getRequest('phprpc_func'));
+ if (array_key_exists($function, $this->functions)) {
+ $function = $this->functions[$function];
+ $arguments = $this->getArguments();
+ $result = $this->encodeString($this->encryptString(serialize_fix($this->call($function, $arguments)), 2));
+ $output = ob_get_clean();
+ $this->buffer .= "phprpc_result=\"$result\";\r\n";
+ if ($this->ref) {
+ $arguments = $this->encodeString($this->encryptString(serialize_fix($arguments), 1));
+ $this->buffer .= "phprpc_args=\"$arguments\";\r\n";
+ }
+ }
+ else {
+ $this->errno = E_ERROR;
+ $this->errstr = "Can't find this function $function().";
+ $output = ob_get_clean();
+ }
+ $this->sendError($output);
+ }
+ function keyExchange() {
+ require_once('bigint.php');
+ $this->initKeylen();
+ if (isset($_SESSION[$this->cid])) {
+ $session = unserialize(base64_decode($_SESSION[$this->cid]));
+ }
+ else {
+ $session = array();
+ }
+ if ($this->encrypt === true) {
+ require_once('dhparams.php');
+ $DHParams = new DHParams($this->keylen);
+ $this->keylen = $DHParams->getL();
+ $encrypt = $DHParams->getDHParams();
+ $x = bigint_random($this->keylen - 1, true);
+ $session['x'] = bigint_num2dec($x);
+ $session['p'] = $encrypt['p'];
+ $session['keylen'] = $this->keylen;
+ $encrypt['y'] = bigint_num2dec(bigint_powmod(bigint_dec2num($encrypt['g']), $x, bigint_dec2num($encrypt['p'])));
+ $this->buffer .= "phprpc_encrypt=\"" . $this->encodeString(serialize_fix($encrypt)) . "\";\r\n";
+ if ($this->keylen != 128) {
+ $this->buffer .= "phprpc_keylen=\"{$this->keylen}\";\r\n";
+ }
+ $this->sendURL();
+ }
+ else {
+ $y = bigint_dec2num($this->encrypt);
+ $x = bigint_dec2num($session['x']);
+ $p = bigint_dec2num($session['p']);
+ $key = bigint_powmod($y, $x, $p);
+ if ($this->keylen == 128) {
+ $key = bigint_num2str($key);
+ }
+ else {
+ $key = pack('H*', md5(bigint_num2dec($key)));
+ }
+ $session['key'] = str_pad($key, 16, "\0", STR_PAD_LEFT);
+ }
+ $_SESSION[$this->cid] = base64_encode(serialize($session));
+ $this->sendCallback();
+ }
+ function initSession() {
+ @ob_start();
+ ob_implicit_flush(0);
+ session_start();
+ }
+ function initOutputBuffer() {
+ @ob_start(array(&$this, "fatalErrorHandler"));
+ ob_implicit_flush(0);
+ $this->buffer = "";
+ }
+ // Public Methods
+ function PHPRPC_Server() {
+ require_once('compat.php');
+ $this->functions = array();
+ $this->charset = 'UTF-8';
+ $this->debug = false;
+ $this->enableGZIP = false;
+ }
+ function add($functions, $obj = NULL, $aliases = NULL) {
+ if (is_null($functions) || (gettype($functions) != gettype($aliases) && !is_null($aliases))) {
+ return false;
+ }
+ if (is_object($functions)) {
+ $obj = $functions;
+ $functions = get_class_methods(get_class($obj));
+ $aliases = $functions;
+ }
+ if (is_null($aliases)) {
+ $aliases = $functions;
+ }
+ if (is_string($functions)) {
+ if (is_null($obj)) {
+ $this->functions[strtolower($aliases)] = $functions;
+ }
+ else if (is_object($obj)) {
+ $this->functions[strtolower($aliases)] = array(&$obj, $functions);
+ }
+ else if (is_string($obj)) {
+ $this->functions[strtolower($aliases)] = array($obj, $functions);
+ }
+ }
+ else {
+ if (count($functions) != count($aliases)) {
+ return false;
+ }
+ foreach ($functions as $key => $function) {
+ $this->add($function, $obj, $aliases[$key]);
+ }
+ }
+ return true;
+ }
+ function setCharset($charset) {
+ $this->charset = $charset;
+ }
+ function setDebugMode($debug) {
+ $this->debug = $debug;
+ }
+ function setEnableGZIP($enableGZIP) {
+ $this->enableGZIP = $enableGZIP;
+ }
+ function start() {
+ while(ob_get_length() !== false) @ob_end_clean();
+ $this->initOutputBuffer();
+ $this->sendHeader();
+ $this->initErrorHandler();
+ $this->initEncode();
+ $this->initCallback();
+ $this->initRef();
+ $this->initClientID();
+ $this->initEncrypt();
+ if (isset($_REQUEST['phprpc_func'])) {
+ $this->callFunction();
+ }
+ else if ($this->encrypt != false) {
+ $this->keyExchange();
+ }
+ else {
+ $this->sendFunctions();
+ }
+ }
+}
+
+PHPRPC_Server::initSession();
+?>
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/phpRPC/xxtea.php b/ThinkPHP/Library/Vendor/phpRPC/xxtea.php
new file mode 100644
index 0000000..b22f68f
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/phpRPC/xxtea.php
@@ -0,0 +1,134 @@
+ |
+| |
+| This file may be distributed and/or modified under the |
+| terms of the GNU General Public License (GPL) version |
+| 2.0 as published by the Free Software Foundation and |
+| appearing in the included file LICENSE. |
+| |
+\**********************************************************/
+
+/* XXTEA encryption arithmetic library.
+ *
+ * Copyright: Ma Bingyao
+ * Version: 1.6
+ * LastModified: Apr 12, 2010
+ * This library is free. You can redistribute it and/or modify it under GPL.
+ */
+if (!extension_loaded('xxtea')) {
+ function long2str($v, $w) {
+ $len = count($v);
+ $n = ($len - 1) << 2;
+ if ($w) {
+ $m = $v[$len - 1];
+ if (($m < $n - 3) || ($m > $n)) return false;
+ $n = $m;
+ }
+ $s = array();
+ for ($i = 0; $i < $len; $i++) {
+ $s[$i] = pack("V", $v[$i]);
+ }
+ if ($w) {
+ return substr(join('', $s), 0, $n);
+ }
+ else {
+ return join('', $s);
+ }
+ }
+
+ function str2long($s, $w) {
+ $v = unpack("V*", $s. str_repeat("\0", (4 - strlen($s) % 4) & 3));
+ $v = array_values($v);
+ if ($w) {
+ $v[count($v)] = strlen($s);
+ }
+ return $v;
+ }
+
+ function int32($n) {
+ while ($n >= 2147483648) $n -= 4294967296;
+ while ($n <= -2147483649) $n += 4294967296;
+ return (int)$n;
+ }
+
+ function xxtea_encrypt($str, $key) {
+ if ($str == "") {
+ return "";
+ }
+ $v = str2long($str, true);
+ $k = str2long($key, false);
+ if (count($k) < 4) {
+ for ($i = count($k); $i < 4; $i++) {
+ $k[$i] = 0;
+ }
+ }
+ $n = count($v) - 1;
+
+ $z = $v[$n];
+ $y = $v[0];
+ $delta = 0x9E3779B9;
+ $q = floor(6 + 52 / ($n + 1));
+ $sum = 0;
+ while (0 < $q--) {
+ $sum = int32($sum + $delta);
+ $e = $sum >> 2 & 3;
+ for ($p = 0; $p < $n; $p++) {
+ $y = $v[$p + 1];
+ $mx = int32((($z >> 5 & 0x07ffffff) ^ $y << 2) + (($y >> 3 & 0x1fffffff) ^ $z << 4)) ^ int32(($sum ^ $y) + ($k[$p & 3 ^ $e] ^ $z));
+ $z = $v[$p] = int32($v[$p] + $mx);
+ }
+ $y = $v[0];
+ $mx = int32((($z >> 5 & 0x07ffffff) ^ $y << 2) + (($y >> 3 & 0x1fffffff) ^ $z << 4)) ^ int32(($sum ^ $y) + ($k[$p & 3 ^ $e] ^ $z));
+ $z = $v[$n] = int32($v[$n] + $mx);
+ }
+ return long2str($v, false);
+ }
+
+ function xxtea_decrypt($str, $key) {
+ if ($str == "") {
+ return "";
+ }
+ $v = str2long($str, false);
+ $k = str2long($key, false);
+ if (count($k) < 4) {
+ for ($i = count($k); $i < 4; $i++) {
+ $k[$i] = 0;
+ }
+ }
+ $n = count($v) - 1;
+
+ $z = $v[$n];
+ $y = $v[0];
+ $delta = 0x9E3779B9;
+ $q = floor(6 + 52 / ($n + 1));
+ $sum = int32($q * $delta);
+ while ($sum != 0) {
+ $e = $sum >> 2 & 3;
+ for ($p = $n; $p > 0; $p--) {
+ $z = $v[$p - 1];
+ $mx = int32((($z >> 5 & 0x07ffffff) ^ $y << 2) + (($y >> 3 & 0x1fffffff) ^ $z << 4)) ^ int32(($sum ^ $y) + ($k[$p & 3 ^ $e] ^ $z));
+ $y = $v[$p] = int32($v[$p] - $mx);
+ }
+ $z = $v[$n];
+ $mx = int32((($z >> 5 & 0x07ffffff) ^ $y << 2) + (($y >> 3 & 0x1fffffff) ^ $z << 4)) ^ int32(($sum ^ $y) + ($k[$p & 3 ^ $e] ^ $z));
+ $y = $v[0] = int32($v[0] - $mx);
+ $sum = int32($sum - $delta);
+ }
+ return long2str($v, true);
+ }
+}
+?>
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/spyc/COPYING b/ThinkPHP/Library/Vendor/spyc/COPYING
new file mode 100644
index 0000000..8e7ddbc
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/spyc/COPYING
@@ -0,0 +1,21 @@
+The MIT License
+
+Copyright (c) 2011 Vladimir Andersen
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/spyc/README.md b/ThinkPHP/Library/Vendor/spyc/README.md
new file mode 100644
index 0000000..f8fa848
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/spyc/README.md
@@ -0,0 +1,30 @@
+**Spyc** is a YAML loader/dumper written in pure PHP. Given a YAML document, Spyc will return an array that
+you can use however you see fit. Given an array, Spyc will return a string which contains a YAML document
+built from your data.
+
+**YAML** is an amazingly human friendly and strikingly versatile data serialization language which can be used
+for log files, config files, custom protocols, the works. For more information, see http://www.yaml.org.
+
+Spyc supports YAML 1.0 specification.
+
+## Using Spyc
+
+Using Spyc is trivial:
+
+```
+
+ * @author Chris Wanstrath
+ * @link http://code.google.com/p/spyc/
+ * @copyright Copyright 2005-2006 Chris Wanstrath, 2006-2011 Vlad Andersen
+ * @license http://www.opensource.org/licenses/mit-license.php MIT License
+ * @package Spyc
+ */
+
+if (!function_exists('spyc_load')) {
+ /**
+ * Parses YAML to array.
+ * @param string $string YAML string.
+ * @return array
+ */
+ function spyc_load ($string) {
+ return Spyc::YAMLLoadString($string);
+ }
+}
+
+if (!function_exists('spyc_load_file')) {
+ /**
+ * Parses YAML to array.
+ * @param string $file Path to YAML file.
+ * @return array
+ */
+ function spyc_load_file ($file) {
+ return Spyc::YAMLLoad($file);
+ }
+}
+
+if (!function_exists('spyc_dump')) {
+ /**
+ * Dumps array to YAML.
+ * @param array $data Array.
+ * @return string
+ */
+ function spyc_dump ($data) {
+ return Spyc::YAMLDump($data, false, false, true);
+ }
+}
+
+/**
+ * The Simple PHP YAML Class.
+ *
+ * This class can be used to read a YAML file and convert its contents
+ * into a PHP array. It currently supports a very limited subsection of
+ * the YAML spec.
+ *
+ * Usage:
+ *
+ * $Spyc = new Spyc;
+ * $array = $Spyc->load($file);
+ *
+ * or:
+ *
+ * $array = Spyc::YAMLLoad($file);
+ *
+ * or:
+ *
+ * $array = spyc_load_file($file);
+ *
+ * @package Spyc
+ */
+class Spyc {
+
+ // SETTINGS
+
+ const REMPTY = "\0\0\0\0\0";
+
+ /**
+ * Setting this to true will force YAMLDump to enclose any string value in
+ * quotes. False by default.
+ *
+ * @var bool
+ */
+ public $setting_dump_force_quotes = false;
+
+ /**
+ * Setting this to true will forse YAMLLoad to use syck_load function when
+ * possible. False by default.
+ * @var bool
+ */
+ public $setting_use_syck_is_possible = false;
+
+
+
+ /**#@+
+ * @access private
+ * @var mixed
+ */
+ private $_dumpIndent;
+ private $_dumpWordWrap;
+ private $_containsGroupAnchor = false;
+ private $_containsGroupAlias = false;
+ private $path;
+ private $result;
+ private $LiteralPlaceHolder = '___YAML_Literal_Block___';
+ private $SavedGroups = array();
+ private $indent;
+ /**
+ * Path modifier that should be applied after adding current element.
+ * @var array
+ */
+ private $delayedPath = array();
+
+ /**#@+
+ * @access public
+ * @var mixed
+ */
+ public $_nodeId;
+
+/**
+ * Load a valid YAML string to Spyc.
+ * @param string $input
+ * @return array
+ */
+ public function load ($input) {
+ return $this->__loadString($input);
+ }
+
+ /**
+ * Load a valid YAML file to Spyc.
+ * @param string $file
+ * @return array
+ */
+ public function loadFile ($file) {
+ return $this->__load($file);
+ }
+
+ /**
+ * Load YAML into a PHP array statically
+ *
+ * The load method, when supplied with a YAML stream (string or file),
+ * will do its best to convert YAML in a file into a PHP array. Pretty
+ * simple.
+ * Usage:
+ *
+ * $array = Spyc::YAMLLoad('lucky.yaml');
+ * print_r($array);
+ *
+ * @access public
+ * @return array
+ * @param string $input Path of YAML file or string containing YAML
+ */
+ public static function YAMLLoad($input) {
+ $Spyc = new Spyc;
+ return $Spyc->__load($input);
+ }
+
+ /**
+ * Load a string of YAML into a PHP array statically
+ *
+ * The load method, when supplied with a YAML string, will do its best
+ * to convert YAML in a string into a PHP array. Pretty simple.
+ *
+ * Note: use this function if you don't want files from the file system
+ * loaded and processed as YAML. This is of interest to people concerned
+ * about security whose input is from a string.
+ *
+ * Usage:
+ *
+ * $array = Spyc::YAMLLoadString("---\n0: hello world\n");
+ * print_r($array);
+ *
+ * @access public
+ * @return array
+ * @param string $input String containing YAML
+ */
+ public static function YAMLLoadString($input) {
+ $Spyc = new Spyc;
+ return $Spyc->__loadString($input);
+ }
+
+ /**
+ * Dump YAML from PHP array statically
+ *
+ * The dump method, when supplied with an array, will do its best
+ * to convert the array into friendly YAML. Pretty simple. Feel free to
+ * save the returned string as nothing.yaml and pass it around.
+ *
+ * Oh, and you can decide how big the indent is and what the wordwrap
+ * for folding is. Pretty cool -- just pass in 'false' for either if
+ * you want to use the default.
+ *
+ * Indent's default is 2 spaces, wordwrap's default is 40 characters. And
+ * you can turn off wordwrap by passing in 0.
+ *
+ * @access public
+ * @return string
+ * @param array $array PHP array
+ * @param int $indent Pass in false to use the default, which is 2
+ * @param int $wordwrap Pass in 0 for no wordwrap, false for default (40)
+ * @param int $no_opening_dashes Do not start YAML file with "---\n"
+ */
+ public static function YAMLDump($array, $indent = false, $wordwrap = false, $no_opening_dashes = false) {
+ $spyc = new Spyc;
+ return $spyc->dump($array, $indent, $wordwrap, $no_opening_dashes);
+ }
+
+
+ /**
+ * Dump PHP array to YAML
+ *
+ * The dump method, when supplied with an array, will do its best
+ * to convert the array into friendly YAML. Pretty simple. Feel free to
+ * save the returned string as tasteful.yaml and pass it around.
+ *
+ * Oh, and you can decide how big the indent is and what the wordwrap
+ * for folding is. Pretty cool -- just pass in 'false' for either if
+ * you want to use the default.
+ *
+ * Indent's default is 2 spaces, wordwrap's default is 40 characters. And
+ * you can turn off wordwrap by passing in 0.
+ *
+ * @access public
+ * @return string
+ * @param array $array PHP array
+ * @param int $indent Pass in false to use the default, which is 2
+ * @param int $wordwrap Pass in 0 for no wordwrap, false for default (40)
+ */
+ public function dump($array,$indent = false,$wordwrap = false, $no_opening_dashes = false) {
+ // Dumps to some very clean YAML. We'll have to add some more features
+ // and options soon. And better support for folding.
+
+ // New features and options.
+ if ($indent === false or !is_numeric($indent)) {
+ $this->_dumpIndent = 2;
+ } else {
+ $this->_dumpIndent = $indent;
+ }
+
+ if ($wordwrap === false or !is_numeric($wordwrap)) {
+ $this->_dumpWordWrap = 40;
+ } else {
+ $this->_dumpWordWrap = $wordwrap;
+ }
+
+ // New YAML document
+ $string = "";
+ if (!$no_opening_dashes) $string = "---\n";
+
+ // Start at the base of the array and move through it.
+ if ($array) {
+ $array = (array)$array;
+ $previous_key = -1;
+ foreach ($array as $key => $value) {
+ if (!isset($first_key)) $first_key = $key;
+ $string .= $this->_yamlize($key,$value,0,$previous_key, $first_key, $array);
+ $previous_key = $key;
+ }
+ }
+ return $string;
+ }
+
+ /**
+ * Attempts to convert a key / value array item to YAML
+ * @access private
+ * @return string
+ * @param $key The name of the key
+ * @param $value The value of the item
+ * @param $indent The indent of the current node
+ */
+ private function _yamlize($key,$value,$indent, $previous_key = -1, $first_key = 0, $source_array = null) {
+ if (is_array($value)) {
+ if (empty ($value))
+ return $this->_dumpNode($key, array(), $indent, $previous_key, $first_key, $source_array);
+ // It has children. What to do?
+ // Make it the right kind of item
+ $string = $this->_dumpNode($key, self::REMPTY, $indent, $previous_key, $first_key, $source_array);
+ // Add the indent
+ $indent += $this->_dumpIndent;
+ // Yamlize the array
+ $string .= $this->_yamlizeArray($value,$indent);
+ } elseif (!is_array($value)) {
+ // It doesn't have children. Yip.
+ $string = $this->_dumpNode($key, $value, $indent, $previous_key, $first_key, $source_array);
+ }
+ return $string;
+ }
+
+ /**
+ * Attempts to convert an array to YAML
+ * @access private
+ * @return string
+ * @param $array The array you want to convert
+ * @param $indent The indent of the current level
+ */
+ private function _yamlizeArray($array,$indent) {
+ if (is_array($array)) {
+ $string = '';
+ $previous_key = -1;
+ foreach ($array as $key => $value) {
+ if (!isset($first_key)) $first_key = $key;
+ $string .= $this->_yamlize($key, $value, $indent, $previous_key, $first_key, $array);
+ $previous_key = $key;
+ }
+ return $string;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Returns YAML from a key and a value
+ * @access private
+ * @return string
+ * @param $key The name of the key
+ * @param $value The value of the item
+ * @param $indent The indent of the current node
+ */
+ private function _dumpNode($key, $value, $indent, $previous_key = -1, $first_key = 0, $source_array = null) {
+ // do some folding here, for blocks
+ if (is_string ($value) && ((strpos($value,"\n") !== false || strpos($value,": ") !== false || strpos($value,"- ") !== false ||
+ strpos($value,"*") !== false || strpos($value,"#") !== false || strpos($value,"<") !== false || strpos($value,">") !== false || strpos ($value, ' ') !== false ||
+ strpos($value,"[") !== false || strpos($value,"]") !== false || strpos($value,"{") !== false || strpos($value,"}") !== false) || strpos($value,"&") !== false || strpos($value, "'") !== false || strpos($value, "!") === 0 ||
+ substr ($value, -1, 1) == ':')
+ ) {
+ $value = $this->_doLiteralBlock($value,$indent);
+ } else {
+ $value = $this->_doFolding($value,$indent);
+ }
+
+ if ($value === array()) $value = '[ ]';
+ if ($value === "") $value = '""';
+ if (self::isTranslationWord($value)) {
+ $value = $this->_doLiteralBlock($value, $indent);
+ }
+ if (trim ($value) != $value)
+ $value = $this->_doLiteralBlock($value,$indent);
+
+ if (is_bool($value)) {
+ $value = $value ? "true" : "false";
+ }
+
+ if ($value === null) $value = 'null';
+ if ($value === "'" . self::REMPTY . "'") $value = null;
+
+ $spaces = str_repeat(' ',$indent);
+
+ //if (is_int($key) && $key - 1 == $previous_key && $first_key===0) {
+ if (is_array ($source_array) && array_keys($source_array) === range(0, count($source_array) - 1)) {
+ // It's a sequence
+ $string = $spaces.'- '.$value."\n";
+ } else {
+ // if ($first_key===0) throw new Exception('Keys are all screwy. The first one was zero, now it\'s "'. $key .'"');
+ // It's mapped
+ if (strpos($key, ":") !== false || strpos($key, "#") !== false) { $key = '"' . $key . '"'; }
+ $string = rtrim ($spaces.$key.': '.$value)."\n";
+ }
+ return $string;
+ }
+
+ /**
+ * Creates a literal block for dumping
+ * @access private
+ * @return string
+ * @param $value
+ * @param $indent int The value of the indent
+ */
+ private function _doLiteralBlock($value,$indent) {
+ if ($value === "\n") return '\n';
+ if (strpos($value, "\n") === false && strpos($value, "'") === false) {
+ return sprintf ("'%s'", $value);
+ }
+ if (strpos($value, "\n") === false && strpos($value, '"') === false) {
+ return sprintf ('"%s"', $value);
+ }
+ $exploded = explode("\n",$value);
+ $newValue = '|';
+ $indent += $this->_dumpIndent;
+ $spaces = str_repeat(' ',$indent);
+ foreach ($exploded as $line) {
+ $newValue .= "\n" . $spaces . ($line);
+ }
+ return $newValue;
+ }
+
+ /**
+ * Folds a string of text, if necessary
+ * @access private
+ * @return string
+ * @param $value The string you wish to fold
+ */
+ private function _doFolding($value,$indent) {
+ // Don't do anything if wordwrap is set to 0
+
+ if ($this->_dumpWordWrap !== 0 && is_string ($value) && strlen($value) > $this->_dumpWordWrap) {
+ $indent += $this->_dumpIndent;
+ $indent = str_repeat(' ',$indent);
+ $wrapped = wordwrap($value,$this->_dumpWordWrap,"\n$indent");
+ $value = ">\n".$indent.$wrapped;
+ } else {
+ if ($this->setting_dump_force_quotes && is_string ($value) && $value !== self::REMPTY)
+ $value = '"' . $value . '"';
+ if (is_numeric($value) && is_string($value))
+ $value = '"' . $value . '"';
+ }
+
+
+ return $value;
+ }
+
+ private function isTrueWord($value) {
+ $words = self::getTranslations(array('true', 'on', 'yes', 'y'));
+ return in_array($value, $words, true);
+ }
+
+ private function isFalseWord($value) {
+ $words = self::getTranslations(array('false', 'off', 'no', 'n'));
+ return in_array($value, $words, true);
+ }
+
+ private function isNullWord($value) {
+ $words = self::getTranslations(array('null', '~'));
+ return in_array($value, $words, true);
+ }
+
+ private function isTranslationWord($value) {
+ return (
+ self::isTrueWord($value) ||
+ self::isFalseWord($value) ||
+ self::isNullWord($value)
+ );
+ }
+
+ /**
+ * Coerce a string into a native type
+ * Reference: http://yaml.org/type/bool.html
+ * TODO: Use only words from the YAML spec.
+ * @access private
+ * @param $value The value to coerce
+ */
+ private function coerceValue(&$value) {
+ if (self::isTrueWord($value)) {
+ $value = true;
+ } else if (self::isFalseWord($value)) {
+ $value = false;
+ } else if (self::isNullWord($value)) {
+ $value = null;
+ }
+ }
+
+ /**
+ * Given a set of words, perform the appropriate translations on them to
+ * match the YAML 1.1 specification for type coercing.
+ * @param $words The words to translate
+ * @access private
+ */
+ private static function getTranslations(array $words) {
+ $result = array();
+ foreach ($words as $i) {
+ $result = array_merge($result, array(ucfirst($i), strtoupper($i), strtolower($i)));
+ }
+ return $result;
+ }
+
+// LOADING FUNCTIONS
+
+ private function __load($input) {
+ $Source = $this->loadFromSource($input);
+ return $this->loadWithSource($Source);
+ }
+
+ private function __loadString($input) {
+ $Source = $this->loadFromString($input);
+ return $this->loadWithSource($Source);
+ }
+
+ private function loadWithSource($Source) {
+ if (empty ($Source)) return array();
+ if ($this->setting_use_syck_is_possible && function_exists ('syck_load')) {
+ $array = syck_load (implode ("\n", $Source));
+ return is_array($array) ? $array : array();
+ }
+
+ $this->path = array();
+ $this->result = array();
+
+ $cnt = count($Source);
+ for ($i = 0; $i < $cnt; $i++) {
+ $line = $Source[$i];
+
+ $this->indent = strlen($line) - strlen(ltrim($line));
+ $tempPath = $this->getParentPathByIndent($this->indent);
+ $line = self::stripIndent($line, $this->indent);
+ if (self::isComment($line)) continue;
+ if (self::isEmpty($line)) continue;
+ $this->path = $tempPath;
+
+ $literalBlockStyle = self::startsLiteralBlock($line);
+ if ($literalBlockStyle) {
+ $line = rtrim ($line, $literalBlockStyle . " \n");
+ $literalBlock = '';
+ $line .= ' '.$this->LiteralPlaceHolder;
+ $literal_block_indent = strlen($Source[$i+1]) - strlen(ltrim($Source[$i+1]));
+ while (++$i < $cnt && $this->literalBlockContinues($Source[$i], $this->indent)) {
+ $literalBlock = $this->addLiteralLine($literalBlock, $Source[$i], $literalBlockStyle, $literal_block_indent);
+ }
+ $i--;
+ }
+
+ // Strip out comments
+ if (strpos ($line, '#')) {
+ $line = preg_replace('/\s*#([^"\']+)$/','',$line);
+ }
+
+ while (++$i < $cnt && self::greedilyNeedNextLine($line)) {
+ $line = rtrim ($line, " \n\t\r") . ' ' . ltrim ($Source[$i], " \t");
+ }
+ $i--;
+
+ $lineArray = $this->_parseLine($line);
+
+ if ($literalBlockStyle)
+ $lineArray = $this->revertLiteralPlaceHolder ($lineArray, $literalBlock);
+
+ $this->addArray($lineArray, $this->indent);
+
+ foreach ($this->delayedPath as $indent => $delayedPath)
+ $this->path[$indent] = $delayedPath;
+
+ $this->delayedPath = array();
+
+ }
+ return $this->result;
+ }
+
+ private function loadFromSource ($input) {
+ if (!empty($input) && strpos($input, "\n") === false && file_exists($input))
+ $input = file_get_contents($input);
+
+ return $this->loadFromString($input);
+ }
+
+ private function loadFromString ($input) {
+ $lines = explode("\n",$input);
+ foreach ($lines as $k => $_) {
+ $lines[$k] = rtrim ($_, "\r");
+ }
+ return $lines;
+ }
+
+ /**
+ * Parses YAML code and returns an array for a node
+ * @access private
+ * @return array
+ * @param string $line A line from the YAML file
+ */
+ private function _parseLine($line) {
+ if (!$line) return array();
+ $line = trim($line);
+ if (!$line) return array();
+
+ $array = array();
+
+ $group = $this->nodeContainsGroup($line);
+ if ($group) {
+ $this->addGroup($line, $group);
+ $line = $this->stripGroup ($line, $group);
+ }
+
+ if ($this->startsMappedSequence($line))
+ return $this->returnMappedSequence($line);
+
+ if ($this->startsMappedValue($line))
+ return $this->returnMappedValue($line);
+
+ if ($this->isArrayElement($line))
+ return $this->returnArrayElement($line);
+
+ if ($this->isPlainArray($line))
+ return $this->returnPlainArray($line);
+
+
+ return $this->returnKeyValuePair($line);
+
+ }
+
+ /**
+ * Finds the type of the passed value, returns the value as the new type.
+ * @access private
+ * @param string $value
+ * @return mixed
+ */
+ private function _toType($value) {
+ if ($value === '') return "";
+ $first_character = $value[0];
+ $last_character = substr($value, -1, 1);
+
+ $is_quoted = false;
+ do {
+ if (!$value) break;
+ if ($first_character != '"' && $first_character != "'") break;
+ if ($last_character != '"' && $last_character != "'") break;
+ $is_quoted = true;
+ } while (0);
+
+ if ($is_quoted) {
+ $value = str_replace('\n', "\n", $value);
+ return strtr(substr ($value, 1, -1), array ('\\"' => '"', '\'\'' => '\'', '\\\'' => '\''));
+ }
+
+ if (strpos($value, ' #') !== false && !$is_quoted)
+ $value = preg_replace('/\s+#(.+)$/','',$value);
+
+ if ($first_character == '[' && $last_character == ']') {
+ // Take out strings sequences and mappings
+ $innerValue = trim(substr ($value, 1, -1));
+ if ($innerValue === '') return array();
+ $explode = $this->_inlineEscape($innerValue);
+ // Propagate value array
+ $value = array();
+ foreach ($explode as $v) {
+ $value[] = $this->_toType($v);
+ }
+ return $value;
+ }
+
+ if (strpos($value,': ')!==false && $first_character != '{') {
+ $array = explode(': ',$value);
+ $key = trim($array[0]);
+ array_shift($array);
+ $value = trim(implode(': ',$array));
+ $value = $this->_toType($value);
+ return array($key => $value);
+ }
+
+ if ($first_character == '{' && $last_character == '}') {
+ $innerValue = trim(substr ($value, 1, -1));
+ if ($innerValue === '') return array();
+ // Inline Mapping
+ // Take out strings sequences and mappings
+ $explode = $this->_inlineEscape($innerValue);
+ // Propagate value array
+ $array = array();
+ foreach ($explode as $v) {
+ $SubArr = $this->_toType($v);
+ if (empty($SubArr)) continue;
+ if (is_array ($SubArr)) {
+ $array[key($SubArr)] = $SubArr[key($SubArr)]; continue;
+ }
+ $array[] = $SubArr;
+ }
+ return $array;
+ }
+
+ if ($value == 'null' || $value == 'NULL' || $value == 'Null' || $value == '' || $value == '~') {
+ return null;
+ }
+
+ if ( is_numeric($value) && preg_match ('/^(-|)[1-9]+[0-9]*$/', $value) ){
+ $intvalue = (int)$value;
+ if ($intvalue != PHP_INT_MAX)
+ $value = $intvalue;
+ return $value;
+ }
+
+ if (is_numeric($value) && preg_match('/^0[xX][0-9a-fA-F]+$/', $value)) {
+ // Hexadecimal value.
+ return hexdec($value);
+ }
+
+ $this->coerceValue($value);
+
+ if (is_numeric($value)) {
+ if ($value === '0') return 0;
+ if (rtrim ($value, 0) === $value)
+ $value = (float)$value;
+ return $value;
+ }
+
+ return $value;
+ }
+
+ /**
+ * Used in inlines to check for more inlines or quoted strings
+ * @access private
+ * @return array
+ */
+ private function _inlineEscape($inline) {
+ // There's gotta be a cleaner way to do this...
+ // While pure sequences seem to be nesting just fine,
+ // pure mappings and mappings with sequences inside can't go very
+ // deep. This needs to be fixed.
+
+ $seqs = array();
+ $maps = array();
+ $saved_strings = array();
+ $saved_empties = array();
+
+ // Check for empty strings
+ $regex = '/("")|(\'\')/';
+ if (preg_match_all($regex,$inline,$strings)) {
+ $saved_empties = $strings[0];
+ $inline = preg_replace($regex,'YAMLEmpty',$inline);
+ }
+ unset($regex);
+
+ // Check for strings
+ $regex = '/(?:(")|(?:\'))((?(1)[^"]+|[^\']+))(?(1)"|\')/';
+ if (preg_match_all($regex,$inline,$strings)) {
+ $saved_strings = $strings[0];
+ $inline = preg_replace($regex,'YAMLString',$inline);
+ }
+ unset($regex);
+
+ // echo $inline;
+
+ $i = 0;
+ do {
+
+ // Check for sequences
+ while (preg_match('/\[([^{}\[\]]+)\]/U',$inline,$matchseqs)) {
+ $seqs[] = $matchseqs[0];
+ $inline = preg_replace('/\[([^{}\[\]]+)\]/U', ('YAMLSeq' . (count($seqs) - 1) . 's'), $inline, 1);
+ }
+
+ // Check for mappings
+ while (preg_match('/{([^\[\]{}]+)}/U',$inline,$matchmaps)) {
+ $maps[] = $matchmaps[0];
+ $inline = preg_replace('/{([^\[\]{}]+)}/U', ('YAMLMap' . (count($maps) - 1) . 's'), $inline, 1);
+ }
+
+ if ($i++ >= 10) break;
+
+ } while (strpos ($inline, '[') !== false || strpos ($inline, '{') !== false);
+
+ $explode = explode(',',$inline);
+ $explode = array_map('trim', $explode);
+ $stringi = 0; $i = 0;
+
+ while (1) {
+
+ // Re-add the sequences
+ if (!empty($seqs)) {
+ foreach ($explode as $key => $value) {
+ if (strpos($value,'YAMLSeq') !== false) {
+ foreach ($seqs as $seqk => $seq) {
+ $explode[$key] = str_replace(('YAMLSeq'.$seqk.'s'),$seq,$value);
+ $value = $explode[$key];
+ }
+ }
+ }
+ }
+
+ // Re-add the mappings
+ if (!empty($maps)) {
+ foreach ($explode as $key => $value) {
+ if (strpos($value,'YAMLMap') !== false) {
+ foreach ($maps as $mapk => $map) {
+ $explode[$key] = str_replace(('YAMLMap'.$mapk.'s'), $map, $value);
+ $value = $explode[$key];
+ }
+ }
+ }
+ }
+
+
+ // Re-add the strings
+ if (!empty($saved_strings)) {
+ foreach ($explode as $key => $value) {
+ while (strpos($value,'YAMLString') !== false) {
+ $explode[$key] = preg_replace('/YAMLString/',$saved_strings[$stringi],$value, 1);
+ unset($saved_strings[$stringi]);
+ ++$stringi;
+ $value = $explode[$key];
+ }
+ }
+ }
+
+
+ // Re-add the empties
+ if (!empty($saved_empties)) {
+ foreach ($explode as $key => $value) {
+ while (strpos($value,'YAMLEmpty') !== false) {
+ $explode[$key] = preg_replace('/YAMLEmpty/', '', $value, 1);
+ $value = $explode[$key];
+ }
+ }
+ }
+
+ $finished = true;
+ foreach ($explode as $key => $value) {
+ if (strpos($value,'YAMLSeq') !== false) {
+ $finished = false; break;
+ }
+ if (strpos($value,'YAMLMap') !== false) {
+ $finished = false; break;
+ }
+ if (strpos($value,'YAMLString') !== false) {
+ $finished = false; break;
+ }
+ if (strpos($value,'YAMLEmpty') !== false) {
+ $finished = false; break;
+ }
+ }
+ if ($finished) break;
+
+ $i++;
+ if ($i > 10)
+ break; // Prevent infinite loops.
+ }
+
+
+ return $explode;
+ }
+
+ private function literalBlockContinues ($line, $lineIndent) {
+ if (!trim($line)) return true;
+ if (strlen($line) - strlen(ltrim($line)) > $lineIndent) return true;
+ return false;
+ }
+
+ private function referenceContentsByAlias ($alias) {
+ do {
+ if (!isset($this->SavedGroups[$alias])) { echo "Bad group name: $alias."; break; }
+ $groupPath = $this->SavedGroups[$alias];
+ $value = $this->result;
+ foreach ($groupPath as $k) {
+ $value = $value[$k];
+ }
+ } while (false);
+ return $value;
+ }
+
+ private function addArrayInline ($array, $indent) {
+ $CommonGroupPath = $this->path;
+ if (empty ($array)) return false;
+
+ foreach ($array as $k => $_) {
+ $this->addArray(array($k => $_), $indent);
+ $this->path = $CommonGroupPath;
+ }
+ return true;
+ }
+
+ private function addArray ($incoming_data, $incoming_indent) {
+
+ // print_r ($incoming_data);
+
+ if (count ($incoming_data) > 1)
+ return $this->addArrayInline ($incoming_data, $incoming_indent);
+
+ $key = key ($incoming_data);
+ $value = isset($incoming_data[$key]) ? $incoming_data[$key] : null;
+ if ($key === '__!YAMLZero') $key = '0';
+
+ if ($incoming_indent == 0 && !$this->_containsGroupAlias && !$this->_containsGroupAnchor) { // Shortcut for root-level values.
+ if ($key || $key === '' || $key === '0') {
+ $this->result[$key] = $value;
+ } else {
+ $this->result[] = $value; end ($this->result); $key = key ($this->result);
+ }
+ $this->path[$incoming_indent] = $key;
+ return;
+ }
+
+
+
+ $history = array();
+ // Unfolding inner array tree.
+ $history[] = $_arr = $this->result;
+ foreach ($this->path as $k) {
+ $history[] = $_arr = $_arr[$k];
+ }
+
+ if ($this->_containsGroupAlias) {
+ $value = $this->referenceContentsByAlias($this->_containsGroupAlias);
+ $this->_containsGroupAlias = false;
+ }
+
+
+ // Adding string or numeric key to the innermost level or $this->arr.
+ if (is_string($key) && $key == '<<') {
+ if (!is_array ($_arr)) { $_arr = array (); }
+
+ $_arr = array_merge ($_arr, $value);
+ } else if ($key || $key === '' || $key === '0') {
+ if (!is_array ($_arr))
+ $_arr = array ($key=>$value);
+ else
+ $_arr[$key] = $value;
+ } else {
+ if (!is_array ($_arr)) { $_arr = array ($value); $key = 0; }
+ else { $_arr[] = $value; end ($_arr); $key = key ($_arr); }
+ }
+
+ $reverse_path = array_reverse($this->path);
+ $reverse_history = array_reverse ($history);
+ $reverse_history[0] = $_arr;
+ $cnt = count($reverse_history) - 1;
+ for ($i = 0; $i < $cnt; $i++) {
+ $reverse_history[$i+1][$reverse_path[$i]] = $reverse_history[$i];
+ }
+ $this->result = $reverse_history[$cnt];
+
+ $this->path[$incoming_indent] = $key;
+
+ if ($this->_containsGroupAnchor) {
+ $this->SavedGroups[$this->_containsGroupAnchor] = $this->path;
+ if (is_array ($value)) {
+ $k = key ($value);
+ if (!is_int ($k)) {
+ $this->SavedGroups[$this->_containsGroupAnchor][$incoming_indent + 2] = $k;
+ }
+ }
+ $this->_containsGroupAnchor = false;
+ }
+
+ }
+
+ private static function startsLiteralBlock ($line) {
+ $lastChar = substr (trim($line), -1);
+ if ($lastChar != '>' && $lastChar != '|') return false;
+ if ($lastChar == '|') return $lastChar;
+ // HTML tags should not be counted as literal blocks.
+ if (preg_match ('#<.*?>$#', $line)) return false;
+ return $lastChar;
+ }
+
+ private static function greedilyNeedNextLine($line) {
+ $line = trim ($line);
+ if (!strlen($line)) return false;
+ if (substr ($line, -1, 1) == ']') return false;
+ if ($line[0] == '[') return true;
+ if (preg_match ('#^[^:]+?:\s*\[#', $line)) return true;
+ return false;
+ }
+
+ private function addLiteralLine ($literalBlock, $line, $literalBlockStyle, $indent = -1) {
+ $line = self::stripIndent($line, $indent);
+ if ($literalBlockStyle !== '|') {
+ $line = self::stripIndent($line);
+ }
+ $line = rtrim ($line, "\r\n\t ") . "\n";
+ if ($literalBlockStyle == '|') {
+ return $literalBlock . $line;
+ }
+ if (strlen($line) == 0)
+ return rtrim($literalBlock, ' ') . "\n";
+ if ($line == "\n" && $literalBlockStyle == '>') {
+ return rtrim ($literalBlock, " \t") . "\n";
+ }
+ if ($line != "\n")
+ $line = trim ($line, "\r\n ") . " ";
+ return $literalBlock . $line;
+ }
+
+ function revertLiteralPlaceHolder ($lineArray, $literalBlock) {
+ foreach ($lineArray as $k => $_) {
+ if (is_array($_))
+ $lineArray[$k] = $this->revertLiteralPlaceHolder ($_, $literalBlock);
+ else if (substr($_, -1 * strlen ($this->LiteralPlaceHolder)) == $this->LiteralPlaceHolder)
+ $lineArray[$k] = rtrim ($literalBlock, " \r\n");
+ }
+ return $lineArray;
+ }
+
+ private static function stripIndent ($line, $indent = -1) {
+ if ($indent == -1) $indent = strlen($line) - strlen(ltrim($line));
+ return substr ($line, $indent);
+ }
+
+ private function getParentPathByIndent ($indent) {
+ if ($indent == 0) return array();
+ $linePath = $this->path;
+ do {
+ end($linePath); $lastIndentInParentPath = key($linePath);
+ if ($indent <= $lastIndentInParentPath) array_pop ($linePath);
+ } while ($indent <= $lastIndentInParentPath);
+ return $linePath;
+ }
+
+
+ private function clearBiggerPathValues ($indent) {
+
+
+ if ($indent == 0) $this->path = array();
+ if (empty ($this->path)) return true;
+
+ foreach ($this->path as $k => $_) {
+ if ($k > $indent) unset ($this->path[$k]);
+ }
+
+ return true;
+ }
+
+
+ private static function isComment ($line) {
+ if (!$line) return false;
+ if ($line[0] == '#') return true;
+ if (trim($line, " \r\n\t") == '---') return true;
+ return false;
+ }
+
+ private static function isEmpty ($line) {
+ return (trim ($line) === '');
+ }
+
+
+ private function isArrayElement ($line) {
+ if (!$line || !is_scalar($line)) return false;
+ if (substr($line, 0, 2) != '- ') return false;
+ if (strlen ($line) > 3)
+ if (substr($line,0,3) == '---') return false;
+
+ return true;
+ }
+
+ private function isHashElement ($line) {
+ return strpos($line, ':');
+ }
+
+ private function isLiteral ($line) {
+ if ($this->isArrayElement($line)) return false;
+ if ($this->isHashElement($line)) return false;
+ return true;
+ }
+
+
+ private static function unquote ($value) {
+ if (!$value) return $value;
+ if (!is_string($value)) return $value;
+ if ($value[0] == '\'') return trim ($value, '\'');
+ if ($value[0] == '"') return trim ($value, '"');
+ return $value;
+ }
+
+ private function startsMappedSequence ($line) {
+ return (substr($line, 0, 2) == '- ' && substr ($line, -1, 1) == ':');
+ }
+
+ private function returnMappedSequence ($line) {
+ $array = array();
+ $key = self::unquote(trim(substr($line,1,-1)));
+ $array[$key] = array();
+ $this->delayedPath = array(strpos ($line, $key) + $this->indent => $key);
+ return array($array);
+ }
+
+ private function checkKeysInValue($value) {
+ if (strchr('[{"\'', $value[0]) === false) {
+ if (strchr($value, ': ') !== false) {
+ throw new Exception('Too many keys: '.$value);
+ }
+ }
+ }
+
+ private function returnMappedValue ($line) {
+ $this->checkKeysInValue($line);
+ $array = array();
+ $key = self::unquote (trim(substr($line,0,-1)));
+ $array[$key] = '';
+ return $array;
+ }
+
+ private function startsMappedValue ($line) {
+ return (substr ($line, -1, 1) == ':');
+ }
+
+ private function isPlainArray ($line) {
+ return ($line[0] == '[' && substr ($line, -1, 1) == ']');
+ }
+
+ private function returnPlainArray ($line) {
+ return $this->_toType($line);
+ }
+
+ private function returnKeyValuePair ($line) {
+ $array = array();
+ $key = '';
+ if (strpos ($line, ': ')) {
+ // It's a key/value pair most likely
+ // If the key is in double quotes pull it out
+ if (($line[0] == '"' || $line[0] == "'") && preg_match('/^(["\'](.*)["\'](\s)*:)/',$line,$matches)) {
+ $value = trim(str_replace($matches[1],'',$line));
+ $key = $matches[2];
+ } else {
+ // Do some guesswork as to the key and the value
+ $explode = explode(': ', $line);
+ $key = trim(array_shift($explode));
+ $value = trim(implode(': ', $explode));
+ $this->checkKeysInValue($value);
+ }
+ // Set the type of the value. Int, string, etc
+ $value = $this->_toType($value);
+ if ($key === '0') $key = '__!YAMLZero';
+ $array[$key] = $value;
+ } else {
+ $array = array ($line);
+ }
+ return $array;
+
+ }
+
+
+ private function returnArrayElement ($line) {
+ if (strlen($line) <= 1) return array(array()); // Weird %)
+ $array = array();
+ $value = trim(substr($line,1));
+ $value = $this->_toType($value);
+ if ($this->isArrayElement($value)) {
+ $value = $this->returnArrayElement($value);
+ }
+ $array[] = $value;
+ return $array;
+ }
+
+
+ private function nodeContainsGroup ($line) {
+ $symbolsForReference = 'A-z0-9_\-';
+ if (strpos($line, '&') === false && strpos($line, '*') === false) return false; // Please die fast ;-)
+ if ($line[0] == '&' && preg_match('/^(&['.$symbolsForReference.']+)/', $line, $matches)) return $matches[1];
+ if ($line[0] == '*' && preg_match('/^(\*['.$symbolsForReference.']+)/', $line, $matches)) return $matches[1];
+ if (preg_match('/(&['.$symbolsForReference.']+)$/', $line, $matches)) return $matches[1];
+ if (preg_match('/(\*['.$symbolsForReference.']+$)/', $line, $matches)) return $matches[1];
+ if (preg_match ('#^\s*<<\s*:\s*(\*[^\s]+).*$#', $line, $matches)) return $matches[1];
+ return false;
+
+ }
+
+ private function addGroup ($line, $group) {
+ if ($group[0] == '&') $this->_containsGroupAnchor = substr ($group, 1);
+ if ($group[0] == '*') $this->_containsGroupAlias = substr ($group, 1);
+ //print_r ($this->path);
+ }
+
+ private function stripGroup ($line, $group) {
+ $line = trim(str_replace($group, '', $line));
+ return $line;
+ }
+}
+
+// Enable use of Spyc from command line
+// The syntax is the following: php Spyc.php spyc.yaml
+
+do {
+ if (PHP_SAPI != 'cli') break;
+ if (empty ($_SERVER['argc']) || $_SERVER['argc'] < 2) break;
+ if (empty ($_SERVER['PHP_SELF']) || FALSE === strpos ($_SERVER['PHP_SELF'], 'Spyc.php') ) break;
+ $file = $argv[1];
+ echo json_encode (spyc_load_file ($file));
+} while (0);
diff --git a/ThinkPHP/Library/Vendor/spyc/composer.json b/ThinkPHP/Library/Vendor/spyc/composer.json
new file mode 100644
index 0000000..9105de5
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/spyc/composer.json
@@ -0,0 +1,27 @@
+{
+ "name": "mustangostang/spyc",
+ "description": "A simple YAML loader/dumper class for PHP",
+ "type": "library",
+ "keywords": [
+ "spyc",
+ "yaml",
+ "yml"
+ ],
+ "homepage": "https://github.com/mustangostang/spyc/",
+ "authors" : [{
+ "name": "mustangostang",
+ "email": "vlad.andersen@gmail.com"
+ }],
+ "license": "MIT",
+ "require": {
+ "php": ">=5.3.1"
+ },
+ "autoload": {
+ "files": [ "Spyc.php" ]
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "0.5.x-dev"
+ }
+ }
+}
diff --git a/ThinkPHP/Library/Vendor/spyc/examples/yaml-dump.php b/ThinkPHP/Library/Vendor/spyc/examples/yaml-dump.php
new file mode 100644
index 0000000..9d2160a
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/spyc/examples/yaml-dump.php
@@ -0,0 +1,25 @@
+ 'A sequence','second' => 'of mapped values');
+$array['Mapped'] = array('A sequence','which is mapped');
+$array['A Note'] = 'What if your text is too long?';
+$array['Another Note'] = 'If that is the case, the dumper will probably fold your text by using a block. Kinda like this.';
+$array['The trick?'] = 'The trick is that we overrode the default indent, 2, to 4 and the default wordwrap, 40, to 60.';
+$array['Old Dog'] = "And if you want\n to preserve line breaks, \ngo ahead!";
+$array['key:withcolon'] = "Should support this to";
+
+$yaml = Spyc::YAMLDump($array,4,60);
diff --git a/ThinkPHP/Library/Vendor/spyc/examples/yaml-load.php b/ThinkPHP/Library/Vendor/spyc/examples/yaml-load.php
new file mode 100644
index 0000000..9e457e1
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/spyc/examples/yaml-load.php
@@ -0,0 +1,21 @@
+spyc.yaml loaded into PHP:
';
+print_r($array);
+echo '';
+
+
+echo 'YAML Data dumped back:
';
+echo Spyc::YAMLDump($array);
+echo '
';
diff --git a/ThinkPHP/Library/Vendor/spyc/php4/5to4.php b/ThinkPHP/Library/Vendor/spyc/php4/5to4.php
new file mode 100644
index 0000000..5a48694
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/spyc/php4/5to4.php
@@ -0,0 +1,17 @@
+', $code);
+ $f = fopen ($dest, 'w');
+ fwrite($f, $code);
+ fclose ($f);
+ print "Written to $dest.\n";
+}
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/spyc/php4/spyc.php4 b/ThinkPHP/Library/Vendor/spyc/php4/spyc.php4
new file mode 100644
index 0000000..73f08cc
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/spyc/php4/spyc.php4
@@ -0,0 +1,1023 @@
+
+ * @author Chris Wanstrath
+ * @link http://code.google.com/p/spyc/
+ * @copyright Copyright 2005-2006 Chris Wanstrath, 2006-2009 Vlad Andersen
+ * @license http://www.opensource.org/licenses/mit-license.php MIT License
+ * @package Spyc
+ */
+
+if (!function_exists('spyc_load')) {
+ /**
+ * Parses YAML to array.
+ * @param string $string YAML string.
+ * @return array
+ */
+ function spyc_load ($string) {
+ return Spyc::YAMLLoadString($string);
+ }
+}
+
+if (!function_exists('spyc_load_file')) {
+ /**
+ * Parses YAML to array.
+ * @param string $file Path to YAML file.
+ * @return array
+ */
+ function spyc_load_file ($file) {
+ return Spyc::YAMLLoad($file);
+ }
+}
+
+/**
+ * The Simple PHP YAML Class.
+ *
+ * This class can be used to read a YAML file and convert its contents
+ * into a PHP array. It currently supports a very limited subsection of
+ * the YAML spec.
+ *
+ * Usage:
+ *
+ * $Spyc = new Spyc;
+ * $array = $Spyc->load($file);
+ *
+ * or:
+ *
+ * $array = Spyc::YAMLLoad($file);
+ *
+ * or:
+ *
+ * $array = spyc_load_file($file);
+ *
+ * @package Spyc
+ */
+class Spyc {
+
+ // SETTINGS
+
+ /**
+ * Setting this to true will force YAMLDump to enclose any string value in
+ * quotes. False by default.
+ *
+ * @var bool
+ */
+ var $setting_dump_force_quotes = false;
+
+ /**
+ * Setting this to true will forse YAMLLoad to use syck_load function when
+ * possible. False by default.
+ * @var bool
+ */
+ var $setting_use_syck_is_possible = false;
+
+
+
+ /**#@+
+ * @access private
+ * @var mixed
+ */
+ var $_dumpIndent;
+ var $_dumpWordWrap;
+ var $_containsGroupAnchor = false;
+ var $_containsGroupAlias = false;
+ var $path;
+ var $result;
+ var $LiteralPlaceHolder = '___YAML_Literal_Block___';
+ var $SavedGroups = array();
+ var $indent;
+ /**
+ * Path modifier that should be applied after adding current element.
+ * @var array
+ */
+ var $delayedPath = array();
+
+ /**#@+
+ * @access public
+ * @var mixed
+ */
+ var $_nodeId;
+
+/**
+ * Load a valid YAML string to Spyc.
+ * @param string $input
+ * @return array
+ */
+ function load ($input) {
+ return $this->__loadString($input);
+ }
+
+ /**
+ * Load a valid YAML file to Spyc.
+ * @param string $file
+ * @return array
+ */
+ function loadFile ($file) {
+ return $this->__load($file);
+ }
+
+ /**
+ * Load YAML into a PHP array statically
+ *
+ * The load method, when supplied with a YAML stream (string or file),
+ * will do its best to convert YAML in a file into a PHP array. Pretty
+ * simple.
+ * Usage:
+ *
+ * $array = Spyc::YAMLLoad('lucky.yaml');
+ * print_r($array);
+ *
+ * @access public
+ * @return array
+ * @param string $input Path of YAML file or string containing YAML
+ */
+ function YAMLLoad($input) {
+ $Spyc = new Spyc;
+ return $Spyc->__load($input);
+ }
+
+ /**
+ * Load a string of YAML into a PHP array statically
+ *
+ * The load method, when supplied with a YAML string, will do its best
+ * to convert YAML in a string into a PHP array. Pretty simple.
+ *
+ * Note: use this function if you don't want files from the file system
+ * loaded and processed as YAML. This is of interest to people concerned
+ * about security whose input is from a string.
+ *
+ * Usage:
+ *
+ * $array = Spyc::YAMLLoadString("---\n0: hello world\n");
+ * print_r($array);
+ *
+ * @access public
+ * @return array
+ * @param string $input String containing YAML
+ */
+ function YAMLLoadString($input) {
+ $Spyc = new Spyc;
+ return $Spyc->__loadString($input);
+ }
+
+ /**
+ * Dump YAML from PHP array statically
+ *
+ * The dump method, when supplied with an array, will do its best
+ * to convert the array into friendly YAML. Pretty simple. Feel free to
+ * save the returned string as nothing.yaml and pass it around.
+ *
+ * Oh, and you can decide how big the indent is and what the wordwrap
+ * for folding is. Pretty cool -- just pass in 'false' for either if
+ * you want to use the default.
+ *
+ * Indent's default is 2 spaces, wordwrap's default is 40 characters. And
+ * you can turn off wordwrap by passing in 0.
+ *
+ * @access public
+ * @return string
+ * @param array $array PHP array
+ * @param int $indent Pass in false to use the default, which is 2
+ * @param int $wordwrap Pass in 0 for no wordwrap, false for default (40)
+ */
+ function YAMLDump($array,$indent = false,$wordwrap = false) {
+ $spyc = new Spyc;
+ return $spyc->dump($array,$indent,$wordwrap);
+ }
+
+
+ /**
+ * Dump PHP array to YAML
+ *
+ * The dump method, when supplied with an array, will do its best
+ * to convert the array into friendly YAML. Pretty simple. Feel free to
+ * save the returned string as tasteful.yaml and pass it around.
+ *
+ * Oh, and you can decide how big the indent is and what the wordwrap
+ * for folding is. Pretty cool -- just pass in 'false' for either if
+ * you want to use the default.
+ *
+ * Indent's default is 2 spaces, wordwrap's default is 40 characters. And
+ * you can turn off wordwrap by passing in 0.
+ *
+ * @access public
+ * @return string
+ * @param array $array PHP array
+ * @param int $indent Pass in false to use the default, which is 2
+ * @param int $wordwrap Pass in 0 for no wordwrap, false for default (40)
+ */
+ function dump($array,$indent = false,$wordwrap = false) {
+ // Dumps to some very clean YAML. We'll have to add some more features
+ // and options soon. And better support for folding.
+
+ // New features and options.
+ if ($indent === false or !is_numeric($indent)) {
+ $this->_dumpIndent = 2;
+ } else {
+ $this->_dumpIndent = $indent;
+ }
+
+ if ($wordwrap === false or !is_numeric($wordwrap)) {
+ $this->_dumpWordWrap = 40;
+ } else {
+ $this->_dumpWordWrap = $wordwrap;
+ }
+
+ // New YAML document
+ $string = "---\n";
+
+ // Start at the base of the array and move through it.
+ if ($array) {
+ $array = (array)$array;
+ $first_key = key($array);
+
+ $previous_key = -1;
+ foreach ($array as $key => $value) {
+ $string .= $this->_yamlize($key,$value,0,$previous_key, $first_key);
+ $previous_key = $key;
+ }
+ }
+ return $string;
+ }
+
+ /**
+ * Attempts to convert a key / value array item to YAML
+ * @access private
+ * @return string
+ * @param $key The name of the key
+ * @param $value The value of the item
+ * @param $indent The indent of the current node
+ */
+ function _yamlize($key,$value,$indent, $previous_key = -1, $first_key = 0) {
+ if (is_array($value)) {
+ if (empty ($value))
+ return $this->_dumpNode($key, array(), $indent, $previous_key, $first_key);
+ // It has children. What to do?
+ // Make it the right kind of item
+ $string = $this->_dumpNode($key, NULL, $indent, $previous_key, $first_key);
+ // Add the indent
+ $indent += $this->_dumpIndent;
+ // Yamlize the array
+ $string .= $this->_yamlizeArray($value,$indent);
+ } elseif (!is_array($value)) {
+ // It doesn't have children. Yip.
+ $string = $this->_dumpNode($key, $value, $indent, $previous_key, $first_key);
+ }
+ return $string;
+ }
+
+ /**
+ * Attempts to convert an array to YAML
+ * @access private
+ * @return string
+ * @param $array The array you want to convert
+ * @param $indent The indent of the current level
+ */
+ function _yamlizeArray($array,$indent) {
+ if (is_array($array)) {
+ $string = '';
+ $previous_key = -1;
+ $first_key = key($array);
+ foreach ($array as $key => $value) {
+ $string .= $this->_yamlize($key, $value, $indent, $previous_key, $first_key);
+ $previous_key = $key;
+ }
+ return $string;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Returns YAML from a key and a value
+ * @access private
+ * @return string
+ * @param $key The name of the key
+ * @param $value The value of the item
+ * @param $indent The indent of the current node
+ */
+ function _dumpNode($key, $value, $indent, $previous_key = -1, $first_key = 0) {
+ // do some folding here, for blocks
+ if (is_string ($value) && ((strpos($value,"\n") !== false || strpos($value,": ") !== false || strpos($value,"- ") !== false ||
+ strpos($value,"*") !== false || strpos($value,"#") !== false || strpos($value,"<") !== false || strpos($value,">") !== false ||
+ strpos($value,"[") !== false || strpos($value,"]") !== false || strpos($value,"{") !== false || strpos($value,"}") !== false) || substr ($value, -1, 1) == ':')) {
+ $value = $this->_doLiteralBlock($value,$indent);
+ } else {
+ $value = $this->_doFolding($value,$indent);
+ if (is_bool($value)) {
+ $value = ($value) ? "true" : "false";
+ }
+ }
+
+ if ($value === array()) $value = '[ ]';
+
+ $spaces = str_repeat(' ',$indent);
+
+ if (is_int($key) && $key - 1 == $previous_key && $first_key===0) {
+ // It's a sequence
+ $string = $spaces.'- '.$value."\n";
+ } else {
+ if ($first_key===0) throw new Exception('Keys are all screwy. The first one was zero, now it\'s "'. $key .'"');
+ // It's mapped
+ if (strpos($key, ":") !== false) { $key = '"' . $key . '"'; }
+ $string = $spaces.$key.': '.$value."\n";
+ }
+ return $string;
+ }
+
+ /**
+ * Creates a literal block for dumping
+ * @access private
+ * @return string
+ * @param $value
+ * @param $indent int The value of the indent
+ */
+ function _doLiteralBlock($value,$indent) {
+ if (strpos($value, "\n") === false && strpos($value, "'") === false) {
+ return sprintf ("'%s'", $value);
+ }
+ if (strpos($value, "\n") === false && strpos($value, '"') === false) {
+ return sprintf ('"%s"', $value);
+ }
+ $exploded = explode("\n",$value);
+ $newValue = '|';
+ $indent += $this->_dumpIndent;
+ $spaces = str_repeat(' ',$indent);
+ foreach ($exploded as $line) {
+ $newValue .= "\n" . $spaces . trim($line);
+ }
+ return $newValue;
+ }
+
+ /**
+ * Folds a string of text, if necessary
+ * @access private
+ * @return string
+ * @param $value The string you wish to fold
+ */
+ function _doFolding($value,$indent) {
+ // Don't do anything if wordwrap is set to 0
+
+ if ($this->_dumpWordWrap !== 0 && is_string ($value) && strlen($value) > $this->_dumpWordWrap) {
+ $indent += $this->_dumpIndent;
+ $indent = str_repeat(' ',$indent);
+ $wrapped = wordwrap($value,$this->_dumpWordWrap,"\n$indent");
+ $value = ">\n".$indent.$wrapped;
+ } else {
+ if ($this->setting_dump_force_quotes && is_string ($value))
+ $value = '"' . $value . '"';
+ }
+
+
+ return $value;
+ }
+
+// LOADING FUNCTIONS
+
+ function __load($input) {
+ $Source = $this->loadFromSource($input);
+ return $this->loadWithSource($Source);
+ }
+
+ function __loadString($input) {
+ $Source = $this->loadFromString($input);
+ return $this->loadWithSource($Source);
+ }
+
+ function loadWithSource($Source) {
+ if (empty ($Source)) return array();
+ if ($this->setting_use_syck_is_possible && function_exists ('syck_load')) {
+ $array = syck_load (implode ('', $Source));
+ return is_array($array) ? $array : array();
+ }
+
+ $this->path = array();
+ $this->result = array();
+
+ $cnt = count($Source);
+ for ($i = 0; $i < $cnt; $i++) {
+ $line = $Source[$i];
+
+ $this->indent = strlen($line) - strlen(ltrim($line));
+ $tempPath = $this->getParentPathByIndent($this->indent);
+ $line = $this->stripIndent($line, $this->indent);
+ if ($this->isComment($line)) continue;
+ if ($this->isEmpty($line)) continue;
+ $this->path = $tempPath;
+
+ $literalBlockStyle = $this->startsLiteralBlock($line);
+ if ($literalBlockStyle) {
+ $line = rtrim ($line, $literalBlockStyle . " \n");
+ $literalBlock = '';
+ $line .= $this->LiteralPlaceHolder;
+
+ while (++$i < $cnt && $this->literalBlockContinues($Source[$i], $this->indent)) {
+ $literalBlock = $this->addLiteralLine($literalBlock, $Source[$i], $literalBlockStyle);
+ }
+ $i--;
+ }
+
+ while (++$i < $cnt && $this->greedilyNeedNextLine($line)) {
+ $line = rtrim ($line, " \n\t\r") . ' ' . ltrim ($Source[$i], " \t");
+ }
+ $i--;
+
+
+
+ if (strpos ($line, '#')) {
+ if (strpos ($line, '"') === false && strpos ($line, "'") === false)
+ $line = preg_replace('/\s+#(.+)$/','',$line);
+ }
+
+ $lineArray = $this->_parseLine($line);
+
+ if ($literalBlockStyle)
+ $lineArray = $this->revertLiteralPlaceHolder ($lineArray, $literalBlock);
+
+ $this->addArray($lineArray, $this->indent);
+
+ foreach ($this->delayedPath as $indent => $delayedPath)
+ $this->path[$indent] = $delayedPath;
+
+ $this->delayedPath = array();
+
+ }
+ return $this->result;
+ }
+
+ function loadFromSource ($input) {
+ if (!empty($input) && strpos($input, "\n") === false && file_exists($input))
+ return file($input);
+
+ return $this->loadFromString($input);
+ }
+
+ function loadFromString ($input) {
+ $lines = explode("\n",$input);
+ foreach ($lines as $k => $_) {
+ $lines[$k] = rtrim ($_, "\r");
+ }
+ return $lines;
+ }
+
+ /**
+ * Parses YAML code and returns an array for a node
+ * @access private
+ * @return array
+ * @param string $line A line from the YAML file
+ */
+ function _parseLine($line) {
+ if (!$line) return array();
+ $line = trim($line);
+
+ if (!$line) return array();
+ $array = array();
+
+ $group = $this->nodeContainsGroup($line);
+ if ($group) {
+ $this->addGroup($line, $group);
+ $line = $this->stripGroup ($line, $group);
+ }
+
+ if ($this->startsMappedSequence($line))
+ return $this->returnMappedSequence($line);
+
+ if ($this->startsMappedValue($line))
+ return $this->returnMappedValue($line);
+
+ if ($this->isArrayElement($line))
+ return $this->returnArrayElement($line);
+
+ if ($this->isPlainArray($line))
+ return $this->returnPlainArray($line);
+
+
+ return $this->returnKeyValuePair($line);
+
+ }
+
+ /**
+ * Finds the type of the passed value, returns the value as the new type.
+ * @access private
+ * @param string $value
+ * @return mixed
+ */
+ function _toType($value) {
+ if ($value === '') return null;
+ $first_character = $value[0];
+ $last_character = substr($value, -1, 1);
+
+ $is_quoted = false;
+ do {
+ if (!$value) break;
+ if ($first_character != '"' && $first_character != "'") break;
+ if ($last_character != '"' && $last_character != "'") break;
+ $is_quoted = true;
+ } while (0);
+
+ if ($is_quoted)
+ return strtr(substr ($value, 1, -1), array ('\\"' => '"', '\'\'' => '\'', '\\\'' => '\''));
+
+ if (strpos($value, ' #') !== false)
+ $value = preg_replace('/\s+#(.+)$/','',$value);
+
+ if ($first_character == '[' && $last_character == ']') {
+ // Take out strings sequences and mappings
+ $innerValue = trim(substr ($value, 1, -1));
+ if ($innerValue === '') return array();
+ $explode = $this->_inlineEscape($innerValue);
+ // Propagate value array
+ $value = array();
+ foreach ($explode as $v) {
+ $value[] = $this->_toType($v);
+ }
+ return $value;
+ }
+
+ if (strpos($value,': ')!==false && $first_character != '{') {
+ $array = explode(': ',$value);
+ $key = trim($array[0]);
+ array_shift($array);
+ $value = trim(implode(': ',$array));
+ $value = $this->_toType($value);
+ return array($key => $value);
+ }
+
+ if ($first_character == '{' && $last_character == '}') {
+ $innerValue = trim(substr ($value, 1, -1));
+ if ($innerValue === '') return array();
+ // Inline Mapping
+ // Take out strings sequences and mappings
+ $explode = $this->_inlineEscape($innerValue);
+ // Propagate value array
+ $array = array();
+ foreach ($explode as $v) {
+ $SubArr = $this->_toType($v);
+ if (empty($SubArr)) continue;
+ if (is_array ($SubArr)) {
+ $array[key($SubArr)] = $SubArr[key($SubArr)]; continue;
+ }
+ $array[] = $SubArr;
+ }
+ return $array;
+ }
+
+ if ($value == 'null' || $value == 'NULL' || $value == 'Null' || $value == '' || $value == '~') {
+ return null;
+ }
+
+ if (intval($first_character) > 0 && preg_match ('/^[1-9]+[0-9]*$/', $value)) {
+ $intvalue = (int)$value;
+ if ($intvalue != PHP_INT_MAX)
+ $value = $intvalue;
+ return $value;
+ }
+
+ if (in_array($value,
+ array('true', 'on', '+', 'yes', 'y', 'True', 'TRUE', 'On', 'ON', 'YES', 'Yes', 'Y'))) {
+ return true;
+ }
+
+ if (in_array(strtolower($value),
+ array('false', 'off', '-', 'no', 'n'))) {
+ return false;
+ }
+
+ if (is_numeric($value)) {
+ if ($value === '0') return 0;
+ if (trim ($value, 0) === $value)
+ $value = (float)$value;
+ return $value;
+ }
+
+ return $value;
+ }
+
+ /**
+ * Used in inlines to check for more inlines or quoted strings
+ * @access private
+ * @return array
+ */
+ function _inlineEscape($inline) {
+ // There's gotta be a cleaner way to do this...
+ // While pure sequences seem to be nesting just fine,
+ // pure mappings and mappings with sequences inside can't go very
+ // deep. This needs to be fixed.
+
+ $seqs = array();
+ $maps = array();
+ $saved_strings = array();
+
+ // Check for strings
+ $regex = '/(?:(")|(?:\'))((?(1)[^"]+|[^\']+))(?(1)"|\')/';
+ if (preg_match_all($regex,$inline,$strings)) {
+ $saved_strings = $strings[0];
+ $inline = preg_replace($regex,'YAMLString',$inline);
+ }
+ unset($regex);
+
+ $i = 0;
+ do {
+
+ // Check for sequences
+ while (preg_match('/\[([^{}\[\]]+)\]/U',$inline,$matchseqs)) {
+ $seqs[] = $matchseqs[0];
+ $inline = preg_replace('/\[([^{}\[\]]+)\]/U', ('YAMLSeq' . (count($seqs) - 1) . 's'), $inline, 1);
+ }
+
+ // Check for mappings
+ while (preg_match('/{([^\[\]{}]+)}/U',$inline,$matchmaps)) {
+ $maps[] = $matchmaps[0];
+ $inline = preg_replace('/{([^\[\]{}]+)}/U', ('YAMLMap' . (count($maps) - 1) . 's'), $inline, 1);
+ }
+
+ if ($i++ >= 10) break;
+
+ } while (strpos ($inline, '[') !== false || strpos ($inline, '{') !== false);
+
+ $explode = explode(', ',$inline);
+ $stringi = 0; $i = 0;
+
+ while (1) {
+
+ // Re-add the sequences
+ if (!empty($seqs)) {
+ foreach ($explode as $key => $value) {
+ if (strpos($value,'YAMLSeq') !== false) {
+ foreach ($seqs as $seqk => $seq) {
+ $explode[$key] = str_replace(('YAMLSeq'.$seqk.'s'),$seq,$value);
+ $value = $explode[$key];
+ }
+ }
+ }
+ }
+
+ // Re-add the mappings
+ if (!empty($maps)) {
+ foreach ($explode as $key => $value) {
+ if (strpos($value,'YAMLMap') !== false) {
+ foreach ($maps as $mapk => $map) {
+ $explode[$key] = str_replace(('YAMLMap'.$mapk.'s'), $map, $value);
+ $value = $explode[$key];
+ }
+ }
+ }
+ }
+
+
+ // Re-add the strings
+ if (!empty($saved_strings)) {
+ foreach ($explode as $key => $value) {
+ while (strpos($value,'YAMLString') !== false) {
+ $explode[$key] = preg_replace('/YAMLString/',$saved_strings[$stringi],$value, 1);
+ unset($saved_strings[$stringi]);
+ ++$stringi;
+ $value = $explode[$key];
+ }
+ }
+ }
+
+ $finished = true;
+ foreach ($explode as $key => $value) {
+ if (strpos($value,'YAMLSeq') !== false) {
+ $finished = false; break;
+ }
+ if (strpos($value,'YAMLMap') !== false) {
+ $finished = false; break;
+ }
+ if (strpos($value,'YAMLString') !== false) {
+ $finished = false; break;
+ }
+ }
+ if ($finished) break;
+
+ $i++;
+ if ($i > 10)
+ break; // Prevent infinite loops.
+ }
+
+ return $explode;
+ }
+
+ function literalBlockContinues ($line, $lineIndent) {
+ if (!trim($line)) return true;
+ if (strlen($line) - strlen(ltrim($line)) > $lineIndent) return true;
+ return false;
+ }
+
+ function referenceContentsByAlias ($alias) {
+ do {
+ if (!isset($this->SavedGroups[$alias])) { echo "Bad group name: $alias."; break; }
+ $groupPath = $this->SavedGroups[$alias];
+ $value = $this->result;
+ foreach ($groupPath as $k) {
+ $value = $value[$k];
+ }
+ } while (false);
+ return $value;
+ }
+
+ function addArrayInline ($array, $indent) {
+ $CommonGroupPath = $this->path;
+ if (empty ($array)) return false;
+
+ foreach ($array as $k => $_) {
+ $this->addArray(array($k => $_), $indent);
+ $this->path = $CommonGroupPath;
+ }
+ return true;
+ }
+
+ function addArray ($incoming_data, $incoming_indent) {
+
+ // print_r ($incoming_data);
+
+ if (count ($incoming_data) > 1)
+ return $this->addArrayInline ($incoming_data, $incoming_indent);
+
+ $key = key ($incoming_data);
+ $value = isset($incoming_data[$key]) ? $incoming_data[$key] : null;
+ if ($key === '__!YAMLZero') $key = '0';
+
+ if ($incoming_indent == 0 && !$this->_containsGroupAlias && !$this->_containsGroupAnchor) { // Shortcut for root-level values.
+ if ($key || $key === '' || $key === '0') {
+ $this->result[$key] = $value;
+ } else {
+ $this->result[] = $value; end ($this->result); $key = key ($this->result);
+ }
+ $this->path[$incoming_indent] = $key;
+ return;
+ }
+
+
+
+ $history = array();
+ // Unfolding inner array tree.
+ $history[] = $_arr = $this->result;
+ foreach ($this->path as $k) {
+ $history[] = $_arr = $_arr[$k];
+ }
+
+ if ($this->_containsGroupAlias) {
+ $value = $this->referenceContentsByAlias($this->_containsGroupAlias);
+ $this->_containsGroupAlias = false;
+ }
+
+
+ // Adding string or numeric key to the innermost level or $this->arr.
+ if (is_string($key) && $key == '<<') {
+ if (!is_array ($_arr)) { $_arr = array (); }
+ $_arr = array_merge ($_arr, $value);
+ } else if ($key || $key === '' || $key === '0') {
+ $_arr[$key] = $value;
+ } else {
+ if (!is_array ($_arr)) { $_arr = array ($value); $key = 0; }
+ else { $_arr[] = $value; end ($_arr); $key = key ($_arr); }
+ }
+
+ $reverse_path = array_reverse($this->path);
+ $reverse_history = array_reverse ($history);
+ $reverse_history[0] = $_arr;
+ $cnt = count($reverse_history) - 1;
+ for ($i = 0; $i < $cnt; $i++) {
+ $reverse_history[$i+1][$reverse_path[$i]] = $reverse_history[$i];
+ }
+ $this->result = $reverse_history[$cnt];
+
+ $this->path[$incoming_indent] = $key;
+
+ if ($this->_containsGroupAnchor) {
+ $this->SavedGroups[$this->_containsGroupAnchor] = $this->path;
+ if (is_array ($value)) {
+ $k = key ($value);
+ if (!is_int ($k)) {
+ $this->SavedGroups[$this->_containsGroupAnchor][$incoming_indent + 2] = $k;
+ }
+ }
+ $this->_containsGroupAnchor = false;
+ }
+
+ }
+
+ function startsLiteralBlock ($line) {
+ $lastChar = substr (trim($line), -1);
+ if ($lastChar != '>' && $lastChar != '|') return false;
+ if ($lastChar == '|') return $lastChar;
+ // HTML tags should not be counted as literal blocks.
+ if (preg_match ('#<.*?>$#', $line)) return false;
+ return $lastChar;
+ }
+
+ function greedilyNeedNextLine($line) {
+ $line = trim ($line);
+ if (!strlen($line)) return false;
+ if (substr ($line, -1, 1) == ']') return false;
+ if ($line[0] == '[') return true;
+ if (preg_match ('#^[^:]+?:\s*\[#', $line)) return true;
+ return false;
+ }
+
+ function addLiteralLine ($literalBlock, $line, $literalBlockStyle) {
+ $line = $this->stripIndent($line);
+ $line = rtrim ($line, "\r\n\t ") . "\n";
+ if ($literalBlockStyle == '|') {
+ return $literalBlock . $line;
+ }
+ if (strlen($line) == 0)
+ return rtrim($literalBlock, ' ') . "\n";
+ if ($line == "\n" && $literalBlockStyle == '>') {
+ return rtrim ($literalBlock, " \t") . "\n";
+ }
+ if ($line != "\n")
+ $line = trim ($line, "\r\n ") . " ";
+ return $literalBlock . $line;
+ }
+
+ function revertLiteralPlaceHolder ($lineArray, $literalBlock) {
+ foreach ($lineArray as $k => $_) {
+ if (is_array($_))
+ $lineArray[$k] = $this->revertLiteralPlaceHolder ($_, $literalBlock);
+ else if (substr($_, -1 * strlen ($this->LiteralPlaceHolder)) == $this->LiteralPlaceHolder)
+ $lineArray[$k] = rtrim ($literalBlock, " \r\n");
+ }
+ return $lineArray;
+ }
+
+ function stripIndent ($line, $indent = -1) {
+ if ($indent == -1) $indent = strlen($line) - strlen(ltrim($line));
+ return substr ($line, $indent);
+ }
+
+ function getParentPathByIndent ($indent) {
+ if ($indent == 0) return array();
+ $linePath = $this->path;
+ do {
+ end($linePath); $lastIndentInParentPath = key($linePath);
+ if ($indent <= $lastIndentInParentPath) array_pop ($linePath);
+ } while ($indent <= $lastIndentInParentPath);
+ return $linePath;
+ }
+
+
+ function clearBiggerPathValues ($indent) {
+
+
+ if ($indent == 0) $this->path = array();
+ if (empty ($this->path)) return true;
+
+ foreach ($this->path as $k => $_) {
+ if ($k > $indent) unset ($this->path[$k]);
+ }
+
+ return true;
+ }
+
+
+ function isComment ($line) {
+ if (!$line) return false;
+ if ($line[0] == '#') return true;
+ if (trim($line, " \r\n\t") == '---') return true;
+ return false;
+ }
+
+ function isEmpty ($line) {
+ return (trim ($line) === '');
+ }
+
+
+ function isArrayElement ($line) {
+ if (!$line) return false;
+ if ($line[0] != '-') return false;
+ if (strlen ($line) > 3)
+ if (substr($line,0,3) == '---') return false;
+
+ return true;
+ }
+
+ function isHashElement ($line) {
+ return strpos($line, ':');
+ }
+
+ function isLiteral ($line) {
+ if ($this->isArrayElement($line)) return false;
+ if ($this->isHashElement($line)) return false;
+ return true;
+ }
+
+
+ function unquote ($value) {
+ if (!$value) return $value;
+ if (!is_string($value)) return $value;
+ if ($value[0] == '\'') return trim ($value, '\'');
+ if ($value[0] == '"') return trim ($value, '"');
+ return $value;
+ }
+
+ function startsMappedSequence ($line) {
+ return ($line[0] == '-' && substr ($line, -1, 1) == ':');
+ }
+
+ function returnMappedSequence ($line) {
+ $array = array();
+ $key = $this->unquote(trim(substr($line,1,-1)));
+ $array[$key] = array();
+ $this->delayedPath = array(strpos ($line, $key) + $this->indent => $key);
+ return array($array);
+ }
+
+ function returnMappedValue ($line) {
+ $array = array();
+ $key = $this->unquote (trim(substr($line,0,-1)));
+ $array[$key] = '';
+ return $array;
+ }
+
+ function startsMappedValue ($line) {
+ return (substr ($line, -1, 1) == ':');
+ }
+
+ function isPlainArray ($line) {
+ return ($line[0] == '[' && substr ($line, -1, 1) == ']');
+ }
+
+ function returnPlainArray ($line) {
+ return $this->_toType($line);
+ }
+
+ function returnKeyValuePair ($line) {
+ $array = array();
+ $key = '';
+ if (strpos ($line, ':')) {
+ // It's a key/value pair most likely
+ // If the key is in double quotes pull it out
+ if (($line[0] == '"' || $line[0] == "'") && preg_match('/^(["\'](.*)["\'](\s)*:)/',$line,$matches)) {
+ $value = trim(str_replace($matches[1],'',$line));
+ $key = $matches[2];
+ } else {
+ // Do some guesswork as to the key and the value
+ $explode = explode(':',$line);
+ $key = trim($explode[0]);
+ array_shift($explode);
+ $value = trim(implode(':',$explode));
+ }
+ // Set the type of the value. Int, string, etc
+ $value = $this->_toType($value);
+ if ($key === '0') $key = '__!YAMLZero';
+ $array[$key] = $value;
+ } else {
+ $array = array ($line);
+ }
+ return $array;
+
+ }
+
+
+ function returnArrayElement ($line) {
+ if (strlen($line) <= 1) return array(array()); // Weird %)
+ $array = array();
+ $value = trim(substr($line,1));
+ $value = $this->_toType($value);
+ $array[] = $value;
+ return $array;
+ }
+
+
+ function nodeContainsGroup ($line) {
+ $symbolsForReference = 'A-z0-9_\-';
+ if (strpos($line, '&') === false && strpos($line, '*') === false) return false; // Please die fast ;-)
+ if ($line[0] == '&' && preg_match('/^(&['.$symbolsForReference.']+)/', $line, $matches)) return $matches[1];
+ if ($line[0] == '*' && preg_match('/^(\*['.$symbolsForReference.']+)/', $line, $matches)) return $matches[1];
+ if (preg_match('/(&['.$symbolsForReference.']+)$/', $line, $matches)) return $matches[1];
+ if (preg_match('/(\*['.$symbolsForReference.']+$)/', $line, $matches)) return $matches[1];
+ if (preg_match ('#^\s*<<\s*:\s*(\*[^\s]+).*$#', $line, $matches)) return $matches[1];
+ return false;
+
+ }
+
+ function addGroup ($line, $group) {
+ if ($group[0] == '&') $this->_containsGroupAnchor = substr ($group, 1);
+ if ($group[0] == '*') $this->_containsGroupAlias = substr ($group, 1);
+ //print_r ($this->path);
+ }
+
+ function stripGroup ($line, $group) {
+ $line = trim(str_replace($group, '', $line));
+ return $line;
+ }
+}
+
+// Enable use of Spyc from command line
+// The syntax is the following: php spyc.php spyc.yaml
+
+define ('SPYC_FROM_COMMAND_LINE', false);
+
+do {
+ if (!SPYC_FROM_COMMAND_LINE) break;
+ if (empty ($_SERVER['argc']) || $_SERVER['argc'] < 2) break;
+ if (empty ($_SERVER['PHP_SELF']) || $_SERVER['PHP_SELF'] != 'spyc.php') break;
+ $file = $argv[1];
+ printf ("Spyc loading file: %s\n", $file);
+ print_r (spyc_load_file ($file));
+} while (0);
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/spyc/php4/test.php4 b/ThinkPHP/Library/Vendor/spyc/php4/test.php4
new file mode 100644
index 0000000..315f501
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/spyc/php4/test.php4
@@ -0,0 +1,162 @@
+ "1.5ghz", "ram" => "1 gig",
+ "os" => "os x 10.4.1"))
+ die('Sequence 4 failed');
+
+# Mapped sequence
+if ($yaml['domains'] != array("yaml.org", "php.net"))
+ die("Key: 'domains' failed");
+
+# A sequence like this.
+if ($yaml[5] != array("program" => "Adium", "platform" => "OS X",
+ "type" => "Chat Client"))
+ die('Sequence 5 failed');
+
+# A folded block as a mapped value
+if ($yaml['no time'] != "There isn't any time for your tricks!\nDo you understand?")
+ die("Key: 'no time' failed");
+
+# A literal block as a mapped value
+if ($yaml['some time'] != "There is nothing but time\nfor your tricks.")
+ die("Key: 'some time' failed");
+
+# Crazy combinations
+if ($yaml['databases'] != array( array("name" => "spartan", "notes" =>
+ array( "Needs to be backed up",
+ "Needs to be normalized" ),
+ "type" => "mysql" )))
+ die("Key: 'databases' failed");
+
+# You can be a bit tricky
+if ($yaml["if: you'd"] != "like")
+ die("Key: 'if: you\'d' failed");
+
+# Inline sequences
+if ($yaml[6] != array("One", "Two", "Three", "Four"))
+ die("Sequence 6 failed");
+
+# Nested Inline Sequences
+if ($yaml[7] != array("One", array("Two", "And", "Three"), "Four", "Five"))
+ die("Sequence 7 failed");
+
+# Nested Nested Inline Sequences
+if ($yaml[8] != array( "This", array("Is", "Getting", array("Ridiculous", "Guys")),
+ "Seriously", array("Show", "Mercy")))
+ die("Sequence 8 failed");
+
+# Inline mappings
+if ($yaml[9] != array("name" => "chris", "age" => "young", "brand" => "lucky strike"))
+ die("Sequence 9 failed");
+
+# Nested inline mappings
+if ($yaml[10] != array("name" => "mark", "age" => "older than chris",
+ "brand" => array("marlboro", "lucky strike")))
+ die("Sequence 10 failed");
+
+# References -- they're shaky, but functional
+if ($yaml['dynamic languages'] != array('Perl', 'Python', 'PHP', 'Ruby'))
+ die("Key: 'dynamic languages' failed");
+
+if ($yaml['compiled languages'] != array('C/C++', 'Java'))
+ die("Key: 'compiled languages' failed");
+
+if ($yaml['all languages'] != array(
+ array('Perl', 'Python', 'PHP', 'Ruby'),
+ array('C/C++', 'Java')
+ ))
+ die("Key: 'all languages' failed");
+
+# Added in .2.2: Escaped quotes
+if ($yaml[11] != "you know, this shouldn't work. but it does.")
+ die("Sequence 11 failed.");
+
+if ($yaml[12] != "that's my value.")
+ die("Sequence 12 failed.");
+
+if ($yaml[13] != "again, that's my value.")
+ die("Sequence 13 failed.");
+
+if ($yaml[14] != "here's to \"quotes\", boss.")
+ die("Sequence 14 failed.");
+
+if ($yaml[15] != array( 'name' => "Foo, Bar's", 'age' => 20))
+ die("Sequence 15 failed.");
+
+if ($yaml[16] != array( 0 => "a", 1 => array (0 => 1, 1 => 2), 2 => "b"))
+ die("Sequence 16 failed.");
+
+if ($yaml['endloop'] != "Does this line in the end indeed make Spyc go to an infinite loop?")
+ die("[endloop] failed.");
+
+
+print "spyc.yaml parsed correctly\n";
+
+?>
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/spyc/spyc.yaml b/ThinkPHP/Library/Vendor/spyc/spyc.yaml
new file mode 100644
index 0000000..489f28c
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/spyc/spyc.yaml
@@ -0,0 +1,219 @@
+#
+# S P Y C
+# a simple php yaml class
+#
+# authors: [vlad andersen (vlad.andersen@gmail.com), chris wanstrath (chris@ozmm.org)]
+# websites: [http://www.yaml.org, http://spyc.sourceforge.net/]
+# license: [MIT License, http://www.opensource.org/licenses/mit-license.php]
+# copyright: (c) 2005-2006 Chris Wanstrath, 2006-2014 Vlad Andersen
+#
+# spyc.yaml - A file containing the YAML that Spyc understands.
+
+---
+
+# Mappings - with proper types
+String: Anyone's name, really.
+Int: 13
+BadHex: f0xf3
+Hex: 0xf3
+True: true
+False: false
+Zero: 0
+Null: NULL
+NotNull: 'null'
+NotTrue: 'y'
+NotBoolTrue: 'true'
+NotInt: '5'
+Float: 5.34
+Negative: -90
+SmallFloat: 0.7
+NewLine: \n
+QuotedNewLine: "\n"
+
+# A sequence
+- PHP Class
+- Basic YAML Loader
+- Very Basic YAML Dumper
+
+# A sequence of a sequence
+-
+ - YAML is so easy to learn.
+ - Your config files will never be the same.
+
+# Sequence of mappings
+-
+ cpu: 1.5ghz
+ ram: 1 gig
+ os : os x 10.4.1
+
+# Mapped sequence
+domains:
+ - yaml.org
+ - php.net
+
+# A sequence like this.
+- program: Adium
+ platform: OS X
+ type: Chat Client
+
+# A folded block as a mapped value
+no time: >
+ There isn't any time
+ for your tricks!
+
+ Do you understand?
+
+# A literal block as a mapped value
+some time: |
+ There is nothing but time
+ for your tricks.
+
+# Crazy combinations
+databases:
+ - name: spartan
+ notes:
+ - Needs to be backed up
+ - Needs to be normalized
+ type: mysql
+
+# You can be a bit tricky
+"if: you'd": like
+
+# Inline sequences
+- [One, Two, Three, Four]
+
+# Nested Inline Sequences
+- [One, [Two, And, Three], Four, Five]
+
+# Nested Nested Inline Sequences
+- [This, [Is, Getting, [Ridiculous, Guys]], Seriously, [Show, Mercy]]
+
+# Inline mappings
+- {name: chris, age: young, brand: lucky strike}
+
+# Nested inline mappings
+- {name: mark, age: older than chris, brand: [marlboro, lucky strike]}
+
+# References -- they're shaky, but functional
+dynamic languages: &DLANGS
+ - Perl
+ - Python
+ - PHP
+ - Ruby
+compiled languages: &CLANGS
+ - C/C++
+ - Java
+all languages:
+ - *DLANGS
+ - *CLANGS
+
+# Added in .2.2: Escaped quotes
+- you know, this shouldn't work. but it does.
+- 'that''s my value.'
+- 'again, that\'s my value.'
+- "here's to \"quotes\", boss."
+
+# added in .2.3
+- {name: "Foo, Bar's", age: 20}
+
+# Added in .2.4: bug [ 1418193 ] Quote Values in Nested Arrays
+- [a, ['1', "2"], b]
+
+# Add in .5.2: Quoted new line values.
+- "First line\nSecond line\nThird line"
+
+# Added in .2.4: malformed YAML
+all
+ javascripts: [dom1.js, dom.js]
+
+# Added in .2
+1040: Ooo, a numeric key! # And working comments? Wow! Colons in comments: a menace (0.3).
+
+hash_1: Hash #and a comment
+hash_2: "Hash #and a comment"
+"hash#3": "Hash (#) can appear in key too"
+
+float_test: 1.0
+float_test_with_quotes: '1.0'
+float_inverse_test: 001
+
+a_really_large_number: 115792089237316195423570985008687907853269984665640564039457584007913129639936 # 2^256
+
+int array: [ 1, 2, 3 ]
+
+array on several lines:
+ [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ]
+
+morelesskey: ""
+
+array_of_zero: [0]
+sophisticated_array_of_zero: {rx: {tx: [0]} }
+
+switches:
+ - { row: 0, col: 0, func: {tx: [0, 1]} }
+
+empty_sequence: [ ]
+empty_hash: { }
+
+special_characters: "[{]]{{]]"
+
+asterisks: "*"
+
+empty_key:
+ :
+ key: value
+
+trailing_colon: "foo:"
+
+multiline_items:
+ - type: SomeItem
+ values: [blah, blah, blah,
+ blah]
+ ints: [2, 54, 12,
+ 2143]
+
+many_lines: |
+ A quick
+ fox
+
+
+ jumped
+ over
+
+
+
+
+
+ a lazy
+
+
+
+ dog
+
+
+werte:
+ 1: nummer 1
+ 0: Stunde 0
+
+noindent_records:
+- record1: value1
+- record2: value2
+
+"a:1": [1000]
+"a:2":
+ - 2000
+a:3: [3000]
+
+complex_unquoted_key:
+ a:b:''test': value
+
+array with commas:
+ ["0","1"]
+
+invoice: ["Something", "", '', "Something else"]
+quotes: ['Something', "Nothing", 'Anything', "Thing"]
+
+# [Endloop]
+endloop: |
+ Does this line in the end indeed make Spyc go to an infinite loop?
diff --git a/ThinkPHP/Library/Vendor/spyc/tests/DumpTest.php b/ThinkPHP/Library/Vendor/spyc/tests/DumpTest.php
new file mode 100644
index 0000000..9c31e92
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/spyc/tests/DumpTest.php
@@ -0,0 +1,136 @@
+files_to_test = array ('../spyc.yaml', 'failing1.yaml', 'indent_1.yaml', 'quotes.yaml');
+ }
+
+ public function testShortSyntax() {
+ $dump = spyc_dump(array ('item1', 'item2', 'item3'));
+ $awaiting = "- item1\n- item2\n- item3\n";
+ $this->assertEquals ($awaiting, $dump);
+ }
+
+ public function testDump() {
+ foreach ($this->files_to_test as $file) {
+ $yaml = spyc_load(file_get_contents($file));
+ $dump = Spyc::YAMLDump ($yaml);
+ $yaml_after_dump = Spyc::YAMLLoad ($dump);
+ $this->assertEquals ($yaml, $yaml_after_dump);
+ }
+ }
+
+ public function testDumpWithQuotes() {
+ $Spyc = new Spyc();
+ $Spyc->setting_dump_force_quotes = true;
+ foreach ($this->files_to_test as $file) {
+ $yaml = $Spyc->load(file_get_contents($file));
+ $dump = $Spyc->dump ($yaml);
+ $yaml_after_dump = Spyc::YAMLLoad ($dump);
+ $this->assertEquals ($yaml, $yaml_after_dump);
+ }
+ }
+
+ public function testDumpArrays() {
+ $dump = Spyc::YAMLDump(array ('item1', 'item2', 'item3'));
+ $awaiting = "---\n- item1\n- item2\n- item3\n";
+ $this->assertEquals ($awaiting, $dump);
+ }
+
+ public function testNull() {
+ $dump = Spyc::YAMLDump(array('a' => 1, 'b' => null, 'c' => 3));
+ $awaiting = "---\na: 1\nb: null\nc: 3\n";
+ $this->assertEquals ($awaiting, $dump);
+ }
+
+ public function testNext() {
+ $array = array("aaa", "bbb", "ccc");
+ #set arrays internal pointer to next element
+ next($array);
+ $dump = Spyc::YAMLDump($array);
+ $awaiting = "---\n- aaa\n- bbb\n- ccc\n";
+ $this->assertEquals ($awaiting, $dump);
+ }
+
+ public function testDumpingMixedArrays() {
+ $array = array();
+ $array[] = 'Sequence item';
+ $array['The Key'] = 'Mapped value';
+ $array[] = array('A sequence','of a sequence');
+ $array[] = array('first' => 'A sequence','second' => 'of mapped values');
+ $array['Mapped'] = array('A sequence','which is mapped');
+ $array['A Note'] = 'What if your text is too long?';
+ $array['Another Note'] = 'If that is the case, the dumper will probably fold your text by using a block. Kinda like this.';
+ $array['The trick?'] = 'The trick is that we overrode the default indent, 2, to 4 and the default wordwrap, 40, to 60.';
+ $array['Old Dog'] = "And if you want\n to preserve line breaks, \ngo ahead!";
+ $array['key:withcolon'] = "Should support this to";
+
+ $yaml = Spyc::YAMLDump($array,4,60);
+ }
+
+ public function testMixed() {
+ $dump = Spyc::YAMLDump(array(0 => 1, 'b' => 2, 1 => 3));
+ $awaiting = "---\n0: 1\nb: 2\n1: 3\n";
+ $this->assertEquals ($awaiting, $dump);
+ }
+
+ public function testDumpNumerics() {
+ $dump = Spyc::YAMLDump(array ('404', '405', '500'));
+ $awaiting = "---\n- \"404\"\n- \"405\"\n- \"500\"\n";
+ $this->assertEquals ($awaiting, $dump);
+ }
+
+ public function testDumpAsterisks() {
+ $dump = Spyc::YAMLDump(array ('*'));
+ $awaiting = "---\n- '*'\n";
+ $this->assertEquals ($awaiting, $dump);
+ }
+
+ public function testDumpAmpersands() {
+ $dump = Spyc::YAMLDump(array ('some' => '&foo'));
+ $awaiting = "---\nsome: '&foo'\n";
+ $this->assertEquals ($awaiting, $dump);
+ }
+
+ public function testDumpExclamations() {
+ $dump = Spyc::YAMLDump(array ('some' => '!foo'));
+ $awaiting = "---\nsome: '!foo'\n";
+ $this->assertEquals ($awaiting, $dump);
+ }
+
+ public function testDumpExclamations2() {
+ $dump = Spyc::YAMLDump(array ('some' => 'foo!'));
+ $awaiting = "---\nsome: foo!\n";
+ $this->assertEquals ($awaiting, $dump);
+ }
+
+ public function testDumpApostrophes() {
+ $dump = Spyc::YAMLDump(array ('some' => "'Biz' pimpt bedrijventerreinen"));
+ $awaiting = "---\nsome: \"'Biz' pimpt bedrijventerreinen\"\n";
+ $this->assertEquals ($awaiting, $dump);
+ }
+
+ public function testDumpNumericHashes() {
+ $dump = Spyc::YAMLDump(array ("titel"=> array("0" => "", 1 => "Dr.", 5 => "Prof.", 6 => "Prof. Dr.")));
+ $awaiting = "---\ntitel:\n 0: \"\"\n 1: Dr.\n 5: Prof.\n 6: Prof. Dr.\n";
+ $this->assertEquals ($awaiting, $dump);
+ }
+
+ public function testEmpty() {
+ $dump = Spyc::YAMLDump(array("foo" => array()));
+ $awaiting = "---\nfoo: [ ]\n";
+ $this->assertEquals ($awaiting, $dump);
+ }
+
+ public function testHashesInKeys() {
+ $dump = Spyc::YAMLDump(array ('#color' => '#ffffff'));
+ $awaiting = "---\n\"#color\": '#ffffff'\n";
+ $this->assertEquals ($awaiting, $dump);
+ }
+
+}
diff --git a/ThinkPHP/Library/Vendor/spyc/tests/IndentTest.php b/ThinkPHP/Library/Vendor/spyc/tests/IndentTest.php
new file mode 100644
index 0000000..ee2322f
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/spyc/tests/IndentTest.php
@@ -0,0 +1,65 @@
+Y = Spyc::YAMLLoad("indent_1.yaml");
+ }
+
+ public function testIndent_1() {
+ $this->assertEquals (array ('child_1' => 2, 'child_2' => 0, 'child_3' => 1), $this->Y['root']);
+ }
+
+ public function testIndent_2() {
+ $this->assertEquals (array ('child_1' => 1, 'child_2' => 2), $this->Y['root2']);
+ }
+
+ public function testIndent_3() {
+ $this->assertEquals (array (array ('resolutions' => array (1024 => 768, 1920 => 1200), 'producer' => 'Nec')), $this->Y['display']);
+ }
+
+ public function testIndent_4() {
+ $this->assertEquals (array (
+ array ('resolutions' => array (1024 => 768)),
+ array ('resolutions' => array (1920 => 1200)),
+ ), $this->Y['displays']);
+ }
+
+ public function testIndent_5() {
+ $this->assertEquals (array (array (
+ 'row' => 0,
+ 'col' => 0,
+ 'headsets_affected' => array (
+ array (
+ 'ports' => array (0),
+ 'side' => 'left',
+ )
+ ),
+ 'switch_function' => array (
+ 'ics_ptt' => true
+ )
+ )), $this->Y['nested_hashes_and_seqs']);
+ }
+
+ public function testIndent_6() {
+ $this->assertEquals (array (
+ 'h' => array (
+ array ('a' => 'b', 'a1' => 'b1'),
+ array ('c' => 'd')
+ )
+ ), $this->Y['easier_nest']);
+ }
+
+ public function testIndent_space() {
+ $this->assertEquals ("By four\n spaces", $this->Y['one_space']);
+ }
+
+ public function testListAndComment() {
+ $this->assertEquals (array ('one', 'two', 'three'), $this->Y['list_and_comment']);
+ }
+
+}
diff --git a/ThinkPHP/Library/Vendor/spyc/tests/ParseTest.php b/ThinkPHP/Library/Vendor/spyc/tests/ParseTest.php
new file mode 100644
index 0000000..71196af
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/spyc/tests/ParseTest.php
@@ -0,0 +1,401 @@
+yaml = spyc_load_file('../spyc.yaml');
+ }
+
+ public function testMergeHashKeys() {
+ $Expected = array (
+ array ('step' => array('instrument' => 'Lasik 2000', 'pulseEnergy' => 5.4, 'pulseDuration' => 12, 'repetition' => 1000, 'spotSize' => '1mm')),
+ array ('step' => array('instrument' => 'Lasik 2000', 'pulseEnergy' => 5.4, 'pulseDuration' => 12, 'repetition' => 1000, 'spotSize' => '2mm')),
+ );
+ $Actual = spyc_load_file ('indent_1.yaml');
+ $this->assertEquals ($Expected, $Actual['steps']);
+ }
+
+ public function testDeathMasks() {
+ $Expected = array ('sad' => 2, 'magnificent' => 4);
+ $Actual = spyc_load_file ('indent_1.yaml');
+ $this->assertEquals ($Expected, $Actual['death masks are']);
+ }
+
+ public function testDevDb() {
+ $Expected = array ('adapter' => 'mysql', 'host' => 'localhost', 'database' => 'rails_dev');
+ $Actual = spyc_load_file ('indent_1.yaml');
+ $this->assertEquals ($Expected, $Actual['development']);
+ }
+
+ public function testNumericKey() {
+ $this->assertEquals ("Ooo, a numeric key!", $this->yaml[1040]);
+ }
+
+ public function testMappingsString() {
+ $this->assertEquals ("Anyone's name, really.", $this->yaml['String']);
+ }
+
+ public function testMappingsInt() {
+ $this->assertSame (13, $this->yaml['Int']);
+ }
+
+ public function testMappingsHex() {
+ $this->assertSame (243, $this->yaml['Hex']);
+ $this->assertSame ('f0xf3', $this->yaml['BadHex']);
+ }
+
+ public function testMappingsBooleanTrue() {
+ $this->assertSame (true, $this->yaml['True']);
+ }
+
+ public function testMappingsBooleanFalse() {
+ $this->assertSame (false, $this->yaml['False']);
+ }
+
+ public function testMappingsZero() {
+ $this->assertSame (0, $this->yaml['Zero']);
+ }
+
+ public function testMappingsNull() {
+ $this->assertSame (null, $this->yaml['Null']);
+ }
+
+ public function testMappingsNotNull() {
+ $this->assertSame ('null', $this->yaml['NotNull']);
+ }
+
+ public function testMappingsFloat() {
+ $this->assertSame (5.34, $this->yaml['Float']);
+ }
+
+ public function testMappingsNegative() {
+ $this->assertSame (-90, $this->yaml['Negative']);
+ }
+
+ public function testMappingsSmallFloat() {
+ $this->assertSame (0.7, $this->yaml['SmallFloat']);
+ }
+
+ public function testNewline() {
+ $this->assertSame ('\n', $this->yaml['NewLine']);
+ }
+
+ public function testQuotedNewline() {
+ $this->assertSame ("\n", $this->yaml['QuotedNewLine']);
+ }
+
+ public function testSeq0() {
+ $this->assertEquals ("PHP Class", $this->yaml[0]);
+ }
+
+ public function testSeq1() {
+ $this->assertEquals ("Basic YAML Loader", $this->yaml[1]);
+ }
+
+ public function testSeq2() {
+ $this->assertEquals ("Very Basic YAML Dumper", $this->yaml[2]);
+ }
+
+ public function testSeq3() {
+ $this->assertEquals (array("YAML is so easy to learn.",
+ "Your config files will never be the same."), $this->yaml[3]);
+ }
+
+ public function testSeqMap() {
+ $this->assertEquals (array("cpu" => "1.5ghz", "ram" => "1 gig",
+ "os" => "os x 10.4.1"), $this->yaml[4]);
+ }
+
+ public function testMappedSequence() {
+ $this->assertEquals (array("yaml.org", "php.net"), $this->yaml['domains']);
+ }
+
+ public function testAnotherSequence() {
+ $this->assertEquals (array("program" => "Adium", "platform" => "OS X",
+ "type" => "Chat Client"), $this->yaml[5]);
+ }
+
+ public function testFoldedBlock() {
+ $this->assertEquals ("There isn't any time for your tricks!\nDo you understand?", $this->yaml['no time']);
+ }
+
+ public function testLiteralAsMapped() {
+ $this->assertEquals ("There is nothing but time\nfor your tricks.", $this->yaml['some time']);
+ }
+
+ public function testCrazy() {
+ $this->assertEquals (array( array("name" => "spartan", "notes" =>
+ array( "Needs to be backed up",
+ "Needs to be normalized" ),
+ "type" => "mysql" )), $this->yaml['databases']);
+ }
+
+ public function testColons() {
+ $this->assertEquals ("like", $this->yaml["if: you'd"]);
+ }
+
+ public function testInline() {
+ $this->assertEquals (array("One", "Two", "Three", "Four"), $this->yaml[6]);
+ }
+
+ public function testNestedInline() {
+ $this->assertEquals (array("One", array("Two", "And", "Three"), "Four", "Five"), $this->yaml[7]);
+ }
+
+ public function testNestedNestedInline() {
+ $this->assertEquals (array( "This", array("Is", "Getting", array("Ridiculous", "Guys")),
+ "Seriously", array("Show", "Mercy")), $this->yaml[8]);
+ }
+
+ public function testInlineMappings() {
+ $this->assertEquals (array("name" => "chris", "age" => "young", "brand" => "lucky strike"), $this->yaml[9]);
+ }
+
+ public function testNestedInlineMappings() {
+ $this->assertEquals (array("name" => "mark", "age" => "older than chris",
+ "brand" => array("marlboro", "lucky strike")), $this->yaml[10]);
+ }
+
+ public function testReferences() {
+ $this->assertEquals (array('Perl', 'Python', 'PHP', 'Ruby'), $this->yaml['dynamic languages']);
+ }
+
+ public function testReferences2() {
+ $this->assertEquals (array('C/C++', 'Java'), $this->yaml['compiled languages']);
+ }
+
+ public function testReferences3() {
+ $this->assertEquals (array(
+ array('Perl', 'Python', 'PHP', 'Ruby'),
+ array('C/C++', 'Java')
+ ), $this->yaml['all languages']);
+ }
+
+ public function testEscapedQuotes() {
+ $this->assertEquals ("you know, this shouldn't work. but it does.", $this->yaml[11]);
+ }
+
+ public function testEscapedQuotes_2() {
+ $this->assertEquals ( "that's my value.", $this->yaml[12]);
+ }
+
+ public function testEscapedQuotes_3() {
+ $this->assertEquals ("again, that's my value.", $this->yaml[13]);
+ }
+
+ public function testQuotes() {
+ $this->assertEquals ("here's to \"quotes\", boss.", $this->yaml[14]);
+ }
+
+ public function testQuoteSequence() {
+ $this->assertEquals ( array( 'name' => "Foo, Bar's", 'age' => 20), $this->yaml[15]);
+ }
+
+ public function testShortSequence() {
+ $this->assertEquals (array( 0 => "a", 1 => array (0 => 1, 1 => 2), 2 => "b"), $this->yaml[16]);
+ }
+
+ public function testQuotedNewlines() {
+ $this->assertEquals ("First line\nSecond line\nThird line", $this->yaml[17]);
+ }
+
+ public function testHash_1() {
+ $this->assertEquals ("Hash", $this->yaml['hash_1']);
+ }
+
+ public function testHash_2() {
+ $this->assertEquals ('Hash #and a comment', $this->yaml['hash_2']);
+ }
+
+ public function testHash_3() {
+ $this->assertEquals ('Hash (#) can appear in key too', $this->yaml['hash#3']);
+ }
+
+ public function testEndloop() {
+ $this->assertEquals ("Does this line in the end indeed make Spyc go to an infinite loop?", $this->yaml['endloop']);
+ }
+
+ public function testReallyLargeNumber() {
+ $this->assertEquals ('115792089237316195423570985008687907853269984665640564039457584007913129639936', $this->yaml['a_really_large_number']);
+ }
+
+ public function testFloatWithZeros() {
+ $this->assertSame ('1.0', $this->yaml['float_test']);
+ }
+
+ public function testFloatWithQuotes() {
+ $this->assertSame ('1.0', $this->yaml['float_test_with_quotes']);
+ }
+
+ public function testFloatInverse() {
+ $this->assertEquals ('001', $this->yaml['float_inverse_test']);
+ }
+
+ public function testIntArray() {
+ $this->assertEquals (array (1, 2, 3), $this->yaml['int array']);
+ }
+
+ public function testArrayOnSeveralLines() {
+ $this->assertEquals (array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19), $this->yaml['array on several lines']);
+ }
+
+ public function testArrayWithCommas() {
+ $this->assertEquals(array (0, 1), $this->yaml['array with commas']);
+ }
+
+ public function testmoreLessKey() {
+ $this->assertEquals ('', $this->yaml['morelesskey']);
+ }
+
+ public function testArrayOfZero() {
+ $this->assertSame (array(0), $this->yaml['array_of_zero']);
+ }
+
+ public function testSophisticatedArrayOfZero() {
+ $this->assertSame (array('rx' => array ('tx' => array (0))), $this->yaml['sophisticated_array_of_zero']);
+ }
+
+ public function testSwitches() {
+ $this->assertEquals (array (array ('row' => 0, 'col' => 0, 'func' => array ('tx' => array(0, 1)))), $this->yaml['switches']);
+ }
+
+ public function testEmptySequence() {
+ $this->assertSame (array(), $this->yaml['empty_sequence']);
+ }
+
+ public function testEmptyHash() {
+ $this->assertSame (array(), $this->yaml['empty_hash']);
+ }
+
+ public function testEmptykey() {
+ $this->assertSame (array('' => array ('key' => 'value')), $this->yaml['empty_key']);
+ }
+
+ public function testMultilines() {
+ $this->assertSame (array(array('type' => 'SomeItem', 'values' => array ('blah', 'blah', 'blah', 'blah'), 'ints' => array(2, 54, 12, 2143))), $this->yaml['multiline_items']);
+ }
+
+ public function testManyNewlines() {
+ $this->assertSame ('A quick
+fox
+
+
+jumped
+over
+
+
+
+
+
+a lazy
+
+
+
+dog', $this->yaml['many_lines']);
+ }
+
+ public function testWerte() {
+ $this->assertSame (array ('1' => 'nummer 1', '0' => 'Stunde 0'), $this->yaml['werte']);
+ }
+
+ /* public function testNoIndent() {
+ $this->assertSame (array(
+ array ('record1'=>'value1'),
+ array ('record2'=>'value2')
+ )
+ , $this->yaml['noindent_records']);
+ } */
+
+ public function testColonsInKeys() {
+ $this->assertSame (array (1000), $this->yaml['a:1']);
+ }
+
+ public function testColonsInKeys2() {
+ $this->assertSame (array (2000), $this->yaml['a:2']);
+ }
+
+ public function testUnquotedColonsInKeys() {
+ $this->assertSame (array (3000), $this->yaml['a:3']);
+ }
+
+ public function testComplicatedKeyWithColon() {
+ $this->assertSame(array("a:b:''test'" => 'value'), $this->yaml['complex_unquoted_key']);
+ }
+
+ public function testKeysInMappedValueException() {
+ $this->setExpectedException('Exception');
+ Spyc::YAMLLoad('x: y: z:');
+ }
+
+ public function testKeysInValueException() {
+ $this->setExpectedException('Exception');
+ Spyc::YAMLLoad('x: y: z');
+ }
+
+ public function testSpecialCharacters() {
+ $this->assertSame ('[{]]{{]]', $this->yaml['special_characters']);
+ }
+
+ public function testAngleQuotes() {
+ $Quotes = Spyc::YAMLLoad('quotes.yaml');
+ $this->assertEquals (array ('html_tags' => array ('
', ''), 'html_content' => array ('
hello world
', 'hello
world'), 'text_content' => array ('hello world')),
+ $Quotes);
+ }
+
+ public function testFailingColons() {
+ $Failing = Spyc::YAMLLoad('failing1.yaml');
+ $this->assertSame (array ('MyObject' => array ('Prop1' => array ('key1:val1'))),
+ $Failing);
+ }
+
+ public function testQuotesWithComments() {
+ $Expected = 'bar';
+ $Actual = spyc_load_file ('comments.yaml');
+ $this->assertEquals ($Expected, $Actual['foo']);
+ }
+
+ public function testArrayWithComments() {
+ $Expected = array ('x', 'y', 'z');
+ $Actual = spyc_load_file ('comments.yaml');
+ $this->assertEquals ($Expected, $Actual['arr']);
+ }
+
+ public function testAfterArrayWithKittens() {
+ $Expected = 'kittens';
+ $Actual = spyc_load_file ('comments.yaml');
+ $this->assertEquals ($Expected, $Actual['bar']);
+ }
+
+ // Plain characters http://www.yaml.org/spec/1.2/spec.html#id2789510
+ public function testKai() {
+ $Expected = array('-example' => 'value');
+ $Actual = spyc_load_file ('indent_1.yaml');
+ $this->assertEquals ($Expected, $Actual['kai']);
+ }
+
+ public function testKaiList() {
+ $Expected = array ('-item', '-item', '-item');
+ $Actual = spyc_load_file ('indent_1.yaml');
+ $this->assertEquals ($Expected, $Actual['kai_list_of_items']);
+ }
+
+ public function testDifferentQuoteTypes() {
+ $expected = array ('Something', "", "", "Something else");
+ $this->assertSame ($expected, $this->yaml['invoice']);
+ }
+
+ public function testDifferentQuoteTypes2() {
+ $expected = array ('Something', "Nothing", "Anything", "Thing");
+ $this->assertSame ($expected, $this->yaml['quotes']);
+ }
+
+ // Separation spaces http://www.yaml.org/spec/1.2/spec.html#id2778394
+ public function testMultipleArrays() {
+ $expected = array(array(array('x')));
+ $this->assertSame($expected, Spyc::YAMLLoad("- - - x"));
+ }
+}
diff --git a/ThinkPHP/Library/Vendor/spyc/tests/RoundTripTest.php b/ThinkPHP/Library/Vendor/spyc/tests/RoundTripTest.php
new file mode 100644
index 0000000..448fd48
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/spyc/tests/RoundTripTest.php
@@ -0,0 +1,78 @@
+ $a))); }
+
+
+class RoundTripTest extends PHPUnit_Framework_TestCase {
+
+ protected function setUp() {
+ }
+
+ public function testNull() {
+ $this->assertEquals (array ('x' => null), roundTrip (null));
+ }
+
+ public function testY() {
+ $this->assertEquals (array ('x' => 'y'), roundTrip ('y'));
+ }
+
+ public function testExclam() {
+ $this->assertEquals (array ('x' => '!yeah'), roundTrip ('!yeah'));
+ }
+
+ public function test5() {
+ $this->assertEquals (array ('x' => '5'), roundTrip ('5'));
+ }
+
+ public function testSpaces() {
+ $this->assertEquals (array ('x' => 'x '), roundTrip ('x '));
+ }
+
+ public function testApostrophes() {
+ $this->assertEquals (array ('x' => "'biz'"), roundTrip ("'biz'"));
+ }
+
+ public function testNewLines() {
+ $this->assertEquals (array ('x' => "\n"), roundTrip ("\n"));
+ }
+
+ public function testHashes() {
+ $this->assertEquals (array ('x' => array ("#color" => '#fff')), roundTrip (array ("#color" => '#fff')));
+ }
+
+ public function testPreserveString() {
+ $result1 = roundTrip ('0');
+ $result2 = roundTrip ('true');
+ $this->assertTrue (is_string ($result1['x']));
+ $this->assertTrue (is_string ($result2['x']));
+ }
+
+ public function testPreserveBool() {
+ $result = roundTrip (true);
+ $this->assertTrue (is_bool ($result['x']));
+ }
+
+ public function testPreserveInteger() {
+ $result = roundTrip (0);
+ $this->assertTrue (is_int ($result['x']));
+ }
+
+ public function testWordWrap() {
+ $this->assertEquals (array ('x' => "aaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"), roundTrip ("aaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"));
+ }
+
+ public function testABCD() {
+ $this->assertEquals (array ('a', 'b', 'c', 'd'), Spyc::YAMLLoad(Spyc::YAMLDump(array('a', 'b', 'c', 'd'))));
+ }
+
+ public function testABCD2() {
+ $a = array('a', 'b', 'c', 'd'); // Create a simple list
+ $b = Spyc::YAMLDump($a); // Dump the list as YAML
+ $c = Spyc::YAMLLoad($b); // Load the dumped YAML
+ $d = Spyc::YAMLDump($c); // Re-dump the data
+ $this->assertSame($b, $d);
+ }
+
+}
diff --git a/ThinkPHP/Library/Vendor/spyc/tests/comments.yaml b/ThinkPHP/Library/Vendor/spyc/tests/comments.yaml
new file mode 100644
index 0000000..c05012f
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/spyc/tests/comments.yaml
@@ -0,0 +1,3 @@
+foo: 'bar' #Comment
+arr: ['x', 'y', 'z'] # Comment here
+bar: kittens
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/spyc/tests/failing1.yaml b/ThinkPHP/Library/Vendor/spyc/tests/failing1.yaml
new file mode 100644
index 0000000..6906a51
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/spyc/tests/failing1.yaml
@@ -0,0 +1,2 @@
+MyObject:
+ Prop1: {key1:val1}
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/spyc/tests/indent_1.yaml b/ThinkPHP/Library/Vendor/spyc/tests/indent_1.yaml
new file mode 100644
index 0000000..26dbf34
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/spyc/tests/indent_1.yaml
@@ -0,0 +1,65 @@
+root:
+ child_1: 2
+
+ child_2: 0
+ child_3: 1
+
+root2:
+ child_1: 1
+# A comment
+ child_2: 2
+
+displays:
+ - resolutions:
+ 1024: 768
+ - resolutions:
+ 1920: 1200
+
+display:
+ - resolutions:
+ 1024: 768
+ 1920: 1200
+ producer: "Nec"
+
+nested_hashes_and_seqs:
+ - { row: 0, col: 0, headsets_affected: [{ports: [0], side: left}], switch_function: {ics_ptt: true} }
+
+easier_nest: { h: [{a: b, a1: b1}, {c: d}] }
+
+one_space: |
+ By four
+ spaces
+
+steps:
+ - step: &id001
+ instrument: Lasik 2000
+ pulseEnergy: 5.4
+ pulseDuration: 12
+ repetition: 1000
+ spotSize: 1mm
+ - step:
+ <<: *id001
+ spotSize: 2mm
+
+death masks are:
+ sad: 2
+ <<: {magnificent: 4}
+
+login: &login
+ adapter: mysql
+ host: localhost
+
+development:
+ database: rails_dev
+ <<: *login
+
+"key": "value:"
+colon_only: ":"
+
+list_and_comment: [one, two, three] # comment
+kai:
+ -example: value
+kai_list_of_items:
+ - -item
+ - '-item'
+ -item
\ No newline at end of file
diff --git a/ThinkPHP/Library/Vendor/spyc/tests/quotes.yaml b/ThinkPHP/Library/Vendor/spyc/tests/quotes.yaml
new file mode 100644
index 0000000..2ceea86
--- /dev/null
+++ b/ThinkPHP/Library/Vendor/spyc/tests/quotes.yaml
@@ -0,0 +1,8 @@
+html_tags:
+ -
+ -
+html_content:
+ -
hello world
+ - hello
world
+text_content:
+ - hello world
\ No newline at end of file
diff --git a/ThinkPHP/Mode/Api/App.class.php b/ThinkPHP/Mode/Api/App.class.php
new file mode 100644
index 0000000..92fd3ec
--- /dev/null
+++ b/ThinkPHP/Mode/Api/App.class.php
@@ -0,0 +1,143 @@
+
+// +----------------------------------------------------------------------
+namespace Think;
+/**
+ * ThinkPHP API模式 应用程序类
+ */
+class App {
+
+ /**
+ * 应用程序初始化
+ * @access public
+ * @return void
+ */
+ static public function init() {
+ // 定义当前请求的系统常量
+ define('NOW_TIME', $_SERVER['REQUEST_TIME']);
+ define('REQUEST_METHOD',$_SERVER['REQUEST_METHOD']);
+ define('IS_GET', REQUEST_METHOD =='GET' ? true : false);
+ define('IS_POST', REQUEST_METHOD =='POST' ? true : false);
+ define('IS_PUT', REQUEST_METHOD =='PUT' ? true : false);
+ define('IS_DELETE', REQUEST_METHOD =='DELETE' ? true : false);
+ define('IS_AJAX', ((isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') || !empty($_POST[C('VAR_AJAX_SUBMIT')]) || !empty($_GET[C('VAR_AJAX_SUBMIT')])) ? true : false);
+
+ // URL调度
+ Dispatcher::dispatch();
+
+ if(C('REQUEST_VARS_FILTER')){
+ // 全局安全过滤
+ array_walk_recursive($_GET, 'think_filter');
+ array_walk_recursive($_POST, 'think_filter');
+ array_walk_recursive($_REQUEST, 'think_filter');
+ }
+
+ // 日志目录转换为绝对路径
+ C('LOG_PATH',realpath(LOG_PATH).'/');
+ // TMPL_EXCEPTION_FILE 改为绝对地址
+ C('TMPL_EXCEPTION_FILE',realpath(C('TMPL_EXCEPTION_FILE')));
+ return ;
+ }
+
+ /**
+ * 执行应用程序
+ * @access public
+ * @return void
+ */
+ static public function exec() {
+
+ if(!preg_match('/^[A-Za-z](\/|\w)*$/',CONTROLLER_NAME)){ // 安全检测
+ $module = false;
+ }else{
+ //创建控制器实例
+ $module = A(CONTROLLER_NAME);
+ }
+
+ if(!$module) {
+ // 是否定义Empty控制器
+ $module = A('Empty');
+ if(!$module){
+ E(L('_CONTROLLER_NOT_EXIST_').':'.CONTROLLER_NAME);
+ }
+ }
+
+ // 获取当前操作名 支持动态路由
+ $action = ACTION_NAME;
+
+ try{
+ if(!preg_match('/^[A-Za-z](\w)*$/',$action)){
+ // 非法操作
+ throw new \ReflectionException();
+ }
+ //执行当前操作
+ $method = new \ReflectionMethod($module, $action);
+ if($method->isPublic() && !$method->isStatic()) {
+ $class = new \ReflectionClass($module);
+ // URL参数绑定检测
+ if(C('URL_PARAMS_BIND') && $method->getNumberOfParameters()>0){
+ switch($_SERVER['REQUEST_METHOD']) {
+ case 'POST':
+ $vars = array_merge($_GET,$_POST);
+ break;
+ case 'PUT':
+ parse_str(file_get_contents('php://input'), $vars);
+ break;
+ default:
+ $vars = $_GET;
+ }
+ $params = $method->getParameters();
+ $paramsBindType = C('URL_PARAMS_BIND_TYPE');
+ foreach ($params as $param){
+ $name = $param->getName();
+ if( 1 == $paramsBindType && !empty($vars) ){
+ $args[] = array_shift($vars);
+ }elseif( 0 == $paramsBindType && isset($vars[$name])){
+ $args[] = $vars[$name];
+ }elseif($param->isDefaultValueAvailable()){
+ $args[] = $param->getDefaultValue();
+ }else{
+ E(L('_PARAM_ERROR_').':'.$name);
+ }
+ }
+ array_walk_recursive($args,'think_filter');
+ $method->invokeArgs($module,$args);
+ }else{
+ $method->invoke($module);
+ }
+ }else{
+ // 操作方法不是Public 抛出异常
+ throw new \ReflectionException();
+ }
+ } catch (\ReflectionException $e) {
+ // 方法调用发生异常后 引导到__call方法处理
+ $method = new \ReflectionMethod($module,'__call');
+ $method->invokeArgs($module,array($action,''));
+ }
+ return ;
+ }
+
+ /**
+ * 运行应用实例 入口文件使用的快捷方法
+ * @access public
+ * @return void
+ */
+ static public function run() {
+ App::init();
+ // Session初始化
+ if(!IS_CLI){
+ session(C('SESSION_OPTIONS'));
+ }
+ // 记录应用初始化时间
+ G('initTime');
+ App::exec();
+ return ;
+ }
+
+}
\ No newline at end of file
diff --git a/ThinkPHP/Mode/Api/Controller.class.php b/ThinkPHP/Mode/Api/Controller.class.php
new file mode 100644
index 0000000..578e2b7
--- /dev/null
+++ b/ThinkPHP/Mode/Api/Controller.class.php
@@ -0,0 +1,92 @@
+
+// +----------------------------------------------------------------------
+namespace Think;
+/**
+ * ThinkPHP API模式控制器基类
+ */
+abstract class Controller {
+
+ /**
+ * 架构函数
+ * @access public
+ */
+ public function __construct() {
+ //控制器初始化
+ if(method_exists($this,'_initialize'))
+ $this->_initialize();
+ }
+
+ /**
+ * 魔术方法 有不存在的操作的时候执行
+ * @access public
+ * @param string $method 方法名
+ * @param array $args 参数
+ * @return mixed
+ */
+ public function __call($method,$args) {
+ if( 0 === strcasecmp($method,ACTION_NAME.C('ACTION_SUFFIX'))) {
+ if(method_exists($this,'_empty')) {
+ // 如果定义了_empty操作 则调用
+ $this->_empty($method,$args);
+ }else{
+ E(L('_ERROR_ACTION_').':'.ACTION_NAME);
+ }
+ }else{
+ E(__CLASS__.':'.$method.L('_METHOD_NOT_EXIST_'));
+ return;
+ }
+ }
+
+ /**
+ * Ajax方式返回数据到客户端
+ * @access protected
+ * @param mixed $data 要返回的数据
+ * @param String $type AJAX返回数据格式
+ * @return void
+ */
+ protected function ajaxReturn($data,$type='') {
+ if(empty($type)) $type = C('DEFAULT_AJAX_RETURN');
+ switch (strtoupper($type)){
+ case 'JSON' :
+ // 返回JSON数据格式到客户端 包含状态信息
+ header('Content-Type:application/json; charset=utf-8');
+ exit(json_encode($data));
+ case 'XML' :
+ // 返回xml格式数据
+ header('Content-Type:text/xml; charset=utf-8');
+ exit(xml_encode($data));
+ case 'JSONP':
+ // 返回JSON数据格式到客户端 包含状态信息
+ header('Content-Type:application/json; charset=utf-8');
+ $handler = isset($_GET[C('VAR_JSONP_HANDLER')]) ? $_GET[C('VAR_JSONP_HANDLER')] : C('DEFAULT_JSONP_HANDLER');
+ exit($handler.'('.json_encode($data).');');
+ case 'EVAL' :
+ // 返回可执行的js脚本
+ header('Content-Type:text/html; charset=utf-8');
+ exit($data);
+ }
+ }
+
+ /**
+ * Action跳转(URL重定向) 支持指定模块和延时跳转
+ * @access protected
+ * @param string $url 跳转的URL表达式
+ * @param array $params 其它URL参数
+ * @param integer $delay 延时跳转的时间 单位为秒
+ * @param string $msg 跳转提示信息
+ * @return void
+ */
+ protected function redirect($url,$params=array(),$delay=0,$msg='') {
+ $url = U($url,$params);
+ redirect($url,$delay,$msg);
+ }
+
+}
\ No newline at end of file
diff --git a/ThinkPHP/Mode/Api/Dispatcher.class.php b/ThinkPHP/Mode/Api/Dispatcher.class.php
new file mode 100644
index 0000000..99ee236
--- /dev/null
+++ b/ThinkPHP/Mode/Api/Dispatcher.class.php
@@ -0,0 +1,232 @@
+
+// +----------------------------------------------------------------------
+namespace Think;
+/**
+ * ThinkPHP API模式的Dispatcher类
+ * 完成URL解析、路由和调度
+ */
+class Dispatcher {
+
+ /**
+ * URL映射到控制器
+ * @access public
+ * @return void
+ */
+ static public function dispatch() {
+ $varPath = C('VAR_PATHINFO');
+ $varModule = C('VAR_MODULE');
+ $varController = C('VAR_CONTROLLER');
+ $varAction = C('VAR_ACTION');
+ $urlCase = C('URL_CASE_INSENSITIVE');
+ if(isset($_GET[$varPath])) { // 判断URL里面是否有兼容模式参数
+ $_SERVER['PATH_INFO'] = $_GET[$varPath];
+ unset($_GET[$varPath]);
+ }elseif(IS_CLI){ // CLI模式下 index.php module/controller/action/params/...
+ $_SERVER['PATH_INFO'] = isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : '';
+ }
+
+ // 开启子域名部署
+ if(C('APP_SUB_DOMAIN_DEPLOY')) {
+ $rules = C('APP_SUB_DOMAIN_RULES');
+ if(isset($rules[$_SERVER['HTTP_HOST']])) { // 完整域名或者IP配置
+ define('APP_DOMAIN',$_SERVER['HTTP_HOST']); // 当前完整域名
+ $rule = $rules[APP_DOMAIN];
+ }else{
+ if(strpos(C('APP_DOMAIN_SUFFIX'),'.')){ // com.cn net.cn
+ $domain = array_slice(explode('.', $_SERVER['HTTP_HOST']), 0, -3);
+ }else{
+ $domain = array_slice(explode('.', $_SERVER['HTTP_HOST']), 0, -2);
+ }
+ if(!empty($domain)) {
+ $subDomain = implode('.', $domain);
+ define('SUB_DOMAIN',$subDomain); // 当前完整子域名
+ $domain2 = array_pop($domain); // 二级域名
+ if($domain) { // 存在三级域名
+ $domain3 = array_pop($domain);
+ }
+ if(isset($rules[$subDomain])) { // 子域名
+ $rule = $rules[$subDomain];
+ }elseif(isset($rules['*.' . $domain2]) && !empty($domain3)){ // 泛三级域名
+ $rule = $rules['*.' . $domain2];
+ $panDomain = $domain3;
+ }elseif(isset($rules['*']) && !empty($domain2) && 'www' != $domain2 ){ // 泛二级域名
+ $rule = $rules['*'];
+ $panDomain = $domain2;
+ }
+ }
+ }
+
+ if(!empty($rule)) {
+ // 子域名部署规则 '子域名'=>array('模块名[/控制器名]','var1=a&var2=b');
+ if(is_array($rule)){
+ list($rule,$vars) = $rule;
+ }
+ $array = explode('/',$rule);
+ // 模块绑定
+ define('BIND_MODULE',array_shift($array));
+ // 控制器绑定
+ if(!empty($array)) {
+ $controller = array_shift($array);
+ if($controller){
+ define('BIND_CONTROLLER',$controller);
+ }
+ }
+ if(isset($vars)) { // 传入参数
+ parse_str($vars,$parms);
+ if(isset($panDomain)){
+ $pos = array_search('*', $parms);
+ if(false !== $pos) {
+ // 泛域名作为参数
+ $parms[$pos] = $panDomain;
+ }
+ }
+ $_GET = array_merge($_GET,$parms);
+ }
+ }
+ }
+ // 分析PATHINFO信息
+ if(!isset($_SERVER['PATH_INFO'])) {
+ $types = explode(',',C('URL_PATHINFO_FETCH'));
+ foreach ($types as $type){
+ if(!empty($_SERVER[$type])) {
+ $_SERVER['PATH_INFO'] = (0 === strpos($_SERVER[$type],$_SERVER['SCRIPT_NAME']))?
+ substr($_SERVER[$type], strlen($_SERVER['SCRIPT_NAME'])) : $_SERVER[$type];
+ break;
+ }
+ }
+ }
+ if(empty($_SERVER['PATH_INFO'])) {
+ $_SERVER['PATH_INFO'] = '';
+ }
+ $depr = C('URL_PATHINFO_DEPR');
+ define('MODULE_PATHINFO_DEPR', $depr);
+ define('__INFO__',trim($_SERVER['PATH_INFO'],'/'));
+ // URL后缀
+ define('__EXT__', strtolower(pathinfo($_SERVER['PATH_INFO'],PATHINFO_EXTENSION)));
+
+ $_SERVER['PATH_INFO'] = __INFO__;
+
+ if (__INFO__ && C('MULTI_MODULE') && !defined('BIND_MODULE')){ // 获取模块名
+ $paths = explode($depr,__INFO__,2);
+ $allowList = C('MODULE_ALLOW_LIST'); // 允许的模块列表
+ $module = preg_replace('/\.' . __EXT__ . '$/i', '',$paths[0]);
+ if( empty($allowList) || (is_array($allowList) && in_array_case($module, $allowList))){
+ $_GET[$varModule] = $module;
+ $_SERVER['PATH_INFO'] = isset($paths[1])?$paths[1]:'';
+ }
+ }
+
+ // 获取模块名称
+ define('MODULE_NAME', defined('BIND_MODULE')? BIND_MODULE : self::getModule($varModule));
+
+ // 检测模块是否存在
+ if( MODULE_NAME && (defined('BIND_MODULE') || !in_array_case(MODULE_NAME,C('MODULE_DENY_LIST')) ) && is_dir(APP_PATH.MODULE_NAME)){
+ // 定义当前模块路径
+ define('MODULE_PATH', APP_PATH.MODULE_NAME.'/');
+ // 定义当前模块的模版缓存路径
+ C('CACHE_PATH',CACHE_PATH.MODULE_NAME.'/');
+
+ // 加载模块配置文件
+ if(is_file(MODULE_PATH.'Conf/config.php'))
+ C(include MODULE_PATH.'Conf/config.php');
+ // 加载模块别名定义
+ if(is_file(MODULE_PATH.'Conf/alias.php'))
+ Think::addMap(include MODULE_PATH.'Conf/alias.php');
+ // 加载模块函数文件
+ if(is_file(MODULE_PATH.'Common/function.php'))
+ include MODULE_PATH.'Common/function.php';
+ }else{
+ E(L('_MODULE_NOT_EXIST_').':'.MODULE_NAME);
+ }
+
+ if('' != $_SERVER['PATH_INFO'] && (!C('URL_ROUTER_ON') || !Route::check()) ){ // 检测路由规则 如果没有则按默认规则调度URL
+ // 检查禁止访问的URL后缀
+ if(C('URL_DENY_SUFFIX') && preg_match('/\.('.trim(C('URL_DENY_SUFFIX'),'.').')$/i', $_SERVER['PATH_INFO'])){
+ send_http_status(404);
+ exit;
+ }
+
+ // 去除URL后缀
+ $_SERVER['PATH_INFO'] = preg_replace(C('URL_HTML_SUFFIX')? '/\.('.trim(C('URL_HTML_SUFFIX'),'.').')$/i' : '/\.'.__EXT__.'$/i', '', $_SERVER['PATH_INFO']);
+
+ $depr = C('URL_PATHINFO_DEPR');
+ $paths = explode($depr,trim($_SERVER['PATH_INFO'],$depr));
+
+ if(!defined('BIND_CONTROLLER')) {// 获取控制器
+ $_GET[$varController] = array_shift($paths);
+ }
+ // 获取操作
+ if(!defined('BIND_ACTION')){
+ $_GET[$varAction] = array_shift($paths);
+ }
+ // 解析剩余的URL参数
+ $var = array();
+ if(C('URL_PARAMS_BIND') && 1 == C('URL_PARAMS_BIND_TYPE')){
+ // URL参数按顺序绑定变量
+ $var = $paths;
+ }else{
+ preg_replace_callback('/(\w+)\/([^\/]+)/', function($match) use(&$var){$var[$match[1]]=strip_tags($match[2]);}, implode('/',$paths));
+ }
+ $_GET = array_merge($var,$_GET);
+ }
+ // 获取控制器和操作名
+ define('CONTROLLER_NAME', defined('BIND_CONTROLLER')? BIND_CONTROLLER : self::getController($varController,$urlCase));
+ define('ACTION_NAME', defined('BIND_ACTION')? BIND_ACTION : self::getAction($varAction,$urlCase));
+ //保证$_REQUEST正常取值
+ $_REQUEST = array_merge($_POST,$_GET);
+ }
+
+ /**
+ * 获得实际的控制器名称
+ */
+ static private function getController($var,$urlCase) {
+ $controller = (!empty($_GET[$var])? $_GET[$var]:C('DEFAULT_CONTROLLER'));
+ unset($_GET[$var]);
+ if($urlCase) {
+ // URL地址不区分大小写
+ // 智能识别方式 user_type 识别到 UserTypeController 控制器
+ $controller = parse_name($controller,1);
+ }
+ return strip_tags(ucfirst($controller));
+ }
+
+ /**
+ * 获得实际的操作名称
+ */
+ static private function getAction($var,$urlCase) {
+ $action = !empty($_POST[$var]) ?
+ $_POST[$var] :
+ (!empty($_GET[$var])?$_GET[$var]:C('DEFAULT_ACTION'));
+ unset($_POST[$var],$_GET[$var]);
+ return strip_tags($urlCase?strtolower($action):$action);
+ }
+
+ /**
+ * 获得实际的模块名称
+ */
+ static private function getModule($var) {
+ $module = (!empty($_GET[$var])?$_GET[$var]:C('DEFAULT_MODULE'));
+ unset($_GET[$var]);
+ if($maps = C('URL_MODULE_MAP')) {
+ if(isset($maps[strtolower($module)])) {
+ // 记录当前别名
+ define('MODULE_ALIAS',strtolower($module));
+ // 获取实际的模块名
+ return ucfirst($maps[MODULE_ALIAS]);
+ }elseif(array_search(strtolower($module),$maps)){
+ // 禁止访问原始模块
+ return '';
+ }
+ }
+ return strip_tags(ucfirst(strtolower($module)));
+ }
+
+}
diff --git a/ThinkPHP/Mode/Api/functions.php b/ThinkPHP/Mode/Api/functions.php
new file mode 100644
index 0000000..04a8e69
--- /dev/null
+++ b/ThinkPHP/Mode/Api/functions.php
@@ -0,0 +1,1109 @@
+
+// +----------------------------------------------------------------------
+
+/**
+ * Think API模式函数库
+ */
+
+/**
+ * 获取和设置配置参数 支持批量定义
+ * @param string|array $name 配置变量
+ * @param mixed $value 配置值
+ * @param mixed $default 默认值
+ * @return mixed
+ */
+function C($name=null, $value=null,$default=null) {
+ static $_config = array();
+ // 无参数时获取所有
+ if (empty($name)) {
+ return $_config;
+ }
+ // 优先执行设置获取或赋值
+ if (is_string($name)) {
+ if (!strpos($name, '.')) {
+ $name = strtolower($name);
+ if (is_null($value))
+ return isset($_config[$name]) ? $_config[$name] : $default;
+ $_config[$name] = $value;
+ return;
+ }
+ // 二维数组设置和获取支持
+ $name = explode('.', $name);
+ $name[0] = strtolower($name[0]);
+ if (is_null($value))
+ return isset($_config[$name[0]][$name[1]]) ? $_config[$name[0]][$name[1]] : $default;
+ $_config[$name[0]][$name[1]] = $value;
+ return;
+ }
+ // 批量设置
+ if (is_array($name)){
+ $_config = array_merge($_config, array_change_key_case($name));
+ return;
+ }
+ return null; // 避免非法参数
+}
+
+/**
+ * 加载配置文件 支持格式转换 仅支持一级配置
+ * @param string $file 配置文件名
+ * @param string $parse 配置解析方法 有些格式需要用户自己解析
+ * @return void
+ */
+function load_config($file,$parse=CONF_PARSE){
+ $ext = pathinfo($file,PATHINFO_EXTENSION);
+ switch($ext){
+ case 'php':
+ return include $file;
+ case 'ini':
+ return parse_ini_file($file);
+ case 'yaml':
+ return yaml_parse_file($file);
+ case 'xml':
+ return (array)simplexml_load_file($file);
+ case 'json':
+ return json_decode(file_get_contents($file), true);
+ default:
+ if(function_exists($parse)){
+ return $parse($file);
+ }else{
+ E(L('_NOT_SUPPORT_').':'.$ext);
+ }
+ }
+}
+
+/**
+ * 抛出异常处理
+ * @param string $msg 异常消息
+ * @param integer $code 异常代码 默认为0
+ * @return void
+ */
+function E($msg, $code=0) {
+ throw new Think\Exception($msg, $code);
+}
+
+/**
+ * 记录和统计时间(微秒)和内存使用情况
+ * 使用方法:
+ *
+ * G('begin'); // 记录开始标记位
+ * // ... 区间运行代码
+ * G('end'); // 记录结束标签位
+ * echo G('begin','end',6); // 统计区间运行时间 精确到小数后6位
+ * echo G('begin','end','m'); // 统计区间内存使用情况
+ * 如果end标记位没有定义,则会自动以当前作为标记位
+ * 其中统计内存使用需要 MEMORY_LIMIT_ON 常量为true才有效
+ *
+ * @param string $start 开始标签
+ * @param string $end 结束标签
+ * @param integer|string $dec 小数位或者m
+ * @return mixed
+ */
+function G($start,$end='',$dec=4) {
+ static $_info = array();
+ static $_mem = array();
+ if(is_float($end)) { // 记录时间
+ $_info[$start] = $end;
+ }elseif(!empty($end)){ // 统计时间和内存使用
+ if(!isset($_info[$end])) $_info[$end] = microtime(TRUE);
+ if(MEMORY_LIMIT_ON && $dec=='m'){
+ if(!isset($_mem[$end])) $_mem[$end] = memory_get_usage();
+ return number_format(($_mem[$end]-$_mem[$start])/1024);
+ }else{
+ return number_format(($_info[$end]-$_info[$start]),$dec);
+ }
+
+ }else{ // 记录时间和内存使用
+ $_info[$start] = microtime(TRUE);
+ if(MEMORY_LIMIT_ON) $_mem[$start] = memory_get_usage();
+ }
+}
+
+/**
+ * 获取和设置语言定义(不区分大小写)
+ * @param string|array $name 语言变量
+ * @param string $value 语言值
+ * @return mixed
+ */
+function L($name=null, $value=null) {
+ static $_lang = array();
+ // 空参数返回所有定义
+ if (empty($name))
+ return $_lang;
+ // 判断语言获取(或设置)
+ // 若不存在,直接返回全大写$name
+ if (is_string($name)) {
+ $name = strtoupper($name);
+ if (is_null($value))
+ return isset($_lang[$name]) ? $_lang[$name] : $name;
+ $_lang[$name] = $value; // 语言定义
+ return;
+ }
+ // 批量定义
+ if (is_array($name))
+ $_lang = array_merge($_lang, array_change_key_case($name, CASE_UPPER));
+ return;
+}
+
+/**
+ * 添加和获取页面Trace记录
+ * @param string $value 变量
+ * @param string $label 标签
+ * @param string $level 日志级别
+ * @param boolean $record 是否记录日志
+ * @return void
+ */
+function trace($value='[think]',$label='',$level='DEBUG',$record=false) {
+ return Think\Think::trace($value,$label,$level,$record);
+}
+
+/**
+ * 编译文件
+ * @param string $filename 文件名
+ * @return string
+ */
+function compile($filename) {
+ $content = php_strip_whitespace($filename);
+ $content = trim(substr($content, 5));
+ // 替换预编译指令
+ $content = preg_replace('/\/\/\[RUNTIME\](.*?)\/\/\[\/RUNTIME\]/s', '', $content);
+ if(0===strpos($content,'namespace')){
+ $content = preg_replace('/namespace\s(.*?);/','namespace \\1{',$content,1);
+ }else{
+ $content = 'namespace {'.$content;
+ }
+ if ('?>' == substr($content, -2))
+ $content = substr($content, 0, -2);
+ return $content.'}';
+}
+
+/**
+ * 获取输入参数 支持过滤和默认值
+ * 使用方法:
+ *
+ * I('id',0); 获取id参数 自动判断get或者post
+ * I('post.name','','htmlspecialchars'); 获取$_POST['name']
+ * I('get.'); 获取$_GET
+ *
+ * @param string $name 变量的名称 支持指定类型
+ * @param mixed $default 不存在的时候默认值
+ * @param mixed $filter 参数过滤方法
+ * @param mixed $datas 要获取的额外数据源
+ * @return mixed
+ */
+function I($name,$default='',$filter=null,$datas=null) {
+ if(strpos($name,'/')){ // 指定修饰符
+ list($name,$type) = explode('/',$name,2);
+ }
+ if(strpos($name,'.')) { // 指定参数来源
+ list($method,$name) = explode('.',$name,2);
+ }else{ // 默认为自动判断
+ $method = 'param';
+ }
+ switch(strtolower($method)) {
+ case 'get' : $input =& $_GET;break;
+ case 'post' : $input =& $_POST;break;
+ case 'put' : parse_str(file_get_contents('php://input'), $input);break;
+ case 'param' :
+ switch($_SERVER['REQUEST_METHOD']) {
+ case 'POST':
+ $input = $_POST;
+ break;
+ case 'PUT':
+ parse_str(file_get_contents('php://input'), $input);
+ break;
+ default:
+ $input = $_GET;
+ }
+ break;
+ case 'path' :
+ $input = array();
+ if(!empty($_SERVER['PATH_INFO'])){
+ $depr = C('URL_PATHINFO_DEPR');
+ $input = explode($depr,trim($_SERVER['PATH_INFO'],$depr));
+ }
+ break;
+ case 'request' : $input =& $_REQUEST; break;
+ case 'session' : $input =& $_SESSION; break;
+ case 'cookie' : $input =& $_COOKIE; break;
+ case 'server' : $input =& $_SERVER; break;
+ case 'globals' : $input =& $GLOBALS; break;
+ case 'data' : $input =& $datas; break;
+ default:
+ return NULL;
+ }
+ if(''==$name) { // 获取全部变量
+ $data = $input;
+ $filters = isset($filter)?$filter:C('DEFAULT_FILTER');
+ if($filters) {
+ if(is_string($filters)){
+ $filters = explode(',',$filters);
+ }
+ foreach($filters as $filter){
+ $data = array_map_recursive($filter,$data); // 参数过滤
+ }
+ }
+ }elseif(isset($input[$name])) { // 取值操作
+ $data = $input[$name];
+ $filters = isset($filter)?$filter:C('DEFAULT_FILTER');
+ if($filters) {
+ if(is_string($filters)){
+ $filters = explode(',',$filters);
+ }elseif(is_int($filters)){
+ $filters = array($filters);
+ }
+
+ foreach($filters as $filter){
+ if(function_exists($filter)) {
+ $data = is_array($data) ? array_map_recursive($filter,$data) : $filter($data); // 参数过滤
+ }elseif(0===strpos($filter,'/')){
+ // 支持正则验证
+ if(1 !== preg_match($filter,(string)$data)){
+ return isset($default) ? $default : NULL;
+ }
+ }else{
+ $data = filter_var($data,is_int($filter) ? $filter : filter_id($filter));
+ if(false === $data) {
+ return isset($default) ? $default : NULL;
+ }
+ }
+ }
+ }
+ if(!empty($type)){
+ switch(strtolower($type)){
+ case 's': // 字符串
+ $data = (string)$data;
+ break;
+ case 'a': // 数组
+ $data = (array)$data;
+ break;
+ case 'd': // 数字
+ $data = (int)$data;
+ break;
+ case 'f': // 浮点
+ $data = (float)$data;
+ break;
+ case 'b': // 布尔
+ $data = (boolean)$data;
+ break;
+ }
+ }
+ }else{ // 变量默认值
+ $data = isset($default)?$default:NULL;
+ }
+ is_array($data) && array_walk_recursive($data,'think_filter');
+ return $data;
+}
+
+function array_map_recursive($filter, $data) {
+ $result = array();
+ foreach ($data as $key => $val) {
+ $result[$key] = is_array($val)
+ ? array_map_recursive($filter, $val)
+ : call_user_func($filter, $val);
+ }
+ return $result;
+ }
+
+/**
+ * 设置和获取统计数据
+ * 使用方法:
+ *
+ * N('db',1); // 记录数据库操作次数
+ * N('read',1); // 记录读取次数
+ * echo N('db'); // 获取当前页面数据库的所有操作次数
+ * echo N('read'); // 获取当前页面读取次数
+ *
+ * @param string $key 标识位置
+ * @param integer $step 步进值
+ * @return mixed
+ */
+function N($key, $step=0,$save=false) {
+ static $_num = array();
+ if (!isset($_num[$key])) {
+ $_num[$key] = (false !== $save)? S('N_'.$key) : 0;
+ }
+ if (empty($step))
+ return $_num[$key];
+ else
+ $_num[$key] = $_num[$key] + (int) $step;
+ if(false !== $save){ // 保存结果
+ S('N_'.$key,$_num[$key],$save);
+ }
+}
+
+/**
+ * 字符串命名风格转换
+ * type 0 将Java风格转换为C的风格 1 将C风格转换为Java的风格
+ * @param string $name 字符串
+ * @param integer $type 转换类型
+ * @return string
+ */
+function parse_name($name, $type=0) {
+ if ($type) {
+ return ucfirst(preg_replace_callback('/_([a-zA-Z])/', function($match){return strtoupper($match[1]);}, $name));
+ } else {
+ return strtolower(trim(preg_replace("/[A-Z]/", "_\\0", $name), "_"));
+ }
+}
+
+/**
+ * 优化的require_once
+ * @param string $filename 文件地址
+ * @return boolean
+ */
+function require_cache($filename) {
+ static $_importFiles = array();
+ if (!isset($_importFiles[$filename])) {
+ if (file_exists_case($filename)) {
+ require $filename;
+ $_importFiles[$filename] = true;
+ } else {
+ $_importFiles[$filename] = false;
+ }
+ }
+ return $_importFiles[$filename];
+}
+
+/**
+ * 区分大小写的文件存在判断
+ * @param string $filename 文件地址
+ * @return boolean
+ */
+function file_exists_case($filename) {
+ if (is_file($filename)) {
+ if (IS_WIN && APP_DEBUG) {
+ if (basename(realpath($filename)) != basename($filename))
+ return false;
+ }
+ return true;
+ }
+ return false;
+}
+
+/**
+ * 导入所需的类库 同java的Import 本函数有缓存功能
+ * @param string $class 类库命名空间字符串
+ * @param string $baseUrl 起始路径
+ * @param string $ext 导入的文件扩展名
+ * @return boolean
+ */
+function import($class, $baseUrl = '', $ext=EXT) {
+ static $_file = array();
+ $class = str_replace(array('.', '#'), array('/', '.'), $class);
+ if (isset($_file[$class . $baseUrl]))
+ return true;
+ else
+ $_file[$class . $baseUrl] = true;
+ $class_strut = explode('/', $class);
+ if (empty($baseUrl)) {
+ if ('@' == $class_strut[0] || MODULE_NAME == $class_strut[0]) {
+ //加载当前模块的类库
+ $baseUrl = MODULE_PATH;
+ $class = substr_replace($class, '', 0, strlen($class_strut[0]) + 1);
+ }elseif (in_array($class_strut[0],array('Think','Org','Behavior','Com','Vendor')) || is_dir(LIB_PATH.$class_strut[0])) {
+ // 系统类库包和第三方类库包
+ $baseUrl = LIB_PATH;
+ }else { // 加载其他模块的类库
+ $baseUrl = APP_PATH;
+ }
+ }
+ if (substr($baseUrl, -1) != '/')
+ $baseUrl .= '/';
+ $classfile = $baseUrl . $class . $ext;
+ if (!class_exists(basename($class),false)) {
+ // 如果类不存在 则导入类库文件
+ return require_cache($classfile);
+ }
+}
+
+/**
+ * 基于命名空间方式导入函数库
+ * load('@.Util.Array')
+ * @param string $name 函数库命名空间字符串
+ * @param string $baseUrl 起始路径
+ * @param string $ext 导入的文件扩展名
+ * @return void
+ */
+function load($name, $baseUrl='', $ext='.php') {
+ $name = str_replace(array('.', '#'), array('/', '.'), $name);
+ if (empty($baseUrl)) {
+ if (0 === strpos($name, '@/')) {//加载当前模块函数库
+ $baseUrl = MODULE_PATH.'Common/';
+ $name = substr($name, 2);
+ } else { //加载其他模块函数库
+ $array = explode('/', $name);
+ $baseUrl = APP_PATH . array_shift($array).'/Common/';
+ $name = implode('/',$array);
+ }
+ }
+ if (substr($baseUrl, -1) != '/')
+ $baseUrl .= '/';
+ require_cache($baseUrl . $name . $ext);
+}
+
+/**
+ * 快速导入第三方框架类库 所有第三方框架的类库文件统一放到 系统的Vendor目录下面
+ * @param string $class 类库
+ * @param string $baseUrl 基础目录
+ * @param string $ext 类库后缀
+ * @return boolean
+ */
+function vendor($class, $baseUrl = '', $ext='.php') {
+ if (empty($baseUrl))
+ $baseUrl = VENDOR_PATH;
+ return import($class, $baseUrl, $ext);
+}
+
+/**
+ * D函数用于实例化模型类 格式 [资源://][模块/]模型
+ * @param string $name 资源地址
+ * @param string $layer 模型层名称
+ * @return Model
+ */
+function D($name='',$layer='') {
+ if(empty($name)) return new Think\Model;
+ static $_model = array();
+ $layer = $layer? : C('DEFAULT_M_LAYER');
+ if(isset($_model[$name.$layer]))
+ return $_model[$name.$layer];
+ $class = parse_res_name($name,$layer);
+ if(class_exists($class)) {
+ $model = new $class(basename($name));
+ }elseif(false === strpos($name,'/')){
+ // 自动加载公共模块下面的模型
+ $class = '\\Common\\'.$layer.'\\'.$name.$layer;
+ $model = class_exists($class)? new $class($name) : new Think\Model($name);
+ }else {
+ Think\Log::record('D方法实例化没找到模型类'.$class,Think\Log::NOTICE);
+ $model = new Think\Model(basename($name));
+ }
+ $_model[$name.$layer] = $model;
+ return $model;
+}
+
+/**
+ * M函数用于实例化一个没有模型文件的Model
+ * @param string $name Model名称 支持指定基础模型 例如 MongoModel:User
+ * @param string $tablePrefix 表前缀
+ * @param mixed $connection 数据库连接信息
+ * @return Model
+ */
+function M($name='', $tablePrefix='',$connection='') {
+ static $_model = array();
+ if(strpos($name,':')) {
+ list($class,$name) = explode(':',$name);
+ }else{
+ $class = 'Think\\Model';
+ }
+ $guid = (is_array($connection)?implode('',$connection):$connection).$tablePrefix . $name . '_' . $class;
+ if (!isset($_model[$guid]))
+ $_model[$guid] = new $class($name,$tablePrefix,$connection);
+ return $_model[$guid];
+}
+
+/**
+ * 解析资源地址并导入类库文件
+ * 例如 module/controller addon://module/behavior
+ * @param string $name 资源地址 格式:[扩展://][模块/]资源名
+ * @param string $layer 分层名称
+ * @return string
+ */
+function parse_res_name($name,$layer,$level=1){
+ if(strpos($name,'://')) {// 指定扩展资源
+ list($extend,$name) = explode('://',$name);
+ }else{
+ $extend = '';
+ }
+ if(strpos($name,'/') && substr_count($name, '/')>=$level){ // 指定模块
+ list($module,$name) = explode('/',$name,2);
+ }else{
+ $module = MODULE_NAME;
+ }
+ $array = explode('/',$name);
+ $class = $module.'\\'.$layer;
+ foreach($array as $name){
+ $class .= '\\'.parse_name($name, 1);
+ }
+ // 导入资源类库
+ if($extend){ // 扩展资源
+ $class = $extend.'\\'.$class;
+ }
+ return $class.$layer;
+}
+
+/**
+ * A函数用于实例化控制器 格式:[资源://][模块/]控制器
+ * @param string $name 资源地址
+ * @param string $layer 控制层名称
+ * @param integer $level 控制器层次
+ * @return Controller|false
+ */
+function A($name,$layer='',$level='') {
+ static $_action = array();
+ $layer = $layer? : C('DEFAULT_C_LAYER');
+ $level = $level? : ($layer == C('DEFAULT_C_LAYER')?C('CONTROLLER_LEVEL'):1);
+ if(isset($_action[$name.$layer]))
+ return $_action[$name.$layer];
+ $class = parse_res_name($name,$layer,$level);
+ if(class_exists($class)) {
+ $action = new $class();
+ $_action[$name.$layer] = $action;
+ return $action;
+ }else {
+ return false;
+ }
+}
+
+/**
+ * 远程调用控制器的操作方法 URL 参数格式 [资源://][模块/]控制器/操作
+ * @param string $url 调用地址
+ * @param string|array $vars 调用参数 支持字符串和数组
+ * @param string $layer 要调用的控制层名称
+ * @return mixed
+ */
+function R($url,$vars=array(),$layer='') {
+ $info = pathinfo($url);
+ $action = $info['basename'];
+ $module = $info['dirname'];
+ $class = A($module,$layer);
+ if($class){
+ if(is_string($vars)) {
+ parse_str($vars,$vars);
+ }
+ return call_user_func_array(array(&$class,$action.C('ACTION_SUFFIX')),$vars);
+ }else{
+ return false;
+ }
+}
+
+/**
+ * 执行某个行为
+ * @param string $name 行为名称
+ * @param Mixed $params 传入的参数
+ * @return void
+ */
+function B($name, &$params=NULL) {
+ if(strpos($name,'/')){
+ list($name,$tag) = explode('/',$name);
+ }else{
+ $tag = 'run';
+ }
+ return \Think\Hook::exec($name,$tag,$params);
+}
+
+/**
+ * 去除代码中的空白和注释
+ * @param string $content 代码内容
+ * @return string
+ */
+function strip_whitespace($content) {
+ $stripStr = '';
+ //分析php源码
+ $tokens = token_get_all($content);
+ $last_space = false;
+ for ($i = 0, $j = count($tokens); $i < $j; $i++) {
+ if (is_string($tokens[$i])) {
+ $last_space = false;
+ $stripStr .= $tokens[$i];
+ } else {
+ switch ($tokens[$i][0]) {
+ //过滤各种PHP注释
+ case T_COMMENT:
+ case T_DOC_COMMENT:
+ break;
+ //过滤空格
+ case T_WHITESPACE:
+ if (!$last_space) {
+ $stripStr .= ' ';
+ $last_space = true;
+ }
+ break;
+ case T_START_HEREDOC:
+ $stripStr .= "<<' . $label . htmlspecialchars($output, ENT_QUOTES) . '';
+ } else {
+ $output = $label . print_r($var, true);
+ }
+ } else {
+ ob_start();
+ var_dump($var);
+ $output = ob_get_clean();
+ if (!extension_loaded('xdebug')) {
+ $output = preg_replace('/\]\=\>\n(\s+)/m', '] => ', $output);
+ $output = '' . $label . htmlspecialchars($output, ENT_QUOTES) . '
';
+ }
+ }
+ if ($echo) {
+ echo($output);
+ return null;
+ }else
+ return $output;
+}
+
+/**
+ * URL重定向
+ * @param string $url 重定向的URL地址
+ * @param integer $time 重定向的等待时间(秒)
+ * @param string $msg 重定向前的提示信息
+ * @return void
+ */
+function redirect($url, $time=0, $msg='') {
+ //多行URL地址支持
+ $url = str_replace(array("\n", "\r"), '', $url);
+ if (empty($msg))
+ $msg = "系统将在{$time}秒之后自动跳转到{$url}!";
+ if (!headers_sent()) {
+ // redirect
+ if (0 === $time) {
+ header('Location: ' . $url);
+ } else {
+ header("refresh:{$time};url={$url}");
+ echo($msg);
+ }
+ exit();
+ } else {
+ $str = "";
+ if ($time != 0)
+ $str .= $msg;
+ exit($str);
+ }
+}
+
+/**
+ * 缓存管理
+ * @param mixed $name 缓存名称,如果为数组表示进行缓存设置
+ * @param mixed $value 缓存值
+ * @param mixed $options 缓存参数
+ * @return mixed
+ */
+function S($name,$value='',$options=null) {
+ static $cache = '';
+ if(is_array($options) && empty($cache)){
+ // 缓存操作的同时初始化
+ $type = isset($options['type'])?$options['type']:'';
+ $cache = Think\Cache::getInstance($type,$options);
+ }elseif(is_array($name)) { // 缓存初始化
+ $type = isset($name['type'])?$name['type']:'';
+ $cache = Think\Cache::getInstance($type,$name);
+ return $cache;
+ }elseif(empty($cache)) { // 自动初始化
+ $cache = Think\Cache::getInstance();
+ }
+ if(''=== $value){ // 获取缓存
+ return $cache->get($name);
+ }elseif(is_null($value)) { // 删除缓存
+ return $cache->rm($name);
+ }else { // 缓存数据
+ if(is_array($options)) {
+ $expire = isset($options['expire'])?$options['expire']:NULL;
+ }else{
+ $expire = is_numeric($options)?$options:NULL;
+ }
+ return $cache->set($name, $value, $expire);
+ }
+}
+
+/**
+ * 快速文件数据读取和保存 针对简单类型数据 字符串、数组
+ * @param string $name 缓存名称
+ * @param mixed $value 缓存值
+ * @param string $path 缓存路径
+ * @return mixed
+ */
+function F($name, $value='', $path=DATA_PATH) {
+ static $_cache = array();
+ $filename = $path . $name . '.php';
+ if ('' !== $value) {
+ if (is_null($value)) {
+ // 删除缓存
+ if(false !== strpos($name,'*')){
+ return false; // TODO
+ }else{
+ unset($_cache[$name]);
+ return Think\Storage::unlink($filename,'F');
+ }
+ } else {
+ Think\Storage::put($filename,serialize($value),'F');
+ // 缓存数据
+ $_cache[$name] = $value;
+ return ;
+ }
+ }
+ // 获取缓存数据
+ if (isset($_cache[$name]))
+ return $_cache[$name];
+ if (Think\Storage::has($filename,'F')){
+ $value = unserialize(Think\Storage::read($filename,'F'));
+ $_cache[$name] = $value;
+ } else {
+ $value = false;
+ }
+ return $value;
+}
+
+/**
+ * 根据PHP各种类型变量生成唯一标识号
+ * @param mixed $mix 变量
+ * @return string
+ */
+function to_guid_string($mix) {
+ if (is_object($mix)) {
+ return spl_object_hash($mix);
+ } elseif (is_resource($mix)) {
+ $mix = get_resource_type($mix) . strval($mix);
+ } else {
+ $mix = serialize($mix);
+ }
+ return md5($mix);
+}
+
+/**
+ * XML编码
+ * @param mixed $data 数据
+ * @param string $root 根节点名
+ * @param string $item 数字索引的子节点名
+ * @param string $attr 根节点属性
+ * @param string $id 数字索引子节点key转换的属性名
+ * @param string $encoding 数据编码
+ * @return string
+ */
+function xml_encode($data, $root='think', $item='item', $attr='', $id='id', $encoding='utf-8') {
+ if(is_array($attr)){
+ $_attr = array();
+ foreach ($attr as $key => $value) {
+ $_attr[] = "{$key}=\"{$value}\"";
+ }
+ $attr = implode(' ', $_attr);
+ }
+ $attr = trim($attr);
+ $attr = empty($attr) ? '' : " {$attr}";
+ $xml = "";
+ $xml .= "<{$root}{$attr}>";
+ $xml .= data_to_xml($data, $item, $id);
+ $xml .= "{$root}>";
+ return $xml;
+}
+
+/**
+ * 数据XML编码
+ * @param mixed $data 数据
+ * @param string $item 数字索引时的节点名称
+ * @param string $id 数字索引key转换为的属性名
+ * @return string
+ */
+function data_to_xml($data, $item='item', $id='id') {
+ $xml = $attr = '';
+ foreach ($data as $key => $val) {
+ if(is_numeric($key)){
+ $id && $attr = " {$id}=\"{$key}\"";
+ $key = $item;
+ }
+ $xml .= "<{$key}{$attr}>";
+ $xml .= (is_array($val) || is_object($val)) ? data_to_xml($val, $item, $id) : $val;
+ $xml .= "{$key}>";
+ }
+ return $xml;
+}
+
+/**
+ * session管理函数
+ * @param string|array $name session名称 如果为数组则表示进行session设置
+ * @param mixed $value session值
+ * @return mixed
+ */
+function session($name,$value='') {
+ $prefix = C('SESSION_PREFIX');
+ if(is_array($name)) { // session初始化 在session_start 之前调用
+ if(isset($name['prefix'])) C('SESSION_PREFIX',$name['prefix']);
+ if(C('VAR_SESSION_ID') && isset($_REQUEST[C('VAR_SESSION_ID')])){
+ session_id($_REQUEST[C('VAR_SESSION_ID')]);
+ }elseif(isset($name['id'])) {
+ session_id($name['id']);
+ }
+ if('common' != APP_MODE){ // 其它模式可能不支持
+ ini_set('session.auto_start', 0);
+ }
+ if(isset($name['name'])) session_name($name['name']);
+ if(isset($name['path'])) session_save_path($name['path']);
+ if(isset($name['domain'])) ini_set('session.cookie_domain', $name['domain']);
+ if(isset($name['expire'])) ini_set('session.gc_maxlifetime', $name['expire']);
+ if(isset($name['use_trans_sid'])) ini_set('session.use_trans_sid', $name['use_trans_sid']?1:0);
+ if(isset($name['use_cookies'])) ini_set('session.use_cookies', $name['use_cookies']?1:0);
+ if(isset($name['cache_limiter'])) session_cache_limiter($name['cache_limiter']);
+ if(isset($name['cache_expire'])) session_cache_expire($name['cache_expire']);
+ if(isset($name['type'])) C('SESSION_TYPE',$name['type']);
+ if(C('SESSION_TYPE')) { // 读取session驱动
+ $type = C('SESSION_TYPE');
+ $class = strpos($type,'\\')? $type : 'Think\\Session\\Driver\\'. ucwords(strtolower($type));
+ $hander = new $class();
+ session_set_save_handler(
+ array(&$hander,"open"),
+ array(&$hander,"close"),
+ array(&$hander,"read"),
+ array(&$hander,"write"),
+ array(&$hander,"destroy"),
+ array(&$hander,"gc"));
+ }
+ // 启动session
+ if(C('SESSION_AUTO_START')) session_start();
+ }elseif('' === $value){
+ if(0===strpos($name,'[')) { // session 操作
+ if('[pause]'==$name){ // 暂停session
+ session_write_close();
+ }elseif('[start]'==$name){ // 启动session
+ session_start();
+ }elseif('[destroy]'==$name){ // 销毁session
+ $_SESSION = array();
+ session_unset();
+ session_destroy();
+ }elseif('[regenerate]'==$name){ // 重新生成id
+ session_regenerate_id();
+ }
+ }elseif(0===strpos($name,'?')){ // 检查session
+ $name = substr($name,1);
+ if(strpos($name,'.')){ // 支持数组
+ list($name1,$name2) = explode('.',$name);
+ return $prefix?isset($_SESSION[$prefix][$name1][$name2]):isset($_SESSION[$name1][$name2]);
+ }else{
+ return $prefix?isset($_SESSION[$prefix][$name]):isset($_SESSION[$name]);
+ }
+ }elseif(is_null($name)){ // 清空session
+ if($prefix) {
+ unset($_SESSION[$prefix]);
+ }else{
+ $_SESSION = array();
+ }
+ }elseif($prefix){ // 获取session
+ if(strpos($name,'.')){
+ list($name1,$name2) = explode('.',$name);
+ return isset($_SESSION[$prefix][$name1][$name2])?$_SESSION[$prefix][$name1][$name2]:null;
+ }else{
+ return isset($_SESSION[$prefix][$name])?$_SESSION[$prefix][$name]:null;
+ }
+ }else{
+ if(strpos($name,'.')){
+ list($name1,$name2) = explode('.',$name);
+ return isset($_SESSION[$name1][$name2])?$_SESSION[$name1][$name2]:null;
+ }else{
+ return isset($_SESSION[$name])?$_SESSION[$name]:null;
+ }
+ }
+ }elseif(is_null($value)){ // 删除session
+ if($prefix){
+ unset($_SESSION[$prefix][$name]);
+ }else{
+ unset($_SESSION[$name]);
+ }
+ }else{ // 设置session
+ if($prefix){
+ if (!is_array($_SESSION[$prefix])) {
+ $_SESSION[$prefix] = array();
+ }
+ $_SESSION[$prefix][$name] = $value;
+ }else{
+ $_SESSION[$name] = $value;
+ }
+ }
+}
+
+/**
+ * Cookie 设置、获取、删除
+ * @param string $name cookie名称
+ * @param mixed $value cookie值
+ * @param mixed $options cookie参数
+ * @return mixed
+ */
+function cookie($name, $value='', $option=null) {
+ // 默认设置
+ $config = array(
+ 'prefix' => C('COOKIE_PREFIX'), // cookie 名称前缀
+ 'expire' => C('COOKIE_EXPIRE'), // cookie 保存时间
+ 'path' => C('COOKIE_PATH'), // cookie 保存路径
+ 'domain' => C('COOKIE_DOMAIN'), // cookie 有效域名
+ );
+ // 参数设置(会覆盖黙认设置)
+ if (!is_null($option)) {
+ if (is_numeric($option))
+ $option = array('expire' => $option);
+ elseif (is_string($option))
+ parse_str($option, $option);
+ $config = array_merge($config, array_change_key_case($option));
+ }
+ // 清除指定前缀的所有cookie
+ if (is_null($name)) {
+ if (empty($_COOKIE))
+ return;
+ // 要删除的cookie前缀,不指定则删除config设置的指定前缀
+ $prefix = empty($value) ? $config['prefix'] : $value;
+ if (!empty($prefix)) {// 如果前缀为空字符串将不作处理直接返回
+ foreach ($_COOKIE as $key => $val) {
+ if (0 === stripos($key, $prefix)) {
+ setcookie($key, '', time() - 3600, $config['path'], $config['domain']);
+ unset($_COOKIE[$key]);
+ }
+ }
+ }
+ return;
+ }
+ $name = $config['prefix'] . $name;
+ if ('' === $value) {
+ if(isset($_COOKIE[$name])){
+ $value = $_COOKIE[$name];
+ if(0===strpos($value,'think:')){
+ $value = substr($value,6);
+ return array_map('urldecode',json_decode(MAGIC_QUOTES_GPC?stripslashes($value):$value,true));
+ }else{
+ return $value;
+ }
+ }else{
+ return null;
+ }
+ } else {
+ if (is_null($value)) {
+ setcookie($name, '', time() - 3600, $config['path'], $config['domain']);
+ unset($_COOKIE[$name]); // 删除指定cookie
+ } else {
+ // 设置cookie
+ if(is_array($value)){
+ $value = 'think:'.json_encode(array_map('urlencode',$value));
+ }
+ $expire = !empty($config['expire']) ? time() + intval($config['expire']) : 0;
+ setcookie($name, $value, $expire, $config['path'], $config['domain']);
+ $_COOKIE[$name] = $value;
+ }
+ }
+}
+
+/**
+ * 加载动态扩展文件
+ * @return void
+ */
+function load_ext_file($path) {
+ // 加载自定义外部文件
+ if(C('LOAD_EXT_FILE')) {
+ $files = explode(',',C('LOAD_EXT_FILE'));
+ foreach ($files as $file){
+ $file = $path.'Common/'.$file.'.php';
+ if(is_file($file)) include $file;
+ }
+ }
+ // 加载自定义的动态配置文件
+ if(C('LOAD_EXT_CONFIG')) {
+ $configs = C('LOAD_EXT_CONFIG');
+ if(is_string($configs)) $configs = explode(',',$configs);
+ foreach ($configs as $key=>$config){
+ $file = $path.'Conf/'.$config.'.php';
+ if(is_file($file)) {
+ is_numeric($key)?C(include $file):C($key,include $file);
+ }
+ }
+ }
+}
+
+/**
+ * 获取客户端IP地址
+ * @param integer $type 返回类型 0 返回IP地址 1 返回IPV4地址数字
+ * @return mixed
+ */
+function get_client_ip($type = 0) {
+ $type = $type ? 1 : 0;
+ static $ip = NULL;
+ if ($ip !== NULL) return $ip[$type];
+ if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
+ $arr = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
+ $pos = array_search('unknown',$arr);
+ if(false !== $pos) unset($arr[$pos]);
+ $ip = trim($arr[0]);
+ }elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {
+ $ip = $_SERVER['HTTP_CLIENT_IP'];
+ }elseif (isset($_SERVER['REMOTE_ADDR'])) {
+ $ip = $_SERVER['REMOTE_ADDR'];
+ }
+ // IP地址合法验证
+ $long = sprintf("%u",ip2long($ip));
+ $ip = $long ? array($ip, $long) : array('0.0.0.0', 0);
+ return $ip[$type];
+}
+
+/**
+ * 发送HTTP状态
+ * @param integer $code 状态码
+ * @return void
+ */
+function send_http_status($code) {
+ static $_status = array(
+ // Success 2xx
+ 200 => 'OK',
+ // Redirection 3xx
+ 301 => 'Moved Permanently',
+ 302 => 'Moved Temporarily ', // 1.1
+ // Client Error 4xx
+ 400 => 'Bad Request',
+ 403 => 'Forbidden',
+ 404 => 'Not Found',
+ // Server Error 5xx
+ 500 => 'Internal Server Error',
+ 503 => 'Service Unavailable',
+ );
+ if(isset($_status[$code])) {
+ header('HTTP/1.1 '.$code.' '.$_status[$code]);
+ // 确保FastCGI模式下正常
+ header('Status:'.$code.' '.$_status[$code]);
+ }
+}
+
+// 不区分大小写的in_array实现
+function in_array_case($value,$array){
+ return in_array(strtolower($value),array_map('strtolower',$array));
+}
+
+function think_filter(&$value){
+ // TODO 其他安全过滤
+
+ // 过滤查询特殊字符
+ if(preg_match('/^(EXP|NEQ|GT|EGT|LT|ELT|OR|XOR|LIKE|NOTLIKE|NOT BETWEEN|NOTBETWEEN|BETWEEN|NOTIN|NOT IN|IN)$/i',$value)){
+ $value .= ' ';
+ }
+}
\ No newline at end of file
diff --git a/ThinkPHP/Mode/Lite/App.class.php b/ThinkPHP/Mode/Lite/App.class.php
new file mode 100644
index 0000000..78e5a14
--- /dev/null
+++ b/ThinkPHP/Mode/Lite/App.class.php
@@ -0,0 +1,156 @@
+
+// +----------------------------------------------------------------------
+namespace Think;
+/**
+ * ThinkPHP 应用程序类 执行应用过程管理
+ */
+class App {
+
+ /**
+ * 应用程序初始化
+ * @access public
+ * @return void
+ */
+ static public function init() {
+
+ // 日志目录转换为绝对路径 默认情况下存储到公共模块下面
+ C('LOG_PATH', realpath(LOG_PATH).'/Common/');
+
+ // 定义当前请求的系统常量
+ define('NOW_TIME', $_SERVER['REQUEST_TIME']);
+ define('REQUEST_METHOD',$_SERVER['REQUEST_METHOD']);
+ define('IS_GET', REQUEST_METHOD =='GET' ? true : false);
+ define('IS_POST', REQUEST_METHOD =='POST' ? true : false);
+ define('IS_PUT', REQUEST_METHOD =='PUT' ? true : false);
+ define('IS_DELETE', REQUEST_METHOD =='DELETE' ? true : false);
+
+ // URL调度
+ Dispatcher::dispatch();
+
+ if(C('REQUEST_VARS_FILTER')){
+ // 全局安全过滤
+ array_walk_recursive($_GET, 'think_filter');
+ array_walk_recursive($_POST, 'think_filter');
+ array_walk_recursive($_REQUEST, 'think_filter');
+ }
+
+ define('IS_AJAX', ((isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') || !empty($_POST[C('VAR_AJAX_SUBMIT')]) || !empty($_GET[C('VAR_AJAX_SUBMIT')])) ? true : false);
+
+ // TMPL_EXCEPTION_FILE 改为绝对地址
+ C('TMPL_EXCEPTION_FILE',realpath(C('TMPL_EXCEPTION_FILE')));
+ return ;
+ }
+
+ /**
+ * 执行应用程序
+ * @access public
+ * @return void
+ */
+ static public function exec() {
+
+ if(!preg_match('/^[A-Za-z](\/|\w)*$/',CONTROLLER_NAME)){ // 安全检测
+ $module = false;
+ }else{
+ //创建控制器实例
+ $module = controller(CONTROLLER_NAME);
+ }
+
+ if(!$module) {
+ // 是否定义Empty控制器
+ $module = A('Empty');
+ if(!$module){
+ E(L('_CONTROLLER_NOT_EXIST_').':'.CONTROLLER_NAME);
+ }
+ }
+
+ // 获取当前操作名 支持动态路由
+ $action = ACTION_NAME.C('ACTION_SUFFIX');
+
+ try{
+ if(!preg_match('/^[A-Za-z](\w)*$/',$action)){
+ // 非法操作
+ throw new \ReflectionException();
+ }
+ //执行当前操作
+ $method = new \ReflectionMethod($module, $action);
+ if($method->isPublic() && !$method->isStatic()) {
+ $class = new \ReflectionClass($module);
+ // URL参数绑定检测
+ if($method->getNumberOfParameters()>0 && C('URL_PARAMS_BIND')){
+ switch($_SERVER['REQUEST_METHOD']) {
+ case 'POST':
+ $vars = array_merge($_GET,$_POST);
+ break;
+ case 'PUT':
+ parse_str(file_get_contents('php://input'), $vars);
+ break;
+ default:
+ $vars = $_GET;
+ }
+ $params = $method->getParameters();
+ $paramsBindType = C('URL_PARAMS_BIND_TYPE');
+ foreach ($params as $param){
+ $name = $param->getName();
+ if( 1 == $paramsBindType && !empty($vars) ){
+ $args[] = array_shift($vars);
+ }elseif( 0 == $paramsBindType && isset($vars[$name])){
+ $args[] = $vars[$name];
+ }elseif($param->isDefaultValueAvailable()){
+ $args[] = $param->getDefaultValue();
+ }else{
+ E(L('_PARAM_ERROR_').':'.$name);
+ }
+ }
+ // 开启绑定参数过滤机制
+ if(C('URL_PARAMS_SAFE')){
+ $filters = C('URL_PARAMS_FILTER')?:C('DEFAULT_FILTER');
+ if($filters) {
+ $filters = explode(',',$filters);
+ foreach($filters as $filter){
+ $args = array_map_recursive($filter,$args); // 参数过滤
+ }
+ }
+ }
+ array_walk_recursive($args,'think_filter');
+ $method->invokeArgs($module,$args);
+ }else{
+ $method->invoke($module);
+ }
+ }else{
+ // 操作方法不是Public 抛出异常
+ throw new \ReflectionException();
+ }
+ } catch (\ReflectionException $e) {
+ // 方法调用发生异常后 引导到__call方法处理
+ $method = new \ReflectionMethod($module,'__call');
+ $method->invokeArgs($module,array($action,''));
+ }
+ return ;
+ }
+
+ /**
+ * 运行应用实例 入口文件使用的快捷方法
+ * @access public
+ * @return void
+ */
+ static public function run() {
+ App::init();
+ // Session初始化
+ if(!IS_CLI){
+ session(C('SESSION_OPTIONS'));
+ }
+ // 记录应用初始化时间
+ G('initTime');
+ App::exec();
+ return ;
+ }
+
+}
\ No newline at end of file
diff --git a/ThinkPHP/Mode/Lite/Controller.class.php b/ThinkPHP/Mode/Lite/Controller.class.php
new file mode 100644
index 0000000..9d25a7a
--- /dev/null
+++ b/ThinkPHP/Mode/Lite/Controller.class.php
@@ -0,0 +1,275 @@
+
+// +----------------------------------------------------------------------
+namespace Think;
+/**
+ * ThinkPHP 控制器基类 抽象类
+ */
+abstract class Controller {
+
+ /**
+ * 视图实例对象
+ * @var view
+ * @access protected
+ */
+ protected $view = null;
+
+ /**
+ * 控制器参数
+ * @var config
+ * @access protected
+ */
+ protected $config = array();
+
+ /**
+ * 架构函数 取得模板对象实例
+ * @access public
+ */
+ public function __construct() {
+ //实例化视图类
+ $this->view = Think::instance('Think\View');
+ //控制器初始化
+ if(method_exists($this,'_initialize'))
+ $this->_initialize();
+ }
+
+ /**
+ * 模板显示 调用内置的模板引擎显示方法,
+ * @access protected
+ * @param string $templateFile 指定要调用的模板文件
+ * 默认为空 由系统自动定位模板文件
+ * @param string $charset 输出编码
+ * @param string $contentType 输出类型
+ * @param string $content 输出内容
+ * @param string $prefix 模板缓存前缀
+ * @return void
+ */
+ protected function display($templateFile='',$charset='',$contentType='',$content='',$prefix='') {
+ $this->view->display($templateFile,$charset,$contentType,$content,$prefix);
+ }
+
+ /**
+ * 输出内容文本可以包括Html 并支持内容解析
+ * @access protected
+ * @param string $content 输出内容
+ * @param string $charset 模板输出字符集
+ * @param string $contentType 输出类型
+ * @param string $prefix 模板缓存前缀
+ * @return mixed
+ */
+ protected function show($content,$charset='',$contentType='',$prefix='') {
+ $this->view->display('',$charset,$contentType,$content,$prefix);
+ }
+
+ /**
+ * 获取输出页面内容
+ * 调用内置的模板引擎fetch方法,
+ * @access protected
+ * @param string $templateFile 指定要调用的模板文件
+ * 默认为空 由系统自动定位模板文件
+ * @param string $content 模板输出内容
+ * @param string $prefix 模板缓存前缀*
+ * @return string
+ */
+ protected function fetch($templateFile='',$content='',$prefix='') {
+ return $this->view->fetch($templateFile,$content,$prefix);
+ }
+
+ /**
+ * 模板主题设置
+ * @access protected
+ * @param string $theme 模版主题
+ * @return Action
+ */
+ protected function theme($theme){
+ $this->view->theme($theme);
+ return $this;
+ }
+
+ /**
+ * 模板变量赋值
+ * @access protected
+ * @param mixed $name 要显示的模板变量
+ * @param mixed $value 变量的值
+ * @return Action
+ */
+ protected function assign($name,$value='') {
+ $this->view->assign($name,$value);
+ return $this;
+ }
+
+ public function __set($name,$value) {
+ $this->assign($name,$value);
+ }
+
+ /**
+ * 取得模板显示变量的值
+ * @access protected
+ * @param string $name 模板显示变量
+ * @return mixed
+ */
+ public function get($name='') {
+ return $this->view->get($name);
+ }
+
+ public function __get($name) {
+ return $this->get($name);
+ }
+
+ /**
+ * 检测模板变量的值
+ * @access public
+ * @param string $name 名称
+ * @return boolean
+ */
+ public function __isset($name) {
+ return $this->get($name);
+ }
+
+ /**
+ * 魔术方法 有不存在的操作的时候执行
+ * @access public
+ * @param string $method 方法名
+ * @param array $args 参数
+ * @return mixed
+ */
+ public function __call($method,$args) {
+ if( 0 === strcasecmp($method,ACTION_NAME.C('ACTION_SUFFIX'))) {
+ if(method_exists($this,'_empty')) {
+ // 如果定义了_empty操作 则调用
+ $this->_empty($method,$args);
+ }elseif(file_exists_case($this->view->parseTemplate())){
+ // 检查是否存在默认模版 如果有直接输出模版
+ $this->display();
+ }else{
+ E(L('_ERROR_ACTION_').':'.ACTION_NAME);
+ }
+ }else{
+ E(__CLASS__.':'.$method.L('_METHOD_NOT_EXIST_'));
+ return;
+ }
+ }
+
+ /**
+ * 操作错误跳转的快捷方法
+ * @access protected
+ * @param string $message 错误信息
+ * @param string $jumpUrl 页面跳转地址
+ * @param mixed $ajax 是否为Ajax方式 当数字时指定跳转时间
+ * @return void
+ */
+ protected function error($message='',$jumpUrl='',$ajax=false) {
+ $this->dispatchJump($message,0,$jumpUrl,$ajax);
+ }
+
+ /**
+ * 操作成功跳转的快捷方法
+ * @access protected
+ * @param string $message 提示信息
+ * @param string $jumpUrl 页面跳转地址
+ * @param mixed $ajax 是否为Ajax方式 当数字时指定跳转时间
+ * @return void
+ */
+ protected function success($message='',$jumpUrl='',$ajax=false) {
+ $this->dispatchJump($message,1,$jumpUrl,$ajax);
+ }
+
+ /**
+ * Ajax方式返回数据到客户端
+ * @access protected
+ * @param mixed $data 要返回的数据
+ * @param String $type AJAX返回数据格式
+ * @param int $json_option 传递给json_encode的option参数
+ * @return void
+ */
+ protected function ajaxReturn($data,$type='',$json_option=0) {
+ if(empty($type)) $type = C('DEFAULT_AJAX_RETURN');
+ switch (strtoupper($type)){
+ case 'JSON' :
+ // 返回JSON数据格式到客户端 包含状态信息
+ header('Content-Type:application/json; charset=utf-8');
+ $data = json_encode($data,$json_option);
+ break;
+ case 'JSONP':
+ // 返回JSON数据格式到客户端 包含状态信息
+ header('Content-Type:application/json; charset=utf-8');
+ $handler = isset($_GET[C('VAR_JSONP_HANDLER')]) ? $_GET[C('VAR_JSONP_HANDLER')] : C('DEFAULT_JSONP_HANDLER');
+ $data = $handler.'('.json_encode($data,$json_option).');';
+ break;
+ case 'EVAL' :
+ // 返回可执行的js脚本
+ header('Content-Type:text/html; charset=utf-8');
+ break;
+ }
+ exit($data);
+ }
+
+ /**
+ * Action跳转(URL重定向) 支持指定模块和延时跳转
+ * @access protected
+ * @param string $url 跳转的URL表达式
+ * @param array $params 其它URL参数
+ * @param integer $delay 延时跳转的时间 单位为秒
+ * @param string $msg 跳转提示信息
+ * @return void
+ */
+ protected function redirect($url,$params=array(),$delay=0,$msg='') {
+ $url = U($url,$params);
+ redirect($url,$delay,$msg);
+ }
+
+ /**
+ * 默认跳转操作 支持错误导向和正确跳转
+ * 调用模板显示 默认为public目录下面的success页面
+ * 提示页面为可配置 支持模板标签
+ * @param string $message 提示信息
+ * @param Boolean $status 状态
+ * @param string $jumpUrl 页面跳转地址
+ * @param mixed $ajax 是否为Ajax方式 当数字时指定跳转时间
+ * @access private
+ * @return void
+ */
+ private function dispatchJump($message,$status=1,$jumpUrl='',$ajax=false) {
+ if(true === $ajax || IS_AJAX) {// AJAX提交
+ $data = is_array($ajax)?$ajax:array();
+ $data['info'] = $message;
+ $data['status'] = $status;
+ $data['url'] = $jumpUrl;
+ $this->ajaxReturn($data);
+ }
+ if(is_int($ajax)) $this->assign('waitSecond',$ajax);
+ if(!empty($jumpUrl)) $this->assign('jumpUrl',$jumpUrl);
+ // 提示标题
+ $this->assign('msgTitle',$status? L('_OPERATION_SUCCESS_') : L('_OPERATION_FAIL_'));
+ //如果设置了关闭窗口,则提示完毕后自动关闭窗口
+ if($this->get('closeWin')) $this->assign('jumpUrl','javascript:window.close();');
+ $this->assign('status',$status); // 状态
+ //保证输出不受静态缓存影响
+ C('HTML_CACHE_ON',false);
+ if($status) { //发送成功信息
+ $this->assign('message',$message);// 提示信息
+ // 成功操作后默认停留1秒
+ if(!isset($this->waitSecond)) $this->assign('waitSecond','1');
+ // 默认操作成功自动返回操作前页面
+ if(!isset($this->jumpUrl)) $this->assign("jumpUrl",$_SERVER["HTTP_REFERER"]);
+ $this->display(C('TMPL_ACTION_SUCCESS'));
+ }else{
+ $this->assign('error',$message);// 提示信息
+ //发生错误时候默认停留3秒
+ if(!isset($this->waitSecond)) $this->assign('waitSecond','3');
+ // 默认发生错误的话自动返回上页
+ if(!isset($this->jumpUrl)) $this->assign('jumpUrl',"javascript:history.back(-1);");
+ $this->display(C('TMPL_ACTION_ERROR'));
+ // 中止执行 避免出错后继续执行
+ exit ;
+ }
+ }
+
+}
diff --git a/ThinkPHP/Mode/Lite/Dispatcher.class.php b/ThinkPHP/Mode/Lite/Dispatcher.class.php
new file mode 100644
index 0000000..ff5c5dc
--- /dev/null
+++ b/ThinkPHP/Mode/Lite/Dispatcher.class.php
@@ -0,0 +1,264 @@
+
+// +----------------------------------------------------------------------
+namespace Think;
+/**
+ * ThinkPHP内置的Dispatcher类
+ * 完成URL解析、路由和调度
+ */
+class Dispatcher {
+
+ /**
+ * URL映射到控制器
+ * @access public
+ * @return void
+ */
+ static public function dispatch() {
+ $varPath = C('VAR_PATHINFO');
+ $varModule = C('VAR_MODULE');
+ $varController = C('VAR_CONTROLLER');
+ $varAction = C('VAR_ACTION');
+ $urlCase = C('URL_CASE_INSENSITIVE');
+ if(isset($_GET[$varPath])) { // 判断URL里面是否有兼容模式参数
+ $_SERVER['PATH_INFO'] = $_GET[$varPath];
+ unset($_GET[$varPath]);
+ }elseif(IS_CLI){ // CLI模式下 index.php module/controller/action/params/...
+ $_SERVER['PATH_INFO'] = isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : '';
+ }
+
+ // 开启子域名部署
+ if(C('APP_SUB_DOMAIN_DEPLOY')) {
+ $rules = C('APP_SUB_DOMAIN_RULES');
+ if(isset($rules[$_SERVER['HTTP_HOST']])) { // 完整域名或者IP配置
+ define('APP_DOMAIN',$_SERVER['HTTP_HOST']); // 当前完整域名
+ $rule = $rules[APP_DOMAIN];
+ }else{
+ if(strpos(C('APP_DOMAIN_SUFFIX'),'.')){ // com.cn net.cn
+ $domain = array_slice(explode('.', $_SERVER['HTTP_HOST']), 0, -3);
+ }else{
+ $domain = array_slice(explode('.', $_SERVER['HTTP_HOST']), 0, -2);
+ }
+ if(!empty($domain)) {
+ $subDomain = implode('.', $domain);
+ define('SUB_DOMAIN',$subDomain); // 当前完整子域名
+ $domain2 = array_pop($domain); // 二级域名
+ if($domain) { // 存在三级域名
+ $domain3 = array_pop($domain);
+ }
+ if(isset($rules[$subDomain])) { // 子域名
+ $rule = $rules[$subDomain];
+ }elseif(isset($rules['*.' . $domain2]) && !empty($domain3)){ // 泛三级域名
+ $rule = $rules['*.' . $domain2];
+ $panDomain = $domain3;
+ }elseif(isset($rules['*']) && !empty($domain2) && 'www' != $domain2 ){ // 泛二级域名
+ $rule = $rules['*'];
+ $panDomain = $domain2;
+ }
+ }
+ }
+
+ if(!empty($rule)) {
+ // 子域名部署规则 '子域名'=>array('模块名','var1=a&var2=b');
+ if(is_array($rule)){
+ list($rule,$vars) = $rule;
+ }
+ $array = explode('/',$rule);
+ // 模块绑定
+ define('BIND_MODULE',array_shift($array));
+
+ if(isset($vars)) { // 传入参数
+ parse_str($vars,$parms);
+ if(isset($panDomain)){
+ $pos = array_search('*', $parms);
+ if(false !== $pos) {
+ // 泛域名作为参数
+ $parms[$pos] = $panDomain;
+ }
+ }
+ $_GET = array_merge($_GET,$parms);
+ }
+ }
+ }
+ // 分析PATHINFO信息
+ if(!isset($_SERVER['PATH_INFO'])) {
+ $types = explode(',',C('URL_PATHINFO_FETCH'));
+ foreach ($types as $type){
+ if(0===strpos($type,':')) {// 支持函数判断
+ $_SERVER['PATH_INFO'] = call_user_func(substr($type,1));
+ break;
+ }elseif(!empty($_SERVER[$type])) {
+ $_SERVER['PATH_INFO'] = (0 === strpos($_SERVER[$type],$_SERVER['SCRIPT_NAME']))?
+ substr($_SERVER[$type], strlen($_SERVER['SCRIPT_NAME'])) : $_SERVER[$type];
+ break;
+ }
+ }
+ }
+
+ $depr = C('URL_PATHINFO_DEPR');
+ define('MODULE_PATHINFO_DEPR', $depr);
+
+ if(empty($_SERVER['PATH_INFO'])) {
+ $_SERVER['PATH_INFO'] = '';
+ define('__INFO__','');
+ define('__EXT__','');
+ }else{
+ define('__INFO__',trim($_SERVER['PATH_INFO'],'/'));
+ // URL后缀
+ define('__EXT__', strtolower(pathinfo($_SERVER['PATH_INFO'],PATHINFO_EXTENSION)));
+ $_SERVER['PATH_INFO'] = __INFO__;
+ if(!defined('BIND_MODULE') && (!C('URL_ROUTER_ON') || !Route::check())){
+ if (__INFO__ ){ // 获取模块名
+ $paths = explode($depr,__INFO__,2);
+ $allowList = C('MODULE_ALLOW_LIST'); // 允许的模块列表
+ $module = preg_replace('/\.' . __EXT__ . '$/i', '',$paths[0]);
+ if( empty($allowList) || (is_array($allowList) && in_array_case($module, $allowList))){
+ $_GET[$varModule] = $module;
+ $_SERVER['PATH_INFO'] = isset($paths[1])?$paths[1]:'';
+ }
+ }
+ }
+ }
+
+ // URL常量
+ define('__SELF__',strip_tags($_SERVER[C('URL_REQUEST_URI')]));
+
+ // 获取模块名称
+ define('MODULE_NAME', defined('BIND_MODULE')? BIND_MODULE : self::getModule($varModule));
+
+ // 检测模块是否存在
+ if( MODULE_NAME && (defined('BIND_MODULE') || !in_array_case(MODULE_NAME,C('MODULE_DENY_LIST')) ) && is_dir(APP_PATH.MODULE_NAME)){
+ // 定义当前模块路径
+ define('MODULE_PATH', APP_PATH.MODULE_NAME.'/');
+ // 定义当前模块的模版缓存路径
+ C('CACHE_PATH',CACHE_PATH.MODULE_NAME.'/');
+ // 定义当前模块的日志目录
+ C('LOG_PATH', realpath(LOG_PATH).'/'.MODULE_NAME.'/');
+
+ // 加载模块配置文件
+ if(is_file(MODULE_PATH.'Conf/config'.CONF_EXT))
+ C(load_config(MODULE_PATH.'Conf/config'.CONF_EXT));
+
+ // 加载模块别名定义
+ if(is_file(MODULE_PATH.'Conf/alias.php'))
+ Think::addMap(include MODULE_PATH.'Conf/alias.php');
+
+ // 加载模块函数文件
+ if(is_file(MODULE_PATH.'Common/function.php'))
+ include MODULE_PATH.'Common/function.php';
+ }else{
+ E(L('_MODULE_NOT_EXIST_').':'.MODULE_NAME);
+ }
+
+ if(!defined('__APP__')){
+ $urlMode = C('URL_MODEL');
+ if($urlMode == URL_COMPAT ){// 兼容模式判断
+ define('PHP_FILE',_PHP_FILE_.'?'.$varPath.'=');
+ }elseif($urlMode == URL_REWRITE ) {
+ $url = dirname(_PHP_FILE_);
+ if($url == '/' || $url == '\\')
+ $url = '';
+ define('PHP_FILE',$url);
+ }else {
+ define('PHP_FILE',_PHP_FILE_);
+ }
+ // 当前应用地址
+ define('__APP__',strip_tags(PHP_FILE));
+ }
+ // 模块URL地址
+ $moduleName = defined('MODULE_ALIAS')? MODULE_ALIAS : MODULE_NAME;
+ define('__MODULE__',defined('BIND_MODULE') ? __APP__ : __APP__.'/'.($urlCase ? strtolower($moduleName) : $moduleName));
+
+ if('' != $_SERVER['PATH_INFO'] && (!C('URL_ROUTER_ON') || !Route::check()) ){ // 检测路由规则 如果没有则按默认规则调度URL
+ // 检查禁止访问的URL后缀
+ if(C('URL_DENY_SUFFIX') && preg_match('/\.('.trim(C('URL_DENY_SUFFIX'),'.').')$/i', $_SERVER['PATH_INFO'])){
+ send_http_status(404);
+ exit;
+ }
+
+ // 去除URL后缀
+ $_SERVER['PATH_INFO'] = preg_replace(C('URL_HTML_SUFFIX')? '/\.('.trim(C('URL_HTML_SUFFIX'),'.').')$/i' : '/\.'.__EXT__.'$/i', '', $_SERVER['PATH_INFO']);
+
+ $depr = C('URL_PATHINFO_DEPR');
+ $paths = explode($depr,trim($_SERVER['PATH_INFO'],$depr));
+
+ $_GET[$varController] = array_shift($paths);
+ // 获取操作
+ $_GET[$varAction] = array_shift($paths);
+
+ // 解析剩余的URL参数
+ $var = array();
+ if(C('URL_PARAMS_BIND') && 1 == C('URL_PARAMS_BIND_TYPE')){
+ // URL参数按顺序绑定变量
+ $var = $paths;
+ }else{
+ preg_replace_callback('/(\w+)\/([^\/]+)/', function($match) use(&$var){$var[$match[1]]=strip_tags($match[2]);}, implode('/',$paths));
+ }
+ $_GET = array_merge($var,$_GET);
+ }
+ // 获取控制器和操作名
+ define('CONTROLLER_NAME', self::getController($varController,$urlCase));
+ define('ACTION_NAME', self::getAction($varAction,$urlCase));
+
+ // 当前控制器的UR地址
+ define('__CONTROLLER__',__MODULE__.$depr.( $urlCase ? parse_name(CONTROLLER_NAME) : CONTROLLER_NAME ) );
+
+ // 当前操作的URL地址
+ define('__ACTION__',__CONTROLLER__.$depr.ACTION_NAME);
+
+ //保证$_REQUEST正常取值
+ $_REQUEST = array_merge($_POST,$_GET);
+ }
+
+ /**
+ * 获得实际的控制器名称
+ */
+ static private function getController($var,$urlCase) {
+ $controller = (!empty($_GET[$var])? $_GET[$var]:C('DEFAULT_CONTROLLER'));
+ unset($_GET[$var]);
+ if($urlCase) {
+ // URL地址不区分大小写
+ // 智能识别方式 user_type 识别到 UserTypeController 控制器
+ $controller = parse_name($controller,1);
+ }
+ return strip_tags(ucfirst($controller));
+ }
+
+ /**
+ * 获得实际的操作名称
+ */
+ static private function getAction($var,$urlCase) {
+ $action = !empty($_POST[$var]) ?
+ $_POST[$var] :
+ (!empty($_GET[$var])?$_GET[$var]:C('DEFAULT_ACTION'));
+ unset($_POST[$var],$_GET[$var]);
+ return strip_tags( $urlCase? strtolower($action) : $action );
+ }
+
+ /**
+ * 获得实际的模块名称
+ */
+ static private function getModule($var) {
+ $module = (!empty($_GET[$var])?$_GET[$var]:C('DEFAULT_MODULE'));
+ unset($_GET[$var]);
+ if($maps = C('URL_MODULE_MAP')) {
+ if(isset($maps[strtolower($module)])) {
+ // 记录当前别名
+ define('MODULE_ALIAS',strtolower($module));
+ // 获取实际的模块名
+ return ucfirst($maps[MODULE_ALIAS]);
+ }elseif(array_search(strtolower($module),$maps)){
+ // 禁止访问原始模块
+ return '';
+ }
+ }
+ return strip_tags(ucfirst($module));
+ }
+
+}
diff --git a/ThinkPHP/Mode/Lite/Model.class.php b/ThinkPHP/Mode/Lite/Model.class.php
new file mode 100644
index 0000000..9135078
--- /dev/null
+++ b/ThinkPHP/Mode/Lite/Model.class.php
@@ -0,0 +1,1485 @@
+
+// +----------------------------------------------------------------------
+namespace Think;
+/**
+ * ThinkPHP Model模型类
+ * 实现了ORM和ActiveRecords模式
+ */
+class Model {
+
+ // 当前数据库操作对象
+ protected $db = null;
+ // 数据库对象池
+ private $_db = array();
+ // 主键名称
+ protected $pk = 'id';
+ // 主键是否自动增长
+ protected $autoinc = false;
+ // 数据表前缀
+ protected $tablePrefix = null;
+ // 模型名称
+ protected $name = '';
+ // 数据库名称
+ protected $dbName = '';
+ //数据库配置
+ protected $connection = '';
+ // 数据表名(不包含表前缀)
+ protected $tableName = '';
+ // 实际数据表名(包含表前缀)
+ protected $trueTableName = '';
+ // 最近错误信息
+ protected $error = '';
+ // 字段信息
+ protected $fields = array();
+ // 数据信息
+ protected $data = array();
+ // 查询表达式参数
+ protected $options = array();
+ protected $_validate = array(); // 自动验证定义
+ protected $_auto = array(); // 自动完成定义
+ protected $_map = array(); // 字段映射定义
+ protected $_scope = array(); // 命名范围定义
+ // 是否自动检测数据表字段信息
+ protected $autoCheckFields = true;
+ // 是否批处理验证
+ protected $patchValidate = false;
+ // 链操作方法列表
+ protected $methods = array('strict','order','alias','having','group','lock','distinct','auto','filter','validate','result','token','index','force');
+
+ /**
+ * 架构函数
+ * 取得DB类的实例对象 字段检查
+ * @access public
+ * @param string $name 模型名称
+ * @param string $tablePrefix 表前缀
+ * @param mixed $connection 数据库连接信息
+ */
+ public function __construct($name='',$tablePrefix='',$connection='') {
+ // 模型初始化
+ $this->_initialize();
+ // 获取模型名称
+ if(!empty($name)) {
+ if(strpos($name,'.')) { // 支持 数据库名.模型名的 定义
+ list($this->dbName,$this->name) = explode('.',$name);
+ }else{
+ $this->name = $name;
+ }
+ }elseif(empty($this->name)){
+ $this->name = $this->getModelName();
+ }
+ // 设置表前缀
+ if(is_null($tablePrefix)) {// 前缀为Null表示没有前缀
+ $this->tablePrefix = '';
+ }elseif('' != $tablePrefix) {
+ $this->tablePrefix = $tablePrefix;
+ }elseif(!isset($this->tablePrefix)){
+ $this->tablePrefix = C('DB_PREFIX');
+ }
+
+ // 数据库初始化操作
+ // 获取数据库操作对象
+ // 当前模型有独立的数据库连接信息
+ $this->db(0,empty($this->connection)?$connection:$this->connection,true);
+ }
+
+ /**
+ * 自动检测数据表信息
+ * @access protected
+ * @return void
+ */
+ protected function _checkTableInfo() {
+ // 如果不是Model类 自动记录数据表信息
+ // 只在第一次执行记录
+ if(empty($this->fields)) {
+ // 如果数据表字段没有定义则自动获取
+ if(C('DB_FIELDS_CACHE')) {
+ $db = $this->dbName?:C('DB_NAME');
+ $fields = F('_fields/'.strtolower($db.'.'.$this->tablePrefix.$this->name));
+ if($fields) {
+ $this->fields = $fields;
+ if(!empty($fields['_pk'])){
+ $this->pk = $fields['_pk'];
+ }
+ return ;
+ }
+ }
+ // 每次都会读取数据表信息
+ $this->flush();
+ }
+ }
+
+ /**
+ * 获取字段信息并缓存
+ * @access public
+ * @return void
+ */
+ public function flush() {
+ // 缓存不存在则查询数据表信息
+ $this->db->setModel($this->name);
+ $fields = $this->db->getFields($this->getTableName());
+ if(!$fields) { // 无法获取字段信息
+ return false;
+ }
+ $this->fields = array_keys($fields);
+ unset($this->fields['_pk']);
+ foreach ($fields as $key=>$val){
+ // 记录字段类型
+ $type[$key] = $val['type'];
+ if($val['primary']) {
+ // 增加复合主键支持
+ if (isset($this->fields['_pk']) && $this->fields['_pk'] != null) {
+ if (is_string($this->fields['_pk'])) {
+ $this->pk = array($this->fields['_pk']);
+ $this->fields['_pk'] = $this->pk;
+ }
+ $this->pk[] = $key;
+ $this->fields['_pk'][] = $key;
+ } else {
+ $this->pk = $key;
+ $this->fields['_pk'] = $key;
+ }
+ if($val['autoinc']) $this->autoinc = true;
+ }
+ }
+ // 记录字段类型信息
+ $this->fields['_type'] = $type;
+
+ // 2008-3-7 增加缓存开关控制
+ if(C('DB_FIELDS_CACHE')){
+ // 永久缓存数据表信息
+ $db = $this->dbName?:C('DB_NAME');
+ F('_fields/'.strtolower($db.'.'.$this->tablePrefix.$this->name),$this->fields);
+ }
+ }
+
+ /**
+ * 设置数据对象的值
+ * @access public
+ * @param string $name 名称
+ * @param mixed $value 值
+ * @return void
+ */
+ public function __set($name,$value) {
+ // 设置数据对象属性
+ $this->data[$name] = $value;
+ }
+
+ /**
+ * 获取数据对象的值
+ * @access public
+ * @param string $name 名称
+ * @return mixed
+ */
+ public function __get($name) {
+ return isset($this->data[$name])?$this->data[$name]:null;
+ }
+
+ /**
+ * 检测数据对象的值
+ * @access public
+ * @param string $name 名称
+ * @return boolean
+ */
+ public function __isset($name) {
+ return isset($this->data[$name]);
+ }
+
+ /**
+ * 销毁数据对象的值
+ * @access public
+ * @param string $name 名称
+ * @return void
+ */
+ public function __unset($name) {
+ unset($this->data[$name]);
+ }
+
+ /**
+ * 利用__call方法实现一些特殊的Model方法
+ * @access public
+ * @param string $method 方法名称
+ * @param array $args 调用参数
+ * @return mixed
+ */
+ public function __call($method,$args) {
+ if(in_array(strtolower($method),$this->methods,true)) {
+ // 连贯操作的实现
+ $this->options[strtolower($method)] = $args[0];
+ return $this;
+ }elseif(in_array(strtolower($method),array('count','sum','min','max','avg'),true)){
+ // 统计查询的实现
+ $field = isset($args[0])?$args[0]:'*';
+ return $this->getField(strtoupper($method).'('.$field.') AS tp_'.$method);
+ }elseif(strtolower(substr($method,0,5))=='getby') {
+ // 根据某个字段获取记录
+ $field = parse_name(substr($method,5));
+ $where[$field] = $args[0];
+ return $this->where($where)->find();
+ }elseif(strtolower(substr($method,0,10))=='getfieldby') {
+ // 根据某个字段获取记录的某个值
+ $name = parse_name(substr($method,10));
+ $where[$name] =$args[0];
+ return $this->where($where)->getField($args[1]);
+ }elseif(isset($this->_scope[$method])){// 命名范围的单独调用支持
+ return $this->scope($method,$args[0]);
+ }else{
+ E(__CLASS__.':'.$method.L('_METHOD_NOT_EXIST_'));
+ return;
+ }
+ }
+ // 回调方法 初始化模型
+ protected function _initialize() {}
+
+ /**
+ * 对保存到数据库的数据进行处理
+ * @access protected
+ * @param mixed $data 要操作的数据
+ * @return boolean
+ */
+ protected function _facade($data) {
+
+ // 检查数据字段合法性
+ if(!empty($this->fields)) {
+ if(!empty($this->options['field'])) {
+ $fields = $this->options['field'];
+ unset($this->options['field']);
+ if(is_string($fields)) {
+ $fields = explode(',',$fields);
+ }
+ }else{
+ $fields = $this->fields;
+ }
+ foreach ($data as $key=>$val){
+ if(!in_array($key,$fields,true)){
+ if(!empty($this->options['strict'])){
+ E(L('_DATA_TYPE_INVALID_').':['.$key.'=>'.$val.']');
+ }
+ unset($data[$key]);
+ }elseif(is_scalar($val)) {
+ // 字段类型检查 和 强制转换
+ $this->_parseType($data,$key);
+ }
+ }
+ }
+
+ // 安全过滤
+ if(!empty($this->options['filter'])) {
+ $data = array_map($this->options['filter'],$data);
+ unset($this->options['filter']);
+ }
+ $this->_before_write($data);
+ return $data;
+ }
+
+ // 写入数据前的回调方法 包括新增和更新
+ protected function _before_write(&$data) {}
+
+ /**
+ * 新增数据
+ * @access public
+ * @param mixed $data 数据
+ * @param array $options 表达式
+ * @param boolean $replace 是否replace
+ * @return mixed
+ */
+ public function add($data='',$options=array(),$replace=false) {
+ if(empty($data)) {
+ // 没有传递数据,获取当前数据对象的值
+ if(!empty($this->data)) {
+ $data = $this->data;
+ // 重置数据
+ $this->data = array();
+ }else{
+ $this->error = L('_DATA_TYPE_INVALID_');
+ return false;
+ }
+ }
+ // 数据处理
+ $data = $this->_facade($data);
+ // 分析表达式
+ $options = $this->_parseOptions($options);
+ if(false === $this->_before_insert($data,$options)) {
+ return false;
+ }
+ // 写入数据到数据库
+ $result = $this->db->insert($data,$options,$replace);
+ if(false !== $result && is_numeric($result)) {
+ $pk = $this->getPk();
+ // 增加复合主键支持
+ if (is_array($pk)) return $result;
+ $insertId = $this->getLastInsID();
+ if($insertId) {
+ // 自增主键返回插入ID
+ $data[$pk] = $insertId;
+ if(false === $this->_after_insert($data,$options)) {
+ return false;
+ }
+ return $insertId;
+ }
+ if(false === $this->_after_insert($data,$options)) {
+ return false;
+ }
+ }
+ return $result;
+ }
+ // 插入数据前的回调方法
+ protected function _before_insert(&$data,$options) {}
+ // 插入成功后的回调方法
+ protected function _after_insert($data,$options) {}
+
+ public function addAll($dataList,$options=array(),$replace=false){
+ if(empty($dataList)) {
+ $this->error = L('_DATA_TYPE_INVALID_');
+ return false;
+ }
+ // 数据处理
+ foreach ($dataList as $key=>$data){
+ $dataList[$key] = $this->_facade($data);
+ }
+ // 分析表达式
+ $options = $this->_parseOptions($options);
+ // 写入数据到数据库
+ $result = $this->db->insertAll($dataList,$options,$replace);
+ if(false !== $result ) {
+ $insertId = $this->getLastInsID();
+ if($insertId) {
+ return $insertId;
+ }
+ }
+ return $result;
+ }
+
+ /**
+ * 保存数据
+ * @access public
+ * @param mixed $data 数据
+ * @param array $options 表达式
+ * @return boolean
+ */
+ public function save($data='',$options=array()) {
+ if(empty($data)) {
+ // 没有传递数据,获取当前数据对象的值
+ if(!empty($this->data)) {
+ $data = $this->data;
+ // 重置数据
+ $this->data = array();
+ }else{
+ $this->error = L('_DATA_TYPE_INVALID_');
+ return false;
+ }
+ }
+ // 数据处理
+ $data = $this->_facade($data);
+ if(empty($data)){
+ // 没有数据则不执行
+ $this->error = L('_DATA_TYPE_INVALID_');
+ return false;
+ }
+ // 分析表达式
+ $options = $this->_parseOptions($options);
+ $pk = $this->getPk();
+ if(!isset($options['where']) ) {
+ // 如果存在主键数据 则自动作为更新条件
+ if (is_string($pk) && isset($data[$pk])) {
+ $where[$pk] = $data[$pk];
+ unset($data[$pk]);
+ } elseif (is_array($pk)) {
+ // 增加复合主键支持
+ foreach ($pk as $field) {
+ if(isset($data[$field])) {
+ $where[$field] = $data[$field];
+ } else {
+ // 如果缺少复合主键数据则不执行
+ $this->error = L('_OPERATION_WRONG_');
+ return false;
+ }
+ unset($data[$field]);
+ }
+ }
+ if(!isset($where)){
+ // 如果没有任何更新条件则不执行
+ $this->error = L('_OPERATION_WRONG_');
+ return false;
+ }else{
+ $options['where'] = $where;
+ }
+ }
+
+ if(is_array($options['where']) && isset($options['where'][$pk])){
+ $pkValue = $options['where'][$pk];
+ }
+ if(false === $this->_before_update($data,$options)) {
+ return false;
+ }
+ $result = $this->db->update($data,$options);
+ if(false !== $result && is_numeric($result)) {
+ if(isset($pkValue)) $data[$pk] = $pkValue;
+ $this->_after_update($data,$options);
+ }
+ return $result;
+ }
+ // 更新数据前的回调方法
+ protected function _before_update(&$data,$options) {}
+ // 更新成功后的回调方法
+ protected function _after_update($data,$options) {}
+
+ /**
+ * 删除数据
+ * @access public
+ * @param mixed $options 表达式
+ * @return mixed
+ */
+ public function delete($options=array()) {
+ $pk = $this->getPk();
+ if(empty($options) && empty($this->options['where'])) {
+ // 如果删除条件为空 则删除当前数据对象所对应的记录
+ if(!empty($this->data) && isset($this->data[$pk]))
+ return $this->delete($this->data[$pk]);
+ else
+ return false;
+ }
+ if(is_numeric($options) || is_string($options)) {
+ // 根据主键删除记录
+ if(strpos($options,',')) {
+ $where[$pk] = array('IN', $options);
+ }else{
+ $where[$pk] = $options;
+ }
+ $options = array();
+ $options['where'] = $where;
+ }
+ // 根据复合主键删除记录
+ if (is_array($options) && (count($options) > 0) && is_array($pk)) {
+ $count = 0;
+ foreach (array_keys($options) as $key) {
+ if (is_int($key)) $count++;
+ }
+ if ($count == count($pk)) {
+ $i = 0;
+ foreach ($pk as $field) {
+ $where[$field] = $options[$i];
+ unset($options[$i++]);
+ }
+ $options['where'] = $where;
+ } else {
+ return false;
+ }
+ }
+ // 分析表达式
+ $options = $this->_parseOptions($options);
+ if(empty($options['where'])){
+ // 如果条件为空 不进行删除操作 除非设置 1=1
+ return false;
+ }
+ if(is_array($options['where']) && isset($options['where'][$pk])){
+ $pkValue = $options['where'][$pk];
+ }
+
+ if(false === $this->_before_delete($options)) {
+ return false;
+ }
+ $result = $this->db->delete($options);
+ if(false !== $result && is_numeric($result)) {
+ $data = array();
+ if(isset($pkValue)) $data[$pk] = $pkValue;
+ $this->_after_delete($data,$options);
+ }
+ // 返回删除记录个数
+ return $result;
+ }
+ // 删除数据前的回调方法
+ protected function _before_delete($options) {}
+ // 删除成功后的回调方法
+ protected function _after_delete($data,$options) {}
+
+ /**
+ * 查询数据集
+ * @access public
+ * @param array $options 表达式参数
+ * @return mixed
+ */
+ public function select($options=array()) {
+ $pk = $this->getPk();
+ if(is_string($options) || is_numeric($options)) {
+ // 根据主键查询
+ if(strpos($options,',')) {
+ $where[$pk] = array('IN',$options);
+ }else{
+ $where[$pk] = $options;
+ }
+ $options = array();
+ $options['where'] = $where;
+ }elseif (is_array($options) && (count($options) > 0) && is_array($pk)) {
+ // 根据复合主键查询
+ $count = 0;
+ foreach (array_keys($options) as $key) {
+ if (is_int($key)) $count++;
+ }
+ if ($count == count($pk)) {
+ $i = 0;
+ foreach ($pk as $field) {
+ $where[$field] = $options[$i];
+ unset($options[$i++]);
+ }
+ $options['where'] = $where;
+ } else {
+ return false;
+ }
+ } elseif(false === $options){ // 用于子查询 不查询只返回SQL
+ $options = array();
+ // 分析表达式
+ $options = $this->_parseOptions($options);
+ return '( '.$this->fetchSql(true)->select($options).' )';
+ }
+ // 分析表达式
+ $options = $this->_parseOptions($options);
+ // 判断查询缓存
+ if(isset($options['cache'])){
+ $cache = $options['cache'];
+ $key = is_string($cache['key'])?$cache['key']:md5(serialize($options));
+ $data = S($key,'',$cache);
+ if(false !== $data){
+ return $data;
+ }
+ }
+ $resultSet = $this->db->select($options);
+ if(false === $resultSet) {
+ return false;
+ }
+ if(empty($resultSet)) { // 查询结果为空
+ return null;
+ }
+
+ if(is_string($resultSet)){
+ return $resultSet;
+ }
+
+ $resultSet = array_map(array($this,'_read_data'),$resultSet);
+ $this->_after_select($resultSet,$options);
+ if(isset($options['index'])){ // 对数据集进行索引
+ $index = explode(',',$options['index']);
+ foreach ($resultSet as $result){
+ $_key = $result[$index[0]];
+ if(isset($index[1]) && isset($result[$index[1]])){
+ $cols[$_key] = $result[$index[1]];
+ }else{
+ $cols[$_key] = $result;
+ }
+ }
+ $resultSet = $cols;
+ }
+ if(isset($cache)){
+ S($key,$resultSet,$cache);
+ }
+ return $resultSet;
+ }
+ // 查询成功后的回调方法
+ protected function _after_select(&$resultSet,$options) {}
+
+ /**
+ * 分析表达式
+ * @access protected
+ * @param array $options 表达式参数
+ * @return array
+ */
+ protected function _parseOptions($options=array()) {
+ if(is_array($options))
+ $options = array_merge($this->options,$options);
+
+ if(!isset($options['table'])){
+ // 自动获取表名
+ $options['table'] = $this->getTableName();
+ $fields = $this->fields;
+ }else{
+ // 指定数据表 则重新获取字段列表 但不支持类型检测
+ $fields = $this->getDbFields();
+ }
+
+ // 数据表别名
+ if(!empty($options['alias'])) {
+ $options['table'] .= ' '.$options['alias'];
+ }
+ // 记录操作的模型名称
+ $options['model'] = $this->name;
+
+ // 字段类型验证
+ if(isset($options['where']) && is_array($options['where']) && !empty($fields) && !isset($options['join'])) {
+ // 对数组查询条件进行字段类型检查
+ foreach ($options['where'] as $key=>$val){
+ $key = trim($key);
+ if(in_array($key,$fields,true)){
+ if(is_scalar($val)) {
+ $this->_parseType($options['where'],$key);
+ }
+ }elseif(!is_numeric($key) && '_' != substr($key,0,1) && false === strpos($key,'.') && false === strpos($key,'(') && false === strpos($key,'|') && false === strpos($key,'&')){
+ if(!empty($this->options['strict'])){
+ E(L('_ERROR_QUERY_EXPRESS_').':['.$key.'=>'.$val.']');
+ }
+ unset($options['where'][$key]);
+ }
+ }
+ }
+ // 查询过后清空sql表达式组装 避免影响下次查询
+ $this->options = array();
+ // 表达式过滤
+ $this->_options_filter($options);
+ return $options;
+ }
+ // 表达式过滤回调方法
+ protected function _options_filter(&$options) {}
+
+ /**
+ * 数据类型检测
+ * @access protected
+ * @param mixed $data 数据
+ * @param string $key 字段名
+ * @return void
+ */
+ protected function _parseType(&$data,$key) {
+ if(!isset($this->options['bind'][':'.$key]) && isset($this->fields['_type'][$key])){
+ $fieldType = strtolower($this->fields['_type'][$key]);
+ if(false !== strpos($fieldType,'enum')){
+ // 支持ENUM类型优先检测
+ }elseif(false === strpos($fieldType,'bigint') && false !== strpos($fieldType,'int')) {
+ $data[$key] = intval($data[$key]);
+ }elseif(false !== strpos($fieldType,'float') || false !== strpos($fieldType,'double')){
+ $data[$key] = floatval($data[$key]);
+ }elseif(false !== strpos($fieldType,'bool')){
+ $data[$key] = (bool)$data[$key];
+ }
+ }
+ }
+
+ /**
+ * 数据读取后的处理
+ * @access protected
+ * @param array $data 当前数据
+ * @return array
+ */
+ protected function _read_data($data) {
+ // 检查字段映射
+ if(!empty($this->_map) && C('READ_DATA_MAP')) {
+ foreach ($this->_map as $key=>$val){
+ if(isset($data[$val])) {
+ $data[$key] = $data[$val];
+ unset($data[$val]);
+ }
+ }
+ }
+ return $data;
+ }
+
+ /**
+ * 查询数据
+ * @access public
+ * @param mixed $options 表达式参数
+ * @return mixed
+ */
+ public function find($options=array()) {
+ if(is_numeric($options) || is_string($options)) {
+ $where[$this->getPk()] = $options;
+ $options = array();
+ $options['where'] = $where;
+ }
+ // 根据复合主键查找记录
+ $pk = $this->getPk();
+ if (is_array($options) && (count($options) > 0) && is_array($pk)) {
+ // 根据复合主键查询
+ $count = 0;
+ foreach (array_keys($options) as $key) {
+ if (is_int($key)) $count++;
+ }
+ if ($count == count($pk)) {
+ $i = 0;
+ foreach ($pk as $field) {
+ $where[$field] = $options[$i];
+ unset($options[$i++]);
+ }
+ $options['where'] = $where;
+ } else {
+ return false;
+ }
+ }
+ // 总是查找一条记录
+ $options['limit'] = 1;
+ // 分析表达式
+ $options = $this->_parseOptions($options);
+ // 判断查询缓存
+ if(isset($options['cache'])){
+ $cache = $options['cache'];
+ $key = is_string($cache['key'])?$cache['key']:md5(serialize($options));
+ $data = S($key,'',$cache);
+ if(false !== $data){
+ $this->data = $data;
+ return $data;
+ }
+ }
+ $resultSet = $this->db->select($options);
+ if(false === $resultSet) {
+ return false;
+ }
+ if(empty($resultSet)) {// 查询结果为空
+ return null;
+ }
+ if(is_string($resultSet)){
+ return $resultSet;
+ }
+
+ // 读取数据后的处理
+ $data = $this->_read_data($resultSet[0]);
+ $this->_after_find($data,$options);
+ $this->data = $data;
+ if(isset($cache)){
+ S($key,$data,$cache);
+ }
+ return $this->data;
+ }
+ // 查询成功的回调方法
+ protected function _after_find(&$result,$options) {}
+
+ /**
+ * 设置记录的某个字段值
+ * 支持使用数据库字段和方法
+ * @access public
+ * @param string|array $field 字段名
+ * @param string $value 字段值
+ * @return boolean
+ */
+ public function setField($field,$value='') {
+ if(is_array($field)) {
+ $data = $field;
+ }else{
+ $data[$field] = $value;
+ }
+ return $this->save($data);
+ }
+
+ /**
+ * 字段值增长
+ * @access public
+ * @param string $field 字段名
+ * @param integer $step 增长值
+ * @param integer $lazyTime 延时时间(s)
+ * @return boolean
+ */
+ public function setInc($field,$step=1) {
+ return $this->setField($field,array('exp',$field.'+'.$step));
+ }
+
+ /**
+ * 字段值减少
+ * @access public
+ * @param string $field 字段名
+ * @param integer $step 减少值
+ * @param integer $lazyTime 延时时间(s)
+ * @return boolean
+ */
+ public function setDec($field,$step=1) {
+ return $this->setField($field,array('exp',$field.'-'.$step));
+ }
+
+ /**
+ * 获取一条记录的某个字段值
+ * @access public
+ * @param string $field 字段名
+ * @param string $spea 字段数据间隔符号 NULL返回数组
+ * @return mixed
+ */
+ public function getField($field,$sepa=null) {
+ $options['field'] = $field;
+ $options = $this->_parseOptions($options);
+ // 判断查询缓存
+ if(isset($options['cache'])){
+ $cache = $options['cache'];
+ $key = is_string($cache['key'])?$cache['key']:md5($sepa.serialize($options));
+ $data = S($key,'',$cache);
+ if(false !== $data){
+ return $data;
+ }
+ }
+ $field = trim($field);
+ if(strpos($field,',') && false !== $sepa) { // 多字段
+ if(!isset($options['limit'])){
+ $options['limit'] = is_numeric($sepa)?$sepa:'';
+ }
+ $resultSet = $this->db->select($options);
+ if(!empty($resultSet)) {
+ $_field = explode(',', $field);
+ $field = array_keys($resultSet[0]);
+ $key1 = array_shift($field);
+ $key2 = array_shift($field);
+ $cols = array();
+ $count = count($_field);
+ foreach ($resultSet as $result){
+ $name = $result[$key1];
+ if(2==$count) {
+ $cols[$name] = $result[$key2];
+ }else{
+ $cols[$name] = is_string($sepa)?implode($sepa,array_slice($result,1)):$result;
+ }
+ }
+ if(isset($cache)){
+ S($key,$cols,$cache);
+ }
+ return $cols;
+ }
+ }else{ // 查找一条记录
+ // 返回数据个数
+ if(true !== $sepa) {// 当sepa指定为true的时候 返回所有数据
+ $options['limit'] = is_numeric($sepa)?$sepa:1;
+ }
+ $result = $this->db->select($options);
+ if(!empty($result)) {
+ if(true !== $sepa && 1==$options['limit']) {
+ $data = reset($result[0]);
+ if(isset($cache)){
+ S($key,$data,$cache);
+ }
+ return $data;
+ }
+ foreach ($result as $val){
+ $array[] = $val[$field];
+ }
+ if(isset($cache)){
+ S($key,$array,$cache);
+ }
+ return $array;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * 创建数据对象 但不保存到数据库
+ * @access public
+ * @param mixed $data 创建数据
+ * @return mixed
+ */
+ public function create($data='') {
+ // 如果没有传值默认取POST数据
+ if(empty($data)) {
+ $data = I('post.');
+ }elseif(is_object($data)){
+ $data = get_object_vars($data);
+ }
+ // 验证数据
+ if(empty($data) || !is_array($data)) {
+ $this->error = L('_DATA_TYPE_INVALID_');
+ return false;
+ }
+
+ // 检测提交字段的合法性
+ if(isset($this->options['field'])) { // $this->field('field1,field2...')->create()
+ $fields = $this->options['field'];
+ unset($this->options['field']);
+ }
+ if(isset($fields)) {
+ if(is_string($fields)) {
+ $fields = explode(',',$fields);
+ }
+ }
+
+ // 验证完成生成数据对象
+ if($this->autoCheckFields) { // 开启字段检测 则过滤非法字段数据
+ $fields = $this->getDbFields();
+ foreach ($data as $key=>$val){
+ if(!in_array($key,$fields)) {
+ unset($data[$key]);
+ }elseif(MAGIC_QUOTES_GPC && is_string($val)){
+ $data[$key] = stripslashes($val);
+ }
+ }
+ }
+
+ // 赋值当前数据对象
+ $this->data = $data;
+ // 返回创建的数据以供其他调用
+ return $data;
+ }
+
+ /**
+ * 使用正则验证数据
+ * @access public
+ * @param string $value 要验证的数据
+ * @param string $rule 验证规则
+ * @return boolean
+ */
+ public function regex($value,$rule) {
+ $validate = array(
+ 'require' => '/\S+/',
+ 'email' => '/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/',
+ 'url' => '/^http(s?):\/\/(?:[A-za-z0-9-]+\.)+[A-za-z]{2,4}(:\d+)?(?:[\/\?#][\/=\?%\-&~`@[\]\':+!\.#\w]*)?$/',
+ 'currency' => '/^\d+(\.\d+)?$/',
+ 'number' => '/^\d+$/',
+ 'zip' => '/^\d{6}$/',
+ 'integer' => '/^[-\+]?\d+$/',
+ 'double' => '/^[-\+]?\d+(\.\d+)?$/',
+ 'english' => '/^[A-Za-z]+$/',
+ );
+ // 检查是否有内置的正则表达式
+ if(isset($validate[strtolower($rule)]))
+ $rule = $validate[strtolower($rule)];
+ return preg_match($rule,$value)===1;
+ }
+
+ /**
+ * 验证数据 支持 in between equal length regex expire ip_allow ip_deny
+ * @access public
+ * @param string $value 验证数据
+ * @param mixed $rule 验证表达式
+ * @param string $type 验证方式 默认为正则验证
+ * @return boolean
+ */
+ public function check($value,$rule,$type='regex'){
+ $type = strtolower(trim($type));
+ switch($type) {
+ case 'in': // 验证是否在某个指定范围之内 逗号分隔字符串或者数组
+ case 'notin':
+ $range = is_array($rule)? $rule : explode(',',$rule);
+ return $type == 'in' ? in_array($value ,$range) : !in_array($value ,$range);
+ case 'between': // 验证是否在某个范围
+ case 'notbetween': // 验证是否不在某个范围
+ if (is_array($rule)){
+ $min = $rule[0];
+ $max = $rule[1];
+ }else{
+ list($min,$max) = explode(',',$rule);
+ }
+ return $type == 'between' ? $value>=$min && $value<=$max : $value<$min || $value>$max;
+ case 'equal': // 验证是否等于某个值
+ case 'notequal': // 验证是否等于某个值
+ return $type == 'equal' ? $value == $rule : $value != $rule;
+ case 'length': // 验证长度
+ $length = mb_strlen($value,'utf-8'); // 当前数据长度
+ if(strpos($rule,',')) { // 长度区间
+ list($min,$max) = explode(',',$rule);
+ return $length >= $min && $length <= $max;
+ }else{// 指定长度
+ return $length == $rule;
+ }
+ case 'expire':
+ list($start,$end) = explode(',',$rule);
+ if(!is_numeric($start)) $start = strtotime($start);
+ if(!is_numeric($end)) $end = strtotime($end);
+ return NOW_TIME >= $start && NOW_TIME <= $end;
+ case 'ip_allow': // IP 操作许可验证
+ return in_array(get_client_ip(),explode(',',$rule));
+ case 'ip_deny': // IP 操作禁止验证
+ return !in_array(get_client_ip(),explode(',',$rule));
+ case 'regex':
+ default: // 默认使用正则验证 可以使用验证类中定义的验证名称
+ // 检查附加规则
+ return $this->regex($value,$rule);
+ }
+ }
+
+ /**
+ * SQL查询
+ * @access public
+ * @param string $sql SQL指令
+ * @return mixed
+ */
+ public function query($sql) {
+ return $this->db->query($sql);
+ }
+
+ /**
+ * 执行SQL语句
+ * @access public
+ * @param string $sql SQL指令
+ * @return false | integer
+ */
+ public function execute($sql) {
+ return $this->db->execute($sql);
+ }
+
+ /**
+ * 切换当前的数据库连接
+ * @access public
+ * @param integer $linkNum 连接序号
+ * @param mixed $config 数据库连接信息
+ * @param boolean $force 强制重新连接
+ * @return Model
+ */
+ public function db($linkNum='',$config='',$force=false) {
+ if('' === $linkNum && $this->db) {
+ return $this->db;
+ }
+
+ if(!isset($this->_db[$linkNum]) || $force ) {
+ // 创建一个新的实例
+ if(!empty($config) && is_string($config) && false === strpos($config,'/')) { // 支持读取配置参数
+ $config = C($config);
+ }
+ $this->_db[$linkNum] = Db::getInstance($config);
+ }elseif(NULL === $config){
+ $this->_db[$linkNum]->close(); // 关闭数据库连接
+ unset($this->_db[$linkNum]);
+ return ;
+ }
+
+ // 切换数据库连接
+ $this->db = $this->_db[$linkNum];
+ $this->_after_db();
+ // 字段检测
+ if(!empty($this->name) && $this->autoCheckFields) $this->_checkTableInfo();
+ return $this;
+ }
+ // 数据库切换后回调方法
+ protected function _after_db() {}
+
+ /**
+ * 得到当前的数据对象名称
+ * @access public
+ * @return string
+ */
+ public function getModelName() {
+ if(empty($this->name)){
+ $name = substr(get_class($this),0,-strlen(C('DEFAULT_M_LAYER')));
+ if ( $pos = strrpos($name,'\\') ) {//有命名空间
+ $this->name = substr($name,$pos+1);
+ }else{
+ $this->name = $name;
+ }
+ }
+ return $this->name;
+ }
+
+ /**
+ * 得到完整的数据表名
+ * @access public
+ * @return string
+ */
+ public function getTableName() {
+ if(empty($this->trueTableName)) {
+ $tableName = !empty($this->tablePrefix) ? $this->tablePrefix : '';
+ if(!empty($this->tableName)) {
+ $tableName .= $this->tableName;
+ }else{
+ $tableName .= parse_name($this->name);
+ }
+ $this->trueTableName = strtolower($tableName);
+ }
+ return (!empty($this->dbName)?$this->dbName.'.':'').$this->trueTableName;
+ }
+
+ /**
+ * 启动事务
+ * @access public
+ * @return void
+ */
+ public function startTrans() {
+ $this->commit();
+ $this->db->startTrans();
+ return ;
+ }
+
+ /**
+ * 提交事务
+ * @access public
+ * @return boolean
+ */
+ public function commit() {
+ return $this->db->commit();
+ }
+
+ /**
+ * 事务回滚
+ * @access public
+ * @return boolean
+ */
+ public function rollback() {
+ return $this->db->rollback();
+ }
+
+ /**
+ * 返回模型的错误信息
+ * @access public
+ * @return string
+ */
+ public function getError(){
+ return $this->error;
+ }
+
+ /**
+ * 返回数据库的错误信息
+ * @access public
+ * @return string
+ */
+ public function getDbError() {
+ return $this->db->getError();
+ }
+
+ /**
+ * 返回最后插入的ID
+ * @access public
+ * @return string
+ */
+ public function getLastInsID() {
+ return $this->db->getLastInsID();
+ }
+
+ /**
+ * 返回最后执行的sql语句
+ * @access public
+ * @return string
+ */
+ public function getLastSql() {
+ return $this->db->getLastSql($this->name);
+ }
+ // 鉴于getLastSql比较常用 增加_sql 别名
+ public function _sql(){
+ return $this->getLastSql();
+ }
+
+ /**
+ * 获取主键名称
+ * @access public
+ * @return string
+ */
+ public function getPk() {
+ return $this->pk;
+ }
+
+ /**
+ * 获取数据表字段信息
+ * @access public
+ * @return array
+ */
+ public function getDbFields(){
+ if(isset($this->options['table'])) {// 动态指定表名
+ if(is_array($this->options['table'])){
+ $table = key($this->options['table']);
+ }else{
+ $table = $this->options['table'];
+ }
+ $fields = $this->db->getFields($table);
+ return $fields ? array_keys($fields) : false;
+ }
+ if($this->fields) {
+ $fields = $this->fields;
+ unset($fields['_type'],$fields['_pk']);
+ return $fields;
+ }
+ return false;
+ }
+
+ /**
+ * 设置数据对象值
+ * @access public
+ * @param mixed $data 数据
+ * @return Model
+ */
+ public function data($data=''){
+ if('' === $data && !empty($this->data)) {
+ return $this->data;
+ }
+ if(is_object($data)){
+ $data = get_object_vars($data);
+ }elseif(is_string($data)){
+ parse_str($data,$data);
+ }elseif(!is_array($data)){
+ E(L('_DATA_TYPE_INVALID_'));
+ }
+ $this->data = $data;
+ return $this;
+ }
+
+ /**
+ * 指定当前的数据表
+ * @access public
+ * @param mixed $table
+ * @return Model
+ */
+ public function table($table) {
+ $prefix = $this->tablePrefix;
+ if(is_array($table)) {
+ $this->options['table'] = $table;
+ }elseif(!empty($table)) {
+ //将__TABLE_NAME__替换成带前缀的表名
+ $table = preg_replace_callback("/__([A-Z0-9_-]+)__/sU", function($match) use($prefix){ return $prefix.strtolower($match[1]);}, $table);
+ $this->options['table'] = $table;
+ }
+ return $this;
+ }
+
+ /**
+ * USING支持 用于多表删除
+ * @access public
+ * @param mixed $using
+ * @return Model
+ */
+ public function using($using){
+ $prefix = $this->tablePrefix;
+ if(is_array($using)) {
+ $this->options['using'] = $using;
+ }elseif(!empty($using)) {
+ //将__TABLE_NAME__替换成带前缀的表名
+ $using = preg_replace_callback("/__([A-Z0-9_-]+)__/sU", function($match) use($prefix){ return $prefix.strtolower($match[1]);}, $using);
+ $this->options['using'] = $using;
+ }
+ return $this;
+ }
+
+ /**
+ * 查询SQL组装 join
+ * @access public
+ * @param mixed $join
+ * @param string $type JOIN类型
+ * @return Model
+ */
+ public function join($join,$type='INNER') {
+ $prefix = $this->tablePrefix;
+ if(is_array($join)) {
+ foreach ($join as $key=>&$_join){
+ $_join = preg_replace_callback("/__([A-Z0-9_-]+)__/sU", function($match) use($prefix){ return $prefix.strtolower($match[1]);}, $_join);
+ $_join = false !== stripos($_join,'JOIN')? $_join : $type.' JOIN ' .$_join;
+ }
+ $this->options['join'] = $join;
+ }elseif(!empty($join)) {
+ //将__TABLE_NAME__字符串替换成带前缀的表名
+ $join = preg_replace_callback("/__([A-Z0-9_-]+)__/sU", function($match) use($prefix){ return $prefix.strtolower($match[1]);}, $join);
+ $this->options['join'][] = false !== stripos($join,'JOIN')? $join : $type.' JOIN '.$join;
+ }
+ return $this;
+ }
+
+ /**
+ * 查询SQL组装 union
+ * @access public
+ * @param mixed $union
+ * @param boolean $all
+ * @return Model
+ */
+ public function union($union,$all=false) {
+ if(empty($union)) return $this;
+ if($all) {
+ $this->options['union']['_all'] = true;
+ }
+ if(is_object($union)) {
+ $union = get_object_vars($union);
+ }
+ // 转换union表达式
+ if(is_string($union) ) {
+ $prefix = $this->tablePrefix;
+ //将__TABLE_NAME__字符串替换成带前缀的表名
+ $options = preg_replace_callback("/__([A-Z0-9_-]+)__/sU", function($match) use($prefix){ return $prefix.strtolower($match[1]);}, $union);
+ }elseif(is_array($union)){
+ if(isset($union[0])) {
+ $this->options['union'] = array_merge($this->options['union'],$union);
+ return $this;
+ }else{
+ $options = $union;
+ }
+ }else{
+ E(L('_DATA_TYPE_INVALID_'));
+ }
+ $this->options['union'][] = $options;
+ return $this;
+ }
+
+ /**
+ * 查询缓存
+ * @access public
+ * @param mixed $key
+ * @param integer $expire
+ * @param string $type
+ * @return Model
+ */
+ public function cache($key=true,$expire=null,$type=''){
+ // 增加快捷调用方式 cache(10) 等同于 cache(true, 10)
+ if(is_numeric($key) && is_null($expire)){
+ $expire = $key;
+ $key = true;
+ }
+ if(false !== $key)
+ $this->options['cache'] = array('key'=>$key,'expire'=>$expire,'type'=>$type);
+ return $this;
+ }
+
+ /**
+ * 指定查询字段 支持字段排除
+ * @access public
+ * @param mixed $field
+ * @param boolean $except 是否排除
+ * @return Model
+ */
+ public function field($field,$except=false){
+ if(true === $field) {// 获取全部字段
+ $fields = $this->getDbFields();
+ $field = $fields?:'*';
+ }elseif($except) {// 字段排除
+ if(is_string($field)) {
+ $field = explode(',',$field);
+ }
+ $fields = $this->getDbFields();
+ $field = $fields?array_diff($fields,$field):$field;
+ }
+ $this->options['field'] = $field;
+ return $this;
+ }
+
+ /**
+ * 调用命名范围
+ * @access public
+ * @param mixed $scope 命名范围名称 支持多个 和直接定义
+ * @param array $args 参数
+ * @return Model
+ */
+ public function scope($scope='',$args=NULL){
+ if('' === $scope) {
+ if(isset($this->_scope['default'])) {
+ // 默认的命名范围
+ $options = $this->_scope['default'];
+ }else{
+ return $this;
+ }
+ }elseif(is_string($scope)){ // 支持多个命名范围调用 用逗号分割
+ $scopes = explode(',',$scope);
+ $options = array();
+ foreach ($scopes as $name){
+ if(!isset($this->_scope[$name])) continue;
+ $options = array_merge($options,$this->_scope[$name]);
+ }
+ if(!empty($args) && is_array($args)) {
+ $options = array_merge($options,$args);
+ }
+ }elseif(is_array($scope)){ // 直接传入命名范围定义
+ $options = $scope;
+ }
+
+ if(is_array($options) && !empty($options)){
+ $this->options = array_merge($this->options,array_change_key_case($options));
+ }
+ return $this;
+ }
+
+ /**
+ * 指定查询条件 支持安全过滤
+ * @access public
+ * @param mixed $where 条件表达式
+ * @param mixed $parse 预处理参数
+ * @return Model
+ */
+ public function where($where,$parse=null){
+ if(!is_null($parse) && is_string($where)) {
+ if(!is_array($parse)) {
+ $parse = func_get_args();
+ array_shift($parse);
+ }
+ $parse = array_map(array($this->db,'escapeString'),$parse);
+ $where = vsprintf($where,$parse);
+ }elseif(is_object($where)){
+ $where = get_object_vars($where);
+ }
+ if(is_string($where) && '' != $where){
+ $map = array();
+ $map['_string'] = $where;
+ $where = $map;
+ }
+ if(isset($this->options['where'])){
+ $this->options['where'] = array_merge($this->options['where'],$where);
+ }else{
+ $this->options['where'] = $where;
+ }
+
+ return $this;
+ }
+
+ /**
+ * 指定查询数量
+ * @access public
+ * @param mixed $offset 起始位置
+ * @param mixed $length 查询数量
+ * @return Model
+ */
+ public function limit($offset,$length=null){
+ if(is_null($length) && strpos($offset,',')){
+ list($offset,$length) = explode(',',$offset);
+ }
+ $this->options['limit'] = intval($offset).( $length? ','.intval($length) : '' );
+ return $this;
+ }
+
+ /**
+ * 指定分页
+ * @access public
+ * @param mixed $page 页数
+ * @param mixed $listRows 每页数量
+ * @return Model
+ */
+ public function page($page,$listRows=null){
+ if(is_null($listRows) && strpos($page,',')){
+ list($page,$listRows) = explode(',',$page);
+ }
+ $this->options['page'] = array(intval($page),intval($listRows));
+ return $this;
+ }
+
+ /**
+ * 查询注释
+ * @access public
+ * @param string $comment 注释
+ * @return Model
+ */
+ public function comment($comment){
+ $this->options['comment'] = $comment;
+ return $this;
+ }
+
+ /**
+ * 获取执行的SQL语句
+ * @access public
+ * @param boolean $fetch 是否返回sql
+ * @return Model
+ */
+ public function fetchSql($fetch){
+ $this->options['fetch_sql'] = $fetch;
+ return $this;
+ }
+
+ /**
+ * 参数绑定
+ * @access public
+ * @param string $key 参数名
+ * @param mixed $value 绑定的变量及绑定参数
+ * @return Model
+ */
+ public function bind($key,$value=false) {
+ if(is_array($key)){
+ $this->options['bind'] = $key;
+ }else{
+ $num = func_num_args();
+ if($num>2){
+ $params = func_get_args();
+ array_shift($params);
+ $this->options['bind'][$key] = $params;
+ }else{
+ $this->options['bind'][$key] = $value;
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * 设置模型的属性值
+ * @access public
+ * @param string $name 名称
+ * @param mixed $value 值
+ * @return Model
+ */
+ public function setProperty($name,$value) {
+ if(property_exists($this,$name))
+ $this->$name = $value;
+ return $this;
+ }
+
+}
diff --git a/ThinkPHP/Mode/Lite/View.class.php b/ThinkPHP/Mode/Lite/View.class.php
new file mode 100644
index 0000000..064343f
--- /dev/null
+++ b/ThinkPHP/Mode/Lite/View.class.php
@@ -0,0 +1,293 @@
+
+// +----------------------------------------------------------------------
+namespace Think;
+/**
+ * ThinkPHP 视图类
+ */
+class View {
+ /**
+ * 模板输出变量
+ * @var tVar
+ * @access protected
+ */
+ protected $tVar = array();
+
+ /**
+ * 模板主题
+ * @var theme
+ * @access protected
+ */
+ protected $theme = '';
+
+ /**
+ * 模板变量赋值
+ * @access public
+ * @param mixed $name
+ * @param mixed $value
+ */
+ public function assign($name,$value=''){
+ if(is_array($name)) {
+ $this->tVar = array_merge($this->tVar,$name);
+ }else {
+ $this->tVar[$name] = $value;
+ }
+ }
+
+ /**
+ * 取得模板变量的值
+ * @access public
+ * @param string $name
+ * @return mixed
+ */
+ public function get($name=''){
+ if('' === $name) {
+ return $this->tVar;
+ }
+ return isset($this->tVar[$name])?$this->tVar[$name]:false;
+ }
+
+ /**
+ * 加载模板和页面输出 可以返回输出内容
+ * @access public
+ * @param string $templateFile 模板文件名
+ * @param string $charset 模板输出字符集
+ * @param string $contentType 输出类型
+ * @param string $content 模板输出内容
+ * @param string $prefix 模板缓存前缀
+ * @return mixed
+ */
+ public function display($templateFile='',$charset='',$contentType='',$content='',$prefix='') {
+ G('viewStartTime');
+ // 解析并获取模板内容
+ $content = $this->fetch($templateFile,$content,$prefix);
+ // 输出模板内容
+ $this->render($content,$charset,$contentType);
+ }
+
+ /**
+ * 输出内容文本可以包括Html
+ * @access private
+ * @param string $content 输出内容
+ * @param string $charset 模板输出字符集
+ * @param string $contentType 输出类型
+ * @return mixed
+ */
+ private function render($content,$charset='',$contentType=''){
+ if(empty($charset)) $charset = C('DEFAULT_CHARSET');
+ if(empty($contentType)) $contentType = C('TMPL_CONTENT_TYPE');
+ // 网页字符编码
+ header('Content-Type:'.$contentType.'; charset='.$charset);
+ header('Cache-control: '.C('HTTP_CACHE_CONTROL')); // 页面缓存控制
+ header('X-Powered-By:ThinkPHP');
+ // 输出模板文件
+ echo $content;
+ }
+
+ /**
+ * 解析和获取模板内容 用于输出
+ * @access public
+ * @param string $templateFile 模板文件名
+ * @param string $content 模板输出内容
+ * @param string $prefix 模板缓存前缀
+ * @return string
+ */
+ public function fetch($templateFile='',$content='',$prefix='') {
+ if(empty($content)) {
+ $templateFile = $this->parseTemplate($templateFile);
+ // 模板文件不存在直接返回
+ if(!is_file($templateFile)) E(L('_TEMPLATE_NOT_EXIST_').':'.$templateFile);
+ }else{
+ defined('THEME_PATH') or define('THEME_PATH', $this->getThemePath());
+ }
+ // 页面缓存
+ ob_start();
+ ob_implicit_flush(0);
+ if('php' == strtolower(C('TMPL_ENGINE_TYPE'))) { // 使用PHP原生模板
+ $_content = $content;
+ // 模板阵列变量分解成为独立变量
+ extract($this->tVar, EXTR_OVERWRITE);
+ // 直接载入PHP模板
+ empty($_content)?include $templateFile:eval('?>'.$_content);
+ }else{
+ // 视图解析标签
+ $params = array('var'=>$this->tVar,'file'=>$templateFile,'content'=>$content,'prefix'=>$prefix);
+ $_content = !empty($content)?:$templateFile;
+ if((!empty($content) && $this->checkContentCache($content,$prefix)) || $this->checkCache($templateFile,$prefix)) { // 缓存有效
+ //载入模版缓存文件
+ Storage::load(C('CACHE_PATH').$prefix.md5($_content).C('TMPL_CACHFILE_SUFFIX'),$this->tVar);
+ }else{
+ $tpl = Think::instance('Think\\Template');
+ // 编译并加载模板文件
+ $tpl->fetch($_content,$this->tVar,$prefix);
+ }
+ }
+ // 获取并清空缓存
+ $content = ob_get_clean();
+ // 内容过滤标签
+ // 系统默认的特殊变量替换
+ $replace = array(
+ '__ROOT__' => __ROOT__, // 当前网站地址
+ '__APP__' => __APP__, // 当前应用地址
+ '__MODULE__' => __MODULE__,
+ '__ACTION__' => __ACTION__, // 当前操作地址
+ '__SELF__' => __SELF__, // 当前页面地址
+ '__CONTROLLER__'=> __CONTROLLER__,
+ '__URL__' => __CONTROLLER__,
+ '__PUBLIC__' => __ROOT__.'/Public',// 站点公共目录
+ );
+ // 允许用户自定义模板的字符串替换
+ if(is_array(C('TMPL_PARSE_STRING')) )
+ $replace = array_merge($replace,C('TMPL_PARSE_STRING'));
+ $content = str_replace(array_keys($replace),array_values($replace),$content);
+ // 输出模板文件
+ return $content;
+ }
+
+ /**
+ * 检查缓存文件是否有效
+ * 如果无效则需要重新编译
+ * @access public
+ * @param string $tmplTemplateFile 模板文件名
+ * @return boolean
+ */
+ protected function checkCache($tmplTemplateFile,$prefix='') {
+ if (!C('TMPL_CACHE_ON')) // 优先对配置设定检测
+ return false;
+ $tmplCacheFile = C('CACHE_PATH').$prefix.md5($tmplTemplateFile).C('TMPL_CACHFILE_SUFFIX');
+ if(!Storage::has($tmplCacheFile)){
+ return false;
+ }elseif (filemtime($tmplTemplateFile) > Storage::get($tmplCacheFile,'mtime')) {
+ // 模板文件如果有更新则缓存需要更新
+ return false;
+ }elseif (C('TMPL_CACHE_TIME') != 0 && time() > Storage::get($tmplCacheFile,'mtime')+C('TMPL_CACHE_TIME')) {
+ // 缓存是否在有效期
+ return false;
+ }
+ // 开启布局模板
+ if(C('LAYOUT_ON')) {
+ $layoutFile = THEME_PATH.C('LAYOUT_NAME').C('TMPL_TEMPLATE_SUFFIX');
+ if(filemtime($layoutFile) > Storage::get($tmplCacheFile,'mtime')) {
+ return false;
+ }
+ }
+ // 缓存有效
+ return true;
+ }
+
+ /**
+ * 检查缓存内容是否有效
+ * 如果无效则需要重新编译
+ * @access public
+ * @param string $tmplContent 模板内容
+ * @return boolean
+ */
+ protected function checkContentCache($tmplContent,$prefix='') {
+ if(Storage::has(C('CACHE_PATH').$prefix.md5($tmplContent).C('TMPL_CACHFILE_SUFFIX'))){
+ return true;
+ }else{
+ return false;
+ }
+ }
+
+ /**
+ * 自动定位模板文件
+ * @access protected
+ * @param string $template 模板文件规则
+ * @return string
+ */
+ public function parseTemplate($template='') {
+ if(is_file($template)) {
+ return $template;
+ }
+ $depr = C('TMPL_FILE_DEPR');
+ $template = str_replace(':', $depr, $template);
+
+ // 获取当前模块
+ $module = MODULE_NAME;
+ if(strpos($template,'@')){ // 跨模块调用模版文件
+ list($module,$template) = explode('@',$template);
+ }
+ // 获取当前主题的模版路径
+ defined('THEME_PATH') or define('THEME_PATH', $this->getThemePath($module));
+
+ // 分析模板文件规则
+ if('' == $template) {
+ // 如果模板文件名为空 按照默认规则定位
+ $template = CONTROLLER_NAME . $depr . ACTION_NAME;
+ }elseif(false === strpos($template, $depr)){
+ $template = CONTROLLER_NAME . $depr . $template;
+ }
+ $file = THEME_PATH.$template.C('TMPL_TEMPLATE_SUFFIX');
+ if(C('TMPL_LOAD_DEFAULTTHEME') && THEME_NAME != C('DEFAULT_THEME') && !is_file($file)){
+ // 找不到当前主题模板的时候定位默认主题中的模板
+ $file = dirname(THEME_PATH).'/'.C('DEFAULT_THEME').'/'.$template.C('TMPL_TEMPLATE_SUFFIX');
+ }
+ return $file;
+ }
+
+ /**
+ * 获取当前的模板路径
+ * @access protected
+ * @param string $module 模块名
+ * @return string
+ */
+ protected function getThemePath($module=MODULE_NAME){
+ // 获取当前主题名称
+ $theme = $this->getTemplateTheme();
+ // 获取当前主题的模版路径
+ $tmplPath = C('VIEW_PATH'); // 模块设置独立的视图目录
+ if(!$tmplPath){
+ // 定义TMPL_PATH 则改变全局的视图目录到模块之外
+ $tmplPath = defined('TMPL_PATH')? TMPL_PATH.$module.'/' : APP_PATH.$module.'/'.C('DEFAULT_V_LAYER').'/';
+ }
+ return $tmplPath.$theme;
+ }
+
+ /**
+ * 设置当前输出的模板主题
+ * @access public
+ * @param mixed $theme 主题名称
+ * @return View
+ */
+ public function theme($theme){
+ $this->theme = $theme;
+ return $this;
+ }
+
+ /**
+ * 获取当前的模板主题
+ * @access private
+ * @return string
+ */
+ private function getTemplateTheme() {
+ if($this->theme) { // 指定模板主题
+ $theme = $this->theme;
+ }else{
+ /* 获取模板主题名称 */
+ $theme = C('DEFAULT_THEME');
+ if(C('TMPL_DETECT_THEME')) {// 自动侦测模板主题
+ $t = C('VAR_TEMPLATE');
+ if (isset($_GET[$t])){
+ $theme = $_GET[$t];
+ }elseif(cookie('think_template')){
+ $theme = cookie('think_template');
+ }
+ if(!in_array($theme,explode(',',C('THEME_LIST')))){
+ $theme = C('DEFAULT_THEME');
+ }
+ cookie('think_template',$theme,864000);
+ }
+ }
+ defined('THEME_NAME') || define('THEME_NAME', $theme); // 当前模板主题名称
+ return $theme?$theme . '/':'';
+ }
+
+}
\ No newline at end of file
diff --git a/ThinkPHP/Mode/Lite/convention.php b/ThinkPHP/Mode/Lite/convention.php
new file mode 100644
index 0000000..982377d
--- /dev/null
+++ b/ThinkPHP/Mode/Lite/convention.php
@@ -0,0 +1,163 @@
+
+// +----------------------------------------------------------------------
+
+/**
+ * ThinkPHP惯例配置文件
+ * 该文件请不要修改,如果要覆盖惯例配置的值,可在应用配置文件中设定和惯例不符的配置项
+ * 配置名称大小写任意,系统会统一转换成小写
+ * 所有配置参数都可以在生效前动态改变
+ */
+defined('THINK_PATH') or exit();
+return array(
+ /* 应用设定 */
+ 'APP_SUB_DOMAIN_DEPLOY' => false, // 是否开启子域名部署
+ 'APP_SUB_DOMAIN_RULES' => array(), // 子域名部署规则
+ 'APP_DOMAIN_SUFFIX' => '', // 域名后缀 如果是com.cn net.cn 之类的后缀必须设置
+ 'ACTION_SUFFIX' => '', // 操作方法后缀
+ 'MULTI_MODULE' => true, // 是否允许多模块 如果为false 则必须设置 DEFAULT_MODULE
+ 'MODULE_DENY_LIST' => array('Common','Runtime'),
+
+ /* Cookie设置 */
+ 'COOKIE_EXPIRE' => 0, // Cookie有效期
+ 'COOKIE_DOMAIN' => '', // Cookie有效域名
+ 'COOKIE_PATH' => '/', // Cookie路径
+ 'COOKIE_PREFIX' => '', // Cookie前缀 避免冲突
+ 'COOKIE_SECURE' => false, // Cookie安全传输
+ 'COOKIE_HTTPONLY' => '', // Cookie httponly设置
+
+ /* 默认设定 */
+ 'DEFAULT_M_LAYER' => 'Model', // 默认的模型层名称
+ 'DEFAULT_C_LAYER' => 'Controller', // 默认的控制器层名称
+ 'DEFAULT_V_LAYER' => 'View', // 默认的视图层名称
+ 'DEFAULT_LANG' => 'zh-cn', // 默认语言
+ 'DEFAULT_THEME' => '', // 默认模板主题名称
+ 'DEFAULT_MODULE' => 'Home', // 默认模块
+ 'DEFAULT_CONTROLLER' => 'Index', // 默认控制器名称
+ 'DEFAULT_ACTION' => 'index', // 默认操作名称
+ 'DEFAULT_CHARSET' => 'utf-8', // 默认输出编码
+ 'DEFAULT_TIMEZONE' => 'PRC', // 默认时区
+ 'DEFAULT_AJAX_RETURN' => 'JSON', // 默认AJAX 数据返回格式,可选JSON XML ...
+ 'DEFAULT_JSONP_HANDLER' => 'jsonpReturn', // 默认JSONP格式返回的处理方法
+ 'DEFAULT_FILTER' => 'htmlspecialchars', // 默认参数过滤方法 用于I函数...
+
+ /* 数据库设置 */
+ 'DB_TYPE' => '', // 数据库类型
+ 'DB_HOST' => '', // 服务器地址
+ 'DB_NAME' => '', // 数据库名
+ 'DB_USER' => '', // 用户名
+ 'DB_PWD' => '', // 密码
+ 'DB_PORT' => '', // 端口
+ 'DB_PREFIX' => '', // 数据库表前缀
+ 'DB_PARAMS' => array(), // 数据库连接参数
+ 'DB_DEBUG' => TRUE, // 数据库调试模式 开启后可以记录SQL日志
+ 'DB_FIELDS_CACHE' => true, // 启用字段缓存
+ 'DB_CHARSET' => 'utf8', // 数据库编码默认采用utf8
+ 'DB_DEPLOY_TYPE' => 0, // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
+ 'DB_RW_SEPARATE' => false, // 数据库读写是否分离 主从式有效
+ 'DB_MASTER_NUM' => 1, // 读写分离后 主服务器数量
+ 'DB_SLAVE_NO' => '', // 指定从服务器序号
+
+ /* 数据缓存设置 */
+ 'DATA_CACHE_TIME' => 0, // 数据缓存有效期 0表示永久缓存
+ 'DATA_CACHE_COMPRESS' => false, // 数据缓存是否压缩缓存
+ 'DATA_CACHE_CHECK' => false, // 数据缓存是否校验缓存
+ 'DATA_CACHE_PREFIX' => '', // 缓存前缀
+ 'DATA_CACHE_TYPE' => 'File', // 数据缓存类型,支持:File|Db|Apc|Memcache|Shmop|Sqlite|Xcache|Apachenote|Eaccelerator
+ 'DATA_CACHE_PATH' => TEMP_PATH,// 缓存路径设置 (仅对File方式缓存有效)
+ 'DATA_CACHE_KEY' => '', // 缓存文件KEY (仅对File方式缓存有效)
+ 'DATA_CACHE_SUBDIR' => false, // 使用子目录缓存 (自动根据缓存标识的哈希创建子目录)
+ 'DATA_PATH_LEVEL' => 1, // 子目录缓存级别
+
+ /* 错误设置 */
+ 'ERROR_MESSAGE' => '页面错误!请稍后再试~',//错误显示信息,非调试模式有效
+ 'ERROR_PAGE' => '', // 错误定向页面
+ 'SHOW_ERROR_MSG' => false, // 显示错误信息
+ 'TRACE_MAX_RECORD' => 100, // 每个级别的错误信息 最大记录数
+
+ /* 日志设置 */
+ 'LOG_RECORD' => false, // 默认不记录日志
+ 'LOG_TYPE' => 'File', // 日志记录类型 默认为文件方式
+ 'LOG_LEVEL' => 'EMERG,ALERT,CRIT,ERR',// 允许记录的日志级别
+ 'LOG_FILE_SIZE' => 2097152, // 日志文件大小限制
+ 'LOG_EXCEPTION_RECORD' => false, // 是否记录异常信息日志
+
+ /* SESSION设置 */
+ 'SESSION_AUTO_START' => false, // 是否自动开启Session
+ 'SESSION_OPTIONS' => array(), // session 配置数组 支持type name id path expire domain 等参数
+ 'SESSION_TYPE' => '', // session hander类型 默认无需设置 除非扩展了session hander驱动
+ 'SESSION_PREFIX' => '', // session 前缀
+ //'VAR_SESSION_ID' => 'session_id', //sessionID的提交变量
+
+ /* 模板引擎设置 */
+ 'TMPL_CONTENT_TYPE' => 'text/html', // 默认模板输出类型
+ 'TMPL_ACTION_ERROR' => THINK_PATH.'Tpl/dispatch_jump.tpl', // 默认错误跳转对应的模板文件
+ 'TMPL_ACTION_SUCCESS' => THINK_PATH.'Tpl/dispatch_jump.tpl', // 默认成功跳转对应的模板文件
+ 'TMPL_EXCEPTION_FILE' => THINK_PATH.'Tpl/think_exception.tpl',// 异常页面的模板文件
+ 'TMPL_DETECT_THEME' => false, // 自动侦测模板主题
+ 'TMPL_TEMPLATE_SUFFIX' => '.html', // 默认模板文件后缀
+ 'TMPL_FILE_DEPR' => '/', //模板文件CONTROLLER_NAME与ACTION_NAME之间的分割符
+ // 布局设置
+ 'TMPL_ENGINE_TYPE' => 'Think', // 默认模板引擎 以下设置仅对使用Think模板引擎有效
+ 'TMPL_CACHFILE_SUFFIX' => '.php', // 默认模板缓存后缀
+ 'TMPL_DENY_FUNC_LIST' => 'echo,exit', // 模板引擎禁用函数
+ 'TMPL_DENY_PHP' => false, // 默认模板引擎是否禁用PHP原生代码
+ 'TMPL_L_DELIM' => '{', // 模板引擎普通标签开始标记
+ 'TMPL_R_DELIM' => '}', // 模板引擎普通标签结束标记
+ 'TMPL_VAR_IDENTIFY' => 'array', // 模板变量识别。留空自动判断,参数为'obj'则表示对象
+ 'TMPL_STRIP_SPACE' => true, // 是否去除模板文件里面的html空格与换行
+ 'TMPL_CACHE_ON' => true, // 是否开启模板编译缓存,设为false则每次都会重新编译
+ 'TMPL_CACHE_PREFIX' => '', // 模板缓存前缀标识,可以动态改变
+ 'TMPL_CACHE_TIME' => 0, // 模板缓存有效期 0 为永久,(以数字为值,单位:秒)
+ 'TMPL_LAYOUT_ITEM' => '{__CONTENT__}', // 布局模板的内容替换标识
+ 'LAYOUT_ON' => false, // 是否启用布局
+ 'LAYOUT_NAME' => 'layout', // 当前布局名称 默认为layout
+
+ // Think模板引擎标签库相关设定
+ 'TAGLIB_BEGIN' => '<', // 标签库标签开始标记
+ 'TAGLIB_END' => '>', // 标签库标签结束标记
+ 'TAGLIB_LOAD' => true, // 是否使用内置标签库之外的其它标签库,默认自动检测
+ 'TAGLIB_BUILD_IN' => 'cx', // 内置标签库名称(标签使用不必指定标签库名称),以逗号分隔 注意解析顺序
+ 'TAGLIB_PRE_LOAD' => '', // 需要额外加载的标签库(须指定标签库名称),多个以逗号分隔
+
+ /* URL设置 */
+ 'URL_CASE_INSENSITIVE' => true, // 默认false 表示URL区分大小写 true则表示不区分大小写
+ 'URL_MODEL' => 1, // URL访问模式,可选参数0、1、2、3,代表以下四种模式:
+ // 0 (普通模式); 1 (PATHINFO 模式); 2 (REWRITE 模式); 3 (兼容模式) 默认为PATHINFO 模式
+ 'URL_PATHINFO_DEPR' => '/', // PATHINFO模式下,各参数之间的分割符号
+ 'URL_PATHINFO_FETCH' => 'ORIG_PATH_INFO,REDIRECT_PATH_INFO,REDIRECT_URL', // 用于兼容判断PATH_INFO 参数的SERVER替代变量列表
+ 'URL_REQUEST_URI' => 'REQUEST_URI', // 获取当前页面地址的系统变量 默认为REQUEST_URI
+ 'URL_HTML_SUFFIX' => 'html', // URL伪静态后缀设置
+ 'URL_DENY_SUFFIX' => 'ico|png|gif|jpg', // URL禁止访问的后缀设置
+ 'URL_PARAMS_BIND' => true, // URL变量绑定到Action方法参数
+ 'URL_PARAMS_BIND_TYPE' => 0, // URL变量绑定的类型 0 按变量名绑定 1 按变量顺序绑定
+ 'URL_PARAMS_FILTER' => false, // URL变量绑定过滤
+ 'URL_PARAMS_FILTER_TYPE'=> '', // URL变量绑定过滤方法 如果为空 调用DEFAULT_FILTER
+ 'URL_ROUTER_ON' => false, // 是否开启URL路由
+ 'URL_ROUTE_RULES' => array(), // 默认路由规则 针对模块
+ 'URL_MAP_RULES' => array(), // URL映射定义规则
+
+ /* 系统变量名称设置 */
+ 'VAR_MODULE' => 'm', // 默认模块获取变量
+ 'VAR_ADDON' => 'addon', // 默认的插件控制器命名空间变量
+ 'VAR_CONTROLLER' => 'c', // 默认控制器获取变量
+ 'VAR_ACTION' => 'a', // 默认操作获取变量
+ 'VAR_AJAX_SUBMIT' => 'ajax', // 默认的AJAX提交变量
+ 'VAR_JSONP_HANDLER' => 'callback',
+ 'VAR_PATHINFO' => 's', // 兼容模式PATHINFO获取变量例如 ?s=/module/action/id/1 后面的参数取决于URL_PATHINFO_DEPR
+ 'VAR_TEMPLATE' => 't', // 默认模板切换变量
+ 'VAR_AUTO_STRING' => false, // 输入变量是否自动强制转换为字符串 如果开启则数组变量需要手动传入变量修饰符获取变量
+
+ 'HTTP_CACHE_CONTROL' => 'private', // 网页缓存控制
+ 'CHECK_APP_DIR' => true, // 是否检查应用目录是否创建
+ 'FILE_UPLOAD_TYPE' => 'Local', // 文件上传方式
+ 'DATA_CRYPT_TYPE' => 'Think', // 数据加密方式
+
+);
diff --git a/ThinkPHP/Mode/Lite/functions.php b/ThinkPHP/Mode/Lite/functions.php
new file mode 100644
index 0000000..7cf10ac
--- /dev/null
+++ b/ThinkPHP/Mode/Lite/functions.php
@@ -0,0 +1,1378 @@
+
+// +----------------------------------------------------------------------
+
+/**
+ * Think 系统函数库
+ */
+
+/**
+ * 获取和设置配置参数 支持批量定义
+ * @param string|array $name 配置变量
+ * @param mixed $value 配置值
+ * @param mixed $default 默认值
+ * @return mixed
+ */
+function C($name=null, $value=null,$default=null) {
+ static $_config = array();
+ // 无参数时获取所有
+ if (empty($name)) {
+ return $_config;
+ }
+ // 优先执行设置获取或赋值
+ if (is_string($name)) {
+ if (!strpos($name, '.')) {
+ $name = strtoupper($name);
+ if (is_null($value))
+ return isset($_config[$name]) ? $_config[$name] : $default;
+ $_config[$name] = $value;
+ return null;
+ }
+ // 二维数组设置和获取支持
+ $name = explode('.', $name);
+ $name[0] = strtoupper($name[0]);
+ if (is_null($value))
+ return isset($_config[$name[0]][$name[1]]) ? $_config[$name[0]][$name[1]] : $default;
+ $_config[$name[0]][$name[1]] = $value;
+ return null;
+ }
+ // 批量设置
+ if (is_array($name)){
+ $_config = array_merge($_config, array_change_key_case($name,CASE_UPPER));
+ return null;
+ }
+ return null; // 避免非法参数
+}
+
+/**
+ * 加载配置文件 支持格式转换 仅支持一级配置
+ * @param string $file 配置文件名
+ * @param string $parse 配置解析方法 有些格式需要用户自己解析
+ * @return array
+ */
+function load_config($file,$parse=CONF_PARSE){
+ $ext = pathinfo($file,PATHINFO_EXTENSION);
+ switch($ext){
+ case 'php':
+ return include $file;
+ case 'ini':
+ return parse_ini_file($file);
+ case 'yaml':
+ return yaml_parse_file($file);
+ case 'xml':
+ return (array)simplexml_load_file($file);
+ case 'json':
+ return json_decode(file_get_contents($file), true);
+ default:
+ if(function_exists($parse)){
+ return $parse($file);
+ }else{
+ E(L('_NOT_SUPPORT_').':'.$ext);
+ }
+ }
+}
+
+/**
+ * 解析yaml文件返回一个数组
+ * @param string $file 配置文件名
+ * @return array
+ */
+if (!function_exists('yaml_parse_file')) {
+ function yaml_parse_file($file) {
+ vendor('spyc.Spyc');
+ return Spyc::YAMLLoad($file);
+ }
+}
+
+/**
+ * 抛出异常处理
+ * @param string $msg 异常消息
+ * @param integer $code 异常代码 默认为0
+ * @throws Think\Exception
+ * @return void
+ */
+function E($msg, $code=0) {
+ throw new Think\Exception($msg, $code);
+}
+
+/**
+ * 记录和统计时间(微秒)和内存使用情况
+ * 使用方法:
+ *
+ * G('begin'); // 记录开始标记位
+ * // ... 区间运行代码
+ * G('end'); // 记录结束标签位
+ * echo G('begin','end',6); // 统计区间运行时间 精确到小数后6位
+ * echo G('begin','end','m'); // 统计区间内存使用情况
+ * 如果end标记位没有定义,则会自动以当前作为标记位
+ * 其中统计内存使用需要 MEMORY_LIMIT_ON 常量为true才有效
+ *
+ * @param string $start 开始标签
+ * @param string $end 结束标签
+ * @param integer|string $dec 小数位或者m
+ * @return mixed
+ */
+function G($start,$end='',$dec=4) {
+ static $_info = array();
+ static $_mem = array();
+ if(is_float($end)) { // 记录时间
+ $_info[$start] = $end;
+ }elseif(!empty($end)){ // 统计时间和内存使用
+ if(!isset($_info[$end])) {
+ $_info[$end] = microtime(true);
+ }
+ if($dec=='m'){
+ if(!isset($_mem[$end])) $_mem[$end] = memory_get_usage();
+ return number_format(($_mem[$end]-$_mem[$start])/1024);
+ }else{
+ return number_format(($_info[$end]-$_info[$start]),$dec);
+ }
+
+ }else{ // 记录时间和内存使用
+ $_info[$start] = microtime(true);
+ $_mem[$start] = memory_get_usage();
+ }
+ return null;
+}
+
+/**
+ * 获取和设置语言定义(不区分大小写)
+ * @param string|array $name 语言变量
+ * @param mixed $value 语言值或者变量
+ * @return mixed
+ */
+function L($name=null, $value=null) {
+ static $_lang = array();
+ // 空参数返回所有定义
+ if (empty($name)){
+ return $_lang;
+ }
+ // 判断语言获取(或设置)
+ // 若不存在,直接返回全大写$name
+ if (is_string($name)) {
+ $name = strtoupper($name);
+ if (is_null($value)){
+ return isset($_lang[$name]) ? $_lang[$name] : $name;
+ }elseif(is_array($value)){
+ // 支持变量
+ $replace = array_keys($value);
+ foreach($replace as &$v){
+ $v = '{$'.$v.'}';
+ }
+ return str_replace($replace,$value,isset($_lang[$name]) ? $_lang[$name] : $name);
+ }
+ $_lang[$name] = $value; // 语言定义
+ return null;
+ }
+ // 批量定义
+ if (is_array($name)){
+ $_lang = array_merge($_lang, array_change_key_case($name, CASE_UPPER));
+ }
+ return null;
+}
+
+/**
+ * 添加和获取页面Trace记录
+ * @param string $value 变量
+ * @param string $label 标签
+ * @param string $level 日志级别
+ * @param boolean $record 是否记录日志
+ * @return void|array
+ */
+function trace($value='[think]',$label='',$level='DEBUG',$record=false) {
+ return Think\Think::trace($value,$label,$level,$record);
+}
+
+/**
+ * 编译文件
+ * @param string $filename 文件名
+ * @return string
+ */
+function compile($filename) {
+ $content = php_strip_whitespace($filename);
+ $content = trim(substr($content, 5));
+ // 替换预编译指令
+ $content = preg_replace('/\/\/\[RUNTIME\](.*?)\/\/\[\/RUNTIME\]/s', '', $content);
+ if(0===strpos($content,'namespace')){
+ $content = preg_replace('/namespace\s(.*?);/','namespace \\1{',$content,1);
+ }else{
+ $content = 'namespace {'.$content;
+ }
+ if ('?>' == substr($content, -2)){
+ $content = substr($content, 0, -2);
+ }
+ return $content.'}';
+}
+
+/**
+ * 获取模版文件 格式 资源://模块@主题/控制器/操作
+ * @param string $template 模版资源地址
+ * @param string $layer 视图层(目录)名称
+ * @return string
+ */
+function T($template='',$layer=''){
+
+ // 解析模版资源地址
+ if(false === strpos($template,'://')){
+ $template = 'http://'.str_replace(':', '/',$template);
+ }
+ $info = parse_url($template);
+ $file = $info['host'].(isset($info['path'])?$info['path']:'');
+ $module = isset($info['user'])?$info['user'].'/':MODULE_NAME.'/';
+ $extend = $info['scheme'];
+ $layer = $layer?$layer:C('DEFAULT_V_LAYER');
+
+ // 获取当前主题的模版路径
+ $auto = C('AUTOLOAD_NAMESPACE');
+ if($auto && isset($auto[$extend])){ // 扩展资源
+ $baseUrl = $auto[$extend].$module.$layer.'/';
+ }elseif(C('VIEW_PATH')){
+ // 改变模块视图目录
+ $baseUrl = C('VIEW_PATH');
+ }elseif(defined('TMPL_PATH')){
+ // 指定全局视图目录
+ $baseUrl = TMPL_PATH.$module;
+ }else{
+ $baseUrl = APP_PATH.$module.$layer.'/';
+ }
+
+ // 获取主题
+ $theme = substr_count($file,'/')<2 ? C('DEFAULT_THEME') : '';
+
+ // 分析模板文件规则
+ $depr = C('TMPL_FILE_DEPR');
+ if('' == $file) {
+ // 如果模板文件名为空 按照默认规则定位
+ $file = CONTROLLER_NAME . $depr . ACTION_NAME;
+ }elseif(false === strpos($file, '/')){
+ $file = CONTROLLER_NAME . $depr . $file;
+ }elseif('/' != $depr){
+ $file = substr_count($file,'/')>1 ? substr_replace($file,$depr,strrpos($file,'/'),1) : str_replace('/', $depr, $file);
+ }
+ return $baseUrl.($theme?$theme.'/':'').$file.C('TMPL_TEMPLATE_SUFFIX');
+}
+
+/**
+ * 获取输入参数 支持过滤和默认值
+ * 使用方法:
+ *
+ * I('id',0); 获取id参数 自动判断get或者post
+ * I('post.name','','htmlspecialchars'); 获取$_POST['name']
+ * I('get.'); 获取$_GET
+ *
+ * @param string $name 变量的名称 支持指定类型
+ * @param mixed $default 不存在的时候默认值
+ * @param mixed $filter 参数过滤方法
+ * @param mixed $datas 要获取的额外数据源
+ * @return mixed
+ */
+function I($name,$default='',$filter=null,$datas=null) {
+ if(strpos($name,'/')){ // 指定修饰符
+ list($name,$type) = explode('/',$name,2);
+ }elseif(C('VAR_AUTO_STRING')){ // 默认强制转换为字符串
+ $type = 's';
+ }
+ if(strpos($name,'.')) { // 指定参数来源
+ list($method,$name) = explode('.',$name,2);
+ }else{ // 默认为自动判断
+ $method = 'param';
+ }
+ switch(strtolower($method)) {
+ case 'get' : $input =& $_GET;break;
+ case 'post' : $input =& $_POST;break;
+ case 'put' : parse_str(file_get_contents('php://input'), $input);break;
+ case 'param' :
+ switch($_SERVER['REQUEST_METHOD']) {
+ case 'POST':
+ $input = $_POST;
+ break;
+ case 'PUT':
+ parse_str(file_get_contents('php://input'), $input);
+ break;
+ default:
+ $input = $_GET;
+ }
+ break;
+ case 'path' :
+ $input = array();
+ if(!empty($_SERVER['PATH_INFO'])){
+ $depr = C('URL_PATHINFO_DEPR');
+ $input = explode($depr,trim($_SERVER['PATH_INFO'],$depr));
+ }
+ break;
+ case 'request' : $input =& $_REQUEST; break;
+ case 'session' : $input =& $_SESSION; break;
+ case 'cookie' : $input =& $_COOKIE; break;
+ case 'server' : $input =& $_SERVER; break;
+ case 'globals' : $input =& $GLOBALS; break;
+ case 'data' : $input =& $datas; break;
+ default:
+ return NULL;
+ }
+ if(''==$name) { // 获取全部变量
+ $data = $input;
+ $filters = isset($filter)?$filter:C('DEFAULT_FILTER');
+ if($filters) {
+ if(is_string($filters)){
+ $filters = explode(',',$filters);
+ }
+ foreach($filters as $filter){
+ $data = array_map_recursive($filter,$data); // 参数过滤
+ }
+ }
+ }elseif(isset($input[$name])) { // 取值操作
+ $data = $input[$name];
+ $filters = isset($filter)?$filter:C('DEFAULT_FILTER');
+ if($filters) {
+ if(is_string($filters)){
+ $filters = explode(',',$filters);
+ }elseif(is_int($filters)){
+ $filters = array($filters);
+ }
+
+ foreach($filters as $filter){
+ if(function_exists($filter)) {
+ $data = is_array($data) ? array_map_recursive($filter,$data) : $filter($data); // 参数过滤
+ }elseif(0===strpos($filter,'/')){
+ // 支持正则验证
+ if(1 !== preg_match($filter,(string)$data)){
+ return isset($default) ? $default : NULL;
+ }
+ }else{
+ $data = filter_var($data,is_int($filter) ? $filter : filter_id($filter));
+ if(false === $data) {
+ return isset($default) ? $default : NULL;
+ }
+ }
+ }
+ }
+ if(!empty($type)){
+ switch(strtolower($type)){
+ case 'a': // 数组
+ $data = (array)$data;
+ break;
+ case 'd': // 数字
+ $data = (int)$data;
+ break;
+ case 'f': // 浮点
+ $data = (float)$data;
+ break;
+ case 'b': // 布尔
+ $data = (boolean)$data;
+ break;
+ case 's': // 字符串
+ default:
+ $data = (string)$data;
+ }
+ }
+ }else{ // 变量默认值
+ $data = isset($default)?$default:NULL;
+ }
+ is_array($data) && array_walk_recursive($data,'think_filter');
+ return $data;
+}
+
+function array_map_recursive($filter, $data) {
+ $result = array();
+ foreach ($data as $key => $val) {
+ $result[$key] = is_array($val)
+ ? array_map_recursive($filter, $val)
+ : call_user_func($filter, $val);
+ }
+ return $result;
+ }
+
+/**
+ * 设置和获取统计数据
+ * 使用方法:
+ *
+ * N('db',1); // 记录数据库操作次数
+ * N('read',1); // 记录读取次数
+ * echo N('db'); // 获取当前页面数据库的所有操作次数
+ * echo N('read'); // 获取当前页面读取次数
+ *
+ * @param string $key 标识位置
+ * @param integer $step 步进值
+ * @param boolean $save 是否保存结果
+ * @return mixed
+ */
+function N($key, $step=0,$save=false) {
+ static $_num = array();
+ if (!isset($_num[$key])) {
+ $_num[$key] = (false !== $save)? S('N_'.$key) : 0;
+ }
+ if (empty($step)){
+ return $_num[$key];
+ }else{
+ $_num[$key] = $_num[$key] + (int)$step;
+ }
+ if(false !== $save){ // 保存结果
+ S('N_'.$key,$_num[$key],$save);
+ }
+ return null;
+}
+
+/**
+ * 字符串命名风格转换
+ * type 0 将Java风格转换为C的风格 1 将C风格转换为Java的风格
+ * @param string $name 字符串
+ * @param integer $type 转换类型
+ * @return string
+ */
+function parse_name($name, $type=0) {
+ if ($type) {
+ return ucfirst(preg_replace_callback('/_([a-zA-Z])/', function($match){return strtoupper($match[1]);}, $name));
+ } else {
+ return strtolower(trim(preg_replace("/[A-Z]/", "_\\0", $name), "_"));
+ }
+}
+
+/**
+ * 优化的require_once
+ * @param string $filename 文件地址
+ * @return boolean
+ */
+function require_cache($filename) {
+ static $_importFiles = array();
+ if (!isset($_importFiles[$filename])) {
+ if (file_exists_case($filename)) {
+ require $filename;
+ $_importFiles[$filename] = true;
+ } else {
+ $_importFiles[$filename] = false;
+ }
+ }
+ return $_importFiles[$filename];
+}
+
+/**
+ * 区分大小写的文件存在判断
+ * @param string $filename 文件地址
+ * @return boolean
+ */
+function file_exists_case($filename) {
+ if (is_file($filename)) {
+ if (IS_WIN && APP_DEBUG) {
+ if (basename(realpath($filename)) != basename($filename))
+ return false;
+ }
+ return true;
+ }
+ return false;
+}
+
+/**
+ * 导入所需的类库 同java的Import 本函数有缓存功能
+ * @param string $class 类库命名空间字符串
+ * @param string $baseUrl 起始路径
+ * @param string $ext 导入的文件扩展名
+ * @return boolean
+ */
+function import($class, $baseUrl = '', $ext=EXT) {
+ static $_file = array();
+ $class = str_replace(array('.', '#'), array('/', '.'), $class);
+ if (isset($_file[$class . $baseUrl]))
+ return true;
+ else
+ $_file[$class . $baseUrl] = true;
+ $class_strut = explode('/', $class);
+ if (empty($baseUrl)) {
+ if ('@' == $class_strut[0] || MODULE_NAME == $class_strut[0]) {
+ //加载当前模块的类库
+ $baseUrl = MODULE_PATH;
+ $class = substr_replace($class, '', 0, strlen($class_strut[0]) + 1);
+ }elseif ('Common' == $class_strut[0]) {
+ //加载公共模块的类库
+ $baseUrl = COMMON_PATH;
+ $class = substr($class, 7);
+ }elseif (in_array($class_strut[0],array('Think','Org','Behavior','Com','Vendor')) || is_dir(LIB_PATH.$class_strut[0])) {
+ // 系统类库包和第三方类库包
+ $baseUrl = LIB_PATH;
+ }else { // 加载其他模块的类库
+ $baseUrl = APP_PATH;
+ }
+ }
+ if (substr($baseUrl, -1) != '/')
+ $baseUrl .= '/';
+ $classfile = $baseUrl . $class . $ext;
+ if (!class_exists(basename($class),false)) {
+ // 如果类不存在 则导入类库文件
+ return require_cache($classfile);
+ }
+ return null;
+}
+
+/**
+ * 基于命名空间方式导入函数库
+ * load('@.Util.Array')
+ * @param string $name 函数库命名空间字符串
+ * @param string $baseUrl 起始路径
+ * @param string $ext 导入的文件扩展名
+ * @return void
+ */
+function load($name, $baseUrl='', $ext='.php') {
+ $name = str_replace(array('.', '#'), array('/', '.'), $name);
+ if (empty($baseUrl)) {
+ if (0 === strpos($name, '@/')) {//加载当前模块函数库
+ $baseUrl = MODULE_PATH.'Common/';
+ $name = substr($name, 2);
+ } else { //加载其他模块函数库
+ $array = explode('/', $name);
+ $baseUrl = APP_PATH . array_shift($array).'/Common/';
+ $name = implode('/',$array);
+ }
+ }
+ if (substr($baseUrl, -1) != '/'){
+ $baseUrl .= '/';
+ }
+ require_cache($baseUrl . $name . $ext);
+}
+
+/**
+ * 快速导入第三方框架类库 所有第三方框架的类库文件统一放到 系统的Vendor目录下面
+ * @param string $class 类库
+ * @param string $baseUrl 基础目录
+ * @param string $ext 类库后缀
+ * @return boolean
+ */
+function vendor($class, $baseUrl = '', $ext='.php') {
+ if (empty($baseUrl)){
+ $baseUrl = VENDOR_PATH;
+ }
+ return import($class, $baseUrl, $ext);
+}
+
+/**
+ * 实例化模型类 格式 [资源://][模块/]模型
+ * @param string $name 资源地址
+ * @param string $layer 模型层名称
+ * @return Think\Model
+ */
+function D($name='',$layer='') {
+ if(empty($name)) return new Think\Model;
+ static $_model = array();
+ $layer = $layer? : 'Model';
+ if(isset($_model[$name.$layer])){
+ return $_model[$name.$layer];
+ }
+ $class = parse_res_name($name,$layer);
+ if(class_exists($class)) {
+ $model = new $class(basename($name));
+ }elseif(false === strpos($name,'/')){
+ // 自动加载公共模块下面的模型
+ $class = '\\Common\\'.$layer.'\\'.$name.$layer;
+ $model = class_exists($class)? new $class($name) : new Think\Model($name);
+ }else {
+ $model = new Think\Model(basename($name));
+ }
+ $_model[$name.$layer] = $model;
+ return $model;
+}
+
+/**
+ * 实例化一个没有模型文件的Model
+ * @param string $name Model名称 支持指定基础模型 例如 MongoModel:User
+ * @param string $tablePrefix 表前缀
+ * @param mixed $connection 数据库连接信息
+ * @return Think\Model
+ */
+function M($name='', $tablePrefix='',$connection='') {
+ static $_model = array();
+ if(strpos($name,':')) {
+ list($class,$name) = explode(':',$name);
+ }else{
+ $class = 'Think\\Model';
+ }
+ $guid = (is_array($connection)?implode('',$connection):$connection).$tablePrefix . $name . '_' . $class;
+ if (!isset($_model[$guid])){
+ $_model[$guid] = new $class($name,$tablePrefix,$connection);
+ }
+ return $_model[$guid];
+}
+
+/**
+ * 解析资源地址并导入类库文件
+ * 例如 module/controller addon://module/behavior
+ * @param string $name 资源地址 格式:[扩展://][模块/]资源名
+ * @param string $layer 分层名称
+ * @return string
+ */
+function parse_res_name($name,$layer){
+ if(strpos($name,'://')) {// 指定扩展资源
+ list($extend,$name) = explode('://',$name);
+ }else{
+ $extend = '';
+ }
+ if(strpos($name,'/')){ // 指定模块
+ list($module,$name) = explode('/',$name,2);
+ }else{
+ $module = defined('MODULE_NAME') ? MODULE_NAME : '' ;
+ }
+ $array = explode('/',$name);
+ $class = $module.'\\'.$layer;
+ foreach($array as $name){
+ $class .= '\\'.parse_name($name, 1);
+ }
+ // 导入资源类库
+ if($extend){ // 扩展资源
+ $class = $extend.'\\'.$class;
+ }
+
+ return $class.$layer;
+}
+
+/**
+ * 用于实例化访问控制器
+ * @param string $name 控制器名
+ * @return Think\Controller|false
+ */
+function controller($name){
+ $class = MODULE_NAME .'\\Controller';
+ $array = explode('/',$name);
+ foreach($array as $name){
+ $class .= '\\'.parse_name($name, 1);
+ }
+ $class .= $layer;
+
+ if(class_exists($class)) {
+ return new $class();
+ }else {
+ return false;
+ }
+}
+
+/**
+ * 实例化多层控制器 格式:[资源://][模块/]控制器
+ * @param string $name 资源地址
+ * @param string $layer 控制层名称
+ * @return Think\Controller|false
+ */
+function A($name,$layer='') {
+ static $_action = array();
+ $layer = $layer? : 'Controller';
+ if(isset($_action[$name.$layer])){
+ return $_action[$name.$layer];
+ }
+
+ $class = parse_res_name($name,$layer);
+ if(class_exists($class)) {
+ $action = new $class();
+ $_action[$name.$layer] = $action;
+ return $action;
+ }else {
+ return false;
+ }
+}
+
+
+/**
+ * 远程调用控制器的操作方法 URL 参数格式 [资源://][模块/]控制器/操作
+ * @param string $url 调用地址
+ * @param string|array $vars 调用参数 支持字符串和数组
+ * @param string $layer 要调用的控制层名称
+ * @return mixed
+ */
+function R($url,$vars=array(),$layer='') {
+ $info = pathinfo($url);
+ $action = $info['basename'];
+ $module = $info['dirname'];
+ $class = A($module,$layer);
+ if($class){
+ if(is_string($vars)) {
+ parse_str($vars,$vars);
+ }
+ return call_user_func_array(array(&$class,$action.C('ACTION_SUFFIX')),$vars);
+ }else{
+ return false;
+ }
+}
+
+/**
+ * 处理标签扩展
+ * @param string $tag 标签名称
+ * @param mixed $params 传入参数
+ * @return void
+ */
+function tag($tag, &$params=NULL) {
+ \Think\Hook::listen($tag,$params);
+}
+
+/**
+ * 执行某个行为
+ * @param string $name 行为名称
+ * @param string $tag 标签名称(行为类无需传入)
+ * @param Mixed $params 传入的参数
+ * @return void
+ */
+function B($name, $tag='',&$params=NULL) {
+ if(''==$tag){
+ $name .= 'Behavior';
+ }
+ return \Think\Hook::exec($name,$tag,$params);
+}
+
+/**
+ * 去除代码中的空白和注释
+ * @param string $content 代码内容
+ * @return string
+ */
+function strip_whitespace($content) {
+ $stripStr = '';
+ //分析php源码
+ $tokens = token_get_all($content);
+ $last_space = false;
+ for ($i = 0, $j = count($tokens); $i < $j; $i++) {
+ if (is_string($tokens[$i])) {
+ $last_space = false;
+ $stripStr .= $tokens[$i];
+ } else {
+ switch ($tokens[$i][0]) {
+ //过滤各种PHP注释
+ case T_COMMENT:
+ case T_DOC_COMMENT:
+ break;
+ //过滤空格
+ case T_WHITESPACE:
+ if (!$last_space) {
+ $stripStr .= ' ';
+ $last_space = true;
+ }
+ break;
+ case T_START_HEREDOC:
+ $stripStr .= "<<' . $label . htmlspecialchars($output, ENT_QUOTES) . '';
+ } else {
+ $output = $label . print_r($var, true);
+ }
+ } else {
+ ob_start();
+ var_dump($var);
+ $output = ob_get_clean();
+ if (!extension_loaded('xdebug')) {
+ $output = preg_replace('/\]\=\>\n(\s+)/m', '] => ', $output);
+ $output = '' . $label . htmlspecialchars($output, ENT_QUOTES) . '
';
+ }
+ }
+ if ($echo) {
+ echo($output);
+ return null;
+ }else
+ return $output;
+}
+
+/**
+ * 设置当前页面的布局
+ * @param string|false $layout 布局名称 为false的时候表示关闭布局
+ * @return void
+ */
+function layout($layout) {
+ if(false !== $layout) {
+ // 开启布局
+ C('LAYOUT_ON',true);
+ if(is_string($layout)) { // 设置新的布局模板
+ C('LAYOUT_NAME',$layout);
+ }
+ }else{// 临时关闭布局
+ C('LAYOUT_ON',false);
+ }
+}
+
+/**
+ * URL组装 支持不同URL模式
+ * @param string $url URL表达式,格式:'[模块/控制器/操作#锚点@域名]?参数1=值1&参数2=值2...'
+ * @param string|array $vars 传入的参数,支持数组和字符串
+ * @param string|boolean $suffix 伪静态后缀,默认为true表示获取配置值
+ * @param boolean $domain 是否显示域名
+ * @return string
+ */
+function U($url='',$vars='',$suffix=true,$domain=false) {
+ // 解析URL
+ $info = parse_url($url);
+ $url = !empty($info['path'])?$info['path']:ACTION_NAME;
+ if(isset($info['fragment'])) { // 解析锚点
+ $anchor = $info['fragment'];
+ if(false !== strpos($anchor,'?')) { // 解析参数
+ list($anchor,$info['query']) = explode('?',$anchor,2);
+ }
+ if(false !== strpos($anchor,'@')) { // 解析域名
+ list($anchor,$host) = explode('@',$anchor, 2);
+ }
+ }elseif(false !== strpos($url,'@')) { // 解析域名
+ list($url,$host) = explode('@',$info['path'], 2);
+ }
+ // 解析子域名
+ if(isset($host)) {
+ $domain = $host.(strpos($host,'.')?'':strstr($_SERVER['HTTP_HOST'],'.'));
+ }elseif($domain===true){
+ $domain = $_SERVER['HTTP_HOST'];
+ if(C('APP_SUB_DOMAIN_DEPLOY') ) { // 开启子域名部署
+ $domain = $domain=='localhost'?'localhost':'www'.strstr($_SERVER['HTTP_HOST'],'.');
+ // '子域名'=>array('模块[/控制器]');
+ foreach (C('APP_SUB_DOMAIN_RULES') as $key => $rule) {
+ $rule = is_array($rule)?$rule[0]:$rule;
+ if(false === strpos($key,'*') && 0=== strpos($url,$rule)) {
+ $domain = $key.strstr($domain,'.'); // 生成对应子域名
+ $url = substr_replace($url,'',0,strlen($rule));
+ break;
+ }
+ }
+ }
+ }
+
+ // 解析参数
+ if(is_string($vars)) { // aaa=1&bbb=2 转换成数组
+ parse_str($vars,$vars);
+ }elseif(!is_array($vars)){
+ $vars = array();
+ }
+ if(isset($info['query'])) { // 解析地址里面参数 合并到vars
+ parse_str($info['query'],$params);
+ $vars = array_merge($params,$vars);
+ }
+
+ // URL组装
+ $depr = C('URL_PATHINFO_DEPR');
+ $urlCase = C('URL_CASE_INSENSITIVE');
+ if($url) {
+ if(0=== strpos($url,'/')) {// 定义路由
+ $route = true;
+ $url = substr($url,1);
+ if('/' != $depr) {
+ $url = str_replace('/',$depr,$url);
+ }
+ }else{
+ if('/' != $depr) { // 安全替换
+ $url = str_replace('/',$depr,$url);
+ }
+ // 解析模块、控制器和操作
+ $url = trim($url,$depr);
+ $path = explode($depr,$url);
+ $var = array();
+ $varModule = C('VAR_MODULE');
+ $varController = C('VAR_CONTROLLER');
+ $varAction = C('VAR_ACTION');
+ $var[$varAction] = !empty($path)?array_pop($path):ACTION_NAME;
+ $var[$varController] = !empty($path)?array_pop($path):CONTROLLER_NAME;
+ if($urlCase) {
+ $var[$varController] = parse_name($var[$varController]);
+ }
+ $module = '';
+
+ if(!empty($path)) {
+ $var[$varModule] = implode($depr,$path);
+ }else{
+ if(C('MULTI_MODULE')) {
+ if(MODULE_NAME != C('DEFAULT_MODULE') || !C('MODULE_ALLOW_LIST')){
+ $var[$varModule]= MODULE_NAME;
+ }
+ }
+ }
+ if($maps = C('URL_MODULE_MAP')) {
+ if($_module = array_search(strtolower($var[$varModule]),$maps)){
+ $var[$varModule] = $_module;
+ }
+ }
+ if(isset($var[$varModule])){
+ $module = $var[$varModule];
+ unset($var[$varModule]);
+ }
+
+ }
+ }
+
+ if(C('URL_MODEL') == 0) { // 普通模式URL转换
+ $url = __APP__.'?'.C('VAR_MODULE')."={$module}&".http_build_query(array_reverse($var));
+ if($urlCase){
+ $url = strtolower($url);
+ }
+ if(!empty($vars)) {
+ $vars = http_build_query($vars);
+ $url .= '&'.$vars;
+ }
+ }else{ // PATHINFO模式或者兼容URL模式
+ if(isset($route)) {
+ $url = __APP__.'/'.rtrim($url,$depr);
+ }else{
+ $module = (defined('BIND_MODULE') && BIND_MODULE==$module )? '' : $module;
+ $url = __APP__.'/'.($module?$module.MODULE_PATHINFO_DEPR:'').implode($depr,array_reverse($var));
+ }
+ if($urlCase){
+ $url = strtolower($url);
+ }
+ if(!empty($vars)) { // 添加参数
+ foreach ($vars as $var => $val){
+ if('' !== trim($val)) $url .= $depr . $var . $depr . urlencode($val);
+ }
+ }
+ if($suffix) {
+ $suffix = $suffix===true?C('URL_HTML_SUFFIX'):$suffix;
+ if($pos = strpos($suffix, '|')){
+ $suffix = substr($suffix, 0, $pos);
+ }
+ if($suffix && '/' != substr($url,-1)){
+ $url .= '.'.ltrim($suffix,'.');
+ }
+ }
+ }
+ if(isset($anchor)){
+ $url .= '#'.$anchor;
+ }
+ if($domain) {
+ $url = (is_ssl()?'https://':'http://').$domain.$url;
+ }
+ return $url;
+}
+
+/**
+ * 渲染输出Widget
+ * @param string $name Widget名称
+ * @param array $data 传入的参数
+ * @return void
+ */
+function W($name, $data=array()) {
+ return R($name,$data,'Widget');
+}
+
+/**
+ * 判断是否SSL协议
+ * @return boolean
+ */
+function is_ssl() {
+ if(isset($_SERVER['HTTPS']) && ('1' == $_SERVER['HTTPS'] || 'on' == strtolower($_SERVER['HTTPS']))){
+ return true;
+ }elseif(isset($_SERVER['SERVER_PORT']) && ('443' == $_SERVER['SERVER_PORT'] )) {
+ return true;
+ }
+ return false;
+}
+
+/**
+ * URL重定向
+ * @param string $url 重定向的URL地址
+ * @param integer $time 重定向的等待时间(秒)
+ * @param string $msg 重定向前的提示信息
+ * @return void
+ */
+function redirect($url, $time=0, $msg='') {
+ //多行URL地址支持
+ $url = str_replace(array("\n", "\r"), '', $url);
+ if (empty($msg))
+ $msg = "系统将在{$time}秒之后自动跳转到{$url}!";
+ if (!headers_sent()) {
+ // redirect
+ if (0 === $time) {
+ header('Location: ' . $url);
+ } else {
+ header("refresh:{$time};url={$url}");
+ echo($msg);
+ }
+ exit();
+ } else {
+ $str = "";
+ if ($time != 0)
+ $str .= $msg;
+ exit($str);
+ }
+}
+
+/**
+ * 缓存管理
+ * @param mixed $name 缓存名称,如果为数组表示进行缓存设置
+ * @param mixed $value 缓存值
+ * @param mixed $options 缓存参数
+ * @return mixed
+ */
+function S($name,$value='',$options=null) {
+ static $cache = '';
+ if(is_array($options) && empty($cache)){
+ // 缓存操作的同时初始化
+ $type = isset($options['type'])?$options['type']:'';
+ $cache = Think\Cache::getInstance($type,$options);
+ }elseif(is_array($name)) { // 缓存初始化
+ $type = isset($name['type'])?$name['type']:'';
+ $cache = Think\Cache::getInstance($type,$name);
+ return $cache;
+ }elseif(empty($cache)) { // 自动初始化
+ $cache = Think\Cache::getInstance();
+ }
+ if(''=== $value){ // 获取缓存
+ return $cache->get($name);
+ }elseif(is_null($value)) { // 删除缓存
+ return $cache->rm($name);
+ }else { // 缓存数据
+ if(is_array($options)) {
+ $expire = isset($options['expire'])?$options['expire']:NULL;
+ }else{
+ $expire = is_numeric($options)?$options:NULL;
+ }
+ return $cache->set($name, $value, $expire);
+ }
+}
+
+/**
+ * 快速文件数据读取和保存 针对简单类型数据 字符串、数组
+ * @param string $name 缓存名称
+ * @param mixed $value 缓存值
+ * @param string $path 缓存路径
+ * @return mixed
+ */
+function F($name, $value='', $path=DATA_PATH) {
+ static $_cache = array();
+ $filename = $path . $name . '.php';
+ if ('' !== $value) {
+ if (is_null($value)) {
+ // 删除缓存
+ if(false !== strpos($name,'*')){
+ return false; // TODO
+ }else{
+ unset($_cache[$name]);
+ return Think\Storage::unlink($filename,'F');
+ }
+ } else {
+ Think\Storage::put($filename,serialize($value),'F');
+ // 缓存数据
+ $_cache[$name] = $value;
+ return null;
+ }
+ }
+ // 获取缓存数据
+ if (isset($_cache[$name]))
+ return $_cache[$name];
+ if (Think\Storage::has($filename,'F')){
+ $value = unserialize(Think\Storage::read($filename,'F'));
+ $_cache[$name] = $value;
+ } else {
+ $value = false;
+ }
+ return $value;
+}
+
+/**
+ * 根据PHP各种类型变量生成唯一标识号
+ * @param mixed $mix 变量
+ * @return string
+ */
+function to_guid_string($mix) {
+ if (is_object($mix)) {
+ return spl_object_hash($mix);
+ } elseif (is_resource($mix)) {
+ $mix = get_resource_type($mix) . strval($mix);
+ } else {
+ $mix = serialize($mix);
+ }
+ return md5($mix);
+}
+
+/**
+ * session管理函数
+ * @param string|array $name session名称 如果为数组则表示进行session设置
+ * @param mixed $value session值
+ * @return mixed
+ */
+function session($name='',$value='') {
+ $prefix = C('SESSION_PREFIX');
+ if(is_array($name)) { // session初始化 在session_start 之前调用
+ if(isset($name['prefix'])) C('SESSION_PREFIX',$name['prefix']);
+ if(C('VAR_SESSION_ID') && isset($_REQUEST[C('VAR_SESSION_ID')])){
+ session_id($_REQUEST[C('VAR_SESSION_ID')]);
+ }elseif(isset($name['id'])) {
+ session_id($name['id']);
+ }
+ if('common' != APP_MODE){ // 其它模式可能不支持
+ ini_set('session.auto_start', 0);
+ }
+ if(isset($name['name'])) session_name($name['name']);
+ if(isset($name['path'])) session_save_path($name['path']);
+ if(isset($name['domain'])) ini_set('session.cookie_domain', $name['domain']);
+ if(isset($name['expire'])) ini_set('session.gc_maxlifetime', $name['expire']);
+ if(isset($name['use_trans_sid'])) ini_set('session.use_trans_sid', $name['use_trans_sid']?1:0);
+ if(isset($name['use_cookies'])) ini_set('session.use_cookies', $name['use_cookies']?1:0);
+ if(isset($name['cache_limiter'])) session_cache_limiter($name['cache_limiter']);
+ if(isset($name['cache_expire'])) session_cache_expire($name['cache_expire']);
+ if(isset($name['type'])) C('SESSION_TYPE',$name['type']);
+ if(C('SESSION_TYPE')) { // 读取session驱动
+ $type = C('SESSION_TYPE');
+ $class = strpos($type,'\\')? $type : 'Think\\Session\\Driver\\'. ucwords(strtolower($type));
+ $hander = new $class();
+ session_set_save_handler(
+ array(&$hander,"open"),
+ array(&$hander,"close"),
+ array(&$hander,"read"),
+ array(&$hander,"write"),
+ array(&$hander,"destroy"),
+ array(&$hander,"gc"));
+ }
+ // 启动session
+ if(C('SESSION_AUTO_START')) session_start();
+ }elseif('' === $value){
+ if(''===$name){
+ // 获取全部的session
+ return $prefix ? $_SESSION[$prefix] : $_SESSION;
+ }elseif(0===strpos($name,'[')) { // session 操作
+ if('[pause]'==$name){ // 暂停session
+ session_write_close();
+ }elseif('[start]'==$name){ // 启动session
+ session_start();
+ }elseif('[destroy]'==$name){ // 销毁session
+ $_SESSION = array();
+ session_unset();
+ session_destroy();
+ }elseif('[regenerate]'==$name){ // 重新生成id
+ session_regenerate_id();
+ }
+ }elseif(0===strpos($name,'?')){ // 检查session
+ $name = substr($name,1);
+ if(strpos($name,'.')){ // 支持数组
+ list($name1,$name2) = explode('.',$name);
+ return $prefix?isset($_SESSION[$prefix][$name1][$name2]):isset($_SESSION[$name1][$name2]);
+ }else{
+ return $prefix?isset($_SESSION[$prefix][$name]):isset($_SESSION[$name]);
+ }
+ }elseif(is_null($name)){ // 清空session
+ if($prefix) {
+ unset($_SESSION[$prefix]);
+ }else{
+ $_SESSION = array();
+ }
+ }elseif($prefix){ // 获取session
+ if(strpos($name,'.')){
+ list($name1,$name2) = explode('.',$name);
+ return isset($_SESSION[$prefix][$name1][$name2])?$_SESSION[$prefix][$name1][$name2]:null;
+ }else{
+ return isset($_SESSION[$prefix][$name])?$_SESSION[$prefix][$name]:null;
+ }
+ }else{
+ if(strpos($name,'.')){
+ list($name1,$name2) = explode('.',$name);
+ return isset($_SESSION[$name1][$name2])?$_SESSION[$name1][$name2]:null;
+ }else{
+ return isset($_SESSION[$name])?$_SESSION[$name]:null;
+ }
+ }
+ }elseif(is_null($value)){ // 删除session
+ if(strpos($name,'.')){
+ list($name1,$name2) = explode('.',$name);
+ if($prefix){
+ unset($_SESSION[$prefix][$name1][$name2]);
+ }else{
+ unset($_SESSION[$name1][$name2]);
+ }
+ }else{
+ if($prefix){
+ unset($_SESSION[$prefix][$name]);
+ }else{
+ unset($_SESSION[$name]);
+ }
+ }
+ }else{ // 设置session
+ if(strpos($name,'.')){
+ list($name1,$name2) = explode('.',$name);
+ if($prefix){
+ $_SESSION[$prefix][$name1][$name2] = $value;
+ }else{
+ $_SESSION[$name1][$name2] = $value;
+ }
+ }else{
+ if($prefix){
+ $_SESSION[$prefix][$name] = $value;
+ }else{
+ $_SESSION[$name] = $value;
+ }
+ }
+ }
+ return null;
+}
+
+/**
+ * Cookie 设置、获取、删除
+ * @param string $name cookie名称
+ * @param mixed $value cookie值
+ * @param mixed $option cookie参数
+ * @return mixed
+ */
+function cookie($name='', $value='', $option=null) {
+ // 默认设置
+ $config = array(
+ 'prefix' => C('COOKIE_PREFIX'), // cookie 名称前缀
+ 'expire' => C('COOKIE_EXPIRE'), // cookie 保存时间
+ 'path' => C('COOKIE_PATH'), // cookie 保存路径
+ 'domain' => C('COOKIE_DOMAIN'), // cookie 有效域名
+ 'secure' => C('COOKIE_SECURE'), // cookie 启用安全传输
+ 'httponly' => C('COOKIE_HTTPONLY'), // httponly设置
+ );
+ // 参数设置(会覆盖黙认设置)
+ if (!is_null($option)) {
+ if (is_numeric($option))
+ $option = array('expire' => $option);
+ elseif (is_string($option))
+ parse_str($option, $option);
+ $config = array_merge($config, array_change_key_case($option));
+ }
+ if(!empty($config['httponly'])){
+ ini_set("session.cookie_httponly", 1);
+ }
+ // 清除指定前缀的所有cookie
+ if (is_null($name)) {
+ if (empty($_COOKIE))
+ return null;
+ // 要删除的cookie前缀,不指定则删除config设置的指定前缀
+ $prefix = empty($value) ? $config['prefix'] : $value;
+ if (!empty($prefix)) {// 如果前缀为空字符串将不作处理直接返回
+ foreach ($_COOKIE as $key => $val) {
+ if (0 === stripos($key, $prefix)) {
+ setcookie($key, '', time() - 3600, $config['path'], $config['domain'],$config['secure'],$config['httponly']);
+ unset($_COOKIE[$key]);
+ }
+ }
+ }
+ return null;
+ }elseif('' === $name){
+ // 获取全部的cookie
+ return $_COOKIE;
+ }
+ $name = $config['prefix'] . str_replace('.', '_', $name);
+ if ('' === $value) {
+ if(isset($_COOKIE[$name])){
+ $value = $_COOKIE[$name];
+ if(0===strpos($value,'think:')){
+ $value = substr($value,6);
+ return array_map('urldecode',json_decode(MAGIC_QUOTES_GPC?stripslashes($value):$value,true));
+ }else{
+ return $value;
+ }
+ }else{
+ return null;
+ }
+ } else {
+ if (is_null($value)) {
+ setcookie($name, '', time() - 3600, $config['path'], $config['domain'],$config['secure'],$config['httponly']);
+ unset($_COOKIE[$name]); // 删除指定cookie
+ } else {
+ // 设置cookie
+ if(is_array($value)){
+ $value = 'think:'.json_encode(array_map('urlencode',$value));
+ }
+ $expire = !empty($config['expire']) ? time() + intval($config['expire']) : 0;
+ setcookie($name, $value, $expire, $config['path'], $config['domain'],$config['secure'],$config['httponly']);
+ $_COOKIE[$name] = $value;
+ }
+ }
+ return null;
+}
+
+/**
+ * 发送HTTP状态
+ * @param integer $code 状态码
+ * @return void
+ */
+function send_http_status($code) {
+ static $_status = array(
+ // Informational 1xx
+ 100 => 'Continue',
+ 101 => 'Switching Protocols',
+ // Success 2xx
+ 200 => 'OK',
+ 201 => 'Created',
+ 202 => 'Accepted',
+ 203 => 'Non-Authoritative Information',
+ 204 => 'No Content',
+ 205 => 'Reset Content',
+ 206 => 'Partial Content',
+ // Redirection 3xx
+ 300 => 'Multiple Choices',
+ 301 => 'Moved Permanently',
+ 302 => 'Moved Temporarily ', // 1.1
+ 303 => 'See Other',
+ 304 => 'Not Modified',
+ 305 => 'Use Proxy',
+ // 306 is deprecated but reserved
+ 307 => 'Temporary Redirect',
+ // Client Error 4xx
+ 400 => 'Bad Request',
+ 401 => 'Unauthorized',
+ 402 => 'Payment Required',
+ 403 => 'Forbidden',
+ 404 => 'Not Found',
+ 405 => 'Method Not Allowed',
+ 406 => 'Not Acceptable',
+ 407 => 'Proxy Authentication Required',
+ 408 => 'Request Timeout',
+ 409 => 'Conflict',
+ 410 => 'Gone',
+ 411 => 'Length Required',
+ 412 => 'Precondition Failed',
+ 413 => 'Request Entity Too Large',
+ 414 => 'Request-URI Too Long',
+ 415 => 'Unsupported Media Type',
+ 416 => 'Requested Range Not Satisfiable',
+ 417 => 'Expectation Failed',
+ // Server Error 5xx
+ 500 => 'Internal Server Error',
+ 501 => 'Not Implemented',
+ 502 => 'Bad Gateway',
+ 503 => 'Service Unavailable',
+ 504 => 'Gateway Timeout',
+ 505 => 'HTTP Version Not Supported',
+ 509 => 'Bandwidth Limit Exceeded'
+ );
+ if(isset($_status[$code])) {
+ header('HTTP/1.1 '.$code.' '.$_status[$code]);
+ // 确保FastCGI模式下正常
+ header('Status:'.$code.' '.$_status[$code]);
+ }
+}
+
+function think_filter(&$value){
+ // TODO 其他安全过滤
+
+ // 过滤查询特殊字符
+ if(preg_match('/^(EXP|NEQ|GT|EGT|LT|ELT|OR|XOR|LIKE|NOTLIKE|NOT BETWEEN|NOTBETWEEN|BETWEEN|NOTIN|NOT IN|IN)$/i',$value)){
+ $value .= ' ';
+ }
+}
+
+// 不区分大小写的in_array实现
+function in_array_case($value,$array){
+ return in_array(strtolower($value),array_map('strtolower',$array));
+}
diff --git a/ThinkPHP/Mode/Sae/convention.php b/ThinkPHP/Mode/Sae/convention.php
new file mode 100644
index 0000000..b9df74d
--- /dev/null
+++ b/ThinkPHP/Mode/Sae/convention.php
@@ -0,0 +1,39 @@
+
+// +----------------------------------------------------------------------
+
+/**
+ * SAE模式惯例配置文件
+ * 该文件请不要修改,如果要覆盖惯例配置的值,可在应用配置文件中设定和惯例不符的配置项
+ * 配置名称大小写任意,系统会统一转换成小写
+ * 所有配置参数都可以在生效前动态改变
+ */
+defined('THINK_PATH') or exit();
+$st = new SaeStorage();
+return array(
+ //SAE下固定mysql配置
+ 'DB_TYPE' => 'mysql', // 数据库类型
+ 'DB_DEPLOY_TYPE' => 1,
+ 'DB_RW_SEPARATE' => true,
+ 'DB_HOST' => SAE_MYSQL_HOST_M.','.SAE_MYSQL_HOST_S, // 服务器地址
+ 'DB_NAME' => SAE_MYSQL_DB, // 数据库名
+ 'DB_USER' => SAE_MYSQL_USER, // 用户名
+ 'DB_PWD' => SAE_MYSQL_PASS, // 密码
+ 'DB_PORT' => SAE_MYSQL_PORT, // 端口
+ //更改模板替换变量,让普通能在所有平台下显示
+ 'TMPL_PARSE_STRING' => array(
+ // __PUBLIC__/upload --> /Public/upload -->http://appname-public.stor.sinaapp.com/upload
+ '/Public/upload' => $st->getUrl('public','upload')
+ ),
+ 'LOG_TYPE' => 'Sae',
+ 'DATA_CACHE_TYPE' => 'Memcachesae',
+ 'CHECK_APP_DIR' => false,
+ 'FILE_UPLOAD_TYPE' => 'Sae',
+);
diff --git a/ThinkPHP/Mode/api.php b/ThinkPHP/Mode/api.php
new file mode 100644
index 0000000..92c3a8c
--- /dev/null
+++ b/ThinkPHP/Mode/api.php
@@ -0,0 +1,44 @@
+
+// +----------------------------------------------------------------------
+
+/**
+ * ThinkPHP API模式定义
+ */
+return array(
+ // 配置文件
+ 'config' => array(
+ THINK_PATH.'Conf/convention.php', // 系统惯例配置
+ CONF_PATH.'config'.CONF_EXT, // 应用公共配置
+ ),
+
+ // 别名定义
+ 'alias' => array(
+ 'Think\Exception' => CORE_PATH . 'Exception'.EXT,
+ 'Think\Model' => CORE_PATH . 'Model'.EXT,
+ 'Think\Db' => CORE_PATH . 'Db'.EXT,
+ 'Think\Cache' => CORE_PATH . 'Cache'.EXT,
+ 'Think\Cache\Driver\File' => CORE_PATH . 'Cache/Driver/File'.EXT,
+ 'Think\Storage' => CORE_PATH . 'Storage'.EXT,
+ ),
+
+ // 函数和类文件
+ 'core' => array(
+ MODE_PATH.'Api/functions.php',
+ COMMON_PATH.'Common/function.php',
+ MODE_PATH . 'Api/App'.EXT,
+ MODE_PATH . 'Api/Dispatcher'.EXT,
+ MODE_PATH . 'Api/Controller'.EXT,
+ CORE_PATH . 'Behavior'.EXT,
+ ),
+ // 行为扩展定义
+ 'tags' => array(
+ ),
+);
diff --git a/ThinkPHP/Mode/common.php b/ThinkPHP/Mode/common.php
new file mode 100644
index 0000000..5513773
--- /dev/null
+++ b/ThinkPHP/Mode/common.php
@@ -0,0 +1,71 @@
+
+// +----------------------------------------------------------------------
+
+/**
+ * ThinkPHP 普通模式定义
+ */
+return array(
+ // 配置文件
+ 'config' => array(
+ THINK_PATH.'Conf/convention.php', // 系统惯例配置
+ CONF_PATH.'config'.CONF_EXT, // 应用公共配置
+ ),
+
+ // 别名定义
+ 'alias' => array(
+ 'Think\Log' => CORE_PATH . 'Log'.EXT,
+ 'Think\Log\Driver\File' => CORE_PATH . 'Log/Driver/File'.EXT,
+ 'Think\Exception' => CORE_PATH . 'Exception'.EXT,
+ 'Think\Model' => CORE_PATH . 'Model'.EXT,
+ 'Think\Db' => CORE_PATH . 'Db'.EXT,
+ 'Think\Template' => CORE_PATH . 'Template'.EXT,
+ 'Think\Cache' => CORE_PATH . 'Cache'.EXT,
+ 'Think\Cache\Driver\File' => CORE_PATH . 'Cache/Driver/File'.EXT,
+ 'Think\Storage' => CORE_PATH . 'Storage'.EXT,
+ ),
+
+ // 函数和类文件
+ 'core' => array(
+ THINK_PATH.'Common/functions.php',
+ COMMON_PATH.'Common/function.php',
+ CORE_PATH . 'Hook'.EXT,
+ CORE_PATH . 'App'.EXT,
+ CORE_PATH . 'Dispatcher'.EXT,
+ //CORE_PATH . 'Log'.EXT,
+ CORE_PATH . 'Route'.EXT,
+ CORE_PATH . 'Controller'.EXT,
+ CORE_PATH . 'View'.EXT,
+ BEHAVIOR_PATH . 'BuildLiteBehavior'.EXT,
+ BEHAVIOR_PATH . 'ParseTemplateBehavior'.EXT,
+ BEHAVIOR_PATH . 'ContentReplaceBehavior'.EXT,
+ ),
+ // 行为扩展定义
+ 'tags' => array(
+ 'app_init' => array(
+ 'Behavior\BuildLiteBehavior', // 生成运行Lite文件
+ ),
+ 'app_begin' => array(
+ 'Behavior\ReadHtmlCacheBehavior', // 读取静态缓存
+ ),
+ 'app_end' => array(
+ 'Behavior\ShowPageTraceBehavior', // 页面Trace显示
+ ),
+ 'view_parse' => array(
+ 'Behavior\ParseTemplateBehavior', // 模板解析 支持PHP、内置模板引擎和第三方模板引擎
+ ),
+ 'template_filter'=> array(
+ 'Behavior\ContentReplaceBehavior', // 模板输出替换
+ ),
+ 'view_filter' => array(
+ 'Behavior\WriteHtmlCacheBehavior', // 写入静态缓存
+ ),
+ ),
+);
diff --git a/ThinkPHP/Mode/lite.php b/ThinkPHP/Mode/lite.php
new file mode 100644
index 0000000..22f1cc2
--- /dev/null
+++ b/ThinkPHP/Mode/lite.php
@@ -0,0 +1,47 @@
+
+// +----------------------------------------------------------------------
+
+/**
+ * ThinkPHP Lite模式定义
+ */
+return array(
+ // 配置文件
+ 'config' => array(
+ MODE_PATH.'Lite/convention.php', // 系统惯例配置
+ CONF_PATH.'config'.CONF_EXT, // 应用公共配置
+ ),
+
+ // 别名定义
+ 'alias' => array(
+ 'Think\Exception' => CORE_PATH . 'Exception'.EXT,
+ 'Think\Model' => CORE_PATH . 'Model'.EXT,
+ 'Think\Db' => CORE_PATH . 'Db'.EXT,
+ 'Think\Cache' => CORE_PATH . 'Cache'.EXT,
+ 'Think\Cache\Driver\File' => CORE_PATH . 'Cache/Driver/File'.EXT,
+ 'Think\Storage' => CORE_PATH . 'Storage'.EXT,
+ ),
+
+ // 函数和类文件
+ 'core' => array(
+ MODE_PATH.'Lite/functions.php',
+ COMMON_PATH.'Common/function.php',
+ CORE_PATH . 'Hook'.EXT,
+ CORE_PATH . 'App'.EXT,
+ CORE_PATH . 'Dispatcher'.EXT,
+ //CORE_PATH . 'Log'.EXT,
+ CORE_PATH . 'Route'.EXT,
+ CORE_PATH . 'Controller'.EXT,
+ CORE_PATH . 'View'.EXT,
+ ),
+ // 行为扩展定义
+ 'tags' => array(
+ ),
+);
diff --git a/ThinkPHP/Mode/sae.php b/ThinkPHP/Mode/sae.php
new file mode 100644
index 0000000..4a99110
--- /dev/null
+++ b/ThinkPHP/Mode/sae.php
@@ -0,0 +1,68 @@
+
+// +----------------------------------------------------------------------
+
+/**
+ * ThinkPHP SAE应用模式定义文件
+ */
+return array(
+ // 配置文件
+ 'config' => array(
+ THINK_PATH.'Conf/convention.php', // 系统惯例配置
+ CONF_PATH.'config'.CONF_EXT, // 应用公共配置
+ MODE_PATH.'Sae/convention.php',//[sae] sae的惯例配置
+ ),
+
+ // 别名定义
+ 'alias' => array(
+ 'Think\Log' => CORE_PATH . 'Log'.EXT,
+ 'Think\Log\Driver\File' => CORE_PATH . 'Log/Driver/File'.EXT,
+ 'Think\Exception' => CORE_PATH . 'Exception'.EXT,
+ 'Think\Model' => CORE_PATH . 'Model'.EXT,
+ 'Think\Db' => CORE_PATH . 'Db'.EXT,
+ 'Think\Template' => CORE_PATH . 'Template'.EXT,
+ 'Think\Cache' => CORE_PATH . 'Cache'.EXT,
+ 'Think\Cache\Driver\File' => CORE_PATH . 'Cache/Driver/File'.EXT,
+ 'Think\Storage' => CORE_PATH . 'Storage'.EXT,
+ ),
+
+ // 函数和类文件
+ 'core' => array(
+ THINK_PATH.'Common/functions.php',
+ COMMON_PATH.'Common/function.php',
+ CORE_PATH . 'Hook'.EXT,
+ CORE_PATH . 'App'.EXT,
+ CORE_PATH . 'Dispatcher'.EXT,
+ //CORE_PATH . 'Log'.EXT,
+ CORE_PATH . 'Route'.EXT,
+ CORE_PATH . 'Controller'.EXT,
+ CORE_PATH . 'View'.EXT,
+ BEHAVIOR_PATH . 'ParseTemplateBehavior'.EXT,
+ BEHAVIOR_PATH . 'ContentReplaceBehavior'.EXT,
+ ),
+ // 行为扩展定义
+ 'tags' => array(
+ 'app_begin' => array(
+ 'Behavior\ReadHtmlCacheBehavior', // 读取静态缓存
+ ),
+ 'app_end' => array(
+ 'Behavior\ShowPageTraceBehavior', // 页面Trace显示
+ ),
+ 'view_parse' => array(
+ 'Behavior\ParseTemplateBehavior', // 模板解析 支持PHP、内置模板引擎和第三方模板引擎
+ ),
+ 'template_filter'=> array(
+ 'Behavior\ContentReplaceBehavior', // 模板输出替换
+ ),
+ 'view_filter' => array(
+ 'Behavior\WriteHtmlCacheBehavior', // 写入静态缓存
+ ),
+ ),
+);
diff --git a/ThinkPHP/ThinkPHP.php b/ThinkPHP/ThinkPHP.php
new file mode 100644
index 0000000..16970a7
--- /dev/null
+++ b/ThinkPHP/ThinkPHP.php
@@ -0,0 +1,97 @@
+
+// +----------------------------------------------------------------------
+
+//----------------------------------
+// ThinkPHP公共入口文件
+//----------------------------------
+
+// 记录开始运行时间
+$GLOBALS['_beginTime'] = microtime(TRUE);
+// 记录内存初始使用
+define('MEMORY_LIMIT_ON',function_exists('memory_get_usage'));
+if(MEMORY_LIMIT_ON) $GLOBALS['_startUseMems'] = memory_get_usage();
+
+// 版本信息
+const THINK_VERSION = '3.2.3';
+
+// URL 模式定义
+const URL_COMMON = 0; //普通模式
+const URL_PATHINFO = 1; //PATHINFO模式
+const URL_REWRITE = 2; //REWRITE模式
+const URL_COMPAT = 3; // 兼容模式
+
+// 类文件后缀
+const EXT = '.class.php';
+
+// 系统常量定义
+defined('THINK_PATH') or define('THINK_PATH', __DIR__.'/');
+defined('APP_PATH') or define('APP_PATH', dirname($_SERVER['SCRIPT_FILENAME']).'/');
+defined('APP_STATUS') or define('APP_STATUS', ''); // 应用状态 加载对应的配置文件
+defined('APP_DEBUG') or define('APP_DEBUG', false); // 是否调试模式
+
+if(function_exists('saeAutoLoader')){// 自动识别SAE环境
+ defined('APP_MODE') or define('APP_MODE', 'sae');
+ defined('STORAGE_TYPE') or define('STORAGE_TYPE', 'Sae');
+}else{
+ defined('APP_MODE') or define('APP_MODE', 'common'); // 应用模式 默认为普通模式
+ defined('STORAGE_TYPE') or define('STORAGE_TYPE', 'File'); // 存储类型 默认为File
+}
+
+defined('RUNTIME_PATH') or define('RUNTIME_PATH', APP_PATH.'Runtime/'); // 系统运行时目录
+defined('LIB_PATH') or define('LIB_PATH', realpath(THINK_PATH.'Library').'/'); // 系统核心类库目录
+defined('CORE_PATH') or define('CORE_PATH', LIB_PATH.'Think/'); // Think类库目录
+defined('BEHAVIOR_PATH')or define('BEHAVIOR_PATH', LIB_PATH.'Behavior/'); // 行为类库目录
+defined('MODE_PATH') or define('MODE_PATH', THINK_PATH.'Mode/'); // 系统应用模式目录
+defined('VENDOR_PATH') or define('VENDOR_PATH', LIB_PATH.'Vendor/'); // 第三方类库目录
+defined('COMMON_PATH') or define('COMMON_PATH', APP_PATH.'Common/'); // 应用公共目录
+defined('CONF_PATH') or define('CONF_PATH', COMMON_PATH.'Conf/'); // 应用配置目录
+defined('LANG_PATH') or define('LANG_PATH', COMMON_PATH.'Lang/'); // 应用语言目录
+defined('HTML_PATH') or define('HTML_PATH', APP_PATH.'Html/'); // 应用静态目录
+defined('LOG_PATH') or define('LOG_PATH', RUNTIME_PATH.'Logs/'); // 应用日志目录
+defined('TEMP_PATH') or define('TEMP_PATH', RUNTIME_PATH.'Temp/'); // 应用缓存目录
+defined('DATA_PATH') or define('DATA_PATH', RUNTIME_PATH.'Data/'); // 应用数据目录
+defined('CACHE_PATH') or define('CACHE_PATH', RUNTIME_PATH.'Cache/'); // 应用模板缓存目录
+defined('CONF_EXT') or define('CONF_EXT', '.php'); // 配置文件后缀
+defined('CONF_PARSE') or define('CONF_PARSE', ''); // 配置文件解析方法
+defined('ADDON_PATH') or define('ADDON_PATH', APP_PATH.'Addon');
+
+// 系统信息
+if(version_compare(PHP_VERSION,'5.4.0','<')) {
+ ini_set('magic_quotes_runtime',0);
+ define('MAGIC_QUOTES_GPC',get_magic_quotes_gpc()? true : false);
+}else{
+ define('MAGIC_QUOTES_GPC',false);
+}
+define('IS_CGI',(0 === strpos(PHP_SAPI,'cgi') || false !== strpos(PHP_SAPI,'fcgi')) ? 1 : 0 );
+define('IS_WIN',strstr(PHP_OS, 'WIN') ? 1 : 0 );
+define('IS_CLI',PHP_SAPI=='cli'? 1 : 0);
+
+if(!IS_CLI) {
+ // 当前文件名
+ if(!defined('_PHP_FILE_')) {
+ if(IS_CGI) {
+ //CGI/FASTCGI模式下
+ $_temp = explode('.php',$_SERVER['PHP_SELF']);
+ define('_PHP_FILE_', rtrim(str_replace($_SERVER['HTTP_HOST'],'',$_temp[0].'.php'),'/'));
+ }else {
+ define('_PHP_FILE_', rtrim($_SERVER['SCRIPT_NAME'],'/'));
+ }
+ }
+ if(!defined('__ROOT__')) {
+ $_root = rtrim(dirname(_PHP_FILE_),'/');
+ define('__ROOT__', (($_root=='/' || $_root=='\\')?'':$_root));
+ }
+}
+
+// 加载核心Think类
+require CORE_PATH.'Think'.EXT;
+// 应用初始化
+Think\Think::start();
\ No newline at end of file
diff --git a/ThinkPHP/Tpl/dispatch_jump.tpl b/ThinkPHP/Tpl/dispatch_jump.tpl
new file mode 100644
index 0000000..25d4e4e
--- /dev/null
+++ b/ThinkPHP/Tpl/dispatch_jump.tpl
@@ -0,0 +1,49 @@
+
+
+
+
+
+跳转提示
+
+
+
+
+
+
:)
+
+
+
:(
+
+
+
+
+页面自动 跳转 等待时间:
+
+
+
+
+
diff --git a/ThinkPHP/Tpl/page_trace.tpl b/ThinkPHP/Tpl/page_trace.tpl
new file mode 100644
index 0000000..8bd3703
--- /dev/null
+++ b/ThinkPHP/Tpl/page_trace.tpl
@@ -0,0 +1,67 @@
+
+
+
+ $value){ ?>
+
+
+
+
+
+
+
+ $val){
+ echo '- ' . (is_numeric($k) ? '' : $k.' : ') . htmlentities($val,ENT_COMPAT,'utf-8') .'
';
+ }
+ }
+ ?>
+
+
+
+
+
+
+
+
+
diff --git a/ThinkPHP/Tpl/think_exception.tpl b/ThinkPHP/Tpl/think_exception.tpl
new file mode 100644
index 0000000..61fd007
--- /dev/null
+++ b/ThinkPHP/Tpl/think_exception.tpl
@@ -0,0 +1,58 @@
+
+
+
+
+系统发生错误
+
+
+
+
+
+
ThinkPHP { Fast & Simple OOP PHP Framework } -- [ WE CAN DO IT JUST THINK ]
+
+
+
diff --git a/ThinkPHP/logo.png b/ThinkPHP/logo.png
new file mode 100644
index 0000000..e0b195d
Binary files /dev/null and b/ThinkPHP/logo.png differ
diff --git a/admin.php b/admin.php
new file mode 100644
index 0000000..8dac1c0
--- /dev/null
+++ b/admin.php
@@ -0,0 +1,26 @@
+
+// +----------------------------------------------------------------------
+
+// 应用入口文件
+
+// 检测PHP环境
+if(version_compare(PHP_VERSION,'5.3.0','<')) die('require PHP > 5.3.0 !');
+
+// 开启调试模式 建议开发阶段开启 部署阶段注释或者设为false
+define('APP_DEBUG',True);
+
+// 定义应用目录
+define('APP_PATH','./Backend/');
+
+// 引入ThinkPHP入口文件
+require './ThinkPHP/ThinkPHP.php';
+
+// 亲^_^ 后面不需要任何代码了 就是如此简单
\ No newline at end of file
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..5154e2e
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,18 @@
+{
+ "name": "topthink/thinkphp",
+ "description": "the ThinkPHP Framework",
+ "type": "framework",
+ "keywords": ["framework","thinkphp","ORM"],
+ "homepage": "http://thinkphp.cn/",
+ "license": "Apache2",
+ "authors": [
+ {
+ "name": "liu21st",
+ "email": "liu21st@gmail.com"
+ }
+ ],
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "minimum-stability": "dev"
+}
diff --git a/index.php b/index.php
new file mode 100644
index 0000000..4610e18
--- /dev/null
+++ b/index.php
@@ -0,0 +1,26 @@
+
+// +----------------------------------------------------------------------
+
+// 应用入口文件
+
+// 检测PHP环境
+if(version_compare(PHP_VERSION,'5.3.0','<')) die('require PHP > 5.3.0 !');
+
+// 开启调试模式 建议开发阶段开启 部署阶段注释或者设为false
+define('APP_DEBUG',True);
+
+// 定义应用目录
+define('APP_PATH','./Frontend/');
+
+// 引入ThinkPHP入口文件
+require './ThinkPHP/ThinkPHP.php';
+
+// 亲^_^ 后面不需要任何代码了 就是如此简单
\ No newline at end of file