<?php
/**
* Project: Smarty: the PHP compiling template engine
* File: Smarty_Compiler.class.php
*
* 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
*
* @link http://smarty.php.net/
* @author Monte Ohrt <monte at ohrt dot com>
* @author Andrei Zmievski <andrei@php.net>
* @version 2.6.13
* @copyright 2001-2005 New Digital Group, Inc.
* @package Smarty
*/
/* $Id: Smarty_Compiler.class.php,v 1.1.1.1 2006/07/31 07:21:46 haojianye Exp $ */
/**
* Template compiling class
* @package Smarty
*/
class Smarty_Compiler extends Smarty {
// internal vars
/**#@+
* @access private
*/
var $_folded_blocks = array(); // keeps folded template blocks
var $_current_file = null; // the current template being compiled
var $_current_line_no = 1; // line number for error messages
var $_capture_stack = array(); // keeps track of nested capture buffers
var $_plugin_info = array(); // keeps track of plugins to load
var $_init_smarty_vars = false;
var $_permitted_tokens = array('true','false','yes','no','on','off','null');
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 $_reg_obj_regexp = null;
var $_var_bracket_regexp = null;
var $_num_const_regexp = null;
var $_dvar_guts_regexp = null;
var $_dvar_regexp = null;
var $_cvar_regexp = null;
var $_svar_regexp = null;
var $_avar_regexp = null;
var $_mod_regexp = null;
var $_var_regexp = null;
var $_parenth_param_regexp = null;
var $_func_call_regexp = null;
var $_obj_ext_regexp = null;
var $_obj_start_regexp = null;
var $_obj_params_regexp = null;
var $_obj_call_regexp = null;
var $_cacheable_state = 0;
var $_cache_attrs_count = 0;
var $_nocache_count = 0;
var $_cache_serial = null;
var $_cache_include = null;
var $_strip_depth = 0;
var $_additional_newline = "\n";
/**#@-*/
/**
* The class constructor.
*/
function Smarty_Compiler()
{
// matches double quoted strings:
// "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]
$this->_var_bracket_regexp = '\[\$?[\w\.]+\]';
// matches numerical constants
// 30
// -12
// 13.22
$this->_num_const_regexp = '(?:\-?\d+(?:\.\d+)?)';
// matches $ vars (not objects):
// $foo
// $foo.bar
// $foo.bar.foobar
// $foo[0]
// $foo[$bar]
// $foo[5][blah]
// $foo[5].bar[$foobar][4]
$this->_dvar_math_regexp = '(?:[\+\*\/\%]|(?:-(?!>)))';
$this->_dvar_math_var_regexp = '[\$\w\.\+\-\*\/\%\d\>\[\]]';
$this->_dvar_guts_regexp = '\w+(?:' . $this->_var_bracket_regexp
. ')*(?:\.\$?\w+(?:' . $this->_var_bracket_regexp . ')*)*(?:' . $this->_dvar_math_regexp . '(?:' . $this->_num_const_regexp . '|' . $this->_dvar_math_var_regexp . ')*)?';
$this->_dvar_regexp = '\$' . $this->_dvar_guts_regexp;
// matches config vars:
// #foo#
// #foobar123_foo#
$this->_cvar_regexp = '\#\w+\#';
// matches section vars:
// %foo.bar%
$this->_svar_regexp = '\%\w+\.\w+\%';
// matches all valid variables (no quotes, no modifiers)
$this->_avar_regexp = '(?:' . $this->_dvar_regexp . '|'
. $this->_cvar_regexp . '|' . $this->_svar_regexp . ')';
// matches valid variable syntax:
// $foo
// $foo
// #foo#
// #foo#
// "text"
// "text"
$this->_var_regexp = '(?:' . $this->_avar_regexp . '|' . $this->_qstr_regexp . ')';
// matches valid object call (one level of object nesting allowed in parameters):
// $foo->bar
// $foo->bar()
// $foo->bar("text")
// $foo->bar($foo, $bar, "text")
// $foo->bar($foo, "foo")
// $foo->bar->foo()
// $foo->bar->foo->bar()
// $foo->bar($foo->bar)
// $foo->bar($foo->bar())
// $foo->bar($foo->bar($blah,$foo,44,"foo",$foo[0].bar))
$this->_obj_ext_regexp = '\->(?:\$?' . $this->_dvar_guts_regexp . ')';
$this->_obj_restricted_param_regexp = '(?:'
. '(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . ')(?:' . $this->_obj_ext_regexp . '(?:\((?:(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . ')'
. '(?:\s*,\s*(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . '))*)?\))?)*)';
$this->_obj_single_param_regexp = '(?:\w+|' . $this->_obj_restricted_param_regexp . '(?:\s*,\s*(?:(?:\w+|'
. $this->_var_regexp . $this->_obj_restricted_param_regexp . ')))*)';
$this->_obj_params_regexp = '\((?:' . $this->_obj_single_param_regexp
. '(?:\s*,\s*' . $this->_obj_single_param_regexp . ')*)?\)';
$this->_obj_start_regexp = '(?:' . $this->_dvar_regexp . '(?:' . $this->_obj_ext_regexp . ')+)';
$this->_obj_call_regexp = '(?:' . $this->_obj_start_regexp . '(?:' . $this->_obj_params_regexp . ')?(?:' . $this->_dvar_math_regexp . '(?:' . $this->_num_const_regexp . '|' . $this->_dvar_math_var_regexp . ')*)?)';
// matches valid modifier syntax:
// |foo
// |@foo
// |foo:"bar"
// |foo:$bar
// |foo:"bar":$foobar
// |foo|bar
// |foo:$foo->bar
$this->_mod_regexp = '(?:\|@?\w+(?::(?:\w+|' . $this->_num_const_regexp . '|'
. $this->_obj_call_regexp . '|' . $this->_avar_regexp . '|' . $this->_qstr_regexp .'))*)';
// matches valid function name:
// foo123
// _foo_bar
$this->_func_regexp = '[a-zA-Z_]\w*';
// matches valid registered object:
// foo->bar
$this->_reg_obj_regexp = '[a-zA-Z_]\w*->[a-zA-Z_]\w*';
// matches valid parameter values:
// true
// $foo
// $foo|bar
// #foo#
// #foo#|bar
// "text"
// "text"|bar
// $foo->bar
$this->_param_regexp = '(?:\s*(?:' . $this->_obj_call_regexp . '|'
. $this->_var_regexp . '|' . $this->_num_const_regexp . '|\w+)(?>' . $this->_mod_regexp . '*)\s*)';
// matches valid parenthesised func
没有合适的资源?快使用搜索试试~ 我知道了~
基于Jquery的AJAX简单实用的PHP留言板
共125个文件
php:92个
tpl:15个
conf:3个
5星 · 超过95%的资源 需积分: 9 95 下载量 154 浏览量
2011-06-16
15:52:44
上传
评论 2
收藏 186KB RAR 举报
温馨提示
曾经一直想做个PHP+AJAX的留言板,但是相当郁闷的是网上找了大半天,终于找到了一个。然而他没有使用JS框架,对于我这种JS白痴来说,想要把他的这个例子加到我的网站中就象登天那么难。看他的代码异常复杂,估计他过几天连自己的也看不懂了>_< 这就是为什么我要写这篇文章的原因,是想给大家提供一个简单实用的PHP+AJAX留言板,这篇文章将会异常的简单,只要你有点编程的基础就可以了。
资源推荐
资源详情
资源评论
收起资源包目录
基于Jquery的AJAX简单实用的PHP留言板 (125个子文件)
BUGS 377B
ChangeLog 210KB
test.conf 70B
globals_single_quotes.conf 13B
globals_double_quotes.conf 13B
css.css 60B
FAQ 0B
smarty_icon.gif 1KB
INSTALL 1KB
COPYING.lib 24KB
NEWS 45KB
Smarty_Compiler.class.php 92KB
Smarty.class.php 64KB
test_cases.php 17KB
Config_File.class.php 13KB
function.html_select_date.php 12KB
class.mysql.php 9KB
function.fetch.php 9KB
function.html_select_time.php 7KB
function.config_load.php 6KB
function.mailto.php 5KB
function.html_radios.php 5KB
function.html_image.php 5KB
core.load_plugins.php 4KB
function.html_checkboxes.php 4KB
%%91^912^912211C9%%admin_list.tpl.php 4KB
function.html_options.php 4KB
function.html_table.php 4KB
%%3E^3EF^3EF2E265%%list_New.tpl.php 4KB
core.write_cache_file.php 4KB
core.read_cache_file.php 4KB
function.popup.php 3KB
function.cycle.php 3KB
core.write_compiled_include.php 3KB
block.textformat.php 3KB
modifier.escape.php 3KB
core.run_insert_handler.php 3KB
outputfilter.trimwhitespace.php 3KB
function.math.php 3KB
%%0B^0B5^0B585104%%admin_update.tpl.php 3KB
core.create_dir_structure.php 3KB
core.get_php_resource.php 2KB
core.process_cached_inserts.php 2KB
core.rm_auto.php 2KB
%%F7^F75^F75099C7%%addNew.tpl.php 2KB
core.assemble_plugin_filepath.php 2KB
modifier.debug_print_var.php 2KB
function.counter.php 2KB
core.is_secure.php 2KB
core.smarty_include_php.php 2KB
core.display_debug_console.php 2KB
admin_list.php 2KB
core.rmdir.php 1KB
modifier.date_format.php 1KB
list_New.php 1KB
core.write_file.php 1KB
modifier.truncate.php 1KB
core.is_trusted.php 1KB
core.assign_smarty_interface.php 1KB
shared.make_timestamp.php 1KB
function.assign_debug_info.php 1KB
login.php 1KB
compiler.assign.php 1KB
core.write_compiled_resource.php 1KB
function.eval.php 1KB
core.process_compiled_include.php 1KB
core.get_include_path.php 1KB
modifier.capitalize.php 1KB
function.popup_init.php 1019B
modifier.regex_replace.php 935B
index.php 908B
function.debug.php 870B
admin_update.php 830B
shared.escape_special_chars.php 805B
modifier.count_words.php 784B
modifier.count_characters.php 775B
modifier.strip.php 775B
smarty.init.php 765B
modifier.nl2br.php 752B
modifier.strip_tags.php 708B
index.php 694B
modifier.count_sentences.php 682B
modifier.spacify.php 674B
modifier.default.php 667B
modifier.count_paragraphs.php 659B
modifier.cat.php 656B
modifier.wordwrap.php 642B
%%FD^FD1^FD153A02%%top.tpl.php 631B
modifier.replace.php 615B
modifier.string_format.php 608B
modifier.indent.php 595B
admin_update_Ac.php 587B
addNew.php 585B
modifier.upper.php 507B
modifier.lower.php 507B
core.get_microtime.php 383B
login_.php 372B
class.config.php 214B
admin.php 205B
smarty_unit_test.php 187B
共 125 条
- 1
- 2
kai540088301
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 简历-求职简历-word-文件-简历模版免费分享-应届生-高颜值简历模版-个人简历模版-简约大气-大学生在校生-求职-实习
- 简历-求职简历-word-文件-简历模版免费分享-应届生-高颜值简历模版-个人简历模版-简约大气-大学生在校生-求职-实习
- ic_launcher.png
- 测试文件,1234法沙发沙发范德萨
- 简历-求职简历-word-文件-简历模版免费分享-应届生-高颜值简历模版-个人简历模版-简约大气-大学生在校生-求职-实习
- ??????????????
- 简历-求职简历-word-文件-简历模版免费分享-应届生-高颜值简历模版-个人简历模版-简约大气-大学生在校生-求职-实习
- 简历-求职简历-word-文件-简历模版免费分享-应届生-高颜值简历模版-个人简历模版-简约大气-大学生在校生-求职-实习
- 简历-求职简历-word-文件-简历模版免费分享-应届生-高颜值简历模版-个人简历模版-简约大气-大学生在校生-求职-实习
- API网关选型对比之APISIX
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页