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

歡迎訪問 生活随笔!

生活随笔

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

php

php smarty框架案例,php封装的smarty类案例

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

這篇文章主要介紹了php封裝的smarty類,針對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';

}

}

總結:以上就是本文的全部內容,希望對大家的學習有所幫助。

相關推薦:

總結

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

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

毛片精品免费在线观看 | 免费精品国产va自在自线 | 综合色天天 | 成 人 免费 黄 色 视频 | 免费国产在线观看 | 丝袜护士aⅴ在线白丝护士 天天综合精品 | 欧美疯狂性受xxxxx另类 | 字幕网资源站中文字幕 | 国产91区| 麻豆视频在线免费看 | 黄色软件视频网站 | 久草视频在线观 | 99精品视频一区二区 | 亚洲精品一区二区三区在线观看 | 黄色在线网站噜噜噜 | 日韩电影在线观看一区二区三区 | 精品免费视频123区 午夜久久成人 | 成人免费在线观看电影 | 久久8精品 | 亚洲高清资源 | 99视频久久| 久草网站在线 | 成人黄大片视频在线观看 | 久草在线免费资源 | 欧美久久电影 | 狠狠干天天色 | av在线影片 | 97视频播放 | 欧美极品xxx| 色av网站| 久日精品 | 日韩 | 黄色精品一区二区 | 欧美成人基地 | 五月花激情 | 91精品视频一区二区三区 | 日韩精品一区二区三区丰满 | www.国产在线视频 | 色妞色视频一区二区三区四区 | 日韩在线观看视频在线 | 91九色在线观看视频 | 1000部18岁以下禁看视频 | av一区二区在线观看中文字幕 | 欧洲亚洲激情 | 国产成人精品福利 | 国产中文视频 | av大片免费在线观看 | 久久这里只有精品视频首页 | 人人插超碰 | 成人黄色片免费看 | 国产视频一级 | 玖玖玖在线观看 | 97国产一区二区 | 在线观看中文字幕一区二区 | 国产精品色 | 毛片二区 | 九九欧美视频 | 日韩在线观看视频免费 | 久草网视频在线观看 | 黄色成人av| 精品一二三四在线 | 久久乐九色婷婷综合色狠狠182 | 久久深夜福利免费观看 | www色| 人人干人人干人人干 | 国产夫妻性生活自拍 | 我要色综合天天 | 精品二区视频 | 亚洲国产精品影院 | 91精品国产91 | 91色蜜桃| 最近2019年日本中文免费字幕 | 亚洲精品国产精品国产 | 久久久久 免费视频 | 国产破处在线播放 | 午夜精品视频一区二区三区在线看 | 国产日韩视频在线 | 在线观看免费av网站 | 精品久久久久久久久久久久久久久久 | 精品国产成人av在线免 | 日韩成人黄色 | www.国产在线 | 精品久久久久久亚洲综合网 | 在线观看色网 | 亚洲黑丝少妇 | 日韩videos高潮hd | 91九色网站 | av福利超碰网站 | 天天色 天天 | 成人免费视频网站 | 国产短视频在线播放 | 在线观看国产www | 国产精品成人一区二区 | 8x成人免费视频 | 精品一区二区三区在线播放 | 亚洲乱码一区 | 国产精品入口麻豆www | 久草视频在线新免费 | 国产日产精品一区二区三区四区 | 日韩黄色在线 | 久久乐九色婷婷综合色狠狠182 | 在线观看av小说 | 婷婷精品国产一区二区三区日韩 | 欧美一级电影免费观看 | 日韩av一区二区在线影视 | 亚洲在线日韩 | 狠狠干天天 | 又黄又爽又湿又无遮挡的在线视频 | 午夜12点 | 欧美激情精品久久久久久免费印度 | 伊人宗合网| 中文字幕在线观 | 六月丁香激情网 | 99久久精品免费视频 | 欧美日韩一区二区三区视频 | 国产精品久久久久久久久久新婚 | 中文字幕亚洲五码 | 精品国产一区二区三区不卡 | 正在播放 国产精品 | 久久精品国产久精国产 | 日韩欧美一区二区三区免费观看 | 午夜精品99久久免费 | 欧美韩日在线 | 精品高清视频 | 美女久久 | 久久人人添人人爽添人人88v | av电影在线免费观看 | 久草在线免费看视频 | 99综合影院在线 | 免费观看91视频大全 | av观看久久久 | 国产精品日韩精品 | 免费亚洲精品视频 | 激情欧美丁香 | av中文字幕在线电影 | 国产在线精品区 | 91免费网| 久久精品电影院 | 中文字幕国产在线 | 99久免费精品视频在线观看 | 天天综合婷婷 | 免费一级日韩欧美性大片 | 亚洲精品国 | 午夜三级理论 | 91免费高清在线观看 | 久久精品视频中文字幕 | 天天操天天操天天操天天操天天操天天操 | 日韩久久在线 | 日韩在线观看第一页 | 深夜国产福利 | 欧美另类高潮 | 国产专区一 | 91av手机在线| 久草久草视频 | 久久艹中文字幕 | 国产成人精品免高潮在线观看 | 四虎国产精品永久在线国在线 | 97精品国自产拍在线观看 | 探花在线观看 | 国产色综合天天综合网 | 国产精品久久网站 | 日韩xxxxxxxxx | 伊人久久电影网 | 国产精品亚洲片夜色在线 | 欧美日韩高清一区二区三区 | 久久99亚洲热视 | 超碰人人99 | 免费国产一区二区视频 | 精品产品国产在线不卡 | 日韩网站在线看片你懂的 | 欧美视频xxx| 天天色 天天 | 午夜丰满寂寞少妇精品 | 色噜噜在线观看视频 | 日本久久久精品视频 | 国产资源在线播放 | 国产片免费在线观看视频 | 免费看wwwwwwwwwww的视频 久久久久久99精品 91中文字幕视频 | 激情在线网址 | 国产精品18久久久久vr手机版特色 | av在线免费网站 | 日本久久91 | 欧美日韩性生活 | 国产精品精品国产色婷婷 | 日韩videos高潮hd| 丁香婷婷在线观看 | 国产精品久久99精品毛片三a | 成人av影视 | 激情丁香 | 久久久精品国产一区二区三区 | 国产在线不卡精品 | 亚洲精品资源在线观看 | 美女黄色网在线播放 | 99精品久久久久久久久久综合 | 成人a免费| 日韩精品综合在线 | 在线精品视频免费播放 | 免费观看一级视频 | 国产免费又爽又刺激在线观看 | 久久久91精品国产一区二区三区 | 国产精品久久久久久久电影 | 香蕉视频国产在线 | 婷婷丁香激情网 | 色欧美视频 | 国产成人精品在线播放 | 在线观看亚洲免费视频 | 亚洲久草在线 | 九九三级毛片 | 久久网页| 精品在线看 | 美女福利视频在线 | 激情www | 日韩av免费大片 | 久久精品这里热有精品 | 六月婷婷色 | 99视频国产精品 | 精品国产福利在线 | 亚洲国产精久久久久久久 | 日韩精品中文字幕在线不卡尤物 | 中文字幕人成不卡一区 | 色视频在线观看 | 精品在线播放视频 | 夜夜爽88888免费视频4848 | 综合天天网 | 久草国产在线观看 | 久久精品草 | 国产精品96久久久久久吹潮 | 四虎永久国产精品 | 伊人伊成久久人综合网小说 | 欧美日韩国产高清视频 | 国产五月婷 | 日韩免费在线网站 | 中文字幕xxxx| 免费黄a大片 | 九九久久精品 | 国产精品网红直播 | 国产 视频 高清 免费 | 久久久三级视频 | 在线免费观看国产 | 在线看v片成人 | 日日夜夜综合网 | 国产成人精品综合 | 中文在线字幕免费观 | 日韩成人黄色av | 91免费高清 | 色婷婷综合久久久 | 午夜精品久久久久久99热明星 | 男女激情免费网站 | 久久伊人色综合 | 免费av看片 | 黄色网址中文字幕 | 三级小视频在线观看 | 久草国产精品 | 欧美另类xxx| www黄在线| 狠狠狠干 | 中文字幕人成人 | 久久性生活片 | 99久久日韩精品免费热麻豆美女 | 国产午夜视频在线观看 | 国产精品18久久久久久vr | 91精品免费在线观看 | 亚洲一二区精品 | 2023年中文无字幕文字 | 亚洲片在线 | 亚州精品国产 | 亚洲精品国产免费 | 黄视频网站大全 | 免费高清无人区完整版 | 中文字幕一区二区三区在线播放 | 久久草网 | 久久论理 | 中文字幕在线看视频 | 中文字幕在线观看一区 | 亚洲精品国产片 | 国产成人久久久77777 | av网站在线免费观看 | 国产一区二区三区久久久 | 99精品电影 | 久久久久一区二区三区 | 五月天中文字幕mv在线 | 国产精品久久久影视 | 美女久久久久久久久久 | 久久男女视频 | 精品久久久久久亚洲综合网 | 99 视频 高清 | 日韩欧美电影 | 成人性生交视频 | 欧美精品一区二区三区四区在线 | 成人手机在线视频 | www,黄视频| 中文字幕第一页在线vr | 久久精品欧美一区二区三区麻豆 | 天天在线免费视频 | 久久99中文字幕 | 一级一片免费观看 | aa一级片 | 亚洲精品ww | 色综合天天狠狠 | 亚洲经典视频在线观看 | 免费看日韩 | 81精品国产乱码久久久久久 | 国产精品自产拍在线观看桃花 | 色多多视频在线 | 国产69精品久久久久9999apgf | 国产流白浆高潮在线观看 | 欧美成人xxx | 日韩电影在线观看一区二区三区 | 久久免费视频8 | 成年人免费电影 | 亚洲综合最新在线 | a久久久久 | 欧美另类重口 | 成年人av在线播放 | 欧美色图东方 | 日韩在线不卡视频 | 亚洲黄色免费电影 | 97日日碰人人模人人澡分享吧 | 久久久www | 日日爱av | 婷婷丁香社区 | 在线视频一区二区 | 日韩爱爱网站 | 国产一区成人 | 综合网色| 国产区精品区 | 九色福利视频 | 亚洲色五月 | 天天做天天干 | 91在线成人 | a久久久久 | 欧洲精品码一区二区三区免费看 | 国产精品美女久久久网av | 国产一级二级视频 | 亚洲资源一区 | 美女av电影 | 亚洲综合色视频在线观看 | 女人久久久久 | 在线国产黄色 | 人人爽人人爽人人片av | 久久观看| 国产精品麻豆视频 | 国产美腿白丝袜足在线av | 亚洲欧美综合 | 五月婷在线播放 | 黄色免费观看 | 一级黄色免费 | 97在线公开视频 | 欧美久久久久久久久久久久久 | 久久影视网 | 国产精品久久久久永久免费看 | www.色午夜,com | 欧美analxxxx | 亚洲人在线 | 在线久热| 黄色亚洲 | 久久精品二区 | 在线看的av网站 | 久久久久99精品成人片三人毛片 | av五月婷婷 | 99精品国产在热久久下载 | 亚洲精品看片 | 18做爰免费视频网站 | 激情婷婷色 | 99久久成人 | 成 人 黄 色 视频免费播放 | 久久精品视频网址 | 日韩中字在线 | 在线日本看片免费人成视久网 | 中文字幕最新精品 | 午夜私人影院久久久久 | 久久香蕉电影 | 精品国产91亚洲一区二区三区www | 最新日韩视频 | 五月天色站 | 色婷婷激婷婷情综天天 | 91成人蝌蚪 | 最近中文字幕完整视频高清1 | 在线国产一区二区 | 少妇av片 | 久久99久久99精品免视看婷婷 | 女人久久久久 | 国产精品久久婷婷六月丁香 | 日韩av资源站| av观看免费在线 | 国产一区二区在线视频观看 | 日韩欧美国产免费播放 | 久碰视频在线观看 | 在线观看精品一区 | 久草www| 欧美影院久久 | 中文字幕中文字幕中文字幕 | 999视频在线播放 | 成年人电影免费看 | 亚洲欧洲国产视频 | 蜜臀91丨九色丨蝌蚪老版 | 黄色三级在线看 | 91大神电影 | 精品字幕 | 一区二区丝袜 | 九九视频网 | 国产成人一区二区三区在线观看 | 麻豆国产精品永久免费视频 | 亚洲激情综合 | 国产美女久久 | 亚洲女人天堂成人av在线 | 成人午夜在线电影 | 国产精品久久在线观看 | 欧美做受高潮 | 99精品欧美一区二区蜜桃免费 | 亚洲精品乱码久久久久久蜜桃91 | 免费在线一区二区三区 | 国语自产偷拍精品视频偷 | 中文字幕在 | 日韩高清精品免费观看 | 99久久www| 人人干人人干人人干 | 日韩精品1区2区 | 国产精品永久久久久久久久久 | 国产精品久久久久久久久久三级 | 国产在线黄色 | 国产成人精品一区二区三区福利 | 天天干天天做天天操 | 91av在| 天天综合网天天综合色 | 欧美国产精品久久久久久免费 | 男女啪啪网站 | 天天综合网久久综合网 | 婷婷深爱五月 | 国产精品 视频 | 亚洲一级电影在线观看 | 久久视频中文字幕 | 亚洲天堂色婷婷 | 国产精品综合久久久久久 | a亚洲视频 | 97人人模人人爽人人喊中文字 | 一区二区视频在线播放 | 免费色网 | www.色就是色 | 成人av资源站 | 日韩av线观看 | 免费观看黄色12片一级视频 | 国产精品日韩高清 | 免费观看av | 婷五月激情 | 国模精品在线 | 日日草av | 久草国产在线 | 欧美激情第28页 | 91视频高清完整版 | 精品久久久久久国产91 | 成人黄色av免费在线观看 | 亚洲开心色 | 美女久久久久久久久久 | 精品久久久久一区二区国产 | 午夜丰满寂寞少妇精品 | 九九免费观看全部免费视频 | 手机看片午夜 | 午夜精品一区二区三区在线播放 | 特级毛片爽www免费版 | 精精国产xxxx视频在线播放 | 欧美日韩在线观看不卡 | 日韩伦理片hd | 综合久久久久久久久 | 日韩在线小视频 | 亚洲在线精品视频 | 欧美精品v国产精品v日韩精品 | 国产99久久精品 | av国产网站 | 午夜视频黄 | 97国产人人 | 中文字幕在线国产 | 亚洲精品视频在线观看免费视频 | 天天干天天干天天色 | 狠狠的操狠狠的干 | 黄色资源网站 | 亚洲精品免费在线视频 | 中中文字幕av | 91福利视频一区 | 天天天天爱天天躁 | av在线免费网 | 成人h在线播放 | av在线激情| 日韩精品中文字幕在线不卡尤物 | 久久大香线蕉app | 人人爽久久久噜噜噜电影 | 亚洲精区二区三区四区麻豆 | 国产乱码精品一区二区三区介绍 | 日日干 天天干 | 女人魂免费观看 | 国产精品麻豆一区二区三区 | 一区二区三区观看 | 在线最新av | 黄色成人在线 | 国产 日韩 欧美 在线 | 99久久er热在这里只有精品15 | 欧美精品国产综合久久 | 欧美一区二区三区四区夜夜大片 | 日韩久久久久久久 | 欧美日韩高清一区二区 | 欧美影院久久 | 手机在线日韩视频 | 久久国产女人 | 久久免费视频1 | 免费高清国产 | 色偷偷97| 免费观看的av | 亚洲精品国偷拍自产在线观看 | www.亚洲精品在线 | 99久久日韩精品视频免费在线观看 | 正在播放久久 | 欧美 另类 交 | 一区 二区 精品 | 蜜臀久久99精品久久久无需会员 | 午夜精品三区 | 欧美狠狠色 | 久久久高清免费视频 | 久久久免费在线观看 | 99视频免费播放 | 日韩精品一区二区三区第95 | 日色在线视频 | 五月天久久激情 | 超碰国产在线播放 | 日韩系列在线观看 | 久久久国产99久久国产一 | 久草网视频在线观看 | 91九色成人 | 在线精品观看 | 国产精品福利小视频 | 亚洲欧美成人在线 | 日韩 精品 一区 国产 麻豆 | 国产精品久久久久久久久久 | 在线观看www视频 | 中文日韩在线 | 高清不卡毛片 | 亚洲视频2| 在线观看黄av | 国产精品av一区二区 | 超碰97人人爱 | 久久九精品 | 欧美日韩国产高清视频 | 国产无遮挡猛进猛出免费软件 | 日韩av偷拍 | 五月天最新网址 | 九九欧美| 免费久久精品视频 | 看片网站黄色 | 国产第一页精品 | 日日干天天射 | 成人国产精品久久久 | 黄色av网站在线观看免费 | 久久久久久久久综合 | 69av在线播放 | 日韩美在线观看 | 探花视频在线观看免费 | 激情综合五月婷婷 | 91看片淫黄大片91 | av一级网站 | 亚洲国产精品推荐 | 成人资源在线观看 | 中国一级片视频 | 精品视频亚洲 | 在线三级av| 91九色成人蝌蚪首页 | 中文字幕在线网址 | 国产人成一区二区三区影院 | 中文av免费 | 91伊人久久大香线蕉蜜芽人口 | 天天操天天干天天 | 色欧美视频| 在线免费色视频 | 黄污网站在线 | 久久精品国产免费看久久精品 | 香蕉精品视频在线观看 | 夜夜夜 | 精品极品在线 | 亚洲片在线 | 国产伦精品一区二区三区免费 | 人人揉人人揉人人揉人人揉97 | 97人人超| 中文字幕字幕中文 | 亚洲精品国偷拍自产在线观看 | 成人在线一区二区三区 | 婷婷激情av | 亚洲电影影音先锋 | 国产精品久久久久久久久软件 | 91精品视频在线 | 精品久久久久久久久久国产 | 欧美亚洲一区二区在线 | 五月天激情视频在线观看 | 国产99久久久国产精品免费看 | 婷婷丁香激情网 | 99精品视频免费观看视频 | 成人午夜毛片 | 黄色福利视频网站 | 国产无吗一区二区三区在线欢 | 亚洲成av人影片在线观看 | 日韩中文三级 | 中文字幕丝袜美腿 | 69久久99精品久久久久婷婷 | 亚洲精品毛片一级91精品 | 色综合久久久久综合 | 精品国产乱码久久久久久三级人 | 人人爽久久久噜噜噜电影 | 欧美午夜精品久久久久久浪潮 | 精品久久久精品 | 婷婷五天天在线视频 | 国产精品不卡一区 | 国产偷v国产偷∨精品视频 在线草 | 在线a人片免费观看视频 | 日本黄色大片免费 | 久久福利综合 | 天天色天天射综合网 | 深夜精品福利 | 99精品久久久久久久久久综合 | aaawww| 久久r精品 | 日本一区二区三区免费看 | 亚洲国产黄色片 | 日韩综合第一页 | 亚洲五月激情 | 日本精品久久久久中文字幕5 | 久草精品视频在线看网站免费 | 亚洲一级在线观看 | 久久色中文字幕 | 日韩视频免费在线观看 | 国产 日韩 欧美 在线 | 亚洲成人黄色在线观看 | 在线观看日韩中文字幕 | 国产亚洲精品久久久网站好莱 | 91资源在线观看 | 国产精品美女 | 精品久久一区 | 99精品视频在线观看播放 | 亚洲精品视频免费 | 中文字幕在线日本 | av中文字幕第一页 | 人人精品久久 | 久久视频这里有久久精品视频11 | 国产精品免费观看视频 | 欧美性生活久久 | 国产 日韩 在线 亚洲 字幕 中文 | 97av色 | 在线看av网址 | 成人a视频在线观看 | 中文字幕在线观看一区二区 | 久久看片 | 亚洲精品永久免费视频 | 久久综合九色欧美综合狠狠 | a极黄色片 | 久久精品五月 | 国产成人精品综合久久久 | 黄色在线观看免费网站 | 夜夜爽88888免费视频4848 | av中文字幕在线观看网站 | 黄色小说视频网站 | 国产美女黄网站免费 | 美国av大片| 在线免费视频一区 | 欧美另类v | 免费视频二区 | 日韩a欧美 | 超碰精品在线观看 | 日日爱夜夜爱 | 日韩网站在线免费观看 | 美女久久 | 中文字幕免费在线看 | 亚洲综合成人婷婷小说 | 人人超碰人人 | 91久久爱热色涩涩 | 国产精品黄色av | 色婷婷激情四射 | 一级黄色片在线播放 | 天天色中文 | 国产精品一区免费在线观看 | 99久久婷婷 | 蜜臀久久99精品久久久无需会员 | 欧美性色xo影院 | 国产不卡片 | 久久呀| av三级在线播放 | 中文字幕乱码一区二区 | 国产aaa免费视频 | 亚洲天堂网站 | 麻豆精品国产传媒 | 91精品国产91久久久久久三级 | 99理论片 | 久久精品9 | 中文字幕丰满人伦在线 | 免费观看日韩 | 色综合久久久 | av不卡免费在线观看 | 亚洲视频免费在线观看 | 日韩精品中字 | 国产在线专区 | 国产精品精品视频 | 日日摸日日添日日躁av | 手机在线中文字幕 | 国产aaa毛片 | 99产精品成人啪免费网站 | 国内精品久久久久久久久 | 午夜私人影院久久久久 | 久久久久久久久久久黄色 | 97在线看 | 国精产品一二三线999 | 青青啪| 免费看的国产视频网站 | 亚洲激精日韩激精欧美精品 | 中文字幕免费在线看 | 久久婷婷五月综合色丁香 | www免费视频com━ | 一区二区精 | 欧美日韩在线免费视频 | 亚洲精品色 | 91高清完整版在线观看 | 国产精品一区二区白浆 | 亚洲一区免费在线 | 亚洲v欧美v国产v在线观看 | 天无日天天操天天干 | 在线精品视频免费播放 | 97在线观看免费高清完整版在线观看 | 国产毛片aaa| 国产黄色精品在线观看 | 激情综合一区 | www.久草.com | 国产精品毛片久久久久久久 | 一区二区视频网站 | 亚洲精品乱码久久久一二三 | 在线观看免费av网站 | 国产特级毛片 | 在线性视频日韩欧美 | 亚洲欧美少妇 | 一级一级一片免费 | 狠狠色噜噜狠狠 | 久久天| 日韩乱色精品一区二区 | 国产精品高潮呻吟久久久久 | 丁香久久 | 草久视频在线 | 99精品免费久久久久久久久日本 | 亚洲最大免费成人网 | 91成人欧美 | 国产网站av | 在线中文字幕av观看 | 99久久这里有精品 | 天天天插| 99一级片| 99久久网站 | 国产一卡在线 | 在线 国产 亚洲 欧美 | 四虎天堂 | 日本精品久久久久中文字幕 | 午夜精品一二区 | 中文免费 | 久久久久久网站 | 中文字幕中文字幕在线中文字幕三区 | 日韩电影一区二区三区在线观看 | 欧美片一区二区三区 | 91高清视频免费 | 91av在线电影 | 成人久久久久 | 亚洲欧美日韩一级 | 黄色aaa毛片 | 粉嫩av一区二区三区四区五区 | 国产精品一区二区在线免费观看 | 丝袜精品视频 | 五月天中文字幕mv在线 | 人人爽人人av | 97超碰资源网 | 日本性视频| 欧美一级大片在线观看 | 国产精品入口传媒 | 久草网站在线观看 | 欧美资源 | 久久精品久久久精品美女 | 超碰人人草 | 日韩a级黄色 | 91亚洲精品国产 | 丁香综合av| 天天躁天天操 | 人人澡人 | av解说在线观看 | 欧美亚洲国产日韩 | 国产精品一区二区久久久 | 日韩精品一区二区三区免费观看视频 | 国产精品综合久久久久久 | 色天天 | 蜜臀av一区二区 | 手机看片国产 | 园产精品久久久久久久7电影 | 成人免费xxx在线观看 | 成人久久久久 | 一本一本久久a久久精品综合妖精 | 亚洲综合色播 | 开心激情综合网 | 久久影院中文字幕 | 久久久久久久久久久久久久av | 又黄又爽又无遮挡免费的网站 | 国产精品免费不 | 中文字幕精品一区久久久久 | 又黄又爽免费视频 | 精品国产免费久久 | 中文字幕乱偷在线 | 欧美成人精品在线 | 日本高清中文字幕有码在线 | 日韩成人在线免费观看 | 国产成人精品一区一区一区 | 深爱激情开心 | 日本中出在线观看 | 热久久免费视频 | 国产一卡久久电影永久 | 狠狠干天天射 | 人人干人人搞 | 在线免费观看国产视频 | 国产尤物一区二区三区 | 久久黄网站 | 五月婷婷视频在线 | 1000部国产精品成人观看 | 色99在线 | 日韩欧美精品在线观看视频 | 一级黄色片网站 | 国产精品毛片一区视频 | 天天综合网国产 | 国产精品美女久久久久久久久久久 | 99视频免费在线观看 | 久草视频在线免费看 | 毛片网站在线 | 亚洲一区二区三区毛片 | 免费看国产黄色 | 国产精品一区二区果冻传媒 | 综合久久久久久久 | 天天色天天骑天天射 | 国产精品久久久久久久久久ktv | 国产五月色婷婷六月丁香视频 | 久草男人天堂 | 国产午夜三级一二三区 | 成人免费在线视频 | 免费观看日韩av | 久久亚洲在线 | 国产一级在线观看视频 | 国产xxxxx在线观看 | 国产无套精品久久久久久 | 日韩在线观看视频一区二区三区 | 精品国产乱码一区二 | 午夜久久久久久久久久久 | 色欲综合视频天天天 | www.av在线播放 | 国产精品久久久久久久久久免费看 | 99精品国产亚洲 | 国产高清在线永久 | 久精品视频免费观看2 | 国产成人精品一区二区三区 | 国产福利精品视频 | 蜜桃视频日本 | 91看片看淫黄大片 | 91久久国产综合精品女同国语 | 缴情综合网五月天 | av一级免费| 91九色蝌蚪视频 | 92中文资源在线 | 911国产精品 | 精品一区电影国产 | av一区二区三区在线播放 | 97超碰在线久草超碰在线观看 | 亚洲成色777777在线观看影院 | 国产亚洲在线视频 | 999免费视频| 韩国av免费在线 | 国产成人久 | 超碰免费在线公开 | 国产最顶级的黄色片在线免费观看 | 国产精品资源在线 | 在线中文字幕观看 | 成人在线超碰 | 91.dizhi永久地址最新 | 日韩在线观看中文字幕 | 美女久久久久 | 欧美另类亚洲 | 亚洲热久久| 成人毛片一区二区三区 | 91黄色影视 | 西西4444www大胆艺术 | 久久久久欠精品国产毛片国产毛生 | 91.dizhi永久地址最新 | 国产高清成人 | 日本中文在线 | 啪啪免费观看网站 | 五月天开心 | 韩日精品在线观看 | 91精品在线看 | 97超在线视频 | 国内外成人免费在线视频 | 国产一级在线观看 | 亚洲精品一区二区三区新线路 | 五月激情五月激情 | 在线探花| 天天操福利视频 | 亚洲精选视频免费看 | 欧美日韩国产综合网 | 久久国产精品影视 | 蜜臀av性久久久久蜜臀av | 成人免费一区二区三区在线观看 | 玖玖爱免费视频 | 国产黄色片免费观看 | 亚洲欧美日韩一二三区 | 国产亚洲精品综合一区91 | 国内精品久久久久影院一蜜桃 | 国产原厂视频在线观看 | 超碰在线亚洲 | 欧美在线视频日韩 | 欧美激情精品久久久久久 | 精品在线一区二区三区 | 日韩一区二区三免费高清在线观看 | 色天天 | 国产亚洲视频中文字幕视频 | 亚洲精品一区二区精华 | 免费国产黄线在线观看视频 | 91成人网在线观看 | 亚洲精品免费在线观看 | 久久久网站 | 中文在线亚洲 | 91完整版在线观看 | 色综合天天在线 | 久久久网站 | 日韩精品视频一二三 | 国产色久| 中文字幕永久免费 | 国产亚洲片| 午夜.dj高清免费观看视频 | 少妇做爰k8经典 | 亚洲国产经典视频 | 青草视频在线 | 在线午夜电影神马影院 | 亚洲一区二区三区四区在线视频 | 免费亚洲电影 | 在线激情av电影 | 精品国产一区二区三区久久久蜜臀 | 久草视频免费在线播放 | 探花视频在线观看免费 | 日韩免费看视频 | 亚洲精品 在线视频 | 午夜电影久久久 | 91资源在线观看 | 亚洲精品在线观看不卡 | 国产在线 一区二区三区 | 亚洲国产成人精品在线观看 | 激情五月婷婷综合网 | 欧美黑人xxxx猛性大交 | 久久经典视频 | 中文字幕在线观看网址 | 激情五月婷婷网 | 97免费 | 天天操·夜夜操 | 国产小视频在线播放 | 91视频成人免费 | 成人中文字幕+乱码+中文字幕 | 国内精品免费 | 在线黄网站 | 麻豆91网站 | 色av色av色av | 999久久 | 欧美日韩高清 | 玖玖在线视频观看 | 九色视频网站 | 精品成人a区在线观看 | 国产无遮挡又黄又爽在线观看 | 成年人黄色大片在线 | 天天综合日| 欧美贵妇性狂欢 | 久草网免费 | 深爱激情开心 | 日韩欧美视频在线免费观看 | 黄a网站 | 亚洲精品91天天久久人人 | 亚洲理论片 | 亚洲成人精品在线 | 国产精品久久久久av免费 | 青春草视频在线播放 | 久久精品视 | 亚州av网站| 久久精品专区 | 96在线 | 国产久草在线观看 | 国色综合 | 黄色亚洲精品 | 美腿丝袜一区二区三区 | 精品亚洲一区二区三区 | 五月开心婷婷 | 奇米影视999| 久久久久亚洲最大xxxx | 91色吧| 国产高清在线观看 | 欧美片一区二区三区 | 毛片美女网站 | 日本性xxx | 一级黄色片在线播放 | 久久久久久久免费观看 | 日韩在线高清视频 |