日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > php >内容正文

php

php smarty extends,php封装的smarty类完整实例

發布時間:2023/12/18 php 40 豆豆
生活随笔 收集整理的這篇文章主要介紹了 php smarty extends,php封装的smarty类完整实例 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

本文實例講述了php封裝的smarty類。分享給大家供大家參考,具體如下:

/**

* Project: Smarty: the PHP compiling template engine

* File: Smarty.class.php

* SVN: $Id: Smarty.class.php 4848 2014-06-08 18:12:09Z Uwe.Tews@googlemail.com $

* 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

* For questions, help, comments, discussion, etc., please join the

* Smarty mailing list. Send a blank e-mail to

* smarty-discussion-subscribe@googlegroups.com

*

* @link http://www.smarty.net/

* @copyright 2008 New Digital Group, Inc.

* @author Monte Ohrt

* @author Uwe Tews

* @author Rodney Rehm

* @package Smarty

* @version 3.1.19

*/

/**

* define shorthand directory separator constant

*/

if (!defined('DS')) {

define('DS', DIRECTORY_SEPARATOR);

}

/**

* set SMARTY_DIR to absolute path to Smarty library files.

* Sets SMARTY_DIR only if user application has not already defined it.

*/

if (!defined('SMARTY_DIR')) {

define('SMARTY_DIR', dirname(__FILE__) . DS);

}

/**

* set SMARTY_SYSPLUGINS_DIR to absolute path to Smarty internal plugins.

* Sets SMARTY_SYSPLUGINS_DIR only if user application has not already defined it.

*/

if (!defined('SMARTY_SYSPLUGINS_DIR')) {

define('SMARTY_SYSPLUGINS_DIR', SMARTY_DIR . 'sysplugins' . DS);

}

if (!defined('SMARTY_PLUGINS_DIR')) {

define('SMARTY_PLUGINS_DIR', SMARTY_DIR . 'plugins' . DS);

}

if (!defined('SMARTY_MBSTRING')) {

define('SMARTY_MBSTRING', function_exists('mb_split'));

}

if (!defined('SMARTY_RESOURCE_CHAR_SET')) {

// UTF-8 can only be done properly when mbstring is available!

/**

* @deprecated in favor of Smarty::$_CHARSET

*/

define('SMARTY_RESOURCE_CHAR_SET', SMARTY_MBSTRING ? 'UTF-8' : 'ISO-8859-1');

}

if (!defined('SMARTY_RESOURCE_DATE_FORMAT')) {

/**

* @deprecated in favor of Smarty::$_DATE_FORMAT

*/

define('SMARTY_RESOURCE_DATE_FORMAT', '%b %e, %Y');

}

/**

* register the class autoloader

*/

if (!defined('SMARTY_SPL_AUTOLOAD')) {

define('SMARTY_SPL_AUTOLOAD', 0);

}

if (SMARTY_SPL_AUTOLOAD && set_include_path(get_include_path() . PATH_SEPARATOR . SMARTY_SYSPLUGINS_DIR) !== false) {

$registeredAutoLoadFunctions = spl_autoload_functions();

if (!isset($registeredAutoLoadFunctions['spl_autoload'])) {

spl_autoload_register();

}

} else {

spl_autoload_register('smartyAutoload');

}

/**

* Load always needed external class files

*/

include_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_data.php';

include_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_templatebase.php';

include_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_template.php';

include_once SMARTY_SYSPLUGINS_DIR . 'smarty_resource.php';

include_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_resource_file.php';

include_once SMARTY_SYSPLUGINS_DIR . 'smarty_cacheresource.php';

include_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_cacheresource_file.php';

/**

* This is the main Smarty class

*

* @package Smarty

*/

class Smarty extends Smarty_Internal_TemplateBase

{

/**#@+

* constant definitions

*/

/**

* smarty version

*/

const SMARTY_VERSION = 'Smarty-3.1.19';

/**

* define variable scopes

*/

const SCOPE_LOCAL = 0;

const SCOPE_PARENT = 1;

const SCOPE_ROOT = 2;

const SCOPE_GLOBAL = 3;

/**

* define caching modes

*/

const CACHING_OFF = 0;

const CACHING_LIFETIME_CURRENT = 1;

const CACHING_LIFETIME_SAVED = 2;

/**

* define constant for clearing cache files be saved expiration datees

*/

const CLEAR_EXPIRED = - 1;

/**

* define compile check modes

*/

const COMPILECHECK_OFF = 0;

const COMPILECHECK_ON = 1;

const COMPILECHECK_CACHEMISS = 2;

/**

* modes for handling of "<?php ... ?>" tags in templates.

*/

const PHP_PASSTHRU = 0; //-> print tags as plain text

const PHP_QUOTE = 1; //-> escape tags as entities

const PHP_REMOVE = 2; //-> escape tags as entities

const PHP_ALLOW = 3; //-> escape tags as entities

/**

* filter types

*/

const FILTER_POST = 'post';

const FILTER_PRE = 'pre';

const FILTER_OUTPUT = 'output';

const FILTER_VARIABLE = 'variable';

/**

* plugin types

*/

const PLUGIN_FUNCTION = 'function';

const PLUGIN_BLOCK = 'block';

const PLUGIN_COMPILER = 'compiler';

const PLUGIN_MODIFIER = 'modifier';

const PLUGIN_MODIFIERCOMPILER = 'modifiercompiler';

/**#@-*/

/**

* assigned global tpl vars

*/

public static $global_tpl_vars = array();

/**

* error handler returned by set_error_hanlder() in Smarty::muteExpectedErrors()

*/

public static $_previous_error_handler = null;

/**

* contains directories outside of SMARTY_DIR that are to be muted by muteExpectedErrors()

*/

public static $_muted_directories = array();

/**

* Flag denoting if Multibyte String functions are available

*/

public static $_MBSTRING = SMARTY_MBSTRING;

/**

* The character set to adhere to (e.g. "UTF-8")

*/

public static $_CHARSET = SMARTY_RESOURCE_CHAR_SET;

/**

* The date format to be used internally

* (accepts date() and strftime())

*/

public static $_DATE_FORMAT = SMARTY_RESOURCE_DATE_FORMAT;

/**

* Flag denoting if PCRE should run in UTF-8 mode

*/

public static $_UTF8_MODIFIER = 'u';

/**

* Flag denoting if operating system is windows

*/

public static $_IS_WINDOWS = false;

/**#@+

* variables

*/

/**

* auto literal on delimiters with whitspace

*

* @var boolean

*/

public $auto_literal = true;

/**

* display error on not assigned variables

*

* @var boolean

*/

public $error_unassigned = false;

/**

* look up relative filepaths in include_path

*

* @var boolean

*/

public $use_include_path = false;

/**

* template directory

*

* @var array

*/

private $template_dir = array();

/**

* joined template directory string used in cache keys

*

* @var string

*/

public $joined_template_dir = null;

/**

* joined config directory string used in cache keys

*

* @var string

*/

public $joined_config_dir = null;

/**

* default template handler

*

* @var callable

*/

public $default_template_handler_func = null;

/**

* default config handler

*

* @var callable

*/

public $default_config_handler_func = null;

/**

* default plugin handler

*

* @var callable

*/

public $default_plugin_handler_func = null;

/**

* compile directory

*

* @var string

*/

private $compile_dir = null;

/**

* plugins directory

*

* @var array

*/

private $plugins_dir = array();

/**

* cache directory

*

* @var string

*/

private $cache_dir = null;

/**

* config directory

*

* @var array

*/

private $config_dir = array();

/**

* force template compiling?

*

* @var boolean

*/

public $force_compile = false;

/**

* check template for modifications?

*

* @var boolean

*/

public $compile_check = true;

/**

* use sub dirs for compiled/cached files?

*

* @var boolean

*/

public $use_sub_dirs = false;

/**

* allow ambiguous resources (that are made unique by the resource handler)

*

* @var boolean

*/

public $allow_ambiguous_resources = false;

/**

* caching enabled

*

* @var boolean

*/

public $caching = false;

/**

* merge compiled includes

*

* @var boolean

*/

public $merge_compiled_includes = false;

/**

* template inheritance merge compiled includes

*

* @var boolean

*/

public $inheritance_merge_compiled_includes = true;

/**

* cache lifetime in seconds

*

* @var integer

*/

public $cache_lifetime = 3600;

/**

* force cache file creation

*

* @var boolean

*/

public $force_cache = false;

/**

* Set this if you want different sets of cache files for the same

* templates.

*

* @var string

*/

public $cache_id = null;

/**

* Set this if you want different sets of compiled files for the same

* templates.

*

* @var string

*/

public $compile_id = null;

/**

* template left-delimiter

*

* @var string

*/

public $left_delimiter = "{";

/**

* template right-delimiter

*

* @var string

*/

public $right_delimiter = "}";

/**#@+

* security

*/

/**

* class name

* This should be instance of Smarty_Security.

*

* @var string

* @see Smarty_Security

*/

public $security_class = 'Smarty_Security';

/**

* implementation of security class

*

* @var Smarty_Security

*/

public $security_policy = null;

/**

* controls handling of PHP-blocks

*

* @var integer

*/

public $php_handling = self::PHP_PASSTHRU;

/**

* controls if the php template file resource is allowed

*

* @var bool

*/

public $allow_php_templates = false;

/**

* Should compiled-templates be prevented from being called directly?

* {@internal

* Currently used by Smarty_Internal_Template only.

* }}

*

* @var boolean

*/

public $direct_access_security = true;

/**#@-*/

/**

* debug mode

* Setting this to true enables the debug-console.

*

* @var boolean

*/

public $debugging = false;

/**

* This determines if debugging is enable-able from the browser.

*

*

NONE => no debugging control allowed

*

URL => enable debugging when SMARTY_DEBUG is found in the URL.

*

*

* @var string

*/

public $debugging_ctrl = 'NONE';

/**

* Name of debugging URL-param.

* Only used when $debugging_ctrl is set to 'URL'.

* The name of the URL-parameter that activates debugging.

*

* @var type

*/

public $smarty_debug_id = 'SMARTY_DEBUG';

/**

* Path of debug template.

*

* @var string

*/

public $debug_tpl = null;

/**

* When set, smarty uses this value as error_reporting-level.

*

* @var int

*/

public $error_reporting = null;

/**

* Internal flag for getTags()

*

* @var boolean

*/

public $get_used_tags = false;

/**#@+

* config var settings

*/

/**

* Controls whether variables with the same name overwrite each other.

*

* @var boolean

*/

public $config_overwrite = true;

/**

* Controls whether config values of on/true/yes and off/false/no get converted to boolean.

*

* @var boolean

*/

public $config_booleanize = true;

/**

* Controls whether hidden config sections/vars are read from the file.

*

* @var boolean

*/

public $config_read_hidden = false;

/**#@-*/

/**#@+

* resource locking

*/

/**

* locking concurrent compiles

*

* @var boolean

*/

public $compile_locking = true;

/**

* Controls whether cache resources should emply locking mechanism

*

* @var boolean

*/

public $cache_locking = false;

/**

* seconds to wait for acquiring a lock before ignoring the write lock

*

* @var float

*/

public $locking_timeout = 10;

/**#@-*/

/**

* global template functions

*

* @var array

*/

public $template_functions = array();

/**

* resource type used if none given

* Must be an valid key of $registered_resources.

*

* @var string

*/

public $default_resource_type = 'file';

/**

* caching type

* Must be an element of $cache_resource_types.

*

* @var string

*/

public $caching_type = 'file';

/**

* internal config properties

*

* @var array

*/

public $properties = array();

/**

* config type

*

* @var string

*/

public $default_config_type = 'file';

/**

* cached template objects

*

* @var array

*/

public $template_objects = array();

/**

* check If-Modified-Since headers

*

* @var boolean

*/

public $cache_modified_check = false;

/**

* registered plugins

*

* @var array

*/

public $registered_plugins = array();

/**

* plugin search order

*

* @var array

*/

public $plugin_search_order = array('function', 'block', 'compiler', 'class');

/**

* registered objects

*

* @var array

*/

public $registered_objects = array();

/**

* registered classes

*

* @var array

*/

public $registered_classes = array();

/**

* registered filters

*

* @var array

*/

public $registered_filters = array();

/**

* registered resources

*

* @var array

*/

public $registered_resources = array();

/**

* resource handler cache

*

* @var array

*/

public $_resource_handlers = array();

/**

* registered cache resources

*

* @var array

*/

public $registered_cache_resources = array();

/**

* cache resource handler cache

*

* @var array

*/

public $_cacheresource_handlers = array();

/**

* autoload filter

*

* @var array

*/

public $autoload_filters = array();

/**

* default modifier

*

* @var array

*/

public $default_modifiers = array();

/**

* autoescape variable output

*

* @var boolean

*/

public $escape_html = false;

/**

* global internal smarty vars

*

* @var array

*/

public static $_smarty_vars = array();

/**

* start time for execution time calculation

*

* @var int

*/

public $start_time = 0;

/**

* default file permissions

*

* @var int

*/

public $_file_perms = 0644;

/**

* default dir permissions

*

* @var int

*/

public $_dir_perms = 0771;

/**

* block tag hierarchy

*

* @var array

*/

public $_tag_stack = array();

/**

* self pointer to Smarty object

*

* @var Smarty

*/

public $smarty;

/**

* required by the compiler for BC

*

* @var string

*/

public $_current_file = null;

/**

* internal flag to enable parser debugging

*

* @var bool

*/

public $_parserdebug = false;

/**

* Saved parameter of merged templates during compilation

*

* @var array

*/

public $merged_templates_func = array();

/**#@-*/

/**

* Initialize new Smarty object

*/

public function __construct()

{

// selfpointer needed by some other class methods

$this->smarty = $this;

if (is_callable('mb_internal_encoding')) {

mb_internal_encoding(Smarty::$_CHARSET);

}

$this->start_time = microtime(true);

// set default dirs

$this->setTemplateDir('.' . DS . 'templates' . DS)

->setCompileDir('.' . DS . 'templates_c' . DS)

->setPluginsDir(SMARTY_PLUGINS_DIR)

->setCacheDir('.' . DS . 'cache' . DS)

->setConfigDir('.' . DS . 'configs' . DS);

$this->debug_tpl = 'file:' . dirname(__FILE__) . '/debug.tpl';

if (isset($_SERVER['SCRIPT_NAME'])) {

$this->assignGlobal('SCRIPT_NAME', $_SERVER['SCRIPT_NAME']);

}

}

/**

* Class destructor

*/

public function __destruct()

{

// intentionally left blank

}

/**

* <> set selfpointer on cloned object

*/

public function __clone()

{

$this->smarty = $this;

}

/**

* <> Generic getter.

* Calls the appropriate getter function.

* Issues an E_USER_NOTICE if no valid getter is found.

*

* @param string $name property name

*

* @return mixed

*/

public function __get($name)

{

$allowed = array(

'template_dir' => 'getTemplateDir',

'config_dir' => 'getConfigDir',

'plugins_dir' => 'getPluginsDir',

'compile_dir' => 'getCompileDir',

'cache_dir' => 'getCacheDir',

);

if (isset($allowed[$name])) {

return $this->{$allowed[$name]}();

} else {

trigger_error('Undefined property: ' . get_class($this) . '::$' . $name, E_USER_NOTICE);

}

}

/**

* <> Generic setter.

* Calls the appropriate setter function.

* Issues an E_USER_NOTICE if no valid setter is found.

*

* @param string $name property name

* @param mixed $value parameter passed to setter

*/

public function __set($name, $value)

{

$allowed = array(

'template_dir' => 'setTemplateDir',

'config_dir' => 'setConfigDir',

'plugins_dir' => 'setPluginsDir',

'compile_dir' => 'setCompileDir',

'cache_dir' => 'setCacheDir',

);

if (isset($allowed[$name])) {

$this->{$allowed[$name]}($value);

} else {

trigger_error('Undefined property: ' . get_class($this) . '::$' . $name, E_USER_NOTICE);

}

}

/**

* Check if a template resource exists

*

* @param string $resource_name template name

*

* @return boolean status

*/

public function templateExists($resource_name)

{

// create template object

$save = $this->template_objects;

$tpl = new $this->template_class($resource_name, $this);

// check if it does exists

$result = $tpl->source->exists;

$this->template_objects = $save;

return $result;

}

/**

* Returns a single or all global variables

*

* @param string $varname variable name or null

*

* @return string variable value or or array of variables

*/

public function getGlobal($varname = null)

{

if (isset($varname)) {

if (isset(self::$global_tpl_vars[$varname])) {

return self::$global_tpl_vars[$varname]->value;

} else {

return '';

}

} else {

$_result = array();

foreach (self::$global_tpl_vars AS $key => $var) {

$_result[$key] = $var->value;

}

return $_result;

}

}

/**

* Empty cache folder

*

* @param integer $exp_time expiration time

* @param string $type resource type

*

* @return integer number of cache files deleted

*/

public function clearAllCache($exp_time = null, $type = null)

{

// load cache resource and call clearAll

$_cache_resource = Smarty_CacheResource::load($this, $type);

Smarty_CacheResource::invalidLoadedCache($this);

return $_cache_resource->clearAll($this, $exp_time);

}

/**

* Empty cache for a specific template

*

* @param string $template_name template name

* @param string $cache_id cache id

* @param string $compile_id compile id

* @param integer $exp_time expiration time

* @param string $type resource type

*

* @return integer number of cache files deleted

*/

public function clearCache($template_name, $cache_id = null, $compile_id = null, $exp_time = null, $type = null)

{

// load cache resource and call clear

$_cache_resource = Smarty_CacheResource::load($this, $type);

Smarty_CacheResource::invalidLoadedCache($this);

return $_cache_resource->clear($this, $template_name, $cache_id, $compile_id, $exp_time);

}

/**

* Loads security class and enables security

*

* @param string|Smarty_Security $security_class if a string is used, it must be class-name

*

* @return Smarty current Smarty instance for chaining

* @throws SmartyException when an invalid class name is provided

*/

public function enableSecurity($security_class = null)

{

if ($security_class instanceof Smarty_Security) {

$this->security_policy = $security_class;

return $this;

} elseif (is_object($security_class)) {

throw new SmartyException("Class '" . get_class($security_class) . "' must extend Smarty_Security.");

}

if ($security_class == null) {

$security_class = $this->security_class;

}

if (!class_exists($security_class)) {

throw new SmartyException("Security class '$security_class' is not defined");

} elseif ($security_class !== 'Smarty_Security' && !is_subclass_of($security_class, 'Smarty_Security')) {

throw new SmartyException("Class '$security_class' must extend Smarty_Security.");

} else {

$this->security_policy = new $security_class($this);

}

return $this;

}

/**

* Disable security

*

* @return Smarty current Smarty instance for chaining

*/

public function disableSecurity()

{

$this->security_policy = null;

return $this;

}

/**

* Set template directory

*

* @param string|array $template_dir directory(s) of template sources

*

* @return Smarty current Smarty instance for chaining

*/

public function setTemplateDir($template_dir)

{

$this->template_dir = array();

foreach ((array) $template_dir as $k => $v) {

$this->template_dir[$k] = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($v, '/\\')) . DS;

}

$this->joined_template_dir = join(DIRECTORY_SEPARATOR, $this->template_dir);

return $this;

}

/**

* Add template directory(s)

*

* @param string|array $template_dir directory(s) of template sources

* @param string $key of the array element to assign the template dir to

*

* @return Smarty current Smarty instance for chaining

* @throws SmartyException when the given template directory is not valid

*/

public function addTemplateDir($template_dir, $key = null)

{

// make sure we're dealing with an array

$this->template_dir = (array) $this->template_dir;

if (is_array($template_dir)) {

foreach ($template_dir as $k => $v) {

$v = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($v, '/\\')) . DS;

if (is_int($k)) {

// indexes are not merged but appended

$this->template_dir[] = $v;

} else {

// string indexes are overridden

$this->template_dir[$k] = $v;

}

}

} else {

$v = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($template_dir, '/\\')) . DS;

if ($key !== null) {

// override directory at specified index

$this->template_dir[$key] = $v;

} else {

// append new directory

$this->template_dir[] = $v;

}

}

$this->joined_template_dir = join(DIRECTORY_SEPARATOR, $this->template_dir);

return $this;

}

/**

* Get template directories

*

* @param mixed $index index of directory to get, null to get all

*

* @return array|string list of template directories, or directory of $index

*/

public function getTemplateDir($index = null)

{

if ($index !== null) {

return isset($this->template_dir[$index]) ? $this->template_dir[$index] : null;

}

return (array) $this->template_dir;

}

/**

* Set config directory

*

* @param $config_dir

*

* @return Smarty current Smarty instance for chaining

*/

public function setConfigDir($config_dir)

{

$this->config_dir = array();

foreach ((array) $config_dir as $k => $v) {

$this->config_dir[$k] = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($v, '/\\')) . DS;

}

$this->joined_config_dir = join(DIRECTORY_SEPARATOR, $this->config_dir);

return $this;

}

/**

* Add config directory(s)

*

* @param string|array $config_dir directory(s) of config sources

* @param mixed $key key of the array element to assign the config dir to

*

* @return Smarty current Smarty instance for chaining

*/

public function addConfigDir($config_dir, $key = null)

{

// make sure we're dealing with an array

$this->config_dir = (array) $this->config_dir;

if (is_array($config_dir)) {

foreach ($config_dir as $k => $v) {

$v = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($v, '/\\')) . DS;

if (is_int($k)) {

// indexes are not merged but appended

$this->config_dir[] = $v;

} else {

// string indexes are overridden

$this->config_dir[$k] = $v;

}

}

} else {

$v = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($config_dir, '/\\')) . DS;

if ($key !== null) {

// override directory at specified index

$this->config_dir[$key] = rtrim($v, '/\\') . DS;

} else {

// append new directory

$this->config_dir[] = rtrim($v, '/\\') . DS;

}

}

$this->joined_config_dir = join(DIRECTORY_SEPARATOR, $this->config_dir);

return $this;

}

/**

* Get config directory

*

* @param mixed $index index of directory to get, null to get all

*

* @return array|string configuration directory

*/

public function getConfigDir($index = null)

{

if ($index !== null) {

return isset($this->config_dir[$index]) ? $this->config_dir[$index] : null;

}

return (array) $this->config_dir;

}

/**

* Set plugins directory

*

* @param string|array $plugins_dir directory(s) of plugins

*

* @return Smarty current Smarty instance for chaining

*/

public function setPluginsDir($plugins_dir)

{

$this->plugins_dir = array();

foreach ((array) $plugins_dir as $k => $v) {

$this->plugins_dir[$k] = rtrim($v, '/\\') . DS;

}

return $this;

}

/**

* Adds directory of plugin files

*

* @param $plugins_dir

*

* @return Smarty current Smarty instance for chaining

*/

public function addPluginsDir($plugins_dir)

{

// make sure we're dealing with an array

$this->plugins_dir = (array) $this->plugins_dir;

if (is_array($plugins_dir)) {

foreach ($plugins_dir as $k => $v) {

if (is_int($k)) {

// indexes are not merged but appended

$this->plugins_dir[] = rtrim($v, '/\\') . DS;

} else {

// string indexes are overridden

$this->plugins_dir[$k] = rtrim($v, '/\\') . DS;

}

}

} else {

// append new directory

$this->plugins_dir[] = rtrim($plugins_dir, '/\\') . DS;

}

$this->plugins_dir = array_unique($this->plugins_dir);

return $this;

}

/**

* Get plugin directories

*

* @return array list of plugin directories

*/

public function getPluginsDir()

{

return (array) $this->plugins_dir;

}

/**

* Set compile directory

*

* @param string $compile_dir directory to store compiled templates in

*

* @return Smarty current Smarty instance for chaining

*/

public function setCompileDir($compile_dir)

{

$this->compile_dir = rtrim($compile_dir, '/\\') . DS;

if (!isset(Smarty::$_muted_directories[$this->compile_dir])) {

Smarty::$_muted_directories[$this->compile_dir] = null;

}

return $this;

}

/**

* Get compiled directory

*

* @return string path to compiled templates

*/

public function getCompileDir()

{

return $this->compile_dir;

}

/**

* Set cache directory

*

* @param string $cache_dir directory to store cached templates in

*

* @return Smarty current Smarty instance for chaining

*/

public function setCacheDir($cache_dir)

{

$this->cache_dir = rtrim($cache_dir, '/\\') . DS;

if (!isset(Smarty::$_muted_directories[$this->cache_dir])) {

Smarty::$_muted_directories[$this->cache_dir] = null;

}

return $this;

}

/**

* Get cache directory

*

* @return string path of cache directory

*/

public function getCacheDir()

{

return $this->cache_dir;

}

/**

* Set default modifiers

*

* @param array|string $modifiers modifier or list of modifiers to set

*

* @return Smarty current Smarty instance for chaining

*/

public function setDefaultModifiers($modifiers)

{

$this->default_modifiers = (array) $modifiers;

return $this;

}

/**

* Add default modifiers

*

* @param array|string $modifiers modifier or list of modifiers to add

*

* @return Smarty current Smarty instance for chaining

*/

public function addDefaultModifiers($modifiers)

{

if (is_array($modifiers)) {

$this->default_modifiers = array_merge($this->default_modifiers, $modifiers);

} else {

$this->default_modifiers[] = $modifiers;

}

return $this;

}

/**

* Get default modifiers

*

* @return array list of default modifiers

*/

public function getDefaultModifiers()

{

return $this->default_modifiers;

}

/**

* Set autoload filters

*

* @param array $filters filters to load automatically

* @param string $type "pre", "output", … specify the filter type to set. Defaults to none treating $filters' keys as the appropriate types

*

* @return Smarty current Smarty instance for chaining

*/

public function setAutoloadFilters($filters, $type = null)

{

if ($type !== null) {

$this->autoload_filters[$type] = (array) $filters;

} else {

$this->autoload_filters = (array) $filters;

}

return $this;

}

/**

* Add autoload filters

*

* @param array $filters filters to load automatically

* @param string $type "pre", "output", … specify the filter type to set. Defaults to none treating $filters' keys as the appropriate types

*

* @return Smarty current Smarty instance for chaining

*/

public function addAutoloadFilters($filters, $type = null)

{

if ($type !== null) {

if (!empty($this->autoload_filters[$type])) {

$this->autoload_filters[$type] = array_merge($this->autoload_filters[$type], (array) $filters);

} else {

$this->autoload_filters[$type] = (array) $filters;

}

} else {

foreach ((array) $filters as $key => $value) {

if (!empty($this->autoload_filters[$key])) {

$this->autoload_filters[$key] = array_merge($this->autoload_filters[$key], (array) $value);

} else {

$this->autoload_filters[$key] = (array) $value;

}

}

}

return $this;

}

/**

* Get autoload filters

*

* @param string $type type of filter to get autoloads for. Defaults to all autoload filters

*

* @return array array( 'type1' => array( 'filter1', 'filter2', … ) ) or array( 'filter1', 'filter2', …) if $type was specified

*/

public function getAutoloadFilters($type = null)

{

if ($type !== null) {

return isset($this->autoload_filters[$type]) ? $this->autoload_filters[$type] : array();

}

return $this->autoload_filters;

}

/**

* return name of debugging template

*

* @return string

*/

public function getDebugTemplate()

{

return $this->debug_tpl;

}

/**

* set the debug template

*

* @param string $tpl_name

*

* @return Smarty current Smarty instance for chaining

* @throws SmartyException if file is not readable

*/

public function setDebugTemplate($tpl_name)

{

if (!is_readable($tpl_name)) {

throw new SmartyException("Unknown file '{$tpl_name}'");

}

$this->debug_tpl = $tpl_name;

return $this;

}

/**

* creates a template object

*

* @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 object $parent next higher level of Smarty variables

* @param boolean $do_clone flag is Smarty object shall be cloned

*

* @return object template object

*/

public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null, $do_clone = true)

{

if ($cache_id !== null && (is_object($cache_id) || is_array($cache_id))) {

$parent = $cache_id;

$cache_id = null;

}

if ($parent !== null && is_array($parent)) {

$data = $parent;

$parent = null;

} else {

$data = null;

}

// default to cache_id and compile_id of Smarty object

$cache_id = $cache_id === null ? $this->cache_id : $cache_id;

$compile_id = $compile_id === null ? $this->compile_id : $compile_id;

// already in template cache?

if ($this->allow_ambiguous_resources) {

$_templateId = Smarty_Resource::getUniqueTemplateName($this, $template) . $cache_id . $compile_id;

} else {

$_templateId = $this->joined_template_dir . '#' . $template . $cache_id . $compile_id;

}

if (isset($_templateId[150])) {

$_templateId = sha1($_templateId);

}

if ($do_clone) {

if (isset($this->template_objects[$_templateId])) {

// return cached template object

$tpl = clone $this->template_objects[$_templateId];

$tpl->smarty = clone $tpl->smarty;

$tpl->parent = $parent;

$tpl->tpl_vars = array();

$tpl->config_vars = array();

} else {

$tpl = new $this->template_class($template, clone $this, $parent, $cache_id, $compile_id);

}

} else {

if (isset($this->template_objects[$_templateId])) {

// return cached template object

$tpl = $this->template_objects[$_templateId];

$tpl->parent = $parent;

$tpl->tpl_vars = array();

$tpl->config_vars = array();

} else {

$tpl = new $this->template_class($template, $this, $parent, $cache_id, $compile_id);

}

}

// fill data if present

if (!empty($data) && is_array($data)) {

// set up variable values

foreach ($data as $_key => $_val) {

$tpl->tpl_vars[$_key] = new Smarty_variable($_val);

}

}

return $tpl;

}

/**

* Takes unknown classes and loads plugin files for them

* class name format: Smarty_PluginType_PluginName

* plugin filename format: plugintype.pluginname.php

*

* @param string $plugin_name class plugin name to load

* @param bool $check check if already loaded

*

* @throws SmartyException

* @return string |boolean filepath of loaded file or false

*/

public function loadPlugin($plugin_name, $check = true)

{

// if function or class exists, exit silently (already loaded)

if ($check && (is_callable($plugin_name) || class_exists($plugin_name, false))) {

return true;

}

// Plugin name is expected to be: Smarty_[Type]_[Name]

$_name_parts = explode('_', $plugin_name, 3);

// class name must have three parts to be valid plugin

// count($_name_parts) < 3 === !isset($_name_parts[2])

if (!isset($_name_parts[2]) || strtolower($_name_parts[0]) !== 'smarty') {

throw new SmartyException("plugin {$plugin_name} is not a valid name format");

}

// if type is "internal", get plugin from sysplugins

if (strtolower($_name_parts[1]) == 'internal') {

$file = SMARTY_SYSPLUGINS_DIR . strtolower($plugin_name) . '.php';

if (file_exists($file)) {

require_once($file);

return $file;

} else {

return false;

}

}

// plugin filename is expected to be: [type].[name].php

$_plugin_filename = "{$_name_parts[1]}.{$_name_parts[2]}.php";

$_stream_resolve_include_path = function_exists('stream_resolve_include_path');

// loop through plugin dirs and find the plugin

foreach ($this->getPluginsDir() as $_plugin_dir) {

$names = array(

$_plugin_dir . $_plugin_filename,

$_plugin_dir . strtolower($_plugin_filename),

);

foreach ($names as $file) {

if (file_exists($file)) {

require_once($file);

return $file;

}

if ($this->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_plugin_dir)) {

// try PHP include_path

if ($_stream_resolve_include_path) {

$file = stream_resolve_include_path($file);

} else {

$file = Smarty_Internal_Get_Include_Path::getIncludePath($file);

}

if ($file !== false) {

require_once($file);

return $file;

}

}

}

}

// no plugin loaded

return false;

}

/**

* Compile all template files

*

* @param string $extension file extension

* @param bool $force_compile force all to recompile

* @param int $time_limit

* @param int $max_errors

*

* @return integer number of template files recompiled

*/

public function compileAllTemplates($extension = '.tpl', $force_compile = false, $time_limit = 0, $max_errors = null)

{

return Smarty_Internal_Utility::compileAllTemplates($extension, $force_compile, $time_limit, $max_errors, $this);

}

/**

* Compile all config files

*

* @param string $extension file extension

* @param bool $force_compile force all to recompile

* @param int $time_limit

* @param int $max_errors

*

* @return integer number of template files recompiled

*/

public function compileAllConfig($extension = '.conf', $force_compile = false, $time_limit = 0, $max_errors = null)

{

return Smarty_Internal_Utility::compileAllConfig($extension, $force_compile, $time_limit, $max_errors, $this);

}

/**

* Delete compiled template file

*

* @param string $resource_name template name

* @param string $compile_id compile id

* @param integer $exp_time expiration time

*

* @return integer number of template files deleted

*/

public function clearCompiledTemplate($resource_name = null, $compile_id = null, $exp_time = null)

{

return Smarty_Internal_Utility::clearCompiledTemplate($resource_name, $compile_id, $exp_time, $this);

}

/**

* Return array of tag/attributes of all tags used by an template

*

* @param Smarty_Internal_Template $template

*

* @return array of tag/attributes

*/

public function getTags(Smarty_Internal_Template $template)

{

return Smarty_Internal_Utility::getTags($template);

}

/**

* Run installation test

*

* @param array $errors Array to write errors into, rather than outputting them

*

* @return boolean true if setup is fine, false if something is wrong

*/

public function testInstall(&$errors = null)

{

return Smarty_Internal_Utility::testInstall($this, $errors);

}

/**

* Error Handler to mute expected messages

*

* @link http://php.net/set_error_handler

*

* @param integer $errno Error level

* @param $errstr

* @param $errfile

* @param $errline

* @param $errcontext

*

* @return boolean

*/

public static function mutingErrorHandler($errno, $errstr, $errfile, $errline, $errcontext)

{

$_is_muted_directory = false;

// add the SMARTY_DIR to the list of muted directories

if (!isset(Smarty::$_muted_directories[SMARTY_DIR])) {

$smarty_dir = realpath(SMARTY_DIR);

if ($smarty_dir !== false) {

Smarty::$_muted_directories[SMARTY_DIR] = array(

'file' => $smarty_dir,

'length' => strlen($smarty_dir),

);

}

}

// walk the muted directories and test against $errfile

foreach (Smarty::$_muted_directories as $key => &$dir) {

if (!$dir) {

// resolve directory and length for speedy comparisons

$file = realpath($key);

if ($file === false) {

// this directory does not exist, remove and skip it

unset(Smarty::$_muted_directories[$key]);

continue;

}

$dir = array(

'file' => $file,

'length' => strlen($file),

);

}

if (!strncmp($errfile, $dir['file'], $dir['length'])) {

$_is_muted_directory = true;

break;

}

}

// pass to next error handler if this error did not occur inside SMARTY_DIR

// or the error was within smarty but masked to be ignored

if (!$_is_muted_directory || ($errno && $errno & error_reporting())) {

if (Smarty::$_previous_error_handler) {

return call_user_func(Smarty::$_previous_error_handler, $errno, $errstr, $errfile, $errline, $errcontext);

} else {

return false;

}

}

}

/**

* Enable error handler to mute expected messages

*

* @return void

*/

public static function muteExpectedErrors()

{

/*

error muting is done because some people implemented custom error_handlers using

http://php.net/set_error_handler and for some reason did not understand the following paragraph:

It is important to remember that the standard PHP error handler is completely bypassed for the

error types specified by error_types unless the callback function returns FALSE.

error_reporting() settings will have no effect and your error handler will be called regardless -

however you are still able to read the current value of error_reporting and act appropriately.

Of particular note is that this value will be 0 if the statement that caused the error was

prepended by the @ error-control operator.

Smarty deliberately uses @filemtime() over file_exists() and filemtime() in some places. Reasons include

- @filemtime() is almost twice as fast as using an additional file_exists()

- between file_exists() and filemtime() a possible race condition is opened,

which does not exist using the simple @filemtime() approach.

*/

$error_handler = array('Smarty', 'mutingErrorHandler');

$previous = set_error_handler($error_handler);

// avoid dead loops

if ($previous !== $error_handler) {

Smarty::$_previous_error_handler = $previous;

}

}

/**

* Disable error handler muting expected messages

*

* @return void

*/

public static function unmuteExpectedErrors()

{

restore_error_handler();

}

}

// Check if we're running on windows

Smarty::$_IS_WINDOWS = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN';

// let PCRE (preg_*) treat strings as ISO-8859-1 if we're not dealing with UTF-8

if (Smarty::$_CHARSET !== 'UTF-8') {

Smarty::$_UTF8_MODIFIER = '';

}

/**

* Smarty exception class

*

* @package Smarty

*/

class SmartyException extends Exception

{

public static $escape = false;

public function __toString()

{

return ' --> Smarty: ' . (self::$escape ? htmlentities($this->message) : $this->message) . '

}

}

/**

* Smarty compiler exception class

*

* @package Smarty

*/

class SmartyCompilerException extends SmartyException

{

public function __toString()

{

return ' --> Smarty Compiler: ' . $this->message . '

}

/**

* The line number of the template error

*

* @type int|null

*/

public $line = null;

/**

* The template source snippet relating to the error

*

* @type string|null

*/

public $source = null;

/**

* The raw text of the error message

*

* @type string|null

*/

public $desc = null;

/**

* The resource identifier or template name

*

* @type string|null

*/

public $template = null;

}

/**

* Autoloader

*/

function smartyAutoload($class)

{

$_class = strtolower($class);

static $_classes = array(

'smarty_config_source' => true,

'smarty_config_compiled' => true,

'smarty_security' => true,

'smarty_cacheresource' => true,

'smarty_cacheresource_custom' => true,

'smarty_cacheresource_keyvaluestore' => true,

'smarty_resource' => true,

'smarty_resource_custom' => true,

'smarty_resource_uncompiled' => true,

'smarty_resource_recompiled' => true,

);

if (!strncmp($_class, 'smarty_internal_', 16) || isset($_classes[$_class])) {

include SMARTY_SYSPLUGINS_DIR . $_class . '.php';

}

}

/**

* Project: Smarty: the PHP compiling template engine

* File: Smarty.class.php

* SVN: $Id: Smarty.class.php 4848 2014-06-08 18:12:09Z Uwe.Tews@googlemail.com $

* 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

* For questions, help, comments, discussion, etc., please join the

* Smarty mailing list. Send a blank e-mail to

* smarty-discussion-subscribe@googlegroups.com

*

* @link http://www.smarty.net/

* @copyright 2008 New Digital Group, Inc.

* @author Monte Ohrt

* @author Uwe Tews

* @author Rodney Rehm

* @package Smarty

* @version 3.1.19

*/

/**

* define shorthand directory separator constant

*/

if (!defined('DS')) {

define('DS', DIRECTORY_SEPARATOR);

}

/**

* set SMARTY_DIR to absolute path to Smarty library files.

* Sets SMARTY_DIR only if user application has not already defined it.

*/

if (!defined('SMARTY_DIR')) {

define('SMARTY_DIR', dirname(__FILE__) . DS);

}

/**

* set SMARTY_SYSPLUGINS_DIR to absolute path to Smarty internal plugins.

* Sets SMARTY_SYSPLUGINS_DIR only if user application has not already defined it.

*/

if (!defined('SMARTY_SYSPLUGINS_DIR')) {

define('SMARTY_SYSPLUGINS_DIR', SMARTY_DIR . 'sysplugins' . DS);

}

if (!defined('SMARTY_PLUGINS_DIR')) {

define('SMARTY_PLUGINS_DIR', SMARTY_DIR . 'plugins' . DS);

}

if (!defined('SMARTY_MBSTRING')) {

define('SMARTY_MBSTRING', function_exists('mb_split'));

}

if (!defined('SMARTY_RESOURCE_CHAR_SET')) {

// UTF-8 can only be done properly when mbstring is available!

/**

* @deprecated in favor of Smarty::$_CHARSET

*/

define('SMARTY_RESOURCE_CHAR_SET', SMARTY_MBSTRING ? 'UTF-8' : 'ISO-8859-1');

}

if (!defined('SMARTY_RESOURCE_DATE_FORMAT')) {

/**

* @deprecated in favor of Smarty::$_DATE_FORMAT

*/

define('SMARTY_RESOURCE_DATE_FORMAT', '%b %e, %Y');

}

/**

* register the class autoloader

*/

if (!defined('SMARTY_SPL_AUTOLOAD')) {

define('SMARTY_SPL_AUTOLOAD', 0);

}

if (SMARTY_SPL_AUTOLOAD && set_include_path(get_include_path() . PATH_SEPARATOR . SMARTY_SYSPLUGINS_DIR) !== false) {

$registeredAutoLoadFunctions = spl_autoload_functions();

if (!isset($registeredAutoLoadFunctions['spl_autoload'])) {

spl_autoload_register();

}

} else {

spl_autoload_register('smartyAutoload');

}

/**

* Load always needed external class files

*/

include_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_data.php';

include_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_templatebase.php';

include_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_template.php';

include_once SMARTY_SYSPLUGINS_DIR . 'smarty_resource.php';

include_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_resource_file.php';

include_once SMARTY_SYSPLUGINS_DIR . 'smarty_cacheresource.php';

include_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_cacheresource_file.php';

/**

* This is the main Smarty class

*

* @package Smarty

*/

class Smarty extends Smarty_Internal_TemplateBase

{

/**#@+

* constant definitions

*/

/**

* smarty version

*/

const SMARTY_VERSION = 'Smarty-3.1.19';

/**

* define variable scopes

*/

const SCOPE_LOCAL = 0;

const SCOPE_PARENT = 1;

const SCOPE_ROOT = 2;

const SCOPE_GLOBAL = 3;

/**

* define caching modes

*/

const CACHING_OFF = 0;

const CACHING_LIFETIME_CURRENT = 1;

const CACHING_LIFETIME_SAVED = 2;

/**

* define constant for clearing cache files be saved expiration datees

*/

const CLEAR_EXPIRED = - 1;

/**

* define compile check modes

*/

const COMPILECHECK_OFF = 0;

const COMPILECHECK_ON = 1;

const COMPILECHECK_CACHEMISS = 2;

/**

* modes for handling of "<?php ... ?>" tags in templates.

*/

const PHP_PASSTHRU = 0; //-> print tags as plain text

const PHP_QUOTE = 1; //-> escape tags as entities

const PHP_REMOVE = 2; //-> escape tags as entities

const PHP_ALLOW = 3; //-> escape tags as entities

/**

* filter types

*/

const FILTER_POST = 'post';

const FILTER_PRE = 'pre';

const FILTER_OUTPUT = 'output';

const FILTER_VARIABLE = 'variable';

/**

* plugin types

*/

const PLUGIN_FUNCTION = 'function';

const PLUGIN_BLOCK = 'block';

const PLUGIN_COMPILER = 'compiler';

const PLUGIN_MODIFIER = 'modifier';

const PLUGIN_MODIFIERCOMPILER = 'modifiercompiler';

/**#@-*/

/**

* assigned global tpl vars

*/

public static $global_tpl_vars = array();

/**

* error handler returned by set_error_hanlder() in Smarty::muteExpectedErrors()

*/

public static $_previous_error_handler = null;

/**

* contains directories outside of SMARTY_DIR that are to be muted by muteExpectedErrors()

*/

public static $_muted_directories = array();

/**

* Flag denoting if Multibyte String functions are available

*/

public static $_MBSTRING = SMARTY_MBSTRING;

/**

* The character set to adhere to (e.g. "UTF-8")

*/

public static $_CHARSET = SMARTY_RESOURCE_CHAR_SET;

/**

* The date format to be used internally

* (accepts date() and strftime())

*/

public static $_DATE_FORMAT = SMARTY_RESOURCE_DATE_FORMAT;

/**

* Flag denoting if PCRE should run in UTF-8 mode

*/

public static $_UTF8_MODIFIER = 'u';

/**

* Flag denoting if operating system is windows

*/

public static $_IS_WINDOWS = false;

/**#@+

* variables

*/

/**

* auto literal on delimiters with whitspace

*

* @var boolean

*/

public $auto_literal = true;

/**

* display error on not assigned variables

*

* @var boolean

*/

public $error_unassigned = false;

/**

* look up relative filepaths in include_path

*

* @var boolean

*/

public $use_include_path = false;

/**

* template directory

*

* @var array

*/

private $template_dir = array();

/**

* joined template directory string used in cache keys

*

* @var string

*/

public $joined_template_dir = null;

/**

* joined config directory string used in cache keys

*

* @var string

*/

public $joined_config_dir = null;

/**

* default template handler

*

* @var callable

*/

public $default_template_handler_func = null;

/**

* default config handler

*

* @var callable

*/

public $default_config_handler_func = null;

/**

* default plugin handler

*

* @var callable

*/

public $default_plugin_handler_func = null;

/**

* compile directory

*

* @var string

*/

private $compile_dir = null;

/**

* plugins directory

*

* @var array

*/

private $plugins_dir = array();

/**

* cache directory

*

* @var string

*/

private $cache_dir = null;

/**

* config directory

*

* @var array

*/

private $config_dir = array();

/**

* force template compiling?

*

* @var boolean

*/

public $force_compile = false;

/**

* check template for modifications?

*

* @var boolean

*/

public $compile_check = true;

/**

* use sub dirs for compiled/cached files?

*

* @var boolean

*/

public $use_sub_dirs = false;

/**

* allow ambiguous resources (that are made unique by the resource handler)

*

* @var boolean

*/

public $allow_ambiguous_resources = false;

/**

* caching enabled

*

* @var boolean

*/

public $caching = false;

/**

* merge compiled includes

*

* @var boolean

*/

public $merge_compiled_includes = false;

/**

* template inheritance merge compiled includes

*

* @var boolean

*/

public $inheritance_merge_compiled_includes = true;

/**

* cache lifetime in seconds

*

* @var integer

*/

public $cache_lifetime = 3600;

/**

* force cache file creation

*

* @var boolean

*/

public $force_cache = false;

/**

* Set this if you want different sets of cache files for the same

* templates.

*

* @var string

*/

public $cache_id = null;

/**

* Set this if you want different sets of compiled files for the same

* templates.

*

* @var string

*/

public $compile_id = null;

/**

* template left-delimiter

*

* @var string

*/

public $left_delimiter = "{";

/**

* template right-delimiter

*

* @var string

*/

public $right_delimiter = "}";

/**#@+

* security

*/

/**

* class name

* This should be instance of Smarty_Security.

*

* @var string

* @see Smarty_Security

*/

public $security_class = 'Smarty_Security';

/**

* implementation of security class

*

* @var Smarty_Security

*/

public $security_policy = null;

/**

* controls handling of PHP-blocks

*

* @var integer

*/

public $php_handling = self::PHP_PASSTHRU;

/**

* controls if the php template file resource is allowed

*

* @var bool

*/

public $allow_php_templates = false;

/**

* Should compiled-templates be prevented from being called directly?

* {@internal

* Currently used by Smarty_Internal_Template only.

* }}

*

* @var boolean

*/

public $direct_access_security = true;

/**#@-*/

/**

* debug mode

* Setting this to true enables the debug-console.

*

* @var boolean

*/

public $debugging = false;

/**

* This determines if debugging is enable-able from the browser.

*

*

NONE => no debugging control allowed

*

URL => enable debugging when SMARTY_DEBUG is found in the URL.

*

*

* @var string

*/

public $debugging_ctrl = 'NONE';

/**

* Name of debugging URL-param.

* Only used when $debugging_ctrl is set to 'URL'.

* The name of the URL-parameter that activates debugging.

*

* @var type

*/

public $smarty_debug_id = 'SMARTY_DEBUG';

/**

* Path of debug template.

*

* @var string

*/

public $debug_tpl = null;

/**

* When set, smarty uses this value as error_reporting-level.

*

* @var int

*/

public $error_reporting = null;

/**

* Internal flag for getTags()

*

* @var boolean

*/

public $get_used_tags = false;

/**#@+

* config var settings

*/

/**

* Controls whether variables with the same name overwrite each other.

*

* @var boolean

*/

public $config_overwrite = true;

/**

* Controls whether config values of on/true/yes and off/false/no get converted to boolean.

*

* @var boolean

*/

public $config_booleanize = true;

/**

* Controls whether hidden config sections/vars are read from the file.

*

* @var boolean

*/

public $config_read_hidden = false;

/**#@-*/

/**#@+

* resource locking

*/

/**

* locking concurrent compiles

*

* @var boolean

*/

public $compile_locking = true;

/**

* Controls whether cache resources should emply locking mechanism

*

* @var boolean

*/

public $cache_locking = false;

/**

* seconds to wait for acquiring a lock before ignoring the write lock

*

* @var float

*/

public $locking_timeout = 10;

/**#@-*/

/**

* global template functions

*

* @var array

*/

public $template_functions = array();

/**

* resource type used if none given

* Must be an valid key of $registered_resources.

*

* @var string

*/

public $default_resource_type = 'file';

/**

* caching type

* Must be an element of $cache_resource_types.

*

* @var string

*/

public $caching_type = 'file';

/**

* internal config properties

*

* @var array

*/

public $properties = array();

/**

* config type

*

* @var string

*/

public $default_config_type = 'file';

/**

* cached template objects

*

* @var array

*/

public $template_objects = array();

/**

* check If-Modified-Since headers

*

* @var boolean

*/

public $cache_modified_check = false;

/**

* registered plugins

*

* @var array

*/

public $registered_plugins = array();

/**

* plugin search order

*

* @var array

*/

public $plugin_search_order = array('function', 'block', 'compiler', 'class');

/**

* registered objects

*

* @var array

*/

public $registered_objects = array();

/**

* registered classes

*

* @var array

*/

public $registered_classes = array();

/**

* registered filters

*

* @var array

*/

public $registered_filters = array();

/**

* registered resources

*

* @var array

*/

public $registered_resources = array();

/**

* resource handler cache

*

* @var array

*/

public $_resource_handlers = array();

/**

* registered cache resources

*

* @var array

*/

public $registered_cache_resources = array();

/**

* cache resource handler cache

*

* @var array

*/

public $_cacheresource_handlers = array();

/**

* autoload filter

*

* @var array

*/

public $autoload_filters = array();

/**

* default modifier

*

* @var array

*/

public $default_modifiers = array();

/**

* autoescape variable output

*

* @var boolean

*/

public $escape_html = false;

/**

* global internal smarty vars

*

* @var array

*/

public static $_smarty_vars = array();

/**

* start time for execution time calculation

*

* @var int

*/

public $start_time = 0;

/**

* default file permissions

*

* @var int

*/

public $_file_perms = 0644;

/**

* default dir permissions

*

* @var int

*/

public $_dir_perms = 0771;

/**

* block tag hierarchy

*

* @var array

*/

public $_tag_stack = array();

/**

* self pointer to Smarty object

*

* @var Smarty

*/

public $smarty;

/**

* required by the compiler for BC

*

* @var string

*/

public $_current_file = null;

/**

* internal flag to enable parser debugging

*

* @var bool

*/

public $_parserdebug = false;

/**

* Saved parameter of merged templates during compilation

*

* @var array

*/

public $merged_templates_func = array();

/**#@-*/

/**

* Initialize new Smarty object

*/

public function __construct()

{

// selfpointer needed by some other class methods

$this->smarty = $this;

if (is_callable('mb_internal_encoding')) {

mb_internal_encoding(Smarty::$_CHARSET);

}

$this->start_time = microtime(true);

// set default dirs

$this->setTemplateDir('.' . DS . 'templates' . DS)

->setCompileDir('.' . DS . 'templates_c' . DS)

->setPluginsDir(SMARTY_PLUGINS_DIR)

->setCacheDir('.' . DS . 'cache' . DS)

->setConfigDir('.' . DS . 'configs' . DS);

$this->debug_tpl = 'file:' . dirname(__FILE__) . '/debug.tpl';

if (isset($_SERVER['SCRIPT_NAME'])) {

$this->assignGlobal('SCRIPT_NAME', $_SERVER['SCRIPT_NAME']);

}

}

/**

* Class destructor

*/

public function __destruct()

{

// intentionally left blank

}

/**

* <> set selfpointer on cloned object

*/

public function __clone()

{

$this->smarty = $this;

}

/**

* <> Generic getter.

* Calls the appropriate getter function.

* Issues an E_USER_NOTICE if no valid getter is found.

*

* @param string $name property name

*

* @return mixed

*/

public function __get($name)

{

$allowed = array(

'template_dir' => 'getTemplateDir',

'config_dir' => 'getConfigDir',

'plugins_dir' => 'getPluginsDir',

'compile_dir' => 'getCompileDir',

'cache_dir' => 'getCacheDir',

);

if (isset($allowed[$name])) {

return $this->{$allowed[$name]}();

} else {

trigger_error('Undefined property: ' . get_class($this) . '::$' . $name, E_USER_NOTICE);

}

}

/**

* <> Generic setter.

* Calls the appropriate setter function.

* Issues an E_USER_NOTICE if no valid setter is found.

*

* @param string $name property name

* @param mixed $value parameter passed to setter

*/

public function __set($name, $value)

{

$allowed = array(

'template_dir' => 'setTemplateDir',

'config_dir' => 'setConfigDir',

'plugins_dir' => 'setPluginsDir',

'compile_dir' => 'setCompileDir',

'cache_dir' => 'setCacheDir',

);

if (isset($allowed[$name])) {

$this->{$allowed[$name]}($value);

} else {

trigger_error('Undefined property: ' . get_class($this) . '::$' . $name, E_USER_NOTICE);

}

}

/**

* Check if a template resource exists

*

* @param string $resource_name template name

*

* @return boolean status

*/

public function templateExists($resource_name)

{

// create template object

$save = $this->template_objects;

$tpl = new $this->template_class($resource_name, $this);

// check if it does exists

$result = $tpl->source->exists;

$this->template_objects = $save;

return $result;

}

/**

* Returns a single or all global variables

*

* @param string $varname variable name or null

*

* @return string variable value or or array of variables

*/

public function getGlobal($varname = null)

{

if (isset($varname)) {

if (isset(self::$global_tpl_vars[$varname])) {

return self::$global_tpl_vars[$varname]->value;

} else {

return '';

}

} else {

$_result = array();

foreach (self::$global_tpl_vars AS $key => $var) {

$_result[$key] = $var->value;

}

return $_result;

}

}

/**

* Empty cache folder

*

* @param integer $exp_time expiration time

* @param string $type resource type

*

* @return integer number of cache files deleted

*/

public function clearAllCache($exp_time = null, $type = null)

{

// load cache resource and call clearAll

$_cache_resource = Smarty_CacheResource::load($this, $type);

Smarty_CacheResource::invalidLoadedCache($this);

return $_cache_resource->clearAll($this, $exp_time);

}

/**

* Empty cache for a specific template

*

* @param string $template_name template name

* @param string $cache_id cache id

* @param string $compile_id compile id

* @param integer $exp_time expiration time

* @param string $type resource type

*

* @return integer number of cache files deleted

*/

public function clearCache($template_name, $cache_id = null, $compile_id = null, $exp_time = null, $type = null)

{

// load cache resource and call clear

$_cache_resource = Smarty_CacheResource::load($this, $type);

Smarty_CacheResource::invalidLoadedCache($this);

return $_cache_resource->clear($this, $template_name, $cache_id, $compile_id, $exp_time);

}

/**

* Loads security class and enables security

*

* @param string|Smarty_Security $security_class if a string is used, it must be class-name

*

* @return Smarty current Smarty instance for chaining

* @throws SmartyException when an invalid class name is provided

*/

public function enableSecurity($security_class = null)

{

if ($security_class instanceof Smarty_Security) {

$this->security_policy = $security_class;

return $this;

} elseif (is_object($security_class)) {

throw new SmartyException("Class '" . get_class($security_class) . "' must extend Smarty_Security.");

}

if ($security_class == null) {

$security_class = $this->security_class;

}

if (!class_exists($security_class)) {

throw new SmartyException("Security class '$security_class' is not defined");

} elseif ($security_class !== 'Smarty_Security' && !is_subclass_of($security_class, 'Smarty_Security')) {

throw new SmartyException("Class '$security_class' must extend Smarty_Security.");

} else {

$this->security_policy = new $security_class($this);

}

return $this;

}

/**

* Disable security

*

* @return Smarty current Smarty instance for chaining

*/

public function disableSecurity()

{

$this->security_policy = null;

return $this;

}

/**

* Set template directory

*

* @param string|array $template_dir directory(s) of template sources

*

* @return Smarty current Smarty instance for chaining

*/

public function setTemplateDir($template_dir)

{

$this->template_dir = array();

foreach ((array) $template_dir as $k => $v) {

$this->template_dir[$k] = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($v, '/\\')) . DS;

}

$this->joined_template_dir = join(DIRECTORY_SEPARATOR, $this->template_dir);

return $this;

}

/**

* Add template directory(s)

*

* @param string|array $template_dir directory(s) of template sources

* @param string $key of the array element to assign the template dir to

*

* @return Smarty current Smarty instance for chaining

* @throws SmartyException when the given template directory is not valid

*/

public function addTemplateDir($template_dir, $key = null)

{

// make sure we're dealing with an array

$this->template_dir = (array) $this->template_dir;

if (is_array($template_dir)) {

foreach ($template_dir as $k => $v) {

$v = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($v, '/\\')) . DS;

if (is_int($k)) {

// indexes are not merged but appended

$this->template_dir[] = $v;

} else {

// string indexes are overridden

$this->template_dir[$k] = $v;

}

}

} else {

$v = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($template_dir, '/\\')) . DS;

if ($key !== null) {

// override directory at specified index

$this->template_dir[$key] = $v;

} else {

// append new directory

$this->template_dir[] = $v;

}

}

$this->joined_template_dir = join(DIRECTORY_SEPARATOR, $this->template_dir);

return $this;

}

/**

* Get template directories

*

* @param mixed $index index of directory to get, null to get all

*

* @return array|string list of template directories, or directory of $index

*/

public function getTemplateDir($index = null)

{

if ($index !== null) {

return isset($this->template_dir[$index]) ? $this->template_dir[$index] : null;

}

return (array) $this->template_dir;

}

/**

* Set config directory

*

* @param $config_dir

*

* @return Smarty current Smarty instance for chaining

*/

public function setConfigDir($config_dir)

{

$this->config_dir = array();

foreach ((array) $config_dir as $k => $v) {

$this->config_dir[$k] = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($v, '/\\')) . DS;

}

$this->joined_config_dir = join(DIRECTORY_SEPARATOR, $this->config_dir);

return $this;

}

/**

* Add config directory(s)

*

* @param string|array $config_dir directory(s) of config sources

* @param mixed $key key of the array element to assign the config dir to

*

* @return Smarty current Smarty instance for chaining

*/

public function addConfigDir($config_dir, $key = null)

{

// make sure we're dealing with an array

$this->config_dir = (array) $this->config_dir;

if (is_array($config_dir)) {

foreach ($config_dir as $k => $v) {

$v = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($v, '/\\')) . DS;

if (is_int($k)) {

// indexes are not merged but appended

$this->config_dir[] = $v;

} else {

// string indexes are overridden

$this->config_dir[$k] = $v;

}

}

} else {

$v = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($config_dir, '/\\')) . DS;

if ($key !== null) {

// override directory at specified index

$this->config_dir[$key] = rtrim($v, '/\\') . DS;

} else {

// append new directory

$this->config_dir[] = rtrim($v, '/\\') . DS;

}

}

$this->joined_config_dir = join(DIRECTORY_SEPARATOR, $this->config_dir);

return $this;

}

/**

* Get config directory

*

* @param mixed $index index of directory to get, null to get all

*

* @return array|string configuration directory

*/

public function getConfigDir($index = null)

{

if ($index !== null) {

return isset($this->config_dir[$index]) ? $this->config_dir[$index] : null;

}

return (array) $this->config_dir;

}

/**

* Set plugins directory

*

* @param string|array $plugins_dir directory(s) of plugins

*

* @return Smarty current Smarty instance for chaining

*/

public function setPluginsDir($plugins_dir)

{

$this->plugins_dir = array();

foreach ((array) $plugins_dir as $k => $v) {

$this->plugins_dir[$k] = rtrim($v, '/\\') . DS;

}

return $this;

}

/**

* Adds directory of plugin files

*

* @param $plugins_dir

*

* @return Smarty current Smarty instance for chaining

*/

public function addPluginsDir($plugins_dir)

{

// make sure we're dealing with an array

$this->plugins_dir = (array) $this->plugins_dir;

if (is_array($plugins_dir)) {

foreach ($plugins_dir as $k => $v) {

if (is_int($k)) {

// indexes are not merged but appended

$this->plugins_dir[] = rtrim($v, '/\\') . DS;

} else {

// string indexes are overridden

$this->plugins_dir[$k] = rtrim($v, '/\\') . DS;

}

}

} else {

// append new directory

$this->plugins_dir[] = rtrim($plugins_dir, '/\\') . DS;

}

$this->plugins_dir = array_unique($this->plugins_dir);

return $this;

}

/**

* Get plugin directories

*

* @return array list of plugin directories

*/

public function getPluginsDir()

{

return (array) $this->plugins_dir;

}

/**

* Set compile directory

*

* @param string $compile_dir directory to store compiled templates in

*

* @return Smarty current Smarty instance for chaining

*/

public function setCompileDir($compile_dir)

{

$this->compile_dir = rtrim($compile_dir, '/\\') . DS;

if (!isset(Smarty::$_muted_directories[$this->compile_dir])) {

Smarty::$_muted_directories[$this->compile_dir] = null;

}

return $this;

}

/**

* Get compiled directory

*

* @return string path to compiled templates

*/

public function getCompileDir()

{

return $this->compile_dir;

}

/**

* Set cache directory

*

* @param string $cache_dir directory to store cached templates in

*

* @return Smarty current Smarty instance for chaining

*/

public function setCacheDir($cache_dir)

{

$this->cache_dir = rtrim($cache_dir, '/\\') . DS;

if (!isset(Smarty::$_muted_directories[$this->cache_dir])) {

Smarty::$_muted_directories[$this->cache_dir] = null;

}

return $this;

}

/**

* Get cache directory

*

* @return string path of cache directory

*/

public function getCacheDir()

{

return $this->cache_dir;

}

/**

* Set default modifiers

*

* @param array|string $modifiers modifier or list of modifiers to set

*

* @return Smarty current Smarty instance for chaining

*/

public function setDefaultModifiers($modifiers)

{

$this->default_modifiers = (array) $modifiers;

return $this;

}

/**

* Add default modifiers

*

* @param array|string $modifiers modifier or list of modifiers to add

*

* @return Smarty current Smarty instance for chaining

*/

public function addDefaultModifiers($modifiers)

{

if (is_array($modifiers)) {

$this->default_modifiers = array_merge($this->default_modifiers, $modifiers);

} else {

$this->default_modifiers[] = $modifiers;

}

return $this;

}

/**

* Get default modifiers

*

* @return array list of default modifiers

*/

public function getDefaultModifiers()

{

return $this->default_modifiers;

}

/**

* Set autoload filters

*

* @param array $filters filters to load automatically

* @param string $type "pre", "output", … specify the filter type to set. Defaults to none treating $filters' keys as the appropriate types

*

* @return Smarty current Smarty instance for chaining

*/

public function setAutoloadFilters($filters, $type = null)

{

if ($type !== null) {

$this->autoload_filters[$type] = (array) $filters;

} else {

$this->autoload_filters = (array) $filters;

}

return $this;

}

/**

* Add autoload filters

*

* @param array $filters filters to load automatically

* @param string $type "pre", "output", … specify the filter type to set. Defaults to none treating $filters' keys as the appropriate types

*

* @return Smarty current Smarty instance for chaining

*/

public function addAutoloadFilters($filters, $type = null)

{

if ($type !== null) {

if (!empty($this->autoload_filters[$type])) {

$this->autoload_filters[$type] = array_merge($this->autoload_filters[$type], (array) $filters);

} else {

$this->autoload_filters[$type] = (array) $filters;

}

} else {

foreach ((array) $filters as $key => $value) {

if (!empty($this->autoload_filters[$key])) {

$this->autoload_filters[$key] = array_merge($this->autoload_filters[$key], (array) $value);

} else {

$this->autoload_filters[$key] = (array) $value;

}

}

}

return $this;

}

/**

* Get autoload filters

*

* @param string $type type of filter to get autoloads for. Defaults to all autoload filters

*

* @return array array( 'type1' => array( 'filter1', 'filter2', … ) ) or array( 'filter1', 'filter2', …) if $type was specified

*/

public function getAutoloadFilters($type = null)

{

if ($type !== null) {

return isset($this->autoload_filters[$type]) ? $this->autoload_filters[$type] : array();

}

return $this->autoload_filters;

}

/**

* return name of debugging template

*

* @return string

*/

public function getDebugTemplate()

{

return $this->debug_tpl;

}

/**

* set the debug template

*

* @param string $tpl_name

*

* @return Smarty current Smarty instance for chaining

* @throws SmartyException if file is not readable

*/

public function setDebugTemplate($tpl_name)

{

if (!is_readable($tpl_name)) {

throw new SmartyException("Unknown file '{$tpl_name}'");

}

$this->debug_tpl = $tpl_name;

return $this;

}

/**

* creates a template object

*

* @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 object $parent next higher level of Smarty variables

* @param boolean $do_clone flag is Smarty object shall be cloned

*

* @return object template object

*/

public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null, $do_clone = true)

{

if ($cache_id !== null && (is_object($cache_id) || is_array($cache_id))) {

$parent = $cache_id;

$cache_id = null;

}

if ($parent !== null && is_array($parent)) {

$data = $parent;

$parent = null;

} else {

$data = null;

}

// default to cache_id and compile_id of Smarty object

$cache_id = $cache_id === null ? $this->cache_id : $cache_id;

$compile_id = $compile_id === null ? $this->compile_id : $compile_id;

// already in template cache?

if ($this->allow_ambiguous_resources) {

$_templateId = Smarty_Resource::getUniqueTemplateName($this, $template) . $cache_id . $compile_id;

} else {

$_templateId = $this->joined_template_dir . '#' . $template . $cache_id . $compile_id;

}

if (isset($_templateId[150])) {

$_templateId = sha1($_templateId);

}

if ($do_clone) {

if (isset($this->template_objects[$_templateId])) {

// return cached template object

$tpl = clone $this->template_objects[$_templateId];

$tpl->smarty = clone $tpl->smarty;

$tpl->parent = $parent;

$tpl->tpl_vars = array();

$tpl->config_vars = array();

} else {

$tpl = new $this->template_class($template, clone $this, $parent, $cache_id, $compile_id);

}

} else {

if (isset($this->template_objects[$_templateId])) {

// return cached template object

$tpl = $this->template_objects[$_templateId];

$tpl->parent = $parent;

$tpl->tpl_vars = array();

$tpl->config_vars = array();

} else {

$tpl = new $this->template_class($template, $this, $parent, $cache_id, $compile_id);

}

}

// fill data if present

if (!empty($data) && is_array($data)) {

// set up variable values

foreach ($data as $_key => $_val) {

$tpl->tpl_vars[$_key] = new Smarty_variable($_val);

}

}

return $tpl;

}

/**

* Takes unknown classes and loads plugin files for them

* class name format: Smarty_PluginType_PluginName

* plugin filename format: plugintype.pluginname.php

*

* @param string $plugin_name class plugin name to load

* @param bool $check check if already loaded

*

* @throws SmartyException

* @return string |boolean filepath of loaded file or false

*/

public function loadPlugin($plugin_name, $check = true)

{

// if function or class exists, exit silently (already loaded)

if ($check && (is_callable($plugin_name) || class_exists($plugin_name, false))) {

return true;

}

// Plugin name is expected to be: Smarty_[Type]_[Name]

$_name_parts = explode('_', $plugin_name, 3);

// class name must have three parts to be valid plugin

// count($_name_parts) < 3 === !isset($_name_parts[2])

if (!isset($_name_parts[2]) || strtolower($_name_parts[0]) !== 'smarty') {

throw new SmartyException("plugin {$plugin_name} is not a valid name format");

}

// if type is "internal", get plugin from sysplugins

if (strtolower($_name_parts[1]) == 'internal') {

$file = SMARTY_SYSPLUGINS_DIR . strtolower($plugin_name) . '.php';

if (file_exists($file)) {

require_once($file);

return $file;

} else {

return false;

}

}

// plugin filename is expected to be: [type].[name].php

$_plugin_filename = "{$_name_parts[1]}.{$_name_parts[2]}.php";

$_stream_resolve_include_path = function_exists('stream_resolve_include_path');

// loop through plugin dirs and find the plugin

foreach ($this->getPluginsDir() as $_plugin_dir) {

$names = array(

$_plugin_dir . $_plugin_filename,

$_plugin_dir . strtolower($_plugin_filename),

);

foreach ($names as $file) {

if (file_exists($file)) {

require_once($file);

return $file;

}

if ($this->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_plugin_dir)) {

// try PHP include_path

if ($_stream_resolve_include_path) {

$file = stream_resolve_include_path($file);

} else {

$file = Smarty_Internal_Get_Include_Path::getIncludePath($file);

}

if ($file !== false) {

require_once($file);

return $file;

}

}

}

}

// no plugin loaded

return false;

}

/**

* Compile all template files

*

* @param string $extension file extension

* @param bool $force_compile force all to recompile

* @param int $time_limit

* @param int $max_errors

*

* @return integer number of template files recompiled

*/

public function compileAllTemplates($extension = '.tpl', $force_compile = false, $time_limit = 0, $max_errors = null)

{

return Smarty_Internal_Utility::compileAllTemplates($extension, $force_compile, $time_limit, $max_errors, $this);

}

/**

* Compile all config files

*

* @param string $extension file extension

* @param bool $force_compile force all to recompile

* @param int $time_limit

* @param int $max_errors

*

* @return integer number of template files recompiled

*/

public function compileAllConfig($extension = '.conf', $force_compile = false, $time_limit = 0, $max_errors = null)

{

return Smarty_Internal_Utility::compileAllConfig($extension, $force_compile, $time_limit, $max_errors, $this);

}

/**

* Delete compiled template file

*

* @param string $resource_name template name

* @param string $compile_id compile id

* @param integer $exp_time expiration time

*

* @return integer number of template files deleted

*/

public function clearCompiledTemplate($resource_name = null, $compile_id = null, $exp_time = null)

{

return Smarty_Internal_Utility::clearCompiledTemplate($resource_name, $compile_id, $exp_time, $this);

}

/**

* Return array of tag/attributes of all tags used by an template

*

* @param Smarty_Internal_Template $template

*

* @return array of tag/attributes

*/

public function getTags(Smarty_Internal_Template $template)

{

return Smarty_Internal_Utility::getTags($template);

}

/**

* Run installation test

*

* @param array $errors Array to write errors into, rather than outputting them

*

* @return boolean true if setup is fine, false if something is wrong

*/

public function testInstall(&$errors = null)

{

return Smarty_Internal_Utility::testInstall($this, $errors);

}

/**

* Error Handler to mute expected messages

*

* @link http://php.net/set_error_handler

*

* @param integer $errno Error level

* @param $errstr

* @param $errfile

* @param $errline

* @param $errcontext

*

* @return boolean

*/

public static function mutingErrorHandler($errno, $errstr, $errfile, $errline, $errcontext)

{

$_is_muted_directory = false;

// add the SMARTY_DIR to the list of muted directories

if (!isset(Smarty::$_muted_directories[SMARTY_DIR])) {

$smarty_dir = realpath(SMARTY_DIR);

if ($smarty_dir !== false) {

Smarty::$_muted_directories[SMARTY_DIR] = array(

'file' => $smarty_dir,

'length' => strlen($smarty_dir),

);

}

}

// walk the muted directories and test against $errfile

foreach (Smarty::$_muted_directories as $key => &$dir) {

if (!$dir) {

// resolve directory and length for speedy comparisons

$file = realpath($key);

if ($file === false) {

// this directory does not exist, remove and skip it

unset(Smarty::$_muted_directories[$key]);

continue;

}

$dir = array(

'file' => $file,

'length' => strlen($file),

);

}

if (!strncmp($errfile, $dir['file'], $dir['length'])) {

$_is_muted_directory = true;

break;

}

}

// pass to next error handler if this error did not occur inside SMARTY_DIR

// or the error was within smarty but masked to be ignored

if (!$_is_muted_directory || ($errno && $errno & error_reporting())) {

if (Smarty::$_previous_error_handler) {

return call_user_func(Smarty::$_previous_error_handler, $errno, $errstr, $errfile, $errline, $errcontext);

} else {

return false;

}

}

}

/**

* Enable error handler to mute expected messages

*

* @return void

*/

public static function muteExpectedErrors()

{

/*

error muting is done because some people implemented custom error_handlers using

http://php.net/set_error_handler and for some reason did not understand the following paragraph:

It is important to remember that the standard PHP error handler is completely bypassed for the

error types specified by error_types unless the callback function returns FALSE.

error_reporting() settings will have no effect and your error handler will be called regardless -

however you are still able to read the current value of error_reporting and act appropriately.

Of particular note is that this value will be 0 if the statement that caused the error was

prepended by the @ error-control operator.

Smarty deliberately uses @filemtime() over file_exists() and filemtime() in some places. Reasons include

- @filemtime() is almost twice as fast as using an additional file_exists()

- between file_exists() and filemtime() a possible race condition is opened,

which does not exist using the simple @filemtime() approach.

*/

$error_handler = array('Smarty', 'mutingErrorHandler');

$previous = set_error_handler($error_handler);

// avoid dead loops

if ($previous !== $error_handler) {

Smarty::$_previous_error_handler = $previous;

}

}

/**

* Disable error handler muting expected messages

*

* @return void

*/

public static function unmuteExpectedErrors()

{

restore_error_handler();

}

}

// Check if we're running on windows

Smarty::$_IS_WINDOWS = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN';

// let PCRE (preg_*) treat strings as ISO-8859-1 if we're not dealing with UTF-8

if (Smarty::$_CHARSET !== 'UTF-8') {

Smarty::$_UTF8_MODIFIER = '';

}

/**

* Smarty exception class

*

* @package Smarty

*/

class SmartyException extends Exception

{

public static $escape = false;

public function __toString()

{

return ' --> Smarty: ' . (self::$escape ? htmlentities($this->message) : $this->message) . '

}

}

/**

* Smarty compiler exception class

*

* @package Smarty

*/

class SmartyCompilerException extends SmartyException

{

public function __toString()

{

return ' --> Smarty Compiler: ' . $this->message . '

}

/**

* The line number of the template error

*

* @type int|null

*/

public $line = null;

/**

* The template source snippet relating to the error

*

* @type string|null

*/

public $source = null;

/**

* The raw text of the error message

*

* @type string|null

*/

public $desc = null;

/**

* The resource identifier or template name

*

* @type string|null

*/

public $template = null;

}

/**

* Autoloader

*/

function smartyAutoload($class)

{

$_class = strtolower($class);

static $_classes = array(

'smarty_config_source' => true,

'smarty_config_compiled' => true,

'smarty_security' => true,

'smarty_cacheresource' => true,

'smarty_cacheresource_custom' => true,

'smarty_cacheresource_keyvaluestore' => true,

'smarty_resource' => true,

'smarty_resource_custom' => true,

'smarty_resource_uncompiled' => true,

'smarty_resource_recompiled' => true,

);

if (!strncmp($_class, 'smarty_internal_', 16) || isset($_classes[$_class])) {

include SMARTY_SYSPLUGINS_DIR . $_class . '.php';

}

}

希望本文所述對大家基于smarty模板的PHP程序設計有所幫助。

總結

以上是生活随笔為你收集整理的php smarty extends,php封装的smarty类完整实例的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

日韩超碰在线 | 久久av观看 | 欧美a级在线免费观看 | 日韩大陆欧美高清视频区 | 久青草视频在线观看 | 久久 地址 | 久久精品国产一区二区三 | 又黄又爽又无遮挡的视频 | 九九九九免费视频 | 免费在线黄网 | 91麻豆精品国产自产在线游戏 | 91丨九色丨国产丨porny精品 | 成人手机在线视频 | 午夜精品视频一区二区三区在线看 | 天天操人人干 | 久久96国产精品久久99软件 | 欧美日韩高清一区二区三区 | 人人超在线公开视频 | 91在线看 | 97视频在线观看免费 | 国产a级免费 | 午夜电影一区 | 色网av | 欧美日韩a视频 | 奇米影视8888在线观看大全免费 | 91麻豆精品国产 | 中文字幕在线观看日本 | 天天夜夜操 | 国产精品久久久久久麻豆一区 | 午夜在线观看影院 | 91精品国产91久久久久久三级 | 色婷婷婷 | 中文字幕色在线视频 | av成人亚洲 | 最新日韩视频在线观看 | 在线观看日韩国产 | 91在线产啪| 久久久99精品免费观看 | 日韩电影久久久 | 中文字幕免费观看视频 | aaa毛片视频| 久久久久久久久久久免费av | 国产精品久久久久久999 | 极品久久久久久久 | 国产精品剧情 | 人人爽人人爽人人片av免 | 欧美最猛性xxxx | 999精品 | 91探花系列在线播放 | 天天se天天cao天天干 | 久久短视频 | 日本三级中文字幕在线观看 | 91在线播 | 美女国内精品自产拍在线播放 | 欧美日韩一区二区在线 | 日韩资源在线播放 | 91av成人 | 欧美日韩一区二区三区免费视频 | 玖玖999| 亚洲砖区区免费 | 久久久久久久久久久久久久电影 | 91超碰在线播放 | 黄色片网站免费 | 久久涩视频 | 91av九色| 久草线 | 久久九九影院 | 国产一级片网站 | 综合黄色网 | 日韩激情精品 | 91人人爽人人爽人人精88v | 精品久久久久亚洲 | bbbb操bbbb| 色综合激情网 | 亚洲精品中文字幕在线观看 | 国产手机精品视频 | 成年人电影免费在线观看 | 精品黄色片 | 国产在线精品一区二区不卡了 | 国产成人精品午夜在线播放 | 亚洲精品视频在线播放 | 狠狠色狠狠色 | 六月丁香激情综合 | 亚洲成人av电影在线 | 黄色网www| 在线国产中文字幕 | 另类老妇性bbwbbw高清 | 激情在线网 | 中文在线最新版天堂 | 色婷婷97 | 亚洲精品国产精品国自产 | 国产情侣一区 | 久久免费的精品国产v∧ | 成人黄色电影免费观看 | 午夜久久成人 | av在观看 | 亚洲精品午夜久久久久久久 | 在线观看资源 | 国产精品九九九九九 | 久久爱992xxoo| 亚洲精品国产精品99久久 | 最近中文字幕免费视频 | 国产精品成人免费一区久久羞羞 | 久久久激情视频 | 久久高清免费观看 | 久久精品国产亚洲 | 又色又爽又黄 | 午夜在线免费视频 | 91精品国产高清自在线观看 | 免费久久99精品国产婷婷六月 | 欧美国产日韩一区二区三区 | 成人一区二区三区在线观看 | 成人免费视频网站在线观看 | 日韩手机在线观看 | 久久观看最新视频 | 免费一级片在线观看 | 国产精品久久久精品 | 久久精品国产精品亚洲 | 国产日韩欧美精品在线观看 | 综合色中文 | 高清国产午夜精品久久久久久 | 国产精品片 | 99riav1国产精品视频 | 日韩免费看的电影 | 激情综合电影网 | 激情片av | 91激情视频在线观看 | 亚洲国产精久久久久久久 | 伊人黄| 国内精品久久久久 | 国内外成人在线视频 | 久久精品黄色 | 中文字幕一区2区3区 | 日韩 精品 一区 国产 麻豆 | 天天天天综合 | 亚洲人人爱 | 久久精品中文字幕免费mv | 美女在线观看网站 | 欧亚日韩精品一区二区在线 | av免费观看高清 | 91爱爱网址 | 国产精品视频99 | 亚洲精品中文字幕在线 | 免费a视频 | 久久永久免费 | 精品免费| 国产不卡av在线播放 | 成人在线视频免费观看 | 亚洲黄a| 欧美 日韩 成人 | 丰满少妇一级片 | 91福利免费 | 精品五月天 | 中字幕视频在线永久在线观看免费 | 久久久久女教师免费一区 | 狠狠狠狠狠狠干 | 欧美日韩精品免费观看 | 亚洲欧美成人在线 | 国产亚洲精品美女 | 国产成人精品一区二区三区福利 | 日本精品久久久久影院 | 国产成人99久久亚洲综合精品 | 一区二区精品视频 | 国产在线观看av | 国产91精品久久久久久 | 成人看片| 一区免费观看 | 日韩丝袜| 九九九热精品免费视频观看网站 | 国产精品6 | 国内久久精品视频 | 日韩欧美精品免费 | 日韩免费在线看 | 婷婷综合| 8090yy亚洲精品久久 | 久久一区二 | 91av免费看 | 日韩中文字幕免费电影 | 在线观看视频在线 | 黄色字幕网 | 欧美午夜久久久 | 成人精品电影 | 欧美a在线免费观看 | 日韩免费一区二区在线观看 | 国产精品亚洲成人 | 91成人免费在线视频 | 婷婷av网 | 亚洲美女视频在线观看 | 天天色视频| 中文字幕在线观看三区 | 91视频在线观看免费 | 国产精品久久久久久av | 国产小视频免费观看 | 免费观看性生活大片 | 97福利在线 | 五月天综合婷婷 | 免费高清国产 | 97超级碰 | 波多野结衣网址 | 99久久精品国产欧美主题曲 | 免费又黄又爽 | 国产一级黄色免费看 | a在线免费观看视频 | 国产.精品.日韩.另类.中文.在线.播放 | 黄色特一级片 | 在线观看亚洲专区 | 国产四虎在线 | 九九欧美 | 国产一区二区网址 | 国产激情电影综合在线看 | av大全在线免费观看 | 亚洲永久字幕 | 99热精品久久 | 久久深夜福利免费观看 | 亚洲成人免费在线观看 | 成人午夜精品 | 九色最新网址 | 国产免费高清视频 | 伊人影院在线观看 | 超碰在线色 | 亚洲精品看片 | 天天操天天是 | 国产精品免费看久久久8精臀av | 色综合婷婷久久 | 国产成人333kkk | 国产区精品区 | 91丨porny丨九色 | 国产91九色蝌蚪 | 久久天天操 | 天天做日日做天天爽视频免费 | 亚洲麻豆精品 | 国产一区在线免费观看 | 亚洲无吗视频在线 | 69国产精品视频 | 中文在线a√在线 | 国色天香第二季 | 亚洲日本va在线观看 | 久草在线官网 | 久久精国产 | 亚洲国产小视频在线观看 | 91桃色免费视频 | 我爱av激情网 | 中文字幕av日韩 | 狠狠干网站 | 国产精品一区专区欧美日韩 | 婷婷伊人综合亚洲综合网 | 亚洲欧美婷婷六月色综合 | 亚洲精品福利在线观看 | 国产色婷婷 | 在线视频 成人 | 美女久久久久久久久久 | 久久综合久久综合这里只有精品 | 日本黄色免费电影网站 | 又爽又黄又无遮挡网站动态图 | 1024手机基地在线观看 | 日韩av片无码一区二区不卡电影 | 精品电影一区 | 欧美十八| 久久理论电影网 | 日日操天天操狠狠操 | 在线观看成人 | 精品久久久久久久久久国产 | 韩国三级一区 | 一区二区视频免费在线观看 | 欧美日韩午夜爽爽 | 97精品国产97久久久久久久久久久久 | 日韩黄色大片在线观看 | 欧美成人999| 国内三级在线观看 | 四虎影视成人精品国库在线观看 | 精品国产电影 | 探花视频免费在线观看 | 国产最新在线视频 | 欧美日韩xxxxx | 免费一区在线 | 在线免费观看黄 | 日本动漫做毛片一区二区 | 最近日本mv字幕免费观看 | 国产精品普通话 | 日本精品视频一区二区 | 丁香六月婷婷综合 | 精品久久久久久久久久久久久 | 精品极品在线 | 欧美福利视频 | 国产真实精品久久二三区 | 国产精品福利无圣光在线一区 | 久久久久国产精品免费 | 精品国产一区二区三区久久久久久 | 国产成人a亚洲精品 | av国产在线观看 | 亚洲aⅴ乱码精品成人区 | 亚洲电影网站 | 色婷婷99| 午夜18视频在线观看 | 日韩欧美在线视频一区二区三区 | 精品国产自在精品国产精野外直播 | 国产精品高清在线观看 | 日韩 在线a | 97在线视频免费观看 | 欧美少妇xx | 午夜a区| www久久99| 久久伦理影院 | 欧美一级艳片视频免费观看 | 色婷婷免费视频 | 午夜一级免费电影 | 99在线热播精品免费99热 | 91精品视频导航 | 超碰国产在线播放 | 狠狠色伊人亚洲综合成人 | 亚洲精品国产高清 | free,性欧美 九九交易行官网 | 免费看的国产视频网站 | 日韩免费一区二区三区 | 国产日韩精品欧美 | 99久久久久免费精品国产 | 国产剧在线观看片 | 精品国产激情 | 色五月成人 | 亚洲国产成人在线观看 | 特级毛片在线 | 国产精品自产拍在线观看中文 | 日韩成人免费在线观看 | 久久精品视 | 狠狠婷婷| 精品高清美女精品国产区 | 国产精品久久久av久久久 | 亚洲精品国产精品国 | a级片久久久 | 日韩电影在线观看中文字幕 | 在线观看日本高清mv视频 | 日本电影久久 | 久久精品久久99精品久久 | 中文字幕 国产专区 | 免费av网址在线观看 | 国产精品久久久久久超碰 | 日本成人中文字幕在线观看 | 国产.精品.日韩.另类.中文.在线.播放 | 亚洲影视九九影院在线观看 | 欧美在线18| 天天操天天操天天操天天操天天操 | 欧美一级片在线播放 | 日韩免费不卡av | 激情丁香在线 | 日韩在线观看网址 | 婷香五月| 国产欧美最新羞羞视频在线观看 | 成人小电影在线看 | 亚洲精品白浆高清久久久久久 | 精品一区电影国产 | 国产精品美乳一区二区免费 | 日韩大片免费在线观看 | 中文字幕文字幕一区二区 | 国产精品手机在线观看 | 深爱婷婷| 免费看黄色毛片 | 蜜臀av夜夜澡人人爽人人桃色 | 久久综合久色欧美综合狠狠 | 午夜精品一区二区国产 | 国产美女免费观看 | 国产亚洲综合精品 | 福利网址在线观看 | 91视频3p| 日韩在线播放欧美字幕 | 婷婷丁香狠狠爱 | 久久刺激视频 | 又黄又爽又刺激视频 | 一区二区三区精品久久久 | 亚洲日本黄色 | 精品国产精品久久 | 日韩中文字幕在线观看 | 99爱国产精品 | 成人h动漫精品一区二 | 欧洲亚洲国产视频 | 五月婷婷视频在线 | 欧美激情视频在线免费观看 | 日韩免费观看一区二区 | 日韩va欧美va亚洲va久久 | 国产 日韩 欧美 中文 在线播放 | 精品一区二三区 | 久久精品www人人爽人人 | 久久久国产视频 | 婷婷中文字幕综合 | 国产精品福利无圣光在线一区 | 成人午夜电影久久影院 | 视色网站| 亚洲美女久久 | 在线激情电影 | 亚洲精品视频网站在线观看 | 亚洲黄色在线免费观看 | 国内精品视频免费 | 免费看污网站 | 少妇高潮流白浆在线观看 | 毛片网站免费 | 日韩欧美中文 | 欧洲一区二区三区精品 | 日韩va欧美va亚洲va久久 | ww视频在线观看 | a黄色大片 | 91成人精品一区在线播放 | 亚洲视频分类 | 日韩中文字幕免费在线观看 | 91亚洲在线观看 | 91精品视屏| 久久精品一二三区白丝高潮 | 国产视频一区在线免费观看 | 国产电影黄色av | 丝袜美腿亚洲 | 亚洲国产精品女人久久久 | 国产在线2020 | 五月天婷亚洲天综合网鲁鲁鲁 | 国产九九精品视频 | www.操.com | 最新一区二区三区 | 欧美va天堂在线电影 | 国产区精品在线观看 | 97成人精品 | 久久精品久久久久电影 | 九月婷婷人人澡人人添人人爽 | 日韩一片| 日韩在线第一区 | 国内精品免费 | 国产精品毛片一区视频 | 国产99免费| 999久久国产 | 国产专区欧美专区 | 国产精品一区二区电影 | 中文字幕频道 | 亚洲第一伊人 | 日韩欧美国产精品 | 欧美经典久久 | 99国产精品久久久久久久久久 | 天天射综合网视频 | 91综合视频在线观看 | 99热国产在线 | 亚洲精品大全 | 久久精品99国产 | 免费亚洲片| 园产精品久久久久久久7电影 | 日韩啪啪小视频 | 久久66热这里只有精品 | 中文字幕资源网 国产 | 三级黄色欧美 | 激情六月婷婷久久 | 日韩电影中文字幕 | 美女网站视频久久 | 456成人精品影院 | 天天摸日日摸人人看 | 国产成人333kkk| 奇米7777狠狠狠琪琪视频 | 四虎最新域名 | 97超碰精品 | 久久精品视频网站 | 中文字幕一区二区三区四区久久 | 久久久亚洲影院 | 成人黄色片免费 | www天天干com | 国产精久久久 | 久久久午夜精品理论片中文字幕 | 香蕉视频在线看 | 国产啊v在线观看 | 国产高清免费观看 | 四虎成人精品永久免费av | 国产福利一区二区三区视频 | 三级毛片视频 | 亚洲精品国产自产拍在线观看 | 日韩午夜av | 综合激情伊人 | 人人揉人人揉人人揉人人揉97 | 中文字幕在线观看一区二区三区 | 成人作爱视频 | 国产亚洲人成网站在线观看 | 中文字幕在线播放第一页 | 99免费在线 | 成人久久18免费 | 久久免费视频3 | 美女免费网站 | 丁香在线观看完整电影视频 | 亚洲黄色网络 | 亚洲在线网址 | 久久韩国免费视频 | 欧美久久久久久久久久久久 | 国产精品一区二区三区视频免费 | 日韩av电影免费在线观看 | 97在线看片 | 天天骚夜夜操 | 99久久久久久国产精品 | 午夜色大片在线观看 | 国产精品女主播一区二区三区 | 久久精品福利视频 | av+在线播放在线播放 | 精壮的侍卫呻吟h | av大全在线免费观看 | 婷婷丁香自拍 | 精品国产乱码久久久久久浪潮 | 日韩av在线免费播放 | 丁香免费视频 | 17videosex性欧美 | 成人av动漫在线观看 | 久久久久女人精品毛片 | 天天摸日日摸人人看 | 久久96国产精品久久99软件 | 成片免费| 综合亚洲视频 | 91亚洲精品视频 | 日韩亚洲精品电影 | 久久视频99 | 国产精品免费不 | 国产精品久久久毛片 | 日韩中文字幕电影 | 久久在现视频 | 中文字幕av免费 | 欧美作爱视频 | 亚洲精品视频在线观看视频 | 美女久久久久久 | 天天操夜夜操 | 日韩精品欧美视频 | 色综合久久综合中文综合网 | 久久国产精品小视频 | 丁香av在线| 欧洲激情综合 | 亚洲日本va午夜在线影院 | 亚一亚二国产专区 | 看污网站| 中文字幕在线免费 | 一级性av| 一区电影 | 97在线观看免费观看高清 | 国产一区观看 | 国产精品igao视频网网址 | 成人免费观看大片 | 午夜久草| 久久精品国产精品 | 日日爱视频 | 国产精品久久久久婷婷 | 97av影院| 亚洲区视频在线观看 | 中文字幕乱码电影 | 久久激情小视频 | 玖玖玖国产精品 | 2023亚洲精品国偷拍自产在线 | 日日草视频 | 久久精品国产精品 | 99久久久精品 | 一级特黄av | 亚洲女欲精品久久久久久久18 | 99久久99视频只有精品 | 国产福利a| 极品美女被弄高潮视频网站 | 69国产成人综合久久精品欧美 | 国产精品乱码一区二三区 | 亚洲精品美女视频 | 国产大陆亚洲精品国产 | 国产精品视频区 | 一区二区激情 | 国产日本亚洲 | 97色在线观看免费视频 | 成人免费看黄 | 久久综合九色综合97婷婷女人 | 色婷婷激婷婷情综天天 | 黄色网址av | 77国产精品| 日日夜夜天天人人 | 国产亚洲精品久久久久久电影 | 日韩视频在线一区 | 国产精品久久久一区二区 | 91九色性视频 | 欧美日韩国产一区二区在线观看 | a黄在线观看 | 色播激情五月 | 成人在线播放视频 | 久久99热精品这里久久精品 | 亚洲日本一区二区在线 | 日韩av看片 | 久久99久久精品国产 | 国产精品久久久久久久免费 | 五月天婷婷在线观看视频 | 日日夜夜天天操 | 久久手机免费视频 | 久久久91精品国产一区二区精品 | 色欧美成人精品a∨在线观看 | 91视频久久久久久 | 国产视频一二区 | 91精品国产麻豆国产自产影视 | 国产视频1区2区3区 久久夜视频 | 玖玖在线视频观看 | 一区二区视频在线免费观看 | 欧美va天堂在线电影 | av片中文| 免费无遮挡动漫网站 | 99久久精品视频免费 | 手机看片国产 | 国产精品免费观看在线 | 特级西西www44高清大胆图片 | 久久99视频免费观看 | 色综合婷婷| 久久久三级视频 | 久草在线免费看视频 | 天天干天天上 | 国产美女无遮挡永久免费 | 81精品国产乱码久久久久久 | 在线观看91久久久久久 | 五月婷婷视频在线 | 免费视频 三区 | 欧美另类一二三四区 | 丁香综合激情 | 国产亚洲精品bv在线观看 | 天天草天天草 | 国产爽视频 | 天天干天天操天天拍 | 91精品视频在线免费观看 | 色五婷婷 | 一区二区三区免费在线 | 欧美经典久久 | 二区三区在线 | 九精品 | 欧美xxxx性xxxxx高清 | 在线欧美日韩 | 四虎在线观看精品视频 | 亚洲 综合 国产 精品 | 国产精品岛国久久久久久久久红粉 | 国产免费a | 免费观看性生活大片3 | 99国产一区二区三精品乱码 | 欧美91成人网 | 中文字幕字幕中文 | 国产精品毛片 | 在线观看中文字幕网站 | 久久成人国产 | 丁香综合五月 | 97精产国品一二三产区在线 | 国产精品美女免费视频 | 国产精品久久久久久久久久久久久 | av东方在线| 亚洲综合色站 | 婷婷福利影院 | 香蕉久久久久久av成人 | 中文字幕在线观看三区 | 亚洲国产日本 | 操操日日| 我要色综合天天 | 精品国产一区二区三区免费 | 免费看片成人 | 欧美日韩免费一区二区 | 美女视频黄色免费 | 992tv在线观看网站 | 久久超碰99 | 日韩二区三区在线观看 | 亚洲精选国产 | 国产三级视频在线 | 久久国产免费视频 | 日韩激情小视频 | 日本成人黄色片 | 懂色av一区二区在线播放 | av在线播放国产 | 精品一区二区三区电影 | 中文字幕免费 | 久久伊人八月婷婷综合激情 | 在线观看国产日韩 | 欧美日本不卡 | 五月天电影免费在线观看一区 | 在线观看91网站 | 日韩有码在线播放 | 91在线日韩| 91成人精品视频 | 国产成人l区 | 91成人免费在线 | 久久国产精品一区二区三区四区 | 欧美日韩国产一区二区三区 | 国产视频导航 | 亚洲精品国产精品99久久 | 久久av中文字幕片 | va视频在线 | 在线免费观看麻豆视频 | 日韩高清在线一区 | 亚洲天堂免费视频 | 999成人免费视频 | 国产精品成人一区二区 | 国产精品都在这里 | 精品国产伦一区二区三区观看说明 | 在线观看中文字幕2021 | 久久成人午夜 | 国产精彩在线视频 | 91九色成人蝌蚪首页 | 日韩网页| 亚洲 欧美 国产 va在线影院 | 久操中文字幕在线观看 | 天天操天天综合网 | 在线你懂的视频 | 黄色特级一级片 | 亚洲最大在线视频 | 成人久久18免费网站麻豆 | 丁香婷婷久久久综合精品国产 | www.天天操| 国产成人精品一区在线 | 996久久国产精品线观看 | 国产一区二区中文字幕 | 免费观看一区二区 | 欧美在线视频日韩 | 九九热视频在线免费观看 | 精品特级毛片 | 国产在线观看免 | 亚洲黄色激情小说 | 成人在线观看av | 97在线精品视频 | 开心激情久久 | 久久五月婷婷综合 | 狠狠五月婷婷 | 超级碰碰碰碰 | 成人av在线一区二区 | 亚洲成人网在线 | 日韩在线观看三区 | 国产手机在线视频 | 91精品国产乱码 | 麻豆va一区二区三区久久浪 | 在线观看黄色免费视频 | 国产伦理精品一区二区 | 国产老太婆免费交性大片 | 911亚洲精品第一 | 中文字幕成人 | 99精品视频免费观看视频 | 天天摸天天舔天天操 | av免费电影网站 | 99精品国产在热久久 | www.午夜| 日韩av不卡在线观看 | 欧美国产精品久久久久久免费 | 日韩理论电影网 | 日本大片免费观看在线 | 国产精品系列在线 | 国产一区二区在线免费观看 | 国产一级特黄毛片在线毛片 | 亚洲精品国偷自产在线91正片 | 欧美91精品国产自产 | 综合精品在线 | 成人三级视频 | 国产 欧美 日本 | 日韩超碰在线 | 日韩精品高清不卡 | 91精品久久久久久综合乱菊 | 日本字幕网| 99久久久久久久久 | 麻豆一区在线观看 | 久久欧洲视频 | 国产午夜在线观看视频 | 久久久免费少妇 | 天天爽夜夜爽精品视频婷婷 | 国产精品mv在线观看 | 日日夜夜添 | 精品久久久影院 | 成人片在线播放 | 亚洲精品视频在线观看视频 | 日本公妇色中文字幕 | 丁香六月在线 | 日韩精品 在线视频 | 九九热av| 成 人 免费 黄 色 视频 | 97干com| 99电影| 久久综合久久久 | 久久国产精品久久w女人spa | 丁香综合av | 涩涩网站在线看 | 奇米7777狠狠狠琪琪视频 | 五月激情姐姐 | 国产精品美女999 | 五月婷婷av| 97视频在线观看视频免费视频 | 国产精品久久久久av | 中国精品少妇 | 99产精品成人啪免费网站 | 在线天堂视频 | 国产视频久久久久 | 狠狠狠狠狠狠狠狠 | 最新日韩视频在线观看 | 手机看片福利 | 97在线超碰 | 日韩性片| 国产精品一区二区精品视频免费看 | 久二影院 | 在线香蕉视频 | 粉嫩av一区二区三区四区在线观看 | 国产视频日本 | 国产欧美精品一区aⅴ影院 99视频国产精品免费观看 | 91在线公开视频 | 欧美日韩国产二区 | 91亚州| 美女视频黄在线 | 中文字幕在线观看完整版电影 | 偷拍区另类综合在线 | 91福利试看 | 色婷在线| 国产在线精品观看 | 国产精品嫩草影院123 | 五月天婷婷视频 | 成人免费视频网址 | 美女国产网站 | 91中文字幕在线 | 日韩免费在线一区 | 国产色在线 | 四虎在线观看视频 | 久久只精品99品免费久23小说 | 色干干 | 欧美一区二区伦理片 | 国产成人a亚洲精品v | 一区 二区电影免费在线观看 | 91福利社区在线观看 | 亚洲精品视频在线免费播放 | 亚洲国产人午在线一二区 | 国产第一页福利影院 | av电影不卡| 99久久婷婷国产一区二区三区 | 综合网天天射 | 9999毛片 | 成人亚洲精品久久久久 | 西西44人体做爰大胆视频 | 亚洲国产精品va在线 | 欧美久久久久久久久久久 | 亚洲精品国产精品国 | 国产在线视频一区二区三区 | 97操操操 | 国产自产在线视频 | 国产在线毛片 | 日日狠狠 | 麻豆系列在线观看 | 色香蕉在线 | 五月天亚洲综合小说网 | 五月婷婷开心中文字幕 | 免费国产视频 | 免费色视频网站 | 日韩视频一区二区在线观看 | 色综合久久综合中文综合网 | 蜜臀av性久久久久蜜臀aⅴ流畅 | 欧美日韩99| 国产中文字幕视频在线观看 | 蜜臀久久99静品久久久久久 | aaaaaa毛片| 欧美日韩大片在线观看 | 香蕉在线观看视频 | 欧美国产日韩一区二区三区 | 精品一区二区在线免费观看 | 国产精品久久久久av免费 | 国产高清一级 | 中文字幕高清 | 亚洲 欧美 精品 | 国产成人精品免费在线观看 | 日韩电影一区二区三区在线观看 | 欧美日韩国产高清视频 | 在线影院av | 国产91免费在线观看 | www.天天干| 91片在线观看 | 麻豆激情电影 | 日韩精品一区二区免费视频 | 午夜aaaa| 久久在线观看视频 | 日韩乱理 | 91视频麻豆视频 | 久久视频在线观看免费 | 久久8精品 | 久热香蕉视频 | 国产短视频在线播放 | 啪啪精品 | 久久久久久久久久毛片 | 最新色站| 亚洲精品久久久蜜桃直播 | 国产97在线看 | 日韩网站在线观看 | 久久色在线播放 | 一级黄色片毛片 | 日韩电影一区二区在线观看 | 欧美婷婷色| 国产精品久久久久久久久久不蜜月 | 日韩视频图片 | 国产精品久久久999 国产91九色视频 | 国产精品一区二区三区久久 | 欧美精品v国产精品v日韩精品 | 久久国产精品久久w女人spa | 91麻豆精品国产自产 | 国产99在线播放 | 日韩av一区二区三区四区 | 免费婷婷| av韩国在线 | 日韩午夜视频在线观看 | 天天干天天看 | 中文字幕一区二区三区在线观看 | av不卡免费看 | 日韩av成人免费看 | 99久久99视频只有精品 | 国产福利专区 | 亚洲 欧洲 国产 精品 | 91重口视频| 天天干天天摸天天操 | 国内精品在线看 | 成人久久18免费网站图片 | 午夜三级理论 | 久久综合中文色婷婷 | 久久久久久久久久久久久久av | av综合站| 狠狠综合网 | 亚州国产精品 | 午夜精品av | 婷婷久久网站 | 国产视频一级 | 又黄又爽又湿又无遮挡的在线视频 | 美女视频黄频大全免费 | 久久国产一区二区三区 | 亚洲精品66 | 91九色精品| 伊人色播 | 亚洲国产精品视频在线观看 | 久久精品一区二区三区国产主播 | 国产亚洲视频系列 | 日韩美女免费线视频 | 97在线精品国自产拍中文 | 黄色国产高清 | 91在线视频观看免费 | 伊人久久在线观看 | 天天做天天爱夜夜爽 | 又黄又刺激视频 | 久久精品在线视频 | 五月婷婷香蕉 | 亚洲综合色视频在线观看 | 在线观看深夜视频 | 在线国产视频一区 | 欧美亚洲国产精品久久高清浪潮 | 国产成人久久精品 | 午夜av电影 | 蜜臀久久99静品久久久久久 | 韩国在线一区二区 | 免费黄色网止 | 日色在线视频 | 96久久精品 | 国产精品美女视频 | 日韩视频一区二区三区在线播放免费观看 | 成年人免费在线观看网站 | 亚洲欧美成人在线 | 久久国产精品久久精品 | 亚洲传媒在线 | av一本久道久久波多野结衣 | 亚洲视频观看 | 四月婷婷在线观看 | 国产一二三四在线观看视频 | 中文字幕一区二区三区视频 | 免费污片 | 国产精品久久久久av福利动漫 | 91亚洲国产成人久久精品网站 | 操操操干干干 | 久久国产综合视频 | 免费福利视频导航 | 国内揄拍国内精品 | av 一区 二区 久久 | 夜夜高潮夜夜爽国产伦精品 | 五月婷香| 黄色免费大全 | 久久超碰网 | 日韩网站一区二区 | 色综合国产 | 一区二区三区四区精品视频 | 91最新地址永久入口 | 二区三区av | 日韩欧美高清 | 亚洲精品视频久久 | 亚洲欧美综合精品久久成人 | 五月情婷婷 | 啪啪激情网 | 98久久| 中文字幕一区二区三区乱码不卡 | 99精品美女 | 久久久久久久久久久久国产精品 | 9在线观看免费高清完整版在线观看明 | 黄色国产高清 | 日韩一区二区免费视频 | 韩国在线一区 | 五月综合在线观看 | 久久激情影院 | 成人午夜电影在线 | 国产精品区在线观看 | 婷婷激情网站 | 麻豆超碰| 日韩天天综合 | 91在线亚洲 | av一区二区三区在线播放 | 在线观看日韩国产 | 亚洲精品国产精品久久99热 | 一色屋精品视频在线观看 | a久久久久 | 天天综合在线观看 | 精品美女久久久久久免费 | 日韩黄色一级电影 | 成人久久久电影 | ,午夜性刺激免费看视频 | 五月天色网站 | 2022国产精品视频 | 亚洲一区二区精品视频 | 亚洲精品国产欧美在线观看 | 久久久 精品 | 99久久精品国产一区 |