[
  {
    "path": ".gitignore",
    "content": ".idea/\n"
  },
  {
    "path": "Extend/Class/UploadFile.class.php",
    "content": "<?php\n\n/**\n * 文件上传 - PHP300扩展类\n * Class Upload\n */\n\nclass Upload\n{\n    /** @var array 允许的扩展名 */\n    public $allowExts = array();\n\n    /** @var array 允许的文件类型 */\n    public $allowTypes = array();\n\n    /** @var string 文件保存路径 */\n    public $savePath = './Upload/';\n\n    /** @var int|string 最大上传大小 默认最大上传 2M = 2097152 B */\n    public $maxSize = 2097152;\n\n    //最近一次的错误\n    /** @var bool 自动检测文件 默认未开启 */\n    public $autoCheck = true;\n    /** @var bool 是否覆盖同名文件 默认不覆盖 */\n    public $uploadReplace = false;\n    private $error = '';\n    /** @var array 文件上传信息 */\n    private $uploadFileInfo;\n\n    /**\n     * 架构函数\n     * Upload constructor.\n     * @param string $allowExts\n     * @param string $maxSize\n     * @param string $allowTypes\n     */\n    public function __construct($allowExts = '', $maxSize = '', $allowTypes = '')\n    {\n        //设置文件的后缀\n        if (!empty($allowExts)) {\n            if (is_array($allowExts)) {\n                $this->allowExts = array_map('strtolower', $allowExts);\n            } else {\n                $this->allowExts = explode(',', strtolower($allowExts));\n            }\n        }\n        if (!empty($maxSize) && is_numeric($maxSize)) {\n            $this->maxSize = $maxSize;\n        }\n        if (!empty($allowTypes)) {\n            if (is_array($allowTypes)) {\n                $this->allowTypes = array_map('strtolower', $allowTypes);\n            } else {\n                $this->allowTypes = explode(',', strtolower($allowTypes));\n            }\n        }\n\n    }\n\n    /**\n     * 上传所有文件\n     * @param string $savePath\n     * @return bool\n     */\n    public function upload($savePath = '')\n    {\n        if (empty($savePath))\n            $savePath = $this->savePath;\n        $savePath = rtrim($savePath, '/') . '/';\n        if (!is_dir($savePath)) {\n            $this->createDir($savePath);\n            if (!is_dir($savePath)) {\n                $this->error = \"目录{$savePath}不存在\";\n                return false;\n            }\n        } else {\n            if (!is_writeable($savePath)) {\n                $this->error = \"目录{$savePath}不可写\";\n                return false;\n            }\n        }\n\n        $fileInfo = array();\n        $isUpload = false;\n        $files = $this->dealFiles($_FILES);\n        foreach ($files as $key => $file) {\n            if (!empty($file['name'])) {\n                $file['key'] = $key;\n                $file['extension'] = $this->getExt($file['name']);\n                $file['savepath'] = $savePath;\n                $file['savename'] = $this->getSaveName($file);\n                if ($this->autoCheck) {\n                    if (!$this->check($file))\n                        return false;\n                }\n\n                if (!$this->save($file)) return false;\n                unset($file['tmp_name'], $file['error']);\n                $fileInfo[] = $file;\n                $isUpload = true;\n\n            }\n        }\n        if ($isUpload) {\n            $this->uploadFileInfo = $fileInfo;\n            return true;\n        } else {\n            $this->error = '没有选择上传文件';\n            return false;\n        }\n    }\n\n    /**\n     * 遍历创建文件夹\n     * @param $path\n     */\n    private function createDir($path)\n    {\n        if (!file_exists($path)) {\n            $this->createDir(dirname($path));\n            mkdir($path, 0777);\n        }\n    }\n\n    /**\n     * 处理$_FILES信息  将多个file分离\n     * @param $files\n     * @return array\n     */\n    private function dealFiles($files)\n    {\n        $fileArray = array();\n        $n = 0;\n        foreach ($files as $file) {\n            if (is_array($file['name'])) {\n                //关联数组\n                $keys = array_keys($file);\n                $count = count($file['name']);\n                for ($i = 0; $i < $count; $i++) {\n                    foreach ($keys as $key) {\n                        $fileArray[$n][$key] = $file[$key][$i];\n                    }\n                    $n++;\n                }\n            } else {\n                $fileArray[$n] = $file;\n                $n++;\n            }\n        }\n        return $fileArray;\n    }\n\n    /**\n     * 获取扩展名\n     * @param $filename\n     * @return mixed\n     */\n    private function getExt($filename)\n    {\n        $pathinfo = pathinfo($filename);\n        return $pathinfo['extension'];\n    }\n\n    /**\n     * 文件命名 规则\n     * @param $file\n     * @return string\n     */\n    private function getSaveName($file)\n    {\n        $saveName = md5(uniqid()) . '.' . $file['extension'];\n        return $saveName;\n    }\n\n    /**\n     * 检测文件大小，文件扩展名，文件Mime类型，是否非法上传\n     * @param $file\n     * @return bool\n     */\n    private function check($file)\n    {\n        if ($file['error'] !== 0) {\n            $this->error($file['error']);\n            return false;\n        }\n        if (!$this->checkSize($file['size'])) {\n            $this->error = '上传文件大小不符！';\n            return false;\n        }\n        if (!$this->checkExt($file['extension'])) {\n            $this->error = '上传文件类型不允许！';\n            return false;\n        }\n        if (!$this->checkType($file['type'])) {\n            $this->error = '上传文件MIME类型不允许！';\n            return false;\n        }\n        if (!$this->checkUpload($file['tmp_name'])) {\n            $this->error = '非法上传文件！';\n            return false;\n        }\n        return true;\n    }\n\n    /**\n     * 捕获错误上传信息\n     * @param $errorCode\n     */\n    private function error($errorCode)\n    {\n        switch ($errorCode) {\n            case 1:\n                $this->error = '上传的文件超过了 php.ini 中 upload_max_filesize 选项限制的值';\n                break;\n            case 2:\n                $this->error = '上传文件的大小超过了 HTML 表单中 MAX_FILE_SIZE 选项指定的值';\n                break;\n            case 3:\n                $this->error = '文件只有部分被上传';\n                break;\n            case 4:\n                $this->error = '没有文件被上传';\n                break;\n            case 6:\n                $this->error = '找不到临时文件夹';\n                break;\n            case 7:\n                $this->error = '文件写入失败';\n                break;\n            default:\n                $this->error = '未知上传错误！';\n        }\n        return;\n    }\n\n    /**\n     * 检测文件大小\n     * @param $size\n     * @return bool\n     */\n    private function checkSize($size)\n    {\n        return $size < $this->maxSize;\n    }\n\n    /**\n     * 检测文件扩展名\n     * @param $extension\n     * @return bool\n     */\n    private function checkExt($extension)\n    {\n        if (!empty($this->allowExts))\n            return in_array(strtolower($extension), $this->allowExts, true);\n        return true;\n    }\n\n    /**\n     * 检查文件Mime类型\n     * @param $type\n     * @return bool\n     */\n    private function checkType($type)\n    {\n        if (!empty($this->allowTypes))\n            return in_array(strtolower($type), $this->allowTypes, true);\n        return true;\n    }\n\n    /**\n     * 检测是否非法上传\n     * @param $filename\n     * @return bool\n     */\n    private function checkUpload($filename)\n    {\n        return is_uploaded_file($filename);\n    }\n\n    /**\n     * 保存一个文件\n     * @param $file\n     * @return bool\n     */\n    private function save($file)\n    {\n        $filename = $file['savepath'] . $file['savename'];\n        if (!$this->uploadReplace && is_file($filename)) {\n            $this->error = '文件已经存在！' . $filename;\n            return false;\n        }\n        if (in_array(strtolower($file['extension']), array('gif', 'jpg', 'jpeg', 'bmp', 'png', 'swf')) && false === getimagesize($file['tmp_name'])) {\n            $this->error = '非法图像文件';\n            return false;\n        }\n        if (!move_uploaded_file($file['tmp_name'], $filename)) {\n            $this->error = '文件上传保存错误！';\n            return false;\n        }\n        return true;\n    }\n\n    /**\n     * 通过指定文件的$_FILES['name']上传文件\n     * @param $file\n     * @param string $savePath\n     * @return bool\n     */\n    public function uploadOne($file, $savePath = '')\n    {\n        if (empty($savePath))\n            $savePath = $this->savePath;\n        $savePath = rtrim($savePath, '/') . '/';\n        if (!is_dir($savePath)) {\n            $this->createDir($savePath);\n            if (!is_dir($savePath)) {\n                $this->error = \"目录{$savePath}不存在\";\n                return false;\n            }\n        } else {\n            if (!is_writeable($savePath)) {\n                $this->error = '上传目录' . $savePath . '不可写';\n                return false;\n            }\n        }\n        if (!empty($file['name'])) {\n            $fileArray = array();\n            if (is_array($file['name'])) {\n                $keys = array_keys($file);\n                $count = count($file['name']);\n                for ($i = 0; $i < $count; $i++) {\n                    foreach ($keys as $key)\n                        $fileArray[$i][$key] = $file[$key][$i];\n                }\n            } else {\n                $fileArray[] = $file;\n            }\n            $fileInfo = array();\n            foreach ($fileArray as $key => $file) {\n                $file['extension'] = $this->getExt($file['name']);\n                $file['savepath'] = $savePath;\n                $file['savename'] = $this->getSaveName($file);\n                if ($this->autoCheck) {\n                    if (!$this->check($file))\n                        return false;\n                }\n                if (!$this->save($file)) return false;\n                unset($file['tmp_name'], $file['error']);\n                $fileInfo[] = $file;\n            }\n\n            $this->uploadFileInfo = $fileInfo;\n            return true;\n        } else {\n            $this->error = '没有选择上传文件';\n            return false;\n        }\n    }\n\n    /**\n     * 获取文件上传成功之后的信息\n     * @return array 文件上传信息\n     */\n    public function getUploadFileInfo()\n    {\n        return $this->uploadFileInfo;\n    }\n\n    /**\n     * 获取最近一次的错误信息\n     * @return string\n     */\n    public function getErrorMsg()\n    {\n        return $this->error;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/Autoloader.php",
    "content": "<?php\n/**\n * Smarty Autoloader\n *\n * @package    Smarty\n */\n\n/**\n * Smarty Autoloader\n *\n * @package    Smarty\n * @author     Uwe Tews\n *             Usage:\n *                  require_once '...path/Autoloader.php';\n *                  Smarty_Autoloader::register();\n *             or\n *                  include '...path/bootstrap.php';\n *\n *                  $smarty = new Smarty();\n */\nclass Smarty_Autoloader\n{\n   /**\n     * Filepath to Smarty root\n     *\n     * @var string\n     */\n    public static $SMARTY_DIR = null;\n\n    /**\n     * Filepath to Smarty internal plugins\n     *\n     * @var string\n     */\n    public static $SMARTY_SYSPLUGINS_DIR = null;\n\n    /**\n     * Array with Smarty core classes and their filename\n     *\n     * @var array\n     */\n    public static $rootClasses = array('smarty' => 'Smarty.class.php', 'smartybc' => 'SmartyBC.class.php',);\n\n    /**\n     * Registers Smarty_Autoloader backward compatible to older installations.\n     *\n     * @param bool $prepend Whether to prepend the autoloader or not.\n     */\n    public static function registerBC($prepend = false)\n    {\n        /**\n         * register the class autoloader\n         */\n        if (!defined('SMARTY_SPL_AUTOLOAD')) {\n            define('SMARTY_SPL_AUTOLOAD', 0);\n        }\n        if (SMARTY_SPL_AUTOLOAD &&\n            set_include_path(get_include_path() . PATH_SEPARATOR . SMARTY_SYSPLUGINS_DIR) !== false\n        ) {\n            $registeredAutoLoadFunctions = spl_autoload_functions();\n            if (!isset($registeredAutoLoadFunctions[ 'spl_autoload' ])) {\n                spl_autoload_register();\n            }\n        } else {\n            self::register($prepend);\n        }\n    }\n\n    /**\n     * Registers Smarty_Autoloader as an SPL autoloader.\n     *\n     * @param bool $prepend Whether to prepend the autoloader or not.\n     */\n    public static function register($prepend = false)\n    {\n        self::$SMARTY_DIR = defined('SMARTY_DIR') ? SMARTY_DIR : dirname(__FILE__) . DIRECTORY_SEPARATOR;\n        self::$SMARTY_SYSPLUGINS_DIR = defined('SMARTY_SYSPLUGINS_DIR') ? SMARTY_SYSPLUGINS_DIR :\n            self::$SMARTY_DIR . 'sysplugins' . DIRECTORY_SEPARATOR;\n        if (version_compare(PHP_VERSION, '5.3.0', '>=')) {\n            spl_autoload_register(array(__CLASS__, 'autoload'), true, $prepend);\n        } else {\n            spl_autoload_register(array(__CLASS__, 'autoload'));\n        }\n    }\n\n    /**\n     * Handles auto loading of classes.\n     *\n     * @param string $class A class name.\n     */\n    public static function autoload($class)\n    {\n        if ($class[ 0 ] !== 'S' && strpos($class, 'Smarty') !== 0) {\n            return;\n        }\n        $_class = strtolower($class);\n        if (isset(self::$rootClasses[ $_class ])) {\n            $file = self::$SMARTY_DIR . self::$rootClasses[ $_class ];\n            if (is_file($file)) {\n                include $file;\n            }\n        } else {\n            $file = self::$SMARTY_SYSPLUGINS_DIR . $_class . '.php';\n            if (is_file($file)) {\n                include $file;\n            }\n        }\n        return;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/Smarty.class.php",
    "content": "<?php\n/**\n * Project:     Smarty: the PHP compiling template engine\n * File:        Smarty.class.php\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n * For questions, help, comments, discussion, etc., please join the\n * Smarty mailing list. Send a blank e-mail to\n * smarty-discussion-subscribe@googlegroups.com\n *\n * @link      http://www.smarty.net/\n * @copyright 2017 New Digital Group, Inc.\n * @copyright 2017 Uwe Tews\n * @author    Monte Ohrt <monte at ohrt dot com>\n * @author    Uwe Tews\n * @author    Rodney Rehm\n * @package   Smarty\n * @version   3.1.32-dev\n */\n/**\n * set SMARTY_DIR to absolute path to Smarty library files.\n * Sets SMARTY_DIR only if user application has not already defined it.\n */\nif (!defined('SMARTY_DIR')) {\n    /**\n     *\n     */\n    define('SMARTY_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR);\n}\n/**\n * set SMARTY_SYSPLUGINS_DIR to absolute path to Smarty internal plugins.\n * Sets SMARTY_SYSPLUGINS_DIR only if user application has not already defined it.\n */\nif (!defined('SMARTY_SYSPLUGINS_DIR')) {\n    /**\n     *\n     */\n    define('SMARTY_SYSPLUGINS_DIR', SMARTY_DIR . 'sysplugins' . DIRECTORY_SEPARATOR);\n}\nif (!defined('SMARTY_PLUGINS_DIR')) {\n    /**\n     *\n     */\n    define('SMARTY_PLUGINS_DIR', SMARTY_DIR . 'plugins' . DIRECTORY_SEPARATOR);\n}\nif (!defined('SMARTY_MBSTRING')) {\n    /**\n     *\n     */\n    define('SMARTY_MBSTRING', function_exists('mb_get_info'));\n}\nif (!defined('SMARTY_RESOURCE_CHAR_SET')) {\n    // UTF-8 can only be done properly when mbstring is available!\n    /**\n     * @deprecated in favor of Smarty::$_CHARSET\n     */\n    define('SMARTY_RESOURCE_CHAR_SET', SMARTY_MBSTRING ? 'UTF-8' : 'ISO-8859-1');\n}\nif (!defined('SMARTY_RESOURCE_DATE_FORMAT')) {\n    /**\n     * @deprecated in favor of Smarty::$_DATE_FORMAT\n     */\n    define('SMARTY_RESOURCE_DATE_FORMAT', '%b %e, %Y');\n}\n/**\n * Load Smarty_Autoloader\n */\nif (!class_exists('Smarty_Autoloader')) {\n    include dirname(__FILE__) . '/bootstrap.php';\n}\n/**\n * Load always needed external class files\n */\nrequire_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_data.php';\nrequire_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_extension_handler.php';\nrequire_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_templatebase.php';\nrequire_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_template.php';\nrequire_once SMARTY_SYSPLUGINS_DIR . 'smarty_resource.php';\nrequire_once SMARTY_SYSPLUGINS_DIR . 'smarty_variable.php';\nrequire_once SMARTY_SYSPLUGINS_DIR . 'smarty_template_source.php';\nrequire_once SMARTY_SYSPLUGINS_DIR . 'smarty_template_resource_base.php';\nrequire_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_resource_file.php';\n\n/**\n * This is the main Smarty class\n *\n * @package Smarty\n *\n * The following methods will be dynamically loaded by the extension handler when they are called.\n * They are located in a corresponding Smarty_Internal_Method_xxxx class\n *\n * @method int clearAllCache(int $exp_time = null, string $type = null)\n * @method int clearCache(string $template_name, string $cache_id = null, string $compile_id = null, int $exp_time = null, string $type = null)\n * @method int compileAllTemplates(string $extension = '.tpl', bool $force_compile = false, int $time_limit = 0, $max_errors = null)\n * @method int compileAllConfig(string $extension = '.conf', bool $force_compile = false, int $time_limit = 0, $max_errors = null)\n * @method int clearCompiledTemplate($resource_name = null, $compile_id = null, $exp_time = null)\n */\nclass Smarty extends Smarty_Internal_TemplateBase\n{\n    /**\n     * smarty version\n     */\n    const SMARTY_VERSION = '3.1.32-dev-38';\n    /**\n     * define variable scopes\n     */\n    const SCOPE_LOCAL    = 1;\n    const SCOPE_PARENT   = 2;\n    const SCOPE_TPL_ROOT = 4;\n    const SCOPE_ROOT     = 8;\n    const SCOPE_SMARTY   = 16;\n    const SCOPE_GLOBAL   = 32;\n    /**\n     * define caching modes\n     */\n    const CACHING_OFF              = 0;\n    const CACHING_LIFETIME_CURRENT = 1;\n    const CACHING_LIFETIME_SAVED   = 2;\n    /**\n     * define constant for clearing cache files be saved expiration dates\n     */\n    const CLEAR_EXPIRED = -1;\n    /**\n     * define compile check modes\n     */\n    const COMPILECHECK_OFF       = 0;\n    const COMPILECHECK_ON        = 1;\n    const COMPILECHECK_CACHEMISS = 2;\n    /**\n     * define debug modes\n     */\n    const DEBUG_OFF        = 0;\n    const DEBUG_ON         = 1;\n    const DEBUG_INDIVIDUAL = 2;\n    /**\n     * modes for handling of \"<?php ... ?>\" tags in templates.\n     */\n    const PHP_PASSTHRU = 0; //-> print tags as plain text\n    const PHP_QUOTE    = 1; //-> escape tags as entities\n    const PHP_REMOVE   = 2; //-> escape tags as entities\n    const PHP_ALLOW    = 3; //-> escape tags as entities\n    /**\n     * filter types\n     */\n    const FILTER_POST     = 'post';\n    const FILTER_PRE      = 'pre';\n    const FILTER_OUTPUT   = 'output';\n    const FILTER_VARIABLE = 'variable';\n    /**\n     * plugin types\n     */\n    const PLUGIN_FUNCTION         = 'function';\n    const PLUGIN_BLOCK            = 'block';\n    const PLUGIN_COMPILER         = 'compiler';\n    const PLUGIN_MODIFIER         = 'modifier';\n    const PLUGIN_MODIFIERCOMPILER = 'modifiercompiler';\n    /**\n     * assigned global tpl vars\n     */\n    public static $global_tpl_vars = array();\n    /**\n     * Flag denoting if Multibyte String functions are available\n     */\n    public static $_MBSTRING = SMARTY_MBSTRING;\n    /**\n     * The character set to adhere to (e.g. \"UTF-8\")\n     */\n    public static $_CHARSET = SMARTY_RESOURCE_CHAR_SET;\n    /**\n     * The date format to be used internally\n     * (accepts date() and strftime())\n     */\n    public static $_DATE_FORMAT = SMARTY_RESOURCE_DATE_FORMAT;\n    /**\n     * Flag denoting if PCRE should run in UTF-8 mode\n     */\n    public static $_UTF8_MODIFIER = 'u';\n    /**\n     * Flag denoting if operating system is windows\n     */\n    public static $_IS_WINDOWS = false;\n    /**\n     * auto literal on delimiters with whitespace\n     *\n     * @var boolean\n     */\n    public $auto_literal = true;\n    /**\n     * display error on not assigned variables\n     *\n     * @var boolean\n     */\n    public $error_unassigned = false;\n    /**\n     * look up relative file path in include_path\n     *\n     * @var boolean\n     */\n    public $use_include_path = false;\n    /**\n     * flag if template_dir is normalized\n     *\n     * @var bool\n     */\n    public $_templateDirNormalized = false;\n    /**\n     * joined template directory string used in cache keys\n     *\n     * @var string\n     */\n    public $_joined_template_dir = null;\n    /**\n     * flag if config_dir is normalized\n     *\n     * @var bool\n     */\n    public $_configDirNormalized = false;\n    /**\n     * joined config directory string used in cache keys\n     *\n     * @var string\n     */\n    public $_joined_config_dir = null;\n    /**\n     * default template handler\n     *\n     * @var callable\n     */\n    public $default_template_handler_func = null;\n    /**\n     * default config handler\n     *\n     * @var callable\n     */\n    public $default_config_handler_func = null;\n    /**\n     * default plugin handler\n     *\n     * @var callable\n     */\n    public $default_plugin_handler_func = null;\n    /**\n     * flag if template_dir is normalized\n     *\n     * @var bool\n     */\n    public $_compileDirNormalized = false;\n    /**\n     * flag if plugins_dir is normalized\n     *\n     * @var bool\n     */\n    public $_pluginsDirNormalized = false;\n    /**\n     * flag if template_dir is normalized\n     *\n     * @var bool\n     */\n    public $_cacheDirNormalized = false;\n    /**\n     * force template compiling?\n     *\n     * @var boolean\n     */\n    public $force_compile = false;\n     /**\n     * use sub dirs for compiled/cached files?\n     *\n     * @var boolean\n     */\n    public $use_sub_dirs = false;\n    /**\n     * allow ambiguous resources (that are made unique by the resource handler)\n     *\n     * @var boolean\n     */\n    public $allow_ambiguous_resources = false;\n    /**\n     * merge compiled includes\n     *\n     * @var boolean\n     */\n    public $merge_compiled_includes = false;\n    /*\n    * flag for behaviour when extends: resource  and {extends} tag are used simultaneous\n    *   if false disable execution of {extends} in templates called by extends resource.\n    *   (behaviour as versions < 3.1.28)\n    *\n    * @var boolean\n    */\n    public $extends_recursion = true;\n    /**\n     * force cache file creation\n     *\n     * @var boolean\n     */\n    public $force_cache = false;\n    /**\n     * template left-delimiter\n     *\n     * @var string\n     */\n    public $left_delimiter = \"{\";\n    /**\n     * template right-delimiter\n     *\n     * @var string\n     */\n    public $right_delimiter = \"}\";\n    /**\n     * array of strings which shall be treated as literal by compiler\n     *\n     * @var array string\n     */\n    public $literals = array();\n    /**\n     * class name\n     * This should be instance of Smarty_Security.\n     *\n     * @var string\n     * @see Smarty_Security\n     */\n    public $security_class = 'Smarty_Security';\n    /**\n     * implementation of security class\n     *\n     * @var Smarty_Security\n     */\n    public $security_policy = null;\n    /**\n     * controls handling of PHP-blocks\n     *\n     * @var integer\n     */\n    public $php_handling = self::PHP_PASSTHRU;\n    /**\n     * controls if the php template file resource is allowed\n     *\n     * @var bool\n     */\n    public $allow_php_templates = false;\n    /**\n     * debug mode\n     * Setting this to true enables the debug-console.\n     *\n     * @var boolean\n     */\n    public $debugging = false;\n    /**\n     * This determines if debugging is enable-able from the browser.\n     * <ul>\n     *  <li>NONE => no debugging control allowed</li>\n     *  <li>URL => enable debugging when SMARTY_DEBUG is found in the URL.</li>\n     * </ul>\n     *\n     * @var string\n     */\n    public $debugging_ctrl = 'NONE';\n    /**\n     * Name of debugging URL-param.\n     * Only used when $debugging_ctrl is set to 'URL'.\n     * The name of the URL-parameter that activates debugging.\n     *\n     * @var string\n     */\n    public $smarty_debug_id = 'SMARTY_DEBUG';\n    /**\n     * Path of debug template.\n     *\n     * @var string\n     */\n    public $debug_tpl = null;\n    /**\n     * When set, smarty uses this value as error_reporting-level.\n     *\n     * @var int\n     */\n    public $error_reporting = null;\n    /**\n     * Controls whether variables with the same name overwrite each other.\n     *\n     * @var boolean\n     */\n    public $config_overwrite = true;\n    /**\n     * Controls whether config values of on/true/yes and off/false/no get converted to boolean.\n     *\n     * @var boolean\n     */\n    public $config_booleanize = true;\n    /**\n     * Controls whether hidden config sections/vars are read from the file.\n     *\n     * @var boolean\n     */\n    public $config_read_hidden = false;\n    /**\n     * locking concurrent compiles\n     *\n     * @var boolean\n     */\n    public $compile_locking = true;\n    /**\n     * Controls whether cache resources should use locking mechanism\n     *\n     * @var boolean\n     */\n    public $cache_locking = false;\n    /**\n     * seconds to wait for acquiring a lock before ignoring the write lock\n     *\n     * @var float\n     */\n    public $locking_timeout = 10;\n    /**\n     * resource type used if none given\n     * Must be an valid key of $registered_resources.\n     *\n     * @var string\n     */\n    public $default_resource_type = 'file';\n    /**\n     * caching type\n     * Must be an element of $cache_resource_types.\n     *\n     * @var string\n     */\n    public $caching_type = 'file';\n    /**\n     * config type\n     *\n     * @var string\n     */\n    public $default_config_type = 'file';\n    /**\n     * check If-Modified-Since headers\n     *\n     * @var boolean\n     */\n    public $cache_modified_check = false;\n    /**\n     * registered plugins\n     *\n     * @var array\n     */\n    public $registered_plugins = array();\n    /**\n     * registered objects\n     *\n     * @var array\n     */\n    public $registered_objects = array();\n    /**\n     * registered classes\n     *\n     * @var array\n     */\n    public $registered_classes = array();\n    /**\n     * registered filters\n     *\n     * @var array\n     */\n    public $registered_filters = array();\n    /**\n     * registered resources\n     *\n     * @var array\n     */\n    public $registered_resources = array();\n    /**\n     * registered cache resources\n     *\n     * @var array\n     */\n    public $registered_cache_resources = array();\n    /**\n     * autoload filter\n     *\n     * @var array\n     */\n    public $autoload_filters = array();\n    /**\n     * default modifier\n     *\n     * @var array\n     */\n    public $default_modifiers = array();\n    /**\n     * autoescape variable output\n     *\n     * @var boolean\n     */\n    public $escape_html = false;\n    /**\n     * start time for execution time calculation\n     *\n     * @var int\n     */\n    public $start_time = 0;\n    /**\n     * required by the compiler for BC\n     *\n     * @var string\n     */\n    public $_current_file = null;\n    /**\n     * internal flag to enable parser debugging\n     *\n     * @var bool\n     */\n    public $_parserdebug = false;\n    /**\n     * This object type (Smarty = 1, template = 2, data = 4)\n     *\n     * @var int\n     */\n    public $_objType = 1;\n    /**\n     * Debug object\n     *\n     * @var Smarty_Internal_Debug\n     */\n    public $_debug = null;\n    /**\n     * template directory\n     *\n     * @var array\n     */\n    protected $template_dir = array('./templates/');\n    /**\n     * flags for normalized template directory entries\n     *\n     * @var array\n     */\n    protected $_processedTemplateDir = array();\n    /**\n     * config directory\n     *\n     * @var array\n     */\n    protected $config_dir = array('./configs/');\n    /**\n     * flags for normalized template directory entries\n     *\n     * @var array\n     */\n    protected $_processedConfigDir = array();\n    /**\n     * compile directory\n     *\n     * @var string\n     */\n    protected $compile_dir = './templates_c/';\n    /**\n     * plugins directory\n     *\n     * @var array\n     */\n    protected $plugins_dir = array();\n    /**\n     * cache directory\n     *\n     * @var string\n     */\n    protected $cache_dir = './cache/';\n    /**\n     * removed properties\n     *\n     * @var string[]\n     */\n    protected $obsoleteProperties = array('resource_caching', 'template_resource_caching', 'direct_access_security',\n                                          '_dir_perms', '_file_perms', 'plugin_search_order',\n                                          'inheritance_merge_compiled_includes', 'resource_cache_mode',);\n    /**\n     * List of private properties which will call getter/setter on a direct access\n     *\n     * @var string[]\n     */\n    protected $accessMap = array('template_dir' => 'TemplateDir', 'config_dir' => 'ConfigDir',\n                                 'plugins_dir'  => 'PluginsDir', 'compile_dir' => 'CompileDir',\n                                 'cache_dir'    => 'CacheDir',);\n\n    /**\n     * Initialize new Smarty object\n     */\n    public function __construct()\n    {\n        $this->_clearTemplateCache();\n        parent::__construct();\n        if (is_callable('mb_internal_encoding')) {\n            mb_internal_encoding(Smarty::$_CHARSET);\n        }\n        $this->start_time = microtime(true);\n        if (isset($_SERVER[ 'SCRIPT_NAME' ])) {\n            Smarty::$global_tpl_vars[ 'SCRIPT_NAME' ] = new Smarty_Variable($_SERVER[ 'SCRIPT_NAME' ]);\n        }\n        // Check if we're running on windows\n        Smarty::$_IS_WINDOWS = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN';\n        // let PCRE (preg_*) treat strings as ISO-8859-1 if we're not dealing with UTF-8\n        if (Smarty::$_CHARSET !== 'UTF-8') {\n            Smarty::$_UTF8_MODIFIER = '';\n        }\n    }\n\n    /**\n     * Enable error handler to mute expected messages\n     *\n     * @return boolean\n     * @deprecated\n     */\n    public static function muteExpectedErrors()\n    {\n        return Smarty_Internal_ErrorHandler::muteExpectedErrors();\n    }\n\n    /**\n     * Disable error handler muting expected messages\n     *\n     * @deprecated\n     */\n    public static function unmuteExpectedErrors()\n    {\n        restore_error_handler();\n    }\n\n    /**\n     * Check if a template resource exists\n     *\n     * @param  string $resource_name template name\n     *\n     * @return bool status\n     * @throws \\SmartyException\n     */\n    public function templateExists($resource_name)\n    {\n        // create source object\n        $source = Smarty_Template_Source::load(null, $this, $resource_name);\n        return $source->exists;\n    }\n\n    /**\n     * Loads security class and enables security\n     *\n     * @param  string|Smarty_Security $security_class if a string is used, it must be class-name\n     *\n     * @return Smarty                 current Smarty instance for chaining\n     * @throws SmartyException        when an invalid class name is provided\n     */\n    public function enableSecurity($security_class = null)\n    {\n        Smarty_Security::enableSecurity($this, $security_class);\n        return $this;\n    }\n\n    /**\n     * Disable security\n     *\n     * @return Smarty current Smarty instance for chaining\n     */\n    public function disableSecurity()\n    {\n        $this->security_policy = null;\n        return $this;\n    }\n\n    /**\n     * Add template directory(s)\n     *\n     * @param  string|array $template_dir directory(s) of template sources\n     * @param  string       $key          of the array element to assign the template dir to\n     * @param bool          $isConfig     true for config_dir\n     *\n     * @return Smarty          current Smarty instance for chaining\n     */\n    public function addTemplateDir($template_dir, $key = null, $isConfig = false)\n    {\n        if ($isConfig) {\n            $processed = &$this->_processedConfigDir;\n            $dir = &$this->config_dir;\n            $this->_configDirNormalized = false;\n        } else {\n            $processed = &$this->_processedTemplateDir;\n            $dir = &$this->template_dir;\n            $this->_templateDirNormalized = false;\n        }\n        if (is_array($template_dir)) {\n            foreach ($template_dir as $k => $v) {\n                if (is_int($k)) {\n                    // indexes are not merged but appended\n                    $dir[] = $v;\n                } else {\n                    // string indexes are overridden\n                    $dir[ $k ] = $v;\n                    unset($processed[ $key ]);\n                }\n            }\n        } else {\n            if ($key !== null) {\n                // override directory at specified index\n                $dir[ $key ] = $template_dir;\n                unset($processed[ $key ]);\n            } else {\n                // append new directory\n                $dir[] = $template_dir;\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * Get template directories\n     *\n     * @param mixed $index    index of directory to get, null to get all\n     * @param bool  $isConfig true for config_dir\n     *\n     * @return array list of template directories, or directory of $index\n     */\n    public function getTemplateDir($index = null, $isConfig = false)\n    {\n        if ($isConfig) {\n            $dir = &$this->config_dir;\n        } else {\n            $dir = &$this->template_dir;\n        }\n        if ($isConfig ? !$this->_configDirNormalized : !$this->_templateDirNormalized) {\n            $this->_normalizeTemplateConfig($isConfig);\n        }\n        if ($index !== null) {\n            return isset($dir[ $index ]) ? $dir[ $index ] : null;\n        }\n        return $dir;\n    }\n\n    /**\n     * Set template directory\n     *\n     * @param  string|array $template_dir directory(s) of template sources\n     * @param bool          $isConfig     true for config_dir\n     *\n     * @return \\Smarty current Smarty instance for chaining\n     */\n    public function setTemplateDir($template_dir, $isConfig = false)\n    {\n        if ($isConfig) {\n            $this->config_dir = array();\n            $this->_processedConfigDir = array();\n        } else {\n            $this->template_dir = array();\n            $this->_processedTemplateDir = array();\n        }\n        $this->addTemplateDir($template_dir, null, $isConfig);\n        return $this;\n    }\n\n    /**\n     * Add config directory(s)\n     *\n     * @param string|array $config_dir directory(s) of config sources\n     * @param mixed        $key        key of the array element to assign the config dir to\n     *\n     * @return Smarty current Smarty instance for chaining\n     */\n    public function addConfigDir($config_dir, $key = null)\n    {\n        return $this->addTemplateDir($config_dir, $key, true);\n    }\n\n    /**\n     * Get config directory\n     *\n     * @param mixed $index index of directory to get, null to get all\n     *\n     * @return array configuration directory\n     */\n    public function getConfigDir($index = null)\n    {\n        return $this->getTemplateDir($index, true);\n    }\n\n    /**\n     * Set config directory\n     *\n     * @param $config_dir\n     *\n     * @return Smarty       current Smarty instance for chaining\n     */\n    public function setConfigDir($config_dir)\n    {\n        return $this->setTemplateDir($config_dir, true);\n    }\n\n    /**\n     * Adds directory of plugin files\n     *\n     * @param null|array|string $plugins_dir\n     *\n     * @return Smarty current Smarty instance for chaining\n     */\n    public function addPluginsDir($plugins_dir)\n    {\n        if (empty($this->plugins_dir)) {\n            $this->plugins_dir[] = SMARTY_PLUGINS_DIR;\n        }\n        $this->plugins_dir = array_merge($this->plugins_dir, (array)$plugins_dir);\n        $this->_pluginsDirNormalized = false;\n        return $this;\n    }\n\n    /**\n     * Get plugin directories\n     *\n     * @return array list of plugin directories\n     */\n    public function getPluginsDir()\n    {\n        if (empty($this->plugins_dir)) {\n            $this->plugins_dir[] = SMARTY_PLUGINS_DIR;\n            $this->_pluginsDirNormalized = false;\n        }\n        if (!$this->_pluginsDirNormalized) {\n            if (!is_array($this->plugins_dir)) {\n                $this->plugins_dir = (array)$this->plugins_dir;\n            }\n            foreach ($this->plugins_dir as $k => $v) {\n                $this->plugins_dir[ $k ] = $this->_realpath(rtrim($v, \"/\\\\\") . DIRECTORY_SEPARATOR, true);\n            }\n            $this->_cache[ 'plugin_files' ] = array();\n            $this->_pluginsDirNormalized = true;\n        }\n        return $this->plugins_dir;\n    }\n\n    /**\n     * Set plugins directory\n     *\n     * @param  string|array $plugins_dir directory(s) of plugins\n     *\n     * @return Smarty       current Smarty instance for chaining\n     */\n    public function setPluginsDir($plugins_dir)\n    {\n        $this->plugins_dir = (array)$plugins_dir;\n        $this->_pluginsDirNormalized = false;\n        return $this;\n    }\n\n    /**\n     * Get compiled directory\n     *\n     * @return string path to compiled templates\n     */\n    public function getCompileDir()\n    {\n        if (!$this->_compileDirNormalized) {\n            $this->_normalizeDir('compile_dir', $this->compile_dir);\n            $this->_compileDirNormalized = true;\n        }\n        return $this->compile_dir;\n    }\n\n    /**\n     *\n     * @param  string $compile_dir directory to store compiled templates in\n     *\n     * @return Smarty current Smarty instance for chaining\n     */\n    public function setCompileDir($compile_dir)\n    {\n        $this->_normalizeDir('compile_dir', $compile_dir);\n        $this->_compileDirNormalized = true;\n        return $this;\n    }\n\n    /**\n     * Get cache directory\n     *\n     * @return string path of cache directory\n     */\n    public function getCacheDir()\n    {\n        if (!$this->_cacheDirNormalized) {\n            $this->_normalizeDir('cache_dir', $this->cache_dir);\n            $this->_cacheDirNormalized = true;\n        }\n        return $this->cache_dir;\n    }\n\n    /**\n     * Set cache directory\n     *\n     * @param  string $cache_dir directory to store cached templates in\n     *\n     * @return Smarty current Smarty instance for chaining\n     */\n    public function setCacheDir($cache_dir)\n    {\n        $this->_normalizeDir('cache_dir', $cache_dir);\n        $this->_cacheDirNormalized = true;\n        return $this;\n    }\n\n    /**\n     * creates a template object\n     *\n     * @param  string  $template   the resource handle of the template file\n     * @param  mixed   $cache_id   cache id to be used with this template\n     * @param  mixed   $compile_id compile id to be used with this template\n     * @param  object  $parent     next higher level of Smarty variables\n     * @param  boolean $do_clone   flag is Smarty object shall be cloned\n     *\n     * @return \\Smarty_Internal_Template template object\n     * @throws \\SmartyException\n     */\n    public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null, $do_clone = true)\n    {\n        if ($cache_id !== null && (is_object($cache_id) || is_array($cache_id))) {\n            $parent = $cache_id;\n            $cache_id = null;\n        }\n        if ($parent !== null && is_array($parent)) {\n            $data = $parent;\n            $parent = null;\n        } else {\n            $data = null;\n        }\n        if (!$this->_templateDirNormalized) {\n            $this->_normalizeTemplateConfig(false);\n        }\n        $_templateId = $this->_getTemplateId($template, $cache_id, $compile_id);\n        $tpl = null;\n        if ($this->caching && isset(Smarty_Internal_Template::$isCacheTplObj[ $_templateId ])) {\n            $tpl = $do_clone ? clone Smarty_Internal_Template::$isCacheTplObj[ $_templateId ] :\n                Smarty_Internal_Template::$isCacheTplObj[ $_templateId ];\n            $tpl->inheritance = null;\n            $tpl->tpl_vars = $tpl->config_vars = array();\n        } else if (!$do_clone && isset(Smarty_Internal_Template::$tplObjCache[ $_templateId ])) {\n            $tpl = clone Smarty_Internal_Template::$tplObjCache[ $_templateId ];\n            $tpl->inheritance = null;\n            $tpl->tpl_vars = $tpl->config_vars = array();\n        } else {\n            /* @var Smarty_Internal_Template $tpl */\n            $tpl = new $this->template_class($template, $this, null, $cache_id, $compile_id, null, null);\n            $tpl->templateId = $_templateId;\n        }\n        if ($do_clone) {\n            $tpl->smarty = clone $tpl->smarty;\n        }\n        $tpl->parent = $parent ? $parent : $this;\n        // fill data if present\n        if (!empty($data) && is_array($data)) {\n            // set up variable values\n            foreach ($data as $_key => $_val) {\n                $tpl->tpl_vars[ $_key ] = new Smarty_Variable($_val);\n            }\n        }\n        if ($this->debugging || $this->debugging_ctrl === 'URL') {\n            $tpl->smarty->_debug = new Smarty_Internal_Debug();\n            // check URL debugging control\n            if (!$this->debugging && $this->debugging_ctrl === 'URL') {\n                $tpl->smarty->_debug->debugUrl($tpl->smarty);\n            }\n        }\n        return $tpl;\n    }\n\n    /**\n     * Takes unknown classes and loads plugin files for them\n     * class name format: Smarty_PluginType_PluginName\n     * plugin filename format: plugintype.pluginname.php\n     *\n     * @param  string $plugin_name class plugin name to load\n     * @param  bool   $check       check if already loaded\n     *\n     * @throws SmartyException\n     * @return string |boolean filepath of loaded file or false\n     */\n    public function loadPlugin($plugin_name, $check = true)\n    {\n        return $this->ext->loadPlugin->loadPlugin($this, $plugin_name, $check);\n    }\n\n    /**\n     * Get unique template id\n     *\n     * @param string                    $template_name\n     * @param null|mixed                $cache_id\n     * @param null|mixed                $compile_id\n     * @param null                      $caching\n     * @param \\Smarty_Internal_Template $template\n     *\n     * @return string\n     * @throws \\SmartyException\n     */\n    public function _getTemplateId($template_name,\n                                   $cache_id = null,\n                                   $compile_id = null,\n                                   $caching = null,\n                                   Smarty_Internal_Template $template = null)\n    {\n        $template_name = (strpos($template_name, ':') === false) ? \"{$this->default_resource_type}:{$template_name}\" :\n            $template_name;\n        $cache_id = $cache_id === null ? $this->cache_id : $cache_id;\n        $compile_id = $compile_id === null ? $this->compile_id : $compile_id;\n        $caching = (int)($caching === null ? $this->caching : $caching);\n        if ((isset($template) && strpos($template_name, ':.') !== false) || $this->allow_ambiguous_resources) {\n            $_templateId =\n                Smarty_Resource::getUniqueTemplateName((isset($template) ? $template : $this), $template_name) .\n                \"#{$cache_id}#{$compile_id}#{$caching}\";\n        } else {\n            $_templateId = $this->_joined_template_dir . \"#{$template_name}#{$cache_id}#{$compile_id}#{$caching}\";\n        }\n        if (isset($_templateId[ 150 ])) {\n            $_templateId = sha1($_templateId);\n        }\n        return $_templateId;\n    }\n\n    /**\n     * Normalize path\n     *  - remove /./ and /../\n     *  - make it absolute if required\n     *\n     * @param string $path      file path\n     * @param bool   $realpath  if true - convert to absolute\n     *                          false - convert to relative\n     *                          null - keep as it is but remove /./ /../\n     *\n     * @return string\n     */\n    public function _realpath($path, $realpath = null)\n    {\n        $nds = DIRECTORY_SEPARATOR === '/' ? '\\\\' : '/';\n        // normalize DIRECTORY_SEPARATOR\n        $path = str_replace($nds, DIRECTORY_SEPARATOR, $path);\n        preg_match('%^(?<root>(?:[[:alpha:]]:[\\\\\\\\]|/|[\\\\\\\\]{2}[[:alpha:]]+|[[:print:]]{2,}:[/]{2}|[\\\\\\\\])?)(?<path>(.*))$%u',\n                   $path,\n                   $parts);\n        $path = $parts[ 'path' ];\n        if ($parts[ 'root' ] === '\\\\') {\n            $parts[ 'root' ] = substr(getcwd(), 0, 2) . $parts[ 'root' ];\n        } else {\n            if ($realpath !== null && !$parts[ 'root' ]) {\n                $path = getcwd() . DIRECTORY_SEPARATOR . $path;\n            }\n        }\n        // remove noop 'DIRECTORY_SEPARATOR DIRECTORY_SEPARATOR' and 'DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR' patterns\n        $path = preg_replace('#([\\\\\\\\/]([.]?[\\\\\\\\/])+)#u', DIRECTORY_SEPARATOR, $path);\n        // resolve '..DIRECTORY_SEPARATOR' pattern, smallest first\n        if (strpos($path, '..' . DIRECTORY_SEPARATOR) !== false &&\n            preg_match_all('#(([.]?[\\\\\\\\/])*([.][.])[\\\\\\\\/]([.]?[\\\\\\\\/])*)+#u', $path, $match)\n        ) {\n            $counts = array();\n            foreach ($match[ 0 ] as $m) {\n                $counts[] = (int)((strlen($m) - 1) / 3);\n            }\n            sort($counts);\n            foreach ($counts as $count) {\n                $path = preg_replace('#(([\\\\\\\\/]([.]?[\\\\\\\\/])*[^\\\\\\\\/.]+){' . $count .\n                                     '}[\\\\\\\\/]([.]?[\\\\\\\\/])*([.][.][\\\\\\\\/]([.]?[\\\\\\\\/])*){' . $count . '})(?=[^.])#u',\n                                     DIRECTORY_SEPARATOR,\n                                     $path);\n            }\n        }\n        return $parts[ 'root' ] . $path;\n    }\n\n    /**\n     * Empty template objects cache\n     */\n    public function _clearTemplateCache()\n    {\n        Smarty_Internal_Template::$isCacheTplObj = array();\n        Smarty_Internal_Template::$tplObjCache = array();\n    }\n\n    /**\n     * @param boolean $use_sub_dirs\n     */\n    public function setUseSubDirs($use_sub_dirs)\n    {\n        $this->use_sub_dirs = $use_sub_dirs;\n    }\n\n    /**\n     * @param int $error_reporting\n     */\n    public function setErrorReporting($error_reporting)\n    {\n        $this->error_reporting = $error_reporting;\n    }\n\n    /**\n     * @param boolean $escape_html\n     */\n    public function setEscapeHtml($escape_html)\n    {\n        $this->escape_html = $escape_html;\n    }\n\n    /**\n     * Return auto_literal flag\n     *\n     * @return boolean\n     */\n    public function getAutoLiteral()\n    {\n        return $this->auto_literal;\n    }\n\n    /**\n     * Set auto_literal flag\n     *\n     * @param boolean $auto_literal\n     */\n    public function setAutoLiteral($auto_literal = true)\n    {\n        $this->auto_literal = $auto_literal;\n    }\n\n    /**\n     * @param boolean $force_compile\n     */\n    public function setForceCompile($force_compile)\n    {\n        $this->force_compile = $force_compile;\n    }\n\n    /**\n     * @param boolean $merge_compiled_includes\n     */\n    public function setMergeCompiledIncludes($merge_compiled_includes)\n    {\n        $this->merge_compiled_includes = $merge_compiled_includes;\n    }\n\n    /**\n     * Get left delimiter\n     *\n     * @return string\n     */\n    public function getLeftDelimiter()\n    {\n        return $this->left_delimiter;\n    }\n\n    /**\n     * Set left delimiter\n     *\n     * @param string $left_delimiter\n     */\n    public function setLeftDelimiter($left_delimiter)\n    {\n        $this->left_delimiter = $left_delimiter;\n    }\n\n    /**\n     * Get right delimiter\n     *\n     * @return string $right_delimiter\n     */\n    public function getRightDelimiter()\n    {\n        return $this->right_delimiter;\n    }\n\n    /**\n     * Set right delimiter\n     *\n     * @param string\n     */\n    public function setRightDelimiter($right_delimiter)\n    {\n        $this->right_delimiter = $right_delimiter;\n    }\n\n    /**\n     * @param boolean $debugging\n     */\n    public function setDebugging($debugging)\n    {\n        $this->debugging = $debugging;\n    }\n\n    /**\n     * @param boolean $config_overwrite\n     */\n    public function setConfigOverwrite($config_overwrite)\n    {\n        $this->config_overwrite = $config_overwrite;\n    }\n\n    /**\n     * @param boolean $config_booleanize\n     */\n    public function setConfigBooleanize($config_booleanize)\n    {\n        $this->config_booleanize = $config_booleanize;\n    }\n\n    /**\n     * @param boolean $config_read_hidden\n     */\n    public function setConfigReadHidden($config_read_hidden)\n    {\n        $this->config_read_hidden = $config_read_hidden;\n    }\n\n    /**\n     * @param boolean $compile_locking\n     */\n    public function setCompileLocking($compile_locking)\n    {\n        $this->compile_locking = $compile_locking;\n    }\n\n    /**\n     * @param string $default_resource_type\n     */\n    public function setDefaultResourceType($default_resource_type)\n    {\n        $this->default_resource_type = $default_resource_type;\n    }\n\n    /**\n     * @param string $caching_type\n     */\n    public function setCachingType($caching_type)\n    {\n        $this->caching_type = $caching_type;\n    }\n\n    /**\n     * Test install\n     *\n     * @param null $errors\n     */\n    public function testInstall(&$errors = null)\n    {\n        Smarty_Internal_TestInstall::testInstall($this, $errors);\n    }\n\n    /**\n     * Get Smarty object\n     *\n     * @return Smarty\n     */\n    public function _getSmartyObj()\n    {\n        return $this;\n    }\n\n    /**\n     * <<magic>> Generic getter.\n     * Calls the appropriate getter function.\n     * Issues an E_USER_NOTICE if no valid getter is found.\n     *\n     * @param  string $name property name\n     *\n     * @return mixed\n     */\n    public function __get($name)\n    {\n        if (isset($this->accessMap[ $name ])) {\n            $method = 'get' . $this->accessMap[ $name ];\n            return $this->{$method}();\n        } else if (isset($this->_cache[ $name ])) {\n            return $this->_cache[ $name ];\n        } else if (in_array($name, $this->obsoleteProperties)) {\n            return null;\n        } else {\n            trigger_error('Undefined property: ' . get_class($this) . '::$' . $name, E_USER_NOTICE);\n        }\n        return null;\n    }\n\n    /**\n     * <<magic>> Generic setter.\n     * Calls the appropriate setter function.\n     * Issues an E_USER_NOTICE if no valid setter is found.\n     *\n     * @param string $name  property name\n     * @param mixed  $value parameter passed to setter\n     */\n    public function __set($name, $value)\n    {\n        if (isset($this->accessMap[ $name ])) {\n            $method = 'set' . $this->accessMap[ $name ];\n            $this->{$method}($value);\n        } else if (in_array($name, $this->obsoleteProperties)) {\n            return;\n        } else {\n            if (is_object($value) && method_exists($value, $name)) {\n                $this->$name = $value;\n            } else {\n                trigger_error('Undefined property: ' . get_class($this) . '::$' . $name, E_USER_NOTICE);\n            }\n        }\n    }\n\n    /**\n     * Normalize and set directory string\n     *\n     * @param string $dirName cache_dir or compile_dir\n     * @param string $dir     filepath of folder\n     */\n    private function _normalizeDir($dirName, $dir)\n    {\n        $this->{$dirName} = $this->_realpath(rtrim($dir, \"/\\\\\") . DIRECTORY_SEPARATOR, true);\n        if (class_exists('Smarty_Internal_ErrorHandler', false)) {\n            if (!isset(Smarty_Internal_ErrorHandler::$mutedDirectories[ $this->{$dirName} ])) {\n                Smarty_Internal_ErrorHandler::$mutedDirectories[ $this->{$dirName} ] = null;\n            }\n        }\n    }\n\n    /**\n     * Normalize template_dir or config_dir\n     *\n     * @param bool $isConfig true for config_dir\n     *\n     */\n    private function _normalizeTemplateConfig($isConfig)\n    {\n        if ($isConfig) {\n            $processed = &$this->_processedConfigDir;\n            $dir = &$this->config_dir;\n        } else {\n            $processed = &$this->_processedTemplateDir;\n            $dir = &$this->template_dir;\n        }\n        if (!is_array($dir)) {\n            $dir = (array)$dir;\n        }\n        foreach ($dir as $k => $v) {\n            if (!isset($processed[ $k ])) {\n                $dir[ $k ] = $v = $this->_realpath(rtrim($v, \"/\\\\\") . DIRECTORY_SEPARATOR, true);\n                $processed[ $k ] = true;\n            }\n        }\n        $isConfig ? $this->_configDirNormalized = true : $this->_templateDirNormalized = true;\n        $isConfig ? $this->_joined_config_dir = join('#', $this->config_dir) :\n            $this->_joined_template_dir = join('#', $this->template_dir);\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/SmartyBC.class.php",
    "content": "<?php\n/**\n * Project:     Smarty: the PHP compiling template engine\n * File:        SmartyBC.class.php\n * SVN:         $Id: $\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n * For questions, help, comments, discussion, etc., please join the\n * Smarty mailing list. Send a blank e-mail to\n * smarty-discussion-subscribe@googlegroups.com\n *\n * @link      http://www.smarty.net/\n * @copyright 2008 New Digital Group, Inc.\n * @author    Monte Ohrt <monte at ohrt dot com>\n * @author    Uwe Tews\n * @author    Rodney Rehm\n * @package   Smarty\n */\n/**\n * @ignore\n */\nrequire_once(dirname(__FILE__) . '/Smarty.class.php');\n\n/**\n * Smarty Backward Compatibility Wrapper Class\n *\n * @package Smarty\n */\nclass SmartyBC extends Smarty\n{\n    /**\n     * Smarty 2 BC\n     *\n     * @var string\n     */\n    public $_version = self::SMARTY_VERSION;\n\n    /**\n     * This is an array of directories where trusted php scripts reside.\n     *\n     * @var array\n     */\n    public $trusted_dir = array();\n\n    /**\n     * Initialize new SmartyBC object\n     *\n     */\n    public function __construct()\n    {\n        parent::__construct();\n    }\n\n    /**\n     * wrapper for assign_by_ref\n     *\n     * @param string $tpl_var the template variable name\n     * @param mixed  &$value  the referenced value to assign\n     */\n    public function assign_by_ref($tpl_var, &$value)\n    {\n        $this->assignByRef($tpl_var, $value);\n    }\n\n    /**\n     * wrapper for append_by_ref\n     *\n     * @param string  $tpl_var the template variable name\n     * @param mixed   &$value  the referenced value to append\n     * @param boolean $merge   flag if array elements shall be merged\n     */\n    public function append_by_ref($tpl_var, &$value, $merge = false)\n    {\n        $this->appendByRef($tpl_var, $value, $merge);\n    }\n\n    /**\n     * clear the given assigned template variable.\n     *\n     * @param string $tpl_var the template variable to clear\n     */\n    public function clear_assign($tpl_var)\n    {\n        $this->clearAssign($tpl_var);\n    }\n\n    /**\n     * Registers custom function to be used in templates\n     *\n     * @param string $function      the name of the template function\n     * @param string $function_impl the name of the PHP function to register\n     * @param bool   $cacheable\n     * @param mixed  $cache_attrs\n     *\n     * @throws \\SmartyException\n     */\n    public function register_function($function, $function_impl, $cacheable = true, $cache_attrs = null)\n    {\n        $this->registerPlugin('function', $function, $function_impl, $cacheable, $cache_attrs);\n    }\n\n    /**\n     * Unregister custom function\n     *\n     * @param string $function name of template function\n     */\n    public function unregister_function($function)\n    {\n        $this->unregisterPlugin('function', $function);\n    }\n\n    /**\n     * Registers object to be used in templates\n     *\n     * @param string  $object        name of template object\n     * @param object  $object_impl   the referenced PHP object to register\n     * @param array   $allowed       list of allowed methods (empty = all)\n     * @param boolean $smarty_args   smarty argument format, else traditional\n     * @param array   $block_methods list of methods that are block format\n     *\n     * @throws SmartyException\n     * @internal param array $block_functs list of methods that are block format\n     */\n    public function register_object($object, $object_impl, $allowed = array(), $smarty_args = true,\n                                    $block_methods = array())\n    {\n        settype($allowed, 'array');\n        settype($smarty_args, 'boolean');\n        $this->registerObject($object, $object_impl, $allowed, $smarty_args, $block_methods);\n    }\n\n    /**\n     * Unregister object\n     *\n     * @param string $object name of template object\n     */\n    public function unregister_object($object)\n    {\n        $this->unregisterObject($object);\n    }\n\n    /**\n     * Registers block function to be used in templates\n     *\n     * @param string $block      name of template block\n     * @param string $block_impl PHP function to register\n     * @param bool   $cacheable\n     * @param mixed  $cache_attrs\n     *\n     * @throws \\SmartyException\n     */\n    public function register_block($block, $block_impl, $cacheable = true, $cache_attrs = null)\n    {\n        $this->registerPlugin('block', $block, $block_impl, $cacheable, $cache_attrs);\n    }\n\n    /**\n     * Unregister block function\n     *\n     * @param string $block name of template function\n     */\n    public function unregister_block($block)\n    {\n        $this->unregisterPlugin('block', $block);\n    }\n\n    /**\n     * Registers compiler function\n     *\n     * @param string $function      name of template function\n     * @param string $function_impl name of PHP function to register\n     * @param bool   $cacheable\n     *\n     * @throws \\SmartyException\n     */\n    public function register_compiler_function($function, $function_impl, $cacheable = true)\n    {\n        $this->registerPlugin('compiler', $function, $function_impl, $cacheable);\n    }\n\n    /**\n     * Unregister compiler function\n     *\n     * @param string $function name of template function\n     */\n    public function unregister_compiler_function($function)\n    {\n        $this->unregisterPlugin('compiler', $function);\n    }\n\n    /**\n     * Registers modifier to be used in templates\n     *\n     * @param string $modifier      name of template modifier\n     * @param string $modifier_impl name of PHP function to register\n     *\n     * @throws \\SmartyException\n     */\n    public function register_modifier($modifier, $modifier_impl)\n    {\n        $this->registerPlugin('modifier', $modifier, $modifier_impl);\n    }\n\n    /**\n     * Unregister modifier\n     *\n     * @param string $modifier name of template modifier\n     */\n    public function unregister_modifier($modifier)\n    {\n        $this->unregisterPlugin('modifier', $modifier);\n    }\n\n    /**\n     * Registers a resource to fetch a template\n     *\n     * @param string $type      name of resource\n     * @param array  $functions array of functions to handle resource\n     */\n    public function register_resource($type, $functions)\n    {\n        $this->registerResource($type, $functions);\n    }\n\n    /**\n     * Unregister a resource\n     *\n     * @param string $type name of resource\n     */\n    public function unregister_resource($type)\n    {\n        $this->unregisterResource($type);\n    }\n\n    /**\n     * Registers a prefilter function to apply\n     * to a template before compiling\n     *\n     * @param callable $function\n     *\n     * @throws \\SmartyException\n     */\n    public function register_prefilter($function)\n    {\n        $this->registerFilter('pre', $function);\n    }\n\n    /**\n     * Unregister a prefilter function\n     *\n     * @param callable $function\n     */\n    public function unregister_prefilter($function)\n    {\n        $this->unregisterFilter('pre', $function);\n    }\n\n    /**\n     * Registers a postfilter function to apply\n     * to a compiled template after compilation\n     *\n     * @param callable $function\n     *\n     * @throws \\SmartyException\n     */\n    public function register_postfilter($function)\n    {\n        $this->registerFilter('post', $function);\n    }\n\n    /**\n     * Unregister a postfilter function\n     *\n     * @param callable $function\n     */\n    public function unregister_postfilter($function)\n    {\n        $this->unregisterFilter('post', $function);\n    }\n\n    /**\n     * Registers an output filter function to apply\n     * to a template output\n     *\n     * @param callable $function\n     *\n     * @throws \\SmartyException\n     */\n    public function register_outputfilter($function)\n    {\n        $this->registerFilter('output', $function);\n    }\n\n    /**\n     * Unregister an outputfilter function\n     *\n     * @param callable $function\n     */\n    public function unregister_outputfilter($function)\n    {\n        $this->unregisterFilter('output', $function);\n    }\n\n    /**\n     * load a filter of specified type and name\n     *\n     * @param string $type filter type\n     * @param string $name filter name\n     *\n     * @throws \\SmartyException\n     */\n    public function load_filter($type, $name)\n    {\n        $this->loadFilter($type, $name);\n    }\n\n    /**\n     * clear cached content for the given template and cache id\n     *\n     * @param  string $tpl_file   name of template file\n     * @param  string $cache_id   name of cache_id\n     * @param  string $compile_id name of compile_id\n     * @param  string $exp_time   expiration time\n     *\n     * @return boolean\n     */\n    public function clear_cache($tpl_file = null, $cache_id = null, $compile_id = null, $exp_time = null)\n    {\n        return $this->clearCache($tpl_file, $cache_id, $compile_id, $exp_time);\n    }\n\n    /**\n     * clear the entire contents of cache (all templates)\n     *\n     * @param  string $exp_time expire time\n     *\n     * @return boolean\n     */\n    public function clear_all_cache($exp_time = null)\n    {\n        return $this->clearCache(null, null, null, $exp_time);\n    }\n\n    /**\n     * test to see if valid cache exists for this template\n     *\n     * @param  string $tpl_file name of template file\n     * @param  string $cache_id\n     * @param  string $compile_id\n     *\n     * @return bool\n     * @throws \\Exception\n     * @throws \\SmartyException\n     */\n    public function is_cached($tpl_file, $cache_id = null, $compile_id = null)\n    {\n        return $this->isCached($tpl_file, $cache_id, $compile_id);\n    }\n\n    /**\n     * clear all the assigned template variables.\n     */\n    public function clear_all_assign()\n    {\n        $this->clearAllAssign();\n    }\n\n    /**\n     * clears compiled version of specified template resource,\n     * or all compiled template files if one is not specified.\n     * This function is for advanced use only, not normally needed.\n     *\n     * @param  string $tpl_file\n     * @param  string $compile_id\n     * @param  string $exp_time\n     *\n     * @return boolean results of {@link smarty_core_rm_auto()}\n     */\n    public function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null)\n    {\n        return $this->clearCompiledTemplate($tpl_file, $compile_id, $exp_time);\n    }\n\n    /**\n     * Checks whether requested template exists.\n     *\n     * @param  string $tpl_file\n     *\n     * @return bool\n     * @throws \\SmartyException\n     */\n    public function template_exists($tpl_file)\n    {\n        return $this->templateExists($tpl_file);\n    }\n\n    /**\n     * Returns an array containing template variables\n     *\n     * @param  string $name\n     *\n     * @return array\n     */\n    public function get_template_vars($name = null)\n    {\n        return $this->getTemplateVars($name);\n    }\n\n    /**\n     * Returns an array containing config variables\n     *\n     * @param  string $name\n     *\n     * @return array\n     */\n    public function get_config_vars($name = null)\n    {\n        return $this->getConfigVars($name);\n    }\n\n    /**\n     * load configuration values\n     *\n     * @param string $file\n     * @param string $section\n     * @param string $scope\n     */\n    public function config_load($file, $section = null, $scope = 'global')\n    {\n        $this->ConfigLoad($file, $section, $scope);\n    }\n\n    /**\n     * return a reference to a registered object\n     *\n     * @param  string $name\n     *\n     * @return object\n     */\n    public function get_registered_object($name)\n    {\n        return $this->getRegisteredObject($name);\n    }\n\n    /**\n     * clear configuration values\n     *\n     * @param string $var\n     */\n    public function clear_config($var = null)\n    {\n        $this->clearConfig($var);\n    }\n\n    /**\n     * trigger Smarty error\n     *\n     * @param string  $error_msg\n     * @param integer $error_type\n     */\n    public function trigger_error($error_msg, $error_type = E_USER_WARNING)\n    {\n        trigger_error(\"Smarty error: $error_msg\", $error_type);\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/bootstrap.php",
    "content": "<?php\nif (!class_exists('Smarty_Autoloader')) {\n    require dirname(__FILE__) . '/Autoloader.php';\n}\nSmarty_Autoloader::register(true);\n"
  },
  {
    "path": "Extend/Package/smarty/noted.txt",
    "content": "smarty为框架视图依赖项，切勿删除该包"
  },
  {
    "path": "Extend/Package/smarty/plugins/block.textformat.php",
    "content": "<?php\n/**\n * Smarty plugin to format text blocks\n *\n * @package    Smarty\n * @subpackage PluginsBlock\n */\n\n/**\n * Smarty {textformat}{/textformat} block plugin\n * Type:     block function\n * Name:     textformat\n * Purpose:  format text a certain way with preset styles\n *           or custom wrap/indent settings\n * Params:\n *\n * - style         - string (email)\n * - indent        - integer (0)\n * - wrap          - integer (80)\n * - wrap_char     - string (\"\\n\")\n * - indent_char   - string (\" \")\n * - wrap_boundary - boolean (true)\n * \n *\n * @link   http://www.smarty.net/manual/en/language.function.textformat.php {textformat}\n *         (Smarty online manual)\n *\n * @param array                    $params   parameters\n * @param string                   $content  contents of the block\n * @param Smarty_Internal_Template $template template object\n * @param boolean                  &$repeat  repeat flag\n *\n * @return string content re-formatted\n * @author Monte Ohrt <monte at ohrt dot com>\n */\nfunction smarty_block_textformat($params, $content, $template, &$repeat)\n{\n    static $mb_wordwrap_loaded = false;\n    if (is_null($content)) {\n        return;\n    }\n    if (Smarty::$_MBSTRING && !$mb_wordwrap_loaded) {\n        if (!is_callable('smarty_modifier_mb_wordwrap')) {\n            require_once(SMARTY_PLUGINS_DIR . 'modifier.mb_wordwrap.php');\n        }\n        $mb_wordwrap_loaded = true;\n    }\n\n    $style = null;\n    $indent = 0;\n    $indent_first = 0;\n    $indent_char = ' ';\n    $wrap = 80;\n    $wrap_char = \"\\n\";\n    $wrap_cut = false;\n    $assign = null;\n\n    foreach ($params as $_key => $_val) {\n        switch ($_key) {\n            case 'style':\n            case 'indent_char':\n            case 'wrap_char':\n            case 'assign':\n                $$_key = (string) $_val;\n                break;\n\n            case 'indent':\n            case 'indent_first':\n            case 'wrap':\n                $$_key = (int) $_val;\n                break;\n\n            case 'wrap_cut':\n                $$_key = (bool) $_val;\n                break;\n\n            default:\n                trigger_error(\"textformat: unknown attribute '{$_key}'\");\n        }\n    }\n\n    if ($style === 'email') {\n        $wrap = 72;\n    }\n    // split into paragraphs\n    $_paragraphs = preg_split('![\\r\\n]{2}!', $content);\n\n    foreach ($_paragraphs as &$_paragraph) {\n        if (!$_paragraph) {\n            continue;\n        }\n        // convert mult. spaces & special chars to single space\n        $_paragraph =\n            preg_replace(array('!\\s+!' . Smarty::$_UTF8_MODIFIER,\n                               '!(^\\s+)|(\\s+$)!' . Smarty::$_UTF8_MODIFIER),\n                         array(' ',\n                               ''), $_paragraph);\n        // indent first line\n        if ($indent_first > 0) {\n            $_paragraph = str_repeat($indent_char, $indent_first) . $_paragraph;\n        }\n        // wordwrap sentences\n        if (Smarty::$_MBSTRING) {\n            $_paragraph = smarty_modifier_mb_wordwrap($_paragraph, $wrap - $indent, $wrap_char, $wrap_cut);\n        } else {\n            $_paragraph = wordwrap($_paragraph, $wrap - $indent, $wrap_char, $wrap_cut);\n        }\n        // indent lines\n        if ($indent > 0) {\n            $_paragraph = preg_replace('!^!m', str_repeat($indent_char, $indent), $_paragraph);\n        }\n    }\n    $_output = implode($wrap_char . $wrap_char, $_paragraphs);\n\n    if ($assign) {\n        $template->assign($assign, $_output);\n    } else {\n        return $_output;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/function.counter.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsFunction\n */\n\n/**\n * Smarty {counter} function plugin\n * Type:     function\n * Name:     counter\n * Purpose:  print out a counter value\n *\n * @author Monte Ohrt <monte at ohrt dot com>\n * @link   http://www.smarty.net/manual/en/language.function.counter.php {counter}\n *         (Smarty online manual)\n *\n * @param array                    $params   parameters\n * @param Smarty_Internal_Template $template template object\n *\n * @return string|null\n */\nfunction smarty_function_counter($params, $template)\n{\n    static $counters = array();\n\n    $name = (isset($params[ 'name' ])) ? $params[ 'name' ] : 'default';\n    if (!isset($counters[ $name ])) {\n        $counters[ $name ] = array('start' => 1, 'skip' => 1, 'direction' => 'up', 'count' => 1);\n    }\n    $counter =& $counters[ $name ];\n\n    if (isset($params[ 'start' ])) {\n        $counter[ 'start' ] = $counter[ 'count' ] = (int) $params[ 'start' ];\n    }\n\n    if (!empty($params[ 'assign' ])) {\n        $counter[ 'assign' ] = $params[ 'assign' ];\n    }\n\n    if (isset($counter[ 'assign' ])) {\n        $template->assign($counter[ 'assign' ], $counter[ 'count' ]);\n    }\n\n    if (isset($params[ 'print' ])) {\n        $print = (bool) $params[ 'print' ];\n    } else {\n        $print = empty($counter[ 'assign' ]);\n    }\n\n    if ($print) {\n        $retval = $counter[ 'count' ];\n    } else {\n        $retval = null;\n    }\n\n    if (isset($params[ 'skip' ])) {\n        $counter[ 'skip' ] = $params[ 'skip' ];\n    }\n\n    if (isset($params[ 'direction' ])) {\n        $counter[ 'direction' ] = $params[ 'direction' ];\n    }\n\n    if ($counter[ 'direction' ] === 'down') {\n        $counter[ 'count' ] -= $counter[ 'skip' ];\n    } else {\n        $counter[ 'count' ] += $counter[ 'skip' ];\n    }\n\n    return $retval;\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/function.cycle.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsFunction\n */\n\n/**\n * Smarty {cycle} function plugin\n * Type:     function\n * Name:     cycle\n * Date:     May 3, 2002\n * Purpose:  cycle through given values\n * Params:\n *\n * - name      - name of cycle (optional)\n * - values    - comma separated list of values to cycle, or an array of values to cycle\n *               (this can be left out for subsequent calls)\n * - reset     - boolean - resets given var to true\n * - print     - boolean - print var or not. default is true\n * - advance   - boolean - whether or not to advance the cycle\n * - delimiter - the value delimiter, default is \",\"\n * - assign    - boolean, assigns to template var instead of printed.\n *\n * Examples:\n *\n * {cycle values=\"#eeeeee,#d0d0d0d\"}\n * {cycle name=row values=\"one,two,three\" reset=true}\n * {cycle name=row}\n *\n *\n * @link     http://www.smarty.net/manual/en/language.function.cycle.php {cycle}\n *           (Smarty online manual)\n * @author   Monte Ohrt <monte at ohrt dot com>\n * @author   credit to Mark Priatel <mpriatel@rogers.com>\n * @author   credit to Gerard <gerard@interfold.com>\n * @author   credit to Jason Sweat <jsweat_php@yahoo.com>\n * @version  1.3\n *\n * @param array                    $params   parameters\n * @param Smarty_Internal_Template $template template object\n *\n * @return string|null\n */\n\nfunction smarty_function_cycle($params, $template)\n{\n    static $cycle_vars;\n\n    $name = (empty($params[ 'name' ])) ? 'default' : $params[ 'name' ];\n    $print = (isset($params[ 'print' ])) ? (bool) $params[ 'print' ] : true;\n    $advance = (isset($params[ 'advance' ])) ? (bool) $params[ 'advance' ] : true;\n    $reset = (isset($params[ 'reset' ])) ? (bool) $params[ 'reset' ] : false;\n\n    if (!isset($params[ 'values' ])) {\n        if (!isset($cycle_vars[ $name ][ 'values' ])) {\n            trigger_error('cycle: missing \\'values\\' parameter');\n\n            return;\n        }\n    } else {\n        if (isset($cycle_vars[ $name ][ 'values' ]) && $cycle_vars[ $name ][ 'values' ] !== $params[ 'values' ]) {\n            $cycle_vars[ $name ][ 'index' ] = 0;\n        }\n        $cycle_vars[ $name ][ 'values' ] = $params[ 'values' ];\n    }\n\n    if (isset($params[ 'delimiter' ])) {\n        $cycle_vars[ $name ][ 'delimiter' ] = $params[ 'delimiter' ];\n    } elseif (!isset($cycle_vars[ $name ][ 'delimiter' ])) {\n        $cycle_vars[ $name ][ 'delimiter' ] = ',';\n    }\n\n    if (is_array($cycle_vars[ $name ][ 'values' ])) {\n        $cycle_array = $cycle_vars[ $name ][ 'values' ];\n    } else {\n        $cycle_array = explode($cycle_vars[ $name ][ 'delimiter' ], $cycle_vars[ $name ][ 'values' ]);\n    }\n\n    if (!isset($cycle_vars[ $name ][ 'index' ]) || $reset) {\n        $cycle_vars[ $name ][ 'index' ] = 0;\n    }\n\n    if (isset($params[ 'assign' ])) {\n        $print = false;\n        $template->assign($params[ 'assign' ], $cycle_array[ $cycle_vars[ $name ][ 'index' ] ]);\n    }\n\n    if ($print) {\n        $retval = $cycle_array[ $cycle_vars[ $name ][ 'index' ] ];\n    } else {\n        $retval = null;\n    }\n\n    if ($advance) {\n        if ($cycle_vars[ $name ][ 'index' ] >= count($cycle_array) - 1) {\n            $cycle_vars[ $name ][ 'index' ] = 0;\n        } else {\n            $cycle_vars[ $name ][ 'index' ] ++;\n        }\n    }\n\n    return $retval;\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/function.fetch.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsFunction\n */\n\n/**\n * Smarty {fetch} plugin\n * Type:     function\n * Name:     fetch\n * Purpose:  fetch file, web or ftp data and display results\n *\n * @link   http://www.smarty.net/manual/en/language.function.fetch.php {fetch}\n *         (Smarty online manual)\n * @author Monte Ohrt <monte at ohrt dot com>\n *\n * @param array                    $params   parameters\n * @param Smarty_Internal_Template $template template object\n *\n * @throws SmartyException\n * @return string|null if the assign parameter is passed, Smarty assigns the result to a template variable\n */\nfunction smarty_function_fetch($params, $template)\n{\n    if (empty($params[ 'file' ])) {\n        trigger_error('[plugin] fetch parameter \\'file\\' cannot be empty', E_USER_NOTICE);\n\n        return;\n    }\n\n    // strip file protocol\n    if (stripos($params[ 'file' ], 'file://') === 0) {\n        $params[ 'file' ] = substr($params[ 'file' ], 7);\n    }\n\n    $protocol = strpos($params[ 'file' ], '://');\n    if ($protocol !== false) {\n        $protocol = strtolower(substr($params[ 'file' ], 0, $protocol));\n    }\n\n    if (isset($template->smarty->security_policy)) {\n        if ($protocol) {\n            // remote resource (or php stream, …)\n            if (!$template->smarty->security_policy->isTrustedUri($params[ 'file' ])) {\n                return;\n            }\n        } else {\n            // local file\n            if (!$template->smarty->security_policy->isTrustedResourceDir($params[ 'file' ])) {\n                return;\n            }\n        }\n    }\n\n    $content = '';\n    if ($protocol === 'http') {\n        // http fetch\n        if ($uri_parts = parse_url($params[ 'file' ])) {\n            // set defaults\n            $host = $server_name = $uri_parts[ 'host' ];\n            $timeout = 30;\n            $accept = 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*';\n            $agent = 'Smarty Template Engine ' . Smarty::SMARTY_VERSION;\n            $referer = '';\n            $uri = !empty($uri_parts[ 'path' ]) ? $uri_parts[ 'path' ] : '/';\n            $uri .= !empty($uri_parts[ 'query' ]) ? '?' . $uri_parts[ 'query' ] : '';\n            $_is_proxy = false;\n            if (empty($uri_parts[ 'port' ])) {\n                $port = 80;\n            } else {\n                $port = $uri_parts[ 'port' ];\n            }\n            if (!empty($uri_parts[ 'user' ])) {\n                $user = $uri_parts[ 'user' ];\n            }\n            if (!empty($uri_parts[ 'pass' ])) {\n                $pass = $uri_parts[ 'pass' ];\n            }\n            // loop through parameters, setup headers\n            foreach ($params as $param_key => $param_value) {\n                switch ($param_key) {\n                    case 'file':\n                    case 'assign':\n                    case 'assign_headers':\n                        break;\n                    case 'user':\n                        if (!empty($param_value)) {\n                            $user = $param_value;\n                        }\n                        break;\n                    case 'pass':\n                        if (!empty($param_value)) {\n                            $pass = $param_value;\n                        }\n                        break;\n                    case 'accept':\n                        if (!empty($param_value)) {\n                            $accept = $param_value;\n                        }\n                        break;\n                    case 'header':\n                        if (!empty($param_value)) {\n                            if (!preg_match('![\\w\\d-]+: .+!', $param_value)) {\n                                trigger_error(\"[plugin] invalid header format '{$param_value}'\", E_USER_NOTICE);\n\n                                return;\n                            } else {\n                                $extra_headers[] = $param_value;\n                            }\n                        }\n                        break;\n                    case 'proxy_host':\n                        if (!empty($param_value)) {\n                            $proxy_host = $param_value;\n                        }\n                        break;\n                    case 'proxy_port':\n                        if (!preg_match('!\\D!', $param_value)) {\n                            $proxy_port = (int) $param_value;\n                        } else {\n                            trigger_error(\"[plugin] invalid value for attribute '{$param_key }'\", E_USER_NOTICE);\n\n                            return;\n                        }\n                        break;\n                    case 'agent':\n                        if (!empty($param_value)) {\n                            $agent = $param_value;\n                        }\n                        break;\n                    case 'referer':\n                        if (!empty($param_value)) {\n                            $referer = $param_value;\n                        }\n                        break;\n                    case 'timeout':\n                        if (!preg_match('!\\D!', $param_value)) {\n                            $timeout = (int) $param_value;\n                        } else {\n                            trigger_error(\"[plugin] invalid value for attribute '{$param_key}'\", E_USER_NOTICE);\n\n                            return;\n                        }\n                        break;\n                    default:\n                        trigger_error(\"[plugin] unrecognized attribute '{$param_key}'\", E_USER_NOTICE);\n\n                        return;\n                }\n            }\n            if (!empty($proxy_host) && !empty($proxy_port)) {\n                $_is_proxy = true;\n                $fp = fsockopen($proxy_host, $proxy_port, $errno, $errstr, $timeout);\n            } else {\n                $fp = fsockopen($server_name, $port, $errno, $errstr, $timeout);\n            }\n\n            if (!$fp) {\n                trigger_error(\"[plugin] unable to fetch: $errstr ($errno)\", E_USER_NOTICE);\n\n                return;\n            } else {\n                if ($_is_proxy) {\n                    fputs($fp, 'GET ' . $params[ 'file' ] . \" HTTP/1.0\\r\\n\");\n                } else {\n                    fputs($fp, \"GET $uri HTTP/1.0\\r\\n\");\n                }\n                if (!empty($host)) {\n                    fputs($fp, \"Host: $host\\r\\n\");\n                }\n                if (!empty($accept)) {\n                    fputs($fp, \"Accept: $accept\\r\\n\");\n                }\n                if (!empty($agent)) {\n                    fputs($fp, \"User-Agent: $agent\\r\\n\");\n                }\n                if (!empty($referer)) {\n                    fputs($fp, \"Referer: $referer\\r\\n\");\n                }\n                if (isset($extra_headers) && is_array($extra_headers)) {\n                    foreach ($extra_headers as $curr_header) {\n                        fputs($fp, $curr_header . \"\\r\\n\");\n                    }\n                }\n                if (!empty($user) && !empty($pass)) {\n                    fputs($fp, 'Authorization: BASIC ' . base64_encode(\"$user:$pass\") . \"\\r\\n\");\n                }\n\n                fputs($fp, \"\\r\\n\");\n                while (!feof($fp)) {\n                    $content .= fgets($fp, 4096);\n                }\n                fclose($fp);\n                $csplit = preg_split(\"!\\r\\n\\r\\n!\", $content, 2);\n\n                $content = $csplit[ 1 ];\n\n                if (!empty($params[ 'assign_headers' ])) {\n                    $template->assign($params[ 'assign_headers' ], preg_split(\"!\\r\\n!\", $csplit[ 0 ]));\n                }\n            }\n        } else {\n            trigger_error(\"[plugin fetch] unable to parse URL, check syntax\", E_USER_NOTICE);\n\n            return;\n        }\n    } else {\n        $content = @file_get_contents($params[ 'file' ]);\n        if ($content === false) {\n            throw new SmartyException(\"{fetch} cannot read resource '\" . $params[ 'file' ] . \"'\");\n        }\n    }\n\n    if (!empty($params[ 'assign' ])) {\n        $template->assign($params[ 'assign' ], $content);\n    } else {\n        return $content;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/function.html_checkboxes.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsFunction\n */\n\n/**\n * Smarty {html_checkboxes} function plugin\n * File:       function.html_checkboxes.php\n * Type:       function\n * Name:       html_checkboxes\n * Date:       24.Feb.2003\n * Purpose:    Prints out a list of checkbox input types\n * Examples:\n *\n * {html_checkboxes values=$ids output=$names}\n * {html_checkboxes values=$ids name='box' separator='<br>' output=$names}\n * {html_checkboxes values=$ids checked=$checked separator='<br>' output=$names}\n *\n * Params:\n *\n * - name       (optional) - string default \"checkbox\"\n * - values     (required) - array\n * - options    (optional) - associative array\n * - checked    (optional) - array default not set\n * - separator  (optional) - ie <br> or &nbsp;\n * - output     (optional) - the output next to each checkbox\n * - assign     (optional) - assign the output as an array to this variable\n * - escape     (optional) - escape the content (not value), defaults to true\n *\n *\n * @link       http://www.smarty.net/manual/en/language.function.html.checkboxes.php {html_checkboxes}\n *             (Smarty online manual)\n * @author     Christopher Kvarme <christopher.kvarme@flashjab.com>\n * @author     credits to Monte Ohrt <monte at ohrt dot com>\n * @version    1.0\n *\n * @param array  $params   parameters\n * @param object $template template object\n *\n * @return string\n * @uses       smarty_function_escape_special_chars()\n */\nfunction smarty_function_html_checkboxes($params, $template)\n{\n    if (!isset($template->smarty->_cache[ '_required_sesc' ])) {\n        require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');\n        $template->smarty->_cache[ '_required_sesc' ] = true;\n    }\n\n    $name = 'checkbox';\n    $values = null;\n    $options = null;\n    $selected = array();\n    $separator = '';\n    $escape = true;\n    $labels = true;\n    $label_ids = false;\n    $output = null;\n\n    $extra = '';\n\n    foreach ($params as $_key => $_val) {\n        switch ($_key) {\n            case 'name':\n            case 'separator':\n                $$_key = (string) $_val;\n                break;\n\n            case 'escape':\n            case 'labels':\n            case 'label_ids':\n                $$_key = (bool) $_val;\n                break;\n\n            case 'options':\n                $$_key = (array) $_val;\n                break;\n\n            case 'values':\n            case 'output':\n                $$_key = array_values((array) $_val);\n                break;\n\n            case 'checked':\n            case 'selected':\n                if (is_array($_val)) {\n                    $selected = array();\n                    foreach ($_val as $_sel) {\n                        if (is_object($_sel)) {\n                            if (method_exists($_sel, '__toString')) {\n                                $_sel = smarty_function_escape_special_chars((string) $_sel->__toString());\n                            } else {\n                                trigger_error('html_checkboxes: selected attribute contains an object of class \\'' .\n                                              get_class($_sel) . '\\' without __toString() method', E_USER_NOTICE);\n                                continue;\n                            }\n                        } else {\n                            $_sel = smarty_function_escape_special_chars((string) $_sel);\n                        }\n                        $selected[ $_sel ] = true;\n                    }\n                } elseif (is_object($_val)) {\n                    if (method_exists($_val, '__toString')) {\n                        $selected = smarty_function_escape_special_chars((string) $_val->__toString());\n                    } else {\n                        trigger_error('html_checkboxes: selected attribute is an object of class \\'' . get_class($_val) .\n                                      '\\' without __toString() method', E_USER_NOTICE);\n                    }\n                } else {\n                    $selected = smarty_function_escape_special_chars((string) $_val);\n                }\n                break;\n\n            case 'checkboxes':\n                trigger_error('html_checkboxes: the use of the \"checkboxes\" attribute is deprecated, use \"options\" instead',\n                              E_USER_WARNING);\n                $options = (array) $_val;\n                break;\n\n            case 'assign':\n                break;\n\n            case 'strict':\n                break;\n\n            case 'disabled':\n            case 'readonly':\n                if (!empty($params[ 'strict' ])) {\n                    if (!is_scalar($_val)) {\n                        trigger_error(\"html_options: {$_key} attribute must be a scalar, only boolean true or string '{$_key}' will actually add the attribute\",\n                                      E_USER_NOTICE);\n                    }\n\n                    if ($_val === true || $_val === $_key) {\n                        $extra .= ' ' . $_key . '=\"' . smarty_function_escape_special_chars($_key) . '\"';\n                    }\n\n                    break;\n                }\n            // omit break; to fall through!\n\n            default:\n                if (!is_array($_val)) {\n                    $extra .= ' ' . $_key . '=\"' . smarty_function_escape_special_chars($_val) . '\"';\n                } else {\n                    trigger_error(\"html_checkboxes: extra attribute '{$_key}' cannot be an array\", E_USER_NOTICE);\n                }\n                break;\n        }\n    }\n\n    if (!isset($options) && !isset($values)) {\n        return '';\n    } /* raise error here? */\n\n    $_html_result = array();\n\n    if (isset($options)) {\n        foreach ($options as $_key => $_val) {\n            $_html_result[] =\n                smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels,\n                                                       $label_ids, $escape);\n        }\n    } else {\n        foreach ($values as $_i => $_key) {\n            $_val = isset($output[ $_i ]) ? $output[ $_i ] : '';\n            $_html_result[] =\n                smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels,\n                                                       $label_ids, $escape);\n        }\n    }\n\n    if (!empty($params[ 'assign' ])) {\n        $template->assign($params[ 'assign' ], $_html_result);\n    } else {\n        return implode(\"\\n\", $_html_result);\n    }\n}\n/**\n * @param      $name\n * @param      $value\n * @param      $output\n * @param      $selected\n * @param      $extra\n * @param      $separator\n * @param      $labels\n * @param      $label_ids\n * @param bool $escape\n *\n * @return string\n */\nfunction smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels,\n                                                   $label_ids, $escape = true)\n{\n    $_output = '';\n\n    if (is_object($value)) {\n        if (method_exists($value, '__toString')) {\n            $value = (string) $value->__toString();\n        } else {\n            trigger_error('html_options: value is an object of class \\'' . get_class($value) .\n                          '\\' without __toString() method', E_USER_NOTICE);\n\n            return '';\n        }\n    } else {\n        $value = (string) $value;\n    }\n\n    if (is_object($output)) {\n        if (method_exists($output, '__toString')) {\n            $output = (string) $output->__toString();\n        } else {\n            trigger_error('html_options: output is an object of class \\'' . get_class($output) .\n                          '\\' without __toString() method', E_USER_NOTICE);\n\n            return '';\n        }\n    } else {\n        $output = (string) $output;\n    }\n\n    if ($labels) {\n        if ($label_ids) {\n            $_id = smarty_function_escape_special_chars(preg_replace('![^\\w\\-\\.]!' . Smarty::$_UTF8_MODIFIER, '_',\n                                                                     $name . '_' . $value));\n            $_output .= '<label for=\"' . $_id . '\">';\n        } else {\n            $_output .= '<label>';\n        }\n    }\n\n    $name = smarty_function_escape_special_chars($name);\n    $value = smarty_function_escape_special_chars($value);\n    if ($escape) {\n        $output = smarty_function_escape_special_chars($output);\n    }\n\n    $_output .= '<input type=\"checkbox\" name=\"' . $name . '[]\" value=\"' . $value . '\"';\n\n    if ($labels && $label_ids) {\n        $_output .= ' id=\"' . $_id . '\"';\n    }\n\n    if (is_array($selected)) {\n        if (isset($selected[ $value ])) {\n            $_output .= ' checked=\"checked\"';\n        }\n    } elseif ($value === $selected) {\n        $_output .= ' checked=\"checked\"';\n    }\n\n    $_output .= $extra . ' />' . $output;\n    if ($labels) {\n        $_output .= '</label>';\n    }\n\n    $_output .= $separator;\n\n    return $_output;\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/function.html_image.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsFunction\n */\n\n/**\n * Smarty {html_image} function plugin\n * Type:     function\n * Name:     html_image\n * Date:     Feb 24, 2003\n * Purpose:  format HTML tags for the image\n * Examples: {html_image file=\"/images/masthead.gif\"}\n * Output:   <img src=\"/images/masthead.gif\" width=400 height=23>\n * Params:\n *\n * - file        - (required) - file (and path) of image\n * - height      - (optional) - image height (default actual height)\n * - width       - (optional) - image width (default actual width)\n * - basedir     - (optional) - base directory for absolute paths, default is environment variable DOCUMENT_ROOT\n * - path_prefix - prefix for path output (optional, default empty)\n *\n *\n * @link    http://www.smarty.net/manual/en/language.function.html.image.php {html_image}\n *          (Smarty online manual)\n * @author  Monte Ohrt <monte at ohrt dot com>\n * @author  credits to Duda <duda@big.hu>\n * @version 1.0\n *\n * @param array                    $params   parameters\n * @param Smarty_Internal_Template $template template object\n *\n * @throws SmartyException\n * @return string\n * @uses    smarty_function_escape_special_chars()\n */\nfunction smarty_function_html_image($params, $template)\n{\n    if (!isset($template->smarty->_cache[ '_required_sesc' ])) {\n        require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');\n        $template->smarty->_cache[ '_required_sesc' ] = true;\n    }\n\n    $alt = '';\n    $file = '';\n    $height = '';\n    $width = '';\n    $extra = '';\n    $prefix = '';\n    $suffix = '';\n    $path_prefix = '';\n    $basedir = isset($_SERVER[ 'DOCUMENT_ROOT' ]) ? $_SERVER[ 'DOCUMENT_ROOT' ] : '';\n    foreach ($params as $_key => $_val) {\n        switch ($_key) {\n            case 'file':\n            case 'height':\n            case 'width':\n            case 'dpi':\n            case 'path_prefix':\n            case 'basedir':\n                $$_key = $_val;\n                break;\n\n            case 'alt':\n                if (!is_array($_val)) {\n                    $$_key = smarty_function_escape_special_chars($_val);\n                } else {\n                    throw new SmartyException (\"html_image: extra attribute '{$_key}' cannot be an array\", E_USER_NOTICE);\n                }\n                break;\n\n            case 'link':\n            case 'href':\n                $prefix = '<a href=\"' . $_val . '\">';\n                $suffix = '</a>';\n                break;\n\n            default:\n                if (!is_array($_val)) {\n                    $extra .= ' ' . $_key . '=\"' . smarty_function_escape_special_chars($_val) . '\"';\n                } else {\n                    throw new SmartyException (\"html_image: extra attribute '{$_key}' cannot be an array\", E_USER_NOTICE);\n                }\n                break;\n        }\n    }\n\n    if (empty($file)) {\n        trigger_error('html_image: missing \\'file\\' parameter', E_USER_NOTICE);\n\n        return;\n    }\n\n    if ($file[ 0 ] === '/') {\n        $_image_path = $basedir . $file;\n    } else {\n        $_image_path = $file;\n    }\n\n    // strip file protocol\n    if (stripos($params[ 'file' ], 'file://') === 0) {\n        $params[ 'file' ] = substr($params[ 'file' ], 7);\n    }\n\n    $protocol = strpos($params[ 'file' ], '://');\n    if ($protocol !== false) {\n        $protocol = strtolower(substr($params[ 'file' ], 0, $protocol));\n    }\n\n    if (isset($template->smarty->security_policy)) {\n        if ($protocol) {\n            // remote resource (or php stream, …)\n            if (!$template->smarty->security_policy->isTrustedUri($params[ 'file' ])) {\n                return;\n            }\n        } else {\n            // local file\n            if (!$template->smarty->security_policy->isTrustedResourceDir($_image_path)) {\n                return;\n            }\n        }\n    }\n\n    if (!isset($params[ 'width' ]) || !isset($params[ 'height' ])) {\n        // FIXME: (rodneyrehm) getimagesize() loads the complete file off a remote resource, use custom [jpg,png,gif]header reader!\n        if (!$_image_data = @getimagesize($_image_path)) {\n            if (!file_exists($_image_path)) {\n                trigger_error(\"html_image: unable to find '{$_image_path}'\", E_USER_NOTICE);\n\n                return;\n            } elseif (!is_readable($_image_path)) {\n                trigger_error(\"html_image: unable to read '{$_image_path}'\", E_USER_NOTICE);\n\n                return;\n            } else {\n                trigger_error(\"html_image: '{$_image_path}' is not a valid image file\", E_USER_NOTICE);\n\n                return;\n            }\n        }\n\n        if (!isset($params[ 'width' ])) {\n            $width = $_image_data[ 0 ];\n        }\n        if (!isset($params[ 'height' ])) {\n            $height = $_image_data[ 1 ];\n        }\n    }\n\n    if (isset($params[ 'dpi' ])) {\n        if (strstr($_SERVER[ 'HTTP_USER_AGENT' ], 'Mac')) {\n            // FIXME: (rodneyrehm) wrong dpi assumption\n            // don't know who thought this up… even if it was true in 1998, it's definitely wrong in 2011.\n            $dpi_default = 72;\n        } else {\n            $dpi_default = 96;\n        }\n        $_resize = $dpi_default / $params[ 'dpi' ];\n        $width = round($width * $_resize);\n        $height = round($height * $_resize);\n    }\n\n    return $prefix . '<img src=\"' . $path_prefix . $file . '\" alt=\"' . $alt . '\" width=\"' . $width . '\" height=\"' .\n           $height . '\"' . $extra . ' />' . $suffix;\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/function.html_options.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsFunction\n */\n\n/**\n * Smarty {html_options} function plugin\n * Type:     function\n * Name:     html_options\n * Purpose:  Prints the list of <option> tags generated from\n *           the passed parameters\n * Params:\n *\n * - name       (optional) - string default \"select\"\n * - values     (required) - if no options supplied) - array\n * - options    (required) - if no values supplied) - associative array\n * - selected   (optional) - string default not set\n * - output     (required) - if not options supplied) - array\n * - id         (optional) - string default not set\n * - class      (optional) - string default not set\n *\n *\n * @link     http://www.smarty.net/manual/en/language.function.html.options.php {html_image}\n *           (Smarty online manual)\n * @author   Monte Ohrt <monte at ohrt dot com>\n * @author   Ralf Strehle (minor optimization) <ralf dot strehle at yahoo dot de>\n *\n * @param array                     $params parameters\n *\n * @param \\Smarty_Internal_Template $template\n *\n * @return string\n * @uses     smarty_function_escape_special_chars()\n */\nfunction smarty_function_html_options($params, Smarty_Internal_Template $template)\n{\n    if (!isset($template->smarty->_cache[ '_required_sesc' ])) {\n        require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');\n        $template->smarty->_cache[ '_required_sesc' ] = true;\n    }\n\n    $name = null;\n    $values = null;\n    $options = null;\n    $selected = null;\n    $output = null;\n    $id = null;\n    $class = null;\n\n    $extra = '';\n\n    foreach ($params as $_key => $_val) {\n        switch ($_key) {\n            case 'name':\n            case 'class':\n            case 'id':\n                $$_key = (string) $_val;\n                break;\n\n            case 'options':\n                $options = (array) $_val;\n                break;\n\n            case 'values':\n            case 'output':\n                $$_key = array_values((array) $_val);\n                break;\n\n            case 'selected':\n                if (is_array($_val)) {\n                    $selected = array();\n                    foreach ($_val as $_sel) {\n                        if (is_object($_sel)) {\n                            if (method_exists($_sel, '__toString')) {\n                                $_sel = smarty_function_escape_special_chars((string) $_sel->__toString());\n                            } else {\n                                trigger_error('html_options: selected attribute contains an object of class \\'' .\n                                              get_class($_sel) . '\\' without __toString() method', E_USER_NOTICE);\n                                continue;\n                            }\n                        } else {\n                            $_sel = smarty_function_escape_special_chars((string) $_sel);\n                        }\n                        $selected[ $_sel ] = true;\n                    }\n                } elseif (is_object($_val)) {\n                    if (method_exists($_val, '__toString')) {\n                        $selected = smarty_function_escape_special_chars((string) $_val->__toString());\n                    } else {\n                        trigger_error('html_options: selected attribute is an object of class \\'' . get_class($_val) .\n                                      '\\' without __toString() method', E_USER_NOTICE);\n                    }\n                } else {\n                    $selected = smarty_function_escape_special_chars((string) $_val);\n                }\n                break;\n\n            case 'strict':\n                break;\n\n            case 'disabled':\n            case 'readonly':\n                if (!empty($params[ 'strict' ])) {\n                    if (!is_scalar($_val)) {\n                        trigger_error(\"html_options: {$_key} attribute must be a scalar, only boolean true or string '{$_key}' will actually add the attribute\",\n                                      E_USER_NOTICE);\n                    }\n\n                    if ($_val === true || $_val === $_key) {\n                        $extra .= ' ' . $_key . '=\"' . smarty_function_escape_special_chars($_key) . '\"';\n                    }\n\n                    break;\n                }\n            // omit break; to fall through!\n\n            default:\n                if (!is_array($_val)) {\n                    $extra .= ' ' . $_key . '=\"' . smarty_function_escape_special_chars($_val) . '\"';\n                } else {\n                    trigger_error(\"html_options: extra attribute '{$_key}' cannot be an array\", E_USER_NOTICE);\n                }\n                break;\n        }\n    }\n\n    if (!isset($options) && !isset($values)) {\n        /* raise error here? */\n\n        return '';\n    }\n\n    $_html_result = '';\n    $_idx = 0;\n\n    if (isset($options)) {\n        foreach ($options as $_key => $_val) {\n            $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected, $id, $class, $_idx);\n        }\n    } else {\n        foreach ($values as $_i => $_key) {\n            $_val = isset($output[ $_i ]) ? $output[ $_i ] : '';\n            $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected, $id, $class, $_idx);\n        }\n    }\n\n    if (!empty($name)) {\n        $_html_class = !empty($class) ? ' class=\"' . $class . '\"' : '';\n        $_html_id = !empty($id) ? ' id=\"' . $id . '\"' : '';\n        $_html_result =\n            '<select name=\"' . $name . '\"' . $_html_class . $_html_id . $extra . '>' . \"\\n\" . $_html_result .\n            '</select>' . \"\\n\";\n    }\n\n    return $_html_result;\n}\n/**\n * @param $key\n * @param $value\n * @param $selected\n * @param $id\n * @param $class\n * @param $idx\n *\n * @return string\n */\nfunction smarty_function_html_options_optoutput($key, $value, $selected, $id, $class, &$idx)\n{\n    if (!is_array($value)) {\n        $_key = smarty_function_escape_special_chars($key);\n        $_html_result = '<option value=\"' . $_key . '\"';\n        if (is_array($selected)) {\n            if (isset($selected[ $_key ])) {\n                $_html_result .= ' selected=\"selected\"';\n            }\n        } elseif ($_key === $selected) {\n            $_html_result .= ' selected=\"selected\"';\n        }\n        $_html_class = !empty($class) ? ' class=\"' . $class . ' option\"' : '';\n        $_html_id = !empty($id) ? ' id=\"' . $id . '-' . $idx . '\"' : '';\n        if (is_object($value)) {\n            if (method_exists($value, '__toString')) {\n                $value = smarty_function_escape_special_chars((string) $value->__toString());\n            } else {\n                trigger_error('html_options: value is an object of class \\'' . get_class($value) .\n                              '\\' without __toString() method', E_USER_NOTICE);\n\n                return '';\n            }\n        } else {\n            $value = smarty_function_escape_special_chars((string) $value);\n        }\n        $_html_result .= $_html_class . $_html_id . '>' . $value . '</option>' . \"\\n\";\n        $idx ++;\n    } else {\n        $_idx = 0;\n        $_html_result =\n            smarty_function_html_options_optgroup($key, $value, $selected, !empty($id) ? ($id . '-' . $idx) : null,\n                                                  $class, $_idx);\n        $idx ++;\n    }\n\n    return $_html_result;\n}\n/**\n * @param $key\n * @param $values\n * @param $selected\n * @param $id\n * @param $class\n * @param $idx\n *\n * @return string\n */\nfunction smarty_function_html_options_optgroup($key, $values, $selected, $id, $class, &$idx)\n{\n    $optgroup_html = '<optgroup label=\"' . smarty_function_escape_special_chars($key) . '\">' . \"\\n\";\n    foreach ($values as $key => $value) {\n        $optgroup_html .= smarty_function_html_options_optoutput($key, $value, $selected, $id, $class, $idx);\n    }\n    $optgroup_html .= \"</optgroup>\\n\";\n\n    return $optgroup_html;\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/function.html_radios.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsFunction\n */\n\n/**\n * Smarty {html_radios} function plugin\n * File:       function.html_radios.php\n * Type:       function\n * Name:       html_radios\n * Date:       24.Feb.2003\n * Purpose:    Prints out a list of radio input types\n * Params:\n *\n * - name       (optional) - string default \"radio\"\n * - values     (required) - array\n * - options    (required) - associative array\n * - checked    (optional) - array default not set\n * - separator  (optional) - ie <br> or &nbsp;\n * - output     (optional) - the output next to each radio button\n * - assign     (optional) - assign the output as an array to this variable\n * - escape     (optional) - escape the content (not value), defaults to true\n *\n * Examples:\n *\n * {html_radios values=$ids output=$names}\n * {html_radios values=$ids name='box' separator='<br>' output=$names}\n * {html_radios values=$ids checked=$checked separator='<br>' output=$names}\n *\n *\n * @link    http://smarty.php.net/manual/en/language.function.html.radios.php {html_radios}\n *          (Smarty online manual)\n * @author  Christopher Kvarme <christopher.kvarme@flashjab.com>\n * @author  credits to Monte Ohrt <monte at ohrt dot com>\n * @version 1.0\n *\n * @param array                    $params   parameters\n * @param Smarty_Internal_Template $template template object\n *\n * @return string\n * @uses    smarty_function_escape_special_chars()\n */\nfunction smarty_function_html_radios($params, $template)\n{\n    if (!isset($template->smarty->_cache[ '_required_sesc' ])) {\n        require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');\n        $template->smarty->_cache[ '_required_sesc' ] = true;\n    }\n\n    $name = 'radio';\n    $values = null;\n    $options = null;\n    $selected = null;\n    $separator = '';\n    $escape = true;\n    $labels = true;\n    $label_ids = false;\n    $output = null;\n    $extra = '';\n\n    foreach ($params as $_key => $_val) {\n        switch ($_key) {\n            case 'name':\n            case 'separator':\n                $$_key = (string) $_val;\n                break;\n\n            case 'checked':\n            case 'selected':\n                if (is_array($_val)) {\n                    trigger_error('html_radios: the \"' . $_key . '\" attribute cannot be an array', E_USER_WARNING);\n                } elseif (is_object($_val)) {\n                    if (method_exists($_val, '__toString')) {\n                        $selected = smarty_function_escape_special_chars((string) $_val->__toString());\n                    } else {\n                        trigger_error('html_radios: selected attribute is an object of class \\'' . get_class($_val) .\n                                      '\\' without __toString() method', E_USER_NOTICE);\n                    }\n                } else {\n                    $selected = (string) $_val;\n                }\n                break;\n\n            case 'escape':\n            case 'labels':\n            case 'label_ids':\n                $$_key = (bool) $_val;\n                break;\n\n            case 'options':\n                $$_key = (array) $_val;\n                break;\n\n            case 'values':\n            case 'output':\n                $$_key = array_values((array) $_val);\n                break;\n\n            case 'radios':\n                trigger_error('html_radios: the use of the \"radios\" attribute is deprecated, use \"options\" instead',\n                              E_USER_WARNING);\n                $options = (array) $_val;\n                break;\n\n            case 'assign':\n                break;\n\n            case 'strict':\n                break;\n\n            case 'disabled':\n            case 'readonly':\n                if (!empty($params[ 'strict' ])) {\n                    if (!is_scalar($_val)) {\n                        trigger_error(\"html_options: {$_key} attribute must be a scalar, only boolean true or string '$_key' will actually add the attribute\",\n                                      E_USER_NOTICE);\n                    }\n\n                    if ($_val === true || $_val === $_key) {\n                        $extra .= ' ' . $_key . '=\"' . smarty_function_escape_special_chars($_key) . '\"';\n                    }\n\n                    break;\n                }\n            // omit break; to fall through!\n\n            default:\n                if (!is_array($_val)) {\n                    $extra .= ' ' . $_key . '=\"' . smarty_function_escape_special_chars($_val) . '\"';\n                } else {\n                    trigger_error(\"html_radios: extra attribute '{$_key}' cannot be an array\", E_USER_NOTICE);\n                }\n                break;\n        }\n    }\n\n    if (!isset($options) && !isset($values)) {\n        /* raise error here? */\n\n        return '';\n    }\n\n    $_html_result = array();\n\n    if (isset($options)) {\n        foreach ($options as $_key => $_val) {\n            $_html_result[] =\n                smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels,\n                                                   $label_ids, $escape);\n        }\n    } else {\n        foreach ($values as $_i => $_key) {\n            $_val = isset($output[ $_i ]) ? $output[ $_i ] : '';\n            $_html_result[] =\n                smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels,\n                                                   $label_ids, $escape);\n        }\n    }\n\n    if (!empty($params[ 'assign' ])) {\n        $template->assign($params[ 'assign' ], $_html_result);\n    } else {\n        return implode(\"\\n\", $_html_result);\n    }\n}\n/**\n * @param $name\n * @param $value\n * @param $output\n * @param $selected\n * @param $extra\n * @param $separator\n * @param $labels\n * @param $label_ids\n * @param $escape\n *\n * @return string\n */\nfunction smarty_function_html_radios_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids,\n                                               $escape)\n{\n    $_output = '';\n\n    if (is_object($value)) {\n        if (method_exists($value, '__toString')) {\n            $value = (string) $value->__toString();\n        } else {\n            trigger_error('html_options: value is an object of class \\'' . get_class($value) .\n                          '\\' without __toString() method', E_USER_NOTICE);\n\n            return '';\n        }\n    } else {\n        $value = (string) $value;\n    }\n\n    if (is_object($output)) {\n        if (method_exists($output, '__toString')) {\n            $output = (string) $output->__toString();\n        } else {\n            trigger_error('html_options: output is an object of class \\'' . get_class($output) .\n                         '\\' without __toString() method', E_USER_NOTICE);\n\n            return '';\n        }\n    } else {\n        $output = (string) $output;\n    }\n\n    if ($labels) {\n        if ($label_ids) {\n            $_id = smarty_function_escape_special_chars(preg_replace('![^\\w\\-\\.]!' . Smarty::$_UTF8_MODIFIER, '_',\n                                                                     $name . '_' . $value));\n            $_output .= '<label for=\"' . $_id . '\">';\n        } else {\n            $_output .= '<label>';\n        }\n    }\n\n    $name = smarty_function_escape_special_chars($name);\n    $value = smarty_function_escape_special_chars($value);\n    if ($escape) {\n        $output = smarty_function_escape_special_chars($output);\n    }\n\n    $_output .= '<input type=\"radio\" name=\"' . $name . '\" value=\"' . $value . '\"';\n\n    if ($labels && $label_ids) {\n        $_output .= ' id=\"' . $_id . '\"';\n    }\n\n    if ($value === $selected) {\n        $_output .= ' checked=\"checked\"';\n    }\n\n    $_output .= $extra . ' />' . $output;\n    if ($labels) {\n        $_output .= '</label>';\n    }\n\n    $_output .= $separator;\n\n    return $_output;\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/function.html_select_date.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsFunction\n */\n\n/**\n * Smarty {html_select_date} plugin\n * Type:     function\n * Name:     html_select_date\n * Purpose:  Prints the dropdowns for date selection.\n * ChangeLog:\n *\n *            - 1.0 initial release\n *            - 1.1 added support for +/- N syntax for begin\n *              and end year values. (Monte)\n *            - 1.2 added support for yyyy-mm-dd syntax for\n *              time value. (Jan Rosier)\n *            - 1.3 added support for choosing format for\n *              month values (Gary Loescher)\n *            - 1.3.1 added support for choosing format for\n *              day values (Marcus Bointon)\n *            - 1.3.2 support negative timestamps, force year\n *              dropdown to include given date unless explicitly set (Monte)\n *            - 1.3.4 fix behaviour of 0000-00-00 00:00:00 dates to match that\n *              of 0000-00-00 dates (cybot, boots)\n *            - 2.0 complete rewrite for performance,\n *              added attributes month_names, *_id\n *\n *\n * @link     http://www.smarty.net/manual/en/language.function.html.select.date.php {html_select_date}\n *           (Smarty online manual)\n * @version  2.0\n * @author   Andrei Zmievski\n * @author   Monte Ohrt <monte at ohrt dot com>\n * @author   Rodney Rehm\n *\n * @param array                     $params parameters\n *\n * @param \\Smarty_Internal_Template $template\n *\n * @return string\n */\nfunction smarty_function_html_select_date($params, Smarty_Internal_Template $template)\n{\n    if (!isset($template->smarty->_cache[ '_required_sesc' ])) {\n        require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');\n        $template->smarty->_cache[ '_required_sesc' ] = true;\n    }\n    if (!isset($template->smarty->_cache[ '_required_smt' ])) {\n        require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php');\n        $template->smarty->_cache[ '_required_smt' ] = true;\n    }\n    // generate timestamps used for month names only\n    static $_month_timestamps = null;\n    static $_current_year = null;\n    if ($_month_timestamps === null) {\n        $_current_year = date('Y');\n        $_month_timestamps = array();\n        for ($i = 1; $i <= 12; $i ++) {\n            $_month_timestamps[ $i ] = mktime(0, 0, 0, $i, 1, 2000);\n        }\n    }\n\n    /* Default values. */\n    $prefix = 'Date_';\n    $start_year = null;\n    $end_year = null;\n    $display_days = true;\n    $display_months = true;\n    $display_years = true;\n    $month_format = '%B';\n    /* Write months as numbers by default  GL */\n    $month_value_format = '%m';\n    $day_format = '%02d';\n    /* Write day values using this format MB */\n    $day_value_format = '%d';\n    $year_as_text = false;\n    /* Display years in reverse order? Ie. 2000,1999,.... */\n    $reverse_years = false;\n    /* Should the select boxes be part of an array when returned from PHP?\n       e.g. setting it to \"birthday\", would create \"birthday[Day]\",\n       \"birthday[Month]\" & \"birthday[Year]\". Can be combined with prefix */\n    $field_array = null;\n    /* <select size>'s of the different <select> tags.\n       If not set, uses default dropdown. */\n    $day_size = null;\n    $month_size = null;\n    $year_size = null;\n    /* Unparsed attributes common to *ALL* the <select>/<input> tags.\n       An example might be in the template: all_extra ='class =\"foo\"'. */\n    $all_extra = null;\n    /* Separate attributes for the tags. */\n    $day_extra = null;\n    $month_extra = null;\n    $year_extra = null;\n    /* Order in which to display the fields.\n       \"D\" -> day, \"M\" -> month, \"Y\" -> year. */\n    $field_order = 'MDY';\n    /* String printed between the different fields. */\n    $field_separator = \"\\n\";\n    $option_separator = \"\\n\";\n    $time = null;\n    // $all_empty = null;\n    // $day_empty = null;\n    // $month_empty = null;\n    // $year_empty = null;\n    $extra_attrs = '';\n    $all_id = null;\n    $day_id = null;\n    $month_id = null;\n    $year_id = null;\n\n    foreach ($params as $_key => $_value) {\n        switch ($_key) {\n            case 'time':\n                if (!is_array($_value) && $_value !== null) {\n                    $time = smarty_make_timestamp($_value);\n                }\n                break;\n\n            case 'month_names':\n                if (is_array($_value) && count($_value) === 12) {\n                    $$_key = $_value;\n                } else {\n                    trigger_error('html_select_date: month_names must be an array of 12 strings', E_USER_NOTICE);\n                }\n                break;\n\n            case 'prefix':\n            case 'field_array':\n            case 'start_year':\n            case 'end_year':\n            case 'day_format':\n            case 'day_value_format':\n            case 'month_format':\n            case 'month_value_format':\n            case 'day_size':\n            case 'month_size':\n            case 'year_size':\n            case 'all_extra':\n            case 'day_extra':\n            case 'month_extra':\n            case 'year_extra':\n            case 'field_order':\n            case 'field_separator':\n            case 'option_separator':\n            case 'all_empty':\n            case 'month_empty':\n            case 'day_empty':\n            case 'year_empty':\n            case 'all_id':\n            case 'month_id':\n            case 'day_id':\n            case 'year_id':\n                $$_key = (string) $_value;\n                break;\n\n            case 'display_days':\n            case 'display_months':\n            case 'display_years':\n            case 'year_as_text':\n            case 'reverse_years':\n                $$_key = (bool) $_value;\n                break;\n\n            default:\n                if (!is_array($_value)) {\n                    $extra_attrs .= ' ' . $_key . '=\"' . smarty_function_escape_special_chars($_value) . '\"';\n                } else {\n                    trigger_error(\"html_select_date: extra attribute '{$_key}' cannot be an array\", E_USER_NOTICE);\n                }\n                break;\n        }\n    }\n\n    // Note: date() is faster than strftime()\n    // Note: explode(date()) is faster than date() date() date()\n    if (isset($params[ 'time' ]) && is_array($params[ 'time' ])) {\n        if (isset($params[ 'time' ][ $prefix . 'Year' ])) {\n            // $_REQUEST[$field_array] given\n            foreach (array('Y' => 'Year',\n                           'm' => 'Month',\n                           'd' => 'Day') as $_elementKey => $_elementName) {\n                $_variableName = '_' . strtolower($_elementName);\n                $$_variableName =\n                    isset($params[ 'time' ][ $prefix . $_elementName ]) ? $params[ 'time' ][ $prefix . $_elementName ] :\n                        date($_elementKey);\n            }\n        } elseif (isset($params[ 'time' ][ $field_array ][ $prefix . 'Year' ])) {\n            // $_REQUEST given\n            foreach (array('Y' => 'Year',\n                           'm' => 'Month',\n                           'd' => 'Day') as $_elementKey => $_elementName) {\n                $_variableName = '_' . strtolower($_elementName);\n                $$_variableName = isset($params[ 'time' ][ $field_array ][ $prefix . $_elementName ]) ?\n                    $params[ 'time' ][ $field_array ][ $prefix . $_elementName ] : date($_elementKey);\n            }\n        } else {\n            // no date found, use NOW\n            list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d'));\n        }\n    } elseif ($time === null) {\n        if (array_key_exists('time', $params)) {\n            $_year = $_month = $_day = $time = null;\n        } else {\n            list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d'));\n        }\n    } else {\n        list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d', $time));\n    }\n\n    // make syntax \"+N\" or \"-N\" work with $start_year and $end_year\n    // Note preg_match('!^(\\+|\\-)\\s*(\\d+)$!', $end_year, $match) is slower than trim+substr\n    foreach (array('start',\n                   'end') as $key) {\n        $key .= '_year';\n        $t = $$key;\n        if ($t === null) {\n            $$key = (int) $_current_year;\n        } elseif ($t[ 0 ] === '+') {\n            $$key = (int) ($_current_year + (int) trim(substr($t, 1)));\n        } elseif ($t[ 0 ] === '-') {\n            $$key = (int) ($_current_year - (int) trim(substr($t, 1)));\n        } else {\n            $$key = (int) $$key;\n        }\n    }\n\n    // flip for ascending or descending\n    if (($start_year > $end_year && !$reverse_years) || ($start_year < $end_year && $reverse_years)) {\n        $t = $end_year;\n        $end_year = $start_year;\n        $start_year = $t;\n    }\n\n    // generate year <select> or <input>\n    if ($display_years) {\n        $_extra = '';\n        $_name = $field_array ? ($field_array . '[' . $prefix . 'Year]') : ($prefix . 'Year');\n        if ($all_extra) {\n            $_extra .= ' ' . $all_extra;\n        }\n        if ($year_extra) {\n            $_extra .= ' ' . $year_extra;\n        }\n\n        if ($year_as_text) {\n            $_html_years =\n                '<input type=\"text\" name=\"' . $_name . '\" value=\"' . $_year . '\" size=\"4\" maxlength=\"4\"' . $_extra .\n                $extra_attrs . ' />';\n        } else {\n            $_html_years = '<select name=\"' . $_name . '\"';\n            if ($year_id !== null || $all_id !== null) {\n                $_html_years .= ' id=\"' . smarty_function_escape_special_chars($year_id !== null ?\n                                                                                   ($year_id ? $year_id : $_name) :\n                                                                                   ($all_id ? ($all_id . $_name) :\n                                                                                       $_name)) . '\"';\n            }\n            if ($year_size) {\n                $_html_years .= ' size=\"' . $year_size . '\"';\n            }\n            $_html_years .= $_extra . $extra_attrs . '>' . $option_separator;\n\n            if (isset($year_empty) || isset($all_empty)) {\n                $_html_years .= '<option value=\"\">' . (isset($year_empty) ? $year_empty : $all_empty) . '</option>' .\n                                $option_separator;\n            }\n\n            $op = $start_year > $end_year ? - 1 : 1;\n            for ($i = $start_year; $op > 0 ? $i <= $end_year : $i >= $end_year; $i += $op) {\n                $_html_years .= '<option value=\"' . $i . '\"' . ($_year == $i ? ' selected=\"selected\"' : '') . '>' . $i .\n                                '</option>' . $option_separator;\n            }\n\n            $_html_years .= '</select>';\n        }\n    }\n\n    // generate month <select> or <input>\n    if ($display_months) {\n        $_extra = '';\n        $_name = $field_array ? ($field_array . '[' . $prefix . 'Month]') : ($prefix . 'Month');\n        if ($all_extra) {\n            $_extra .= ' ' . $all_extra;\n        }\n        if ($month_extra) {\n            $_extra .= ' ' . $month_extra;\n        }\n\n        $_html_months = '<select name=\"' . $_name . '\"';\n        if ($month_id !== null || $all_id !== null) {\n            $_html_months .= ' id=\"' . smarty_function_escape_special_chars($month_id !== null ?\n                                                                                ($month_id ? $month_id : $_name) :\n                                                                                ($all_id ? ($all_id . $_name) :\n                                                                                    $_name)) . '\"';\n        }\n        if ($month_size) {\n            $_html_months .= ' size=\"' . $month_size . '\"';\n        }\n        $_html_months .= $_extra . $extra_attrs . '>' . $option_separator;\n\n        if (isset($month_empty) || isset($all_empty)) {\n            $_html_months .= '<option value=\"\">' . (isset($month_empty) ? $month_empty : $all_empty) . '</option>' .\n                             $option_separator;\n        }\n\n        for ($i = 1; $i <= 12; $i ++) {\n            $_val = sprintf('%02d', $i);\n            $_text = isset($month_names) ? smarty_function_escape_special_chars($month_names[ $i ]) :\n                ($month_format === '%m' ? $_val : strftime($month_format, $_month_timestamps[ $i ]));\n            $_value = $month_value_format === '%m' ? $_val : strftime($month_value_format, $_month_timestamps[ $i ]);\n            $_html_months .= '<option value=\"' . $_value . '\"' . ($_val == $_month ? ' selected=\"selected\"' : '') .\n                             '>' . $_text . '</option>' . $option_separator;\n        }\n\n        $_html_months .= '</select>';\n    }\n\n    // generate day <select> or <input>\n    if ($display_days) {\n        $_extra = '';\n        $_name = $field_array ? ($field_array . '[' . $prefix . 'Day]') : ($prefix . 'Day');\n        if ($all_extra) {\n            $_extra .= ' ' . $all_extra;\n        }\n        if ($day_extra) {\n            $_extra .= ' ' . $day_extra;\n        }\n\n        $_html_days = '<select name=\"' . $_name . '\"';\n        if ($day_id !== null || $all_id !== null) {\n            $_html_days .= ' id=\"' .\n                           smarty_function_escape_special_chars($day_id !== null ? ($day_id ? $day_id : $_name) :\n                                                                    ($all_id ? ($all_id . $_name) : $_name)) . '\"';\n        }\n        if ($day_size) {\n            $_html_days .= ' size=\"' . $day_size . '\"';\n        }\n        $_html_days .= $_extra . $extra_attrs . '>' . $option_separator;\n\n        if (isset($day_empty) || isset($all_empty)) {\n            $_html_days .= '<option value=\"\">' . (isset($day_empty) ? $day_empty : $all_empty) . '</option>' .\n                           $option_separator;\n        }\n\n        for ($i = 1; $i <= 31; $i ++) {\n            $_val = sprintf('%02d', $i);\n            $_text = $day_format === '%02d' ? $_val : sprintf($day_format, $i);\n            $_value = $day_value_format === '%02d' ? $_val : sprintf($day_value_format, $i);\n            $_html_days .= '<option value=\"' . $_value . '\"' . ($_val == $_day ? ' selected=\"selected\"' : '') . '>' .\n                           $_text . '</option>' . $option_separator;\n        }\n\n        $_html_days .= '</select>';\n    }\n\n    // order the fields for output\n    $_html = '';\n    for ($i = 0; $i <= 2; $i ++) {\n        switch ($field_order[ $i ]) {\n            case 'Y':\n            case 'y':\n                if (isset($_html_years)) {\n                    if ($_html) {\n                        $_html .= $field_separator;\n                    }\n                    $_html .= $_html_years;\n                }\n                break;\n\n            case 'm':\n            case 'M':\n                if (isset($_html_months)) {\n                    if ($_html) {\n                        $_html .= $field_separator;\n                    }\n                    $_html .= $_html_months;\n                }\n                break;\n\n            case 'd':\n            case 'D':\n                if (isset($_html_days)) {\n                    if ($_html) {\n                        $_html .= $field_separator;\n                    }\n                    $_html .= $_html_days;\n                }\n                break;\n        }\n    }\n\n    return $_html;\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/function.html_select_time.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsFunction\n */\n\n/**\n * Smarty {html_select_time} function plugin\n * Type:     function\n * Name:     html_select_time\n * Purpose:  Prints the dropdowns for time selection\n *\n * @link     http://www.smarty.net/manual/en/language.function.html.select.time.php {html_select_time}\n *           (Smarty online manual)\n * @author   Roberto Berto <roberto@berto.net>\n * @author   Monte Ohrt <monte AT ohrt DOT com>\n *\n * @param array                     $params parameters\n *\n * @param \\Smarty_Internal_Template $template\n *\n * @return string\n * @uses     smarty_make_timestamp()\n */\nfunction smarty_function_html_select_time($params, Smarty_Internal_Template $template)\n{\n    if (!isset($template->smarty->_cache[ '_required_sesc' ])) {\n        require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');\n        $template->smarty->_cache[ '_required_sesc' ] = true;\n    }\n    if (!isset($template->smarty->_cache[ '_required_smt' ])) {\n        require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php');\n        $template->smarty->_cache[ '_required_smt' ] = true;\n    }\n    $prefix = 'Time_';\n    $field_array = null;\n    $field_separator = \"\\n\";\n    $option_separator = \"\\n\";\n    $time = null;\n\n    $display_hours = true;\n    $display_minutes = true;\n    $display_seconds = true;\n    $display_meridian = true;\n\n    $hour_format = '%02d';\n    $hour_value_format = '%02d';\n    $minute_format = '%02d';\n    $minute_value_format = '%02d';\n    $second_format = '%02d';\n    $second_value_format = '%02d';\n\n    $hour_size = null;\n    $minute_size = null;\n    $second_size = null;\n    $meridian_size = null;\n\n    $all_empty = null;\n    $hour_empty = null;\n    $minute_empty = null;\n    $second_empty = null;\n    $meridian_empty = null;\n\n    $all_id = null;\n    $hour_id = null;\n    $minute_id = null;\n    $second_id = null;\n    $meridian_id = null;\n\n    $use_24_hours = true;\n    $minute_interval = 1;\n    $second_interval = 1;\n\n    $extra_attrs = '';\n    $all_extra = null;\n    $hour_extra = null;\n    $minute_extra = null;\n    $second_extra = null;\n    $meridian_extra = null;\n\n    foreach ($params as $_key => $_value) {\n        switch ($_key) {\n            case 'time':\n                if (!is_array($_value) && $_value !== null) {\n                    $time = smarty_make_timestamp($_value);\n                }\n                break;\n\n            case 'prefix':\n            case 'field_array':\n\n            case 'field_separator':\n            case 'option_separator':\n\n            case 'all_extra':\n            case 'hour_extra':\n            case 'minute_extra':\n            case 'second_extra':\n            case 'meridian_extra':\n\n            case 'all_empty':\n            case 'hour_empty':\n            case 'minute_empty':\n            case 'second_empty':\n            case 'meridian_empty':\n\n            case 'all_id':\n            case 'hour_id':\n            case 'minute_id':\n            case 'second_id':\n            case 'meridian_id':\n\n            case 'hour_format':\n            case 'hour_value_format':\n            case 'minute_format':\n            case 'minute_value_format':\n            case 'second_format':\n            case 'second_value_format':\n                $$_key = (string) $_value;\n                break;\n\n            case 'display_hours':\n            case 'display_minutes':\n            case 'display_seconds':\n            case 'display_meridian':\n            case 'use_24_hours':\n                $$_key = (bool) $_value;\n                break;\n\n            case 'minute_interval':\n            case 'second_interval':\n\n            case 'hour_size':\n            case 'minute_size':\n            case 'second_size':\n            case 'meridian_size':\n                $$_key = (int) $_value;\n                break;\n\n            default:\n                if (!is_array($_value)) {\n                    $extra_attrs .= ' ' . $_key . '=\"' . smarty_function_escape_special_chars($_value) . '\"';\n                } else {\n                    trigger_error(\"html_select_date: extra attribute '{$_key}' cannot be an array\", E_USER_NOTICE);\n                }\n                break;\n        }\n    }\n\n    if (isset($params[ 'time' ]) && is_array($params[ 'time' ])) {\n        if (isset($params[ 'time' ][ $prefix . 'Hour' ])) {\n            // $_REQUEST[$field_array] given\n            foreach (array('H' => 'Hour',\n                           'i' => 'Minute',\n                           's' => 'Second') as $_elementKey => $_elementName) {\n                $_variableName = '_' . strtolower($_elementName);\n                $$_variableName =\n                    isset($params[ 'time' ][ $prefix . $_elementName ]) ? $params[ 'time' ][ $prefix . $_elementName ] :\n                        date($_elementKey);\n            }\n            $_meridian =\n                isset($params[ 'time' ][ $prefix . 'Meridian' ]) ? (' ' . $params[ 'time' ][ $prefix . 'Meridian' ]) :\n                    '';\n            $time = strtotime($_hour . ':' . $_minute . ':' . $_second . $_meridian);\n            list($_hour, $_minute, $_second) = $time = explode('-', date('H-i-s', $time));\n        } elseif (isset($params[ 'time' ][ $field_array ][ $prefix . 'Hour' ])) {\n            // $_REQUEST given\n            foreach (array('H' => 'Hour',\n                           'i' => 'Minute',\n                           's' => 'Second') as $_elementKey => $_elementName) {\n                $_variableName = '_' . strtolower($_elementName);\n                $$_variableName = isset($params[ 'time' ][ $field_array ][ $prefix . $_elementName ]) ?\n                    $params[ 'time' ][ $field_array ][ $prefix . $_elementName ] : date($_elementKey);\n            }\n            $_meridian = isset($params[ 'time' ][ $field_array ][ $prefix . 'Meridian' ]) ?\n                (' ' . $params[ 'time' ][ $field_array ][ $prefix . 'Meridian' ]) : '';\n            $time = strtotime($_hour . ':' . $_minute . ':' . $_second . $_meridian);\n            list($_hour, $_minute, $_second) = $time = explode('-', date('H-i-s', $time));\n        } else {\n            // no date found, use NOW\n            list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d'));\n        }\n    } elseif ($time === null) {\n        if (array_key_exists('time', $params)) {\n            $_hour = $_minute = $_second = $time = null;\n        } else {\n            list($_hour, $_minute, $_second) = $time = explode('-', date('H-i-s'));\n        }\n    } else {\n        list($_hour, $_minute, $_second) = $time = explode('-', date('H-i-s', $time));\n    }\n\n    // generate hour <select>\n    if ($display_hours) {\n        $_html_hours = '';\n        $_extra = '';\n        $_name = $field_array ? ($field_array . '[' . $prefix . 'Hour]') : ($prefix . 'Hour');\n        if ($all_extra) {\n            $_extra .= ' ' . $all_extra;\n        }\n        if ($hour_extra) {\n            $_extra .= ' ' . $hour_extra;\n        }\n\n        $_html_hours = '<select name=\"' . $_name . '\"';\n        if ($hour_id !== null || $all_id !== null) {\n            $_html_hours .= ' id=\"' .\n                            smarty_function_escape_special_chars($hour_id !== null ? ($hour_id ? $hour_id : $_name) :\n                                                                     ($all_id ? ($all_id . $_name) : $_name)) . '\"';\n        }\n        if ($hour_size) {\n            $_html_hours .= ' size=\"' . $hour_size . '\"';\n        }\n        $_html_hours .= $_extra . $extra_attrs . '>' . $option_separator;\n\n        if (isset($hour_empty) || isset($all_empty)) {\n            $_html_hours .= '<option value=\"\">' . (isset($hour_empty) ? $hour_empty : $all_empty) . '</option>' .\n                            $option_separator;\n        }\n\n        $start = $use_24_hours ? 0 : 1;\n        $end = $use_24_hours ? 23 : 12;\n        for ($i = $start; $i <= $end; $i ++) {\n            $_val = sprintf('%02d', $i);\n            $_text = $hour_format === '%02d' ? $_val : sprintf($hour_format, $i);\n            $_value = $hour_value_format === '%02d' ? $_val : sprintf($hour_value_format, $i);\n\n            if (!$use_24_hours) {\n                $_hour12 = $_hour == 0 ? 12 : ($_hour <= 12 ? $_hour : $_hour - 12);\n            }\n\n            $selected = $_hour !== null ? ($use_24_hours ? $_hour == $_val : $_hour12 == $_val) : null;\n            $_html_hours .= '<option value=\"' . $_value . '\"' . ($selected ? ' selected=\"selected\"' : '') . '>' .\n                            $_text . '</option>' . $option_separator;\n        }\n\n        $_html_hours .= '</select>';\n    }\n\n    // generate minute <select>\n    if ($display_minutes) {\n        $_html_minutes = '';\n        $_extra = '';\n        $_name = $field_array ? ($field_array . '[' . $prefix . 'Minute]') : ($prefix . 'Minute');\n        if ($all_extra) {\n            $_extra .= ' ' . $all_extra;\n        }\n        if ($minute_extra) {\n            $_extra .= ' ' . $minute_extra;\n        }\n\n        $_html_minutes = '<select name=\"' . $_name . '\"';\n        if ($minute_id !== null || $all_id !== null) {\n            $_html_minutes .= ' id=\"' . smarty_function_escape_special_chars($minute_id !== null ?\n                                                                                 ($minute_id ? $minute_id : $_name) :\n                                                                                 ($all_id ? ($all_id . $_name) :\n                                                                                     $_name)) . '\"';\n        }\n        if ($minute_size) {\n            $_html_minutes .= ' size=\"' . $minute_size . '\"';\n        }\n        $_html_minutes .= $_extra . $extra_attrs . '>' . $option_separator;\n\n        if (isset($minute_empty) || isset($all_empty)) {\n            $_html_minutes .= '<option value=\"\">' . (isset($minute_empty) ? $minute_empty : $all_empty) . '</option>' .\n                              $option_separator;\n        }\n\n        $selected = $_minute !== null ? ($_minute - $_minute % $minute_interval) : null;\n        for ($i = 0; $i <= 59; $i += $minute_interval) {\n            $_val = sprintf('%02d', $i);\n            $_text = $minute_format === '%02d' ? $_val : sprintf($minute_format, $i);\n            $_value = $minute_value_format === '%02d' ? $_val : sprintf($minute_value_format, $i);\n            $_html_minutes .= '<option value=\"' . $_value . '\"' . ($selected === $i ? ' selected=\"selected\"' : '') .\n                              '>' . $_text . '</option>' . $option_separator;\n        }\n\n        $_html_minutes .= '</select>';\n    }\n\n    // generate second <select>\n    if ($display_seconds) {\n        $_html_seconds = '';\n        $_extra = '';\n        $_name = $field_array ? ($field_array . '[' . $prefix . 'Second]') : ($prefix . 'Second');\n        if ($all_extra) {\n            $_extra .= ' ' . $all_extra;\n        }\n        if ($second_extra) {\n            $_extra .= ' ' . $second_extra;\n        }\n\n        $_html_seconds = '<select name=\"' . $_name . '\"';\n        if ($second_id !== null || $all_id !== null) {\n            $_html_seconds .= ' id=\"' . smarty_function_escape_special_chars($second_id !== null ?\n                                                                                 ($second_id ? $second_id : $_name) :\n                                                                                 ($all_id ? ($all_id . $_name) :\n                                                                                     $_name)) . '\"';\n        }\n        if ($second_size) {\n            $_html_seconds .= ' size=\"' . $second_size . '\"';\n        }\n        $_html_seconds .= $_extra . $extra_attrs . '>' . $option_separator;\n\n        if (isset($second_empty) || isset($all_empty)) {\n            $_html_seconds .= '<option value=\"\">' . (isset($second_empty) ? $second_empty : $all_empty) . '</option>' .\n                              $option_separator;\n        }\n\n        $selected = $_second !== null ? ($_second - $_second % $second_interval) : null;\n        for ($i = 0; $i <= 59; $i += $second_interval) {\n            $_val = sprintf('%02d', $i);\n            $_text = $second_format === '%02d' ? $_val : sprintf($second_format, $i);\n            $_value = $second_value_format === '%02d' ? $_val : sprintf($second_value_format, $i);\n            $_html_seconds .= '<option value=\"' . $_value . '\"' . ($selected === $i ? ' selected=\"selected\"' : '') .\n                              '>' . $_text . '</option>' . $option_separator;\n        }\n\n        $_html_seconds .= '</select>';\n    }\n\n    // generate meridian <select>\n    if ($display_meridian && !$use_24_hours) {\n        $_html_meridian = '';\n        $_extra = '';\n        $_name = $field_array ? ($field_array . '[' . $prefix . 'Meridian]') : ($prefix . 'Meridian');\n        if ($all_extra) {\n            $_extra .= ' ' . $all_extra;\n        }\n        if ($meridian_extra) {\n            $_extra .= ' ' . $meridian_extra;\n        }\n\n        $_html_meridian = '<select name=\"' . $_name . '\"';\n        if ($meridian_id !== null || $all_id !== null) {\n            $_html_meridian .= ' id=\"' . smarty_function_escape_special_chars($meridian_id !== null ?\n                                                                                  ($meridian_id ? $meridian_id :\n                                                                                      $_name) :\n                                                                                  ($all_id ? ($all_id . $_name) :\n                                                                                      $_name)) . '\"';\n        }\n        if ($meridian_size) {\n            $_html_meridian .= ' size=\"' . $meridian_size . '\"';\n        }\n        $_html_meridian .= $_extra . $extra_attrs . '>' . $option_separator;\n\n        if (isset($meridian_empty) || isset($all_empty)) {\n            $_html_meridian .= '<option value=\"\">' . (isset($meridian_empty) ? $meridian_empty : $all_empty) .\n                               '</option>' . $option_separator;\n        }\n\n        $_html_meridian .= '<option value=\"am\"' . ($_hour > 0 && $_hour < 12 ? ' selected=\"selected\"' : '') .\n                           '>AM</option>' . $option_separator . '<option value=\"pm\"' .\n                           ($_hour < 12 ? '' : ' selected=\"selected\"') . '>PM</option>' . $option_separator .\n                           '</select>';\n    }\n\n    $_html = '';\n    foreach (array('_html_hours',\n                   '_html_minutes',\n                   '_html_seconds',\n                   '_html_meridian') as $k) {\n        if (isset($$k)) {\n            if ($_html) {\n                $_html .= $field_separator;\n            }\n            $_html .= $$k;\n        }\n    }\n\n    return $_html;\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/function.html_table.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsFunction\n */\n\n/**\n * Smarty {html_table} function plugin\n * Type:     function\n * Name:     html_table\n * Date:     Feb 17, 2003\n * Purpose:  make an html table from an array of data\n * Params:\n *\n * - loop       - array to loop through\n * - cols       - number of columns, comma separated list of column names\n *                or array of column names\n * - rows       - number of rows\n * - table_attr - table attributes\n * - th_attr    - table heading attributes (arrays are cycled)\n * - tr_attr    - table row attributes (arrays are cycled)\n * - td_attr    - table cell attributes (arrays are cycled)\n * - trailpad   - value to pad trailing cells with\n * - caption    - text for caption element\n * - vdir       - vertical direction (default: \"down\", means top-to-bottom)\n * - hdir       - horizontal direction (default: \"right\", means left-to-right)\n * - inner      - inner loop (default \"cols\": print $loop line by line,\n *                $loop will be printed column by column otherwise)\n *\n * Examples:\n *\n * {table loop=$data}\n * {table loop=$data cols=4 tr_attr='\"bgcolor=red\"'}\n * {table loop=$data cols=\"first,second,third\" tr_attr=$colors}\n *\n *\n * @author   Monte Ohrt <monte at ohrt dot com>\n * @author   credit to Messju Mohr <messju at lammfellpuschen dot de>\n * @author   credit to boots <boots dot smarty at yahoo dot com>\n * @version  1.1\n * @link     http://www.smarty.net/manual/en/language.function.html.table.php {html_table}\n *           (Smarty online manual)\n *\n * @param array $params parameters\n *\n * @return string\n */\nfunction smarty_function_html_table($params)\n{\n    $table_attr = 'border=\"1\"';\n    $tr_attr = '';\n    $th_attr = '';\n    $td_attr = '';\n    $cols = $cols_count = 3;\n    $rows = 3;\n    $trailpad = '&nbsp;';\n    $vdir = 'down';\n    $hdir = 'right';\n    $inner = 'cols';\n    $caption = '';\n    $loop = null;\n\n    if (!isset($params[ 'loop' ])) {\n        trigger_error(\"html_table: missing 'loop' parameter\", E_USER_WARNING);\n\n        return;\n    }\n\n    foreach ($params as $_key => $_value) {\n        switch ($_key) {\n            case 'loop':\n                $$_key = (array) $_value;\n                break;\n\n            case 'cols':\n                if (is_array($_value) && !empty($_value)) {\n                    $cols = $_value;\n                    $cols_count = count($_value);\n                } elseif (!is_numeric($_value) && is_string($_value) && !empty($_value)) {\n                    $cols = explode(',', $_value);\n                    $cols_count = count($cols);\n                } elseif (!empty($_value)) {\n                    $cols_count = (int) $_value;\n                } else {\n                    $cols_count = $cols;\n                }\n                break;\n\n            case 'rows':\n                $$_key = (int) $_value;\n                break;\n\n            case 'table_attr':\n            case 'trailpad':\n            case 'hdir':\n            case 'vdir':\n            case 'inner':\n            case 'caption':\n                $$_key = (string) $_value;\n                break;\n\n            case 'tr_attr':\n            case 'td_attr':\n            case 'th_attr':\n                $$_key = $_value;\n                break;\n        }\n    }\n\n    $loop_count = count($loop);\n    if (empty($params[ 'rows' ])) {\n        /* no rows specified */\n        $rows = ceil($loop_count / $cols_count);\n    } elseif (empty($params[ 'cols' ])) {\n        if (!empty($params[ 'rows' ])) {\n            /* no cols specified, but rows */\n            $cols_count = ceil($loop_count / $rows);\n        }\n    }\n\n    $output = \"<table $table_attr>\\n\";\n\n    if (!empty($caption)) {\n        $output .= '<caption>' . $caption . \"</caption>\\n\";\n    }\n\n    if (is_array($cols)) {\n        $cols = ($hdir === 'right') ? $cols : array_reverse($cols);\n        $output .= \"<thead><tr>\\n\";\n\n        for ($r = 0; $r < $cols_count; $r ++) {\n            $output .= '<th' . smarty_function_html_table_cycle('th', $th_attr, $r) . '>';\n            $output .= $cols[ $r ];\n            $output .= \"</th>\\n\";\n        }\n        $output .= \"</tr></thead>\\n\";\n    }\n\n    $output .= \"<tbody>\\n\";\n    for ($r = 0; $r < $rows; $r ++) {\n        $output .= \"<tr\" . smarty_function_html_table_cycle('tr', $tr_attr, $r) . \">\\n\";\n        $rx = ($vdir === 'down') ? $r * $cols_count : ($rows - 1 - $r) * $cols_count;\n\n        for ($c = 0; $c < $cols_count; $c ++) {\n            $x = ($hdir === 'right') ? $rx + $c : $rx + $cols_count - 1 - $c;\n            if ($inner !== 'cols') {\n                /* shuffle x to loop over rows*/\n                $x = floor($x / $cols_count) + ($x % $cols_count) * $rows;\n            }\n\n            if ($x < $loop_count) {\n                $output .= \"<td\" . smarty_function_html_table_cycle('td', $td_attr, $c) . \">\" . $loop[ $x ] . \"</td>\\n\";\n            } else {\n                $output .= \"<td\" . smarty_function_html_table_cycle('td', $td_attr, $c) . \">$trailpad</td>\\n\";\n            }\n        }\n        $output .= \"</tr>\\n\";\n    }\n    $output .= \"</tbody>\\n\";\n    $output .= \"</table>\\n\";\n\n    return $output;\n}\n/**\n * @param $name\n * @param $var\n * @param $no\n *\n * @return string\n */\nfunction smarty_function_html_table_cycle($name, $var, $no)\n{\n    if (!is_array($var)) {\n        $ret = $var;\n    } else {\n        $ret = $var[ $no % count($var) ];\n    }\n\n    return ($ret) ? ' ' . $ret : '';\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/function.mailto.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsFunction\n */\n\n/**\n * Smarty {mailto} function plugin\n * Type:     function\n * Name:     mailto\n * Date:     May 21, 2002\n * Purpose:  automate mailto address link creation, and optionally encode them.\n * Params:\n *\n * - address    - (required) - e-mail address\n * - text       - (optional) - text to display, default is address\n * - encode     - (optional) - can be one of:\n *                             * none : no encoding (default)\n *                             * javascript : encode with javascript\n *                             * javascript_charcode : encode with javascript charcode\n *                             * hex : encode with hexadecimal (no javascript)\n * - cc         - (optional) - address(es) to carbon copy\n * - bcc        - (optional) - address(es) to blind carbon copy\n * - subject    - (optional) - e-mail subject\n * - newsgroups - (optional) - newsgroup(s) to post to\n * - followupto - (optional) - address(es) to follow up to\n * - extra      - (optional) - extra tags for the href link\n *\n * Examples:\n *\n * {mailto address=\"me@domain.com\"}\n * {mailto address=\"me@domain.com\" encode=\"javascript\"}\n * {mailto address=\"me@domain.com\" encode=\"hex\"}\n * {mailto address=\"me@domain.com\" subject=\"Hello to you!\"}\n * {mailto address=\"me@domain.com\" cc=\"you@domain.com,they@domain.com\"}\n * {mailto address=\"me@domain.com\" extra='class=\"mailto\"'}\n *\n *\n * @link     http://www.smarty.net/manual/en/language.function.mailto.php {mailto}\n *           (Smarty online manual)\n * @version  1.2\n * @author   Monte Ohrt <monte at ohrt dot com>\n * @author   credits to Jason Sweat (added cc, bcc and subject functionality)\n *\n * @param array $params parameters\n *\n * @return string\n */\nfunction smarty_function_mailto($params)\n{\n    static $_allowed_encoding =\n        array('javascript' => true, 'javascript_charcode' => true, 'hex' => true, 'none' => true);\n    $extra = '';\n\n    if (empty($params[ 'address' ])) {\n        trigger_error(\"mailto: missing 'address' parameter\", E_USER_WARNING);\n\n        return;\n    } else {\n        $address = $params[ 'address' ];\n    }\n\n    $text = $address;\n    // netscape and mozilla do not decode %40 (@) in BCC field (bug?)\n    // so, don't encode it.\n    $search = array('%40', '%2C');\n    $replace = array('@', ',');\n    $mail_parms = array();\n    foreach ($params as $var => $value) {\n        switch ($var) {\n            case 'cc':\n            case 'bcc':\n            case 'followupto':\n                if (!empty($value)) {\n                    $mail_parms[] = $var . '=' . str_replace($search, $replace, rawurlencode($value));\n                }\n                break;\n\n            case 'subject':\n            case 'newsgroups':\n                $mail_parms[] = $var . '=' . rawurlencode($value);\n                break;\n\n            case 'extra':\n            case 'text':\n                $$var = $value;\n\n            default:\n        }\n    }\n\n    if ($mail_parms) {\n        $address .= '?' . join('&', $mail_parms);\n    }\n\n    $encode = (empty($params[ 'encode' ])) ? 'none' : $params[ 'encode' ];\n    if (!isset($_allowed_encoding[ $encode ])) {\n        trigger_error(\"mailto: 'encode' parameter must be none, javascript, javascript_charcode or hex\",\n                      E_USER_WARNING);\n\n        return;\n    }\n    // FIXME: (rodneyrehm) document.write() excues me what? 1998 has passed!\n    if ($encode === 'javascript') {\n        $string = 'document.write(\\'<a href=\"mailto:' . $address . '\" ' . $extra . '>' . $text . '</a>\\');';\n\n        $js_encode = '';\n        for ($x = 0, $_length = strlen($string); $x < $_length; $x ++) {\n            $js_encode .= '%' . bin2hex($string[ $x ]);\n        }\n\n        return '<script type=\"text/javascript\">eval(unescape(\\'' . $js_encode . '\\'))</script>';\n    } elseif ($encode === 'javascript_charcode') {\n        $string = '<a href=\"mailto:' . $address . '\" ' . $extra . '>' . $text . '</a>';\n\n        for ($x = 0, $y = strlen($string); $x < $y; $x ++) {\n            $ord[] = ord($string[ $x ]);\n        }\n\n        $_ret = \"<script type=\\\"text/javascript\\\" language=\\\"javascript\\\">\\n\" . \"{document.write(String.fromCharCode(\" .\n                implode(',', $ord) . \"))\" . \"}\\n\" . \"</script>\\n\";\n\n        return $_ret;\n    } elseif ($encode === 'hex') {\n        preg_match('!^(.*)(\\?.*)$!', $address, $match);\n        if (!empty($match[ 2 ])) {\n            trigger_error(\"mailto: hex encoding does not work with extra attributes. Try javascript.\", E_USER_WARNING);\n\n            return;\n        }\n        $address_encode = '';\n        for ($x = 0, $_length = strlen($address); $x < $_length; $x ++) {\n            if (preg_match('!\\w!' . Smarty::$_UTF8_MODIFIER, $address[ $x ])) {\n                $address_encode .= '%' . bin2hex($address[ $x ]);\n            } else {\n                $address_encode .= $address[ $x ];\n            }\n        }\n        $text_encode = '';\n        for ($x = 0, $_length = strlen($text); $x < $_length; $x ++) {\n            $text_encode .= '&#x' . bin2hex($text[ $x ]) . ';';\n        }\n\n        $mailto = \"&#109;&#97;&#105;&#108;&#116;&#111;&#58;\";\n\n        return '<a href=\"' . $mailto . $address_encode . '\" ' . $extra . '>' . $text_encode . '</a>';\n    } else {\n        // no encoding\n        return '<a href=\"mailto:' . $address . '\" ' . $extra . '>' . $text . '</a>';\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/function.math.php",
    "content": "<?php\n/**\n * Smarty plugin\n * This plugin is only for Smarty2 BC\n *\n * @package    Smarty\n * @subpackage PluginsFunction\n */\n\n/**\n * Smarty {math} function plugin\n * Type:     function\n * Name:     math\n * Purpose:  handle math computations in template\n *\n * @link     http://www.smarty.net/manual/en/language.function.math.php {math}\n *           (Smarty online manual)\n * @author   Monte Ohrt <monte at ohrt dot com>\n *\n * @param array                    $params   parameters\n * @param Smarty_Internal_Template $template template object\n *\n * @return string|null\n */\nfunction smarty_function_math($params, $template)\n{\n    static $_allowed_funcs =\n        array('int' => true, 'abs' => true, 'ceil' => true, 'cos' => true, 'exp' => true, 'floor' => true,\n              'log' => true, 'log10' => true, 'max' => true, 'min' => true, 'pi' => true, 'pow' => true, 'rand' => true,\n              'round' => true, 'sin' => true, 'sqrt' => true, 'srand' => true, 'tan' => true);\n    // be sure equation parameter is present\n    if (empty($params[ 'equation' ])) {\n        trigger_error(\"math: missing equation parameter\", E_USER_WARNING);\n\n        return;\n    }\n\n    $equation = $params[ 'equation' ];\n\n    // make sure parenthesis are balanced\n    if (substr_count($equation, '(') !== substr_count($equation, ')')) {\n        trigger_error(\"math: unbalanced parenthesis\", E_USER_WARNING);\n\n        return;\n    }\n\n    // disallow backticks\n    if (strpos($equation, '`') !== false) {\n        trigger_error(\"math: backtick character not allowed in equation\", E_USER_WARNING);\n\n        return;\n    }\n\n    // also disallow dollar signs\n    if (strpos($equation, '$') !== false) {\n        trigger_error(\"math: dollar signs not allowed in equation\", E_USER_WARNING);\n\n        return;\n    }\n\n    foreach ($params as $key => $val) {\n        if ($key !== 'equation' && $key !== 'format' && $key !== 'assign') {\n            // make sure value is not empty\n            if (strlen($val) === 0) {\n                trigger_error(\"math: parameter '{$key}' is empty\", E_USER_WARNING);\n\n                return;\n            }\n            if (!is_numeric($val)) {\n                trigger_error(\"math: parameter '{$key}' is not numeric\", E_USER_WARNING);\n\n                return;\n            }\n        }\n    }\n\n    // match all vars in equation, make sure all are passed\n    preg_match_all('!(?:0x[a-fA-F0-9]+)|([a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*)!', $equation, $match);\n\n    foreach ($match[ 1 ] as $curr_var) {\n        if ($curr_var && !isset($params[ $curr_var ]) && !isset($_allowed_funcs[ $curr_var ])) {\n            trigger_error(\"math: function call '{$curr_var}' not allowed, or missing parameter '{$curr_var}'\", E_USER_WARNING);\n\n            return;\n        }\n    }\n\n    foreach ($params as $key => $val) {\n        if ($key !== 'equation' && $key !== 'format' && $key !== 'assign') {\n            $equation = preg_replace(\"/\\b$key\\b/\", \" \\$params['$key'] \", $equation);\n        }\n    }\n    $smarty_math_result = null;\n    eval(\"\\$smarty_math_result = \" . $equation . \";\");\n\n    if (empty($params[ 'format' ])) {\n        if (empty($params[ 'assign' ])) {\n            return $smarty_math_result;\n        } else {\n            $template->assign($params[ 'assign' ], $smarty_math_result);\n        }\n    } else {\n        if (empty($params[ 'assign' ])) {\n            printf($params[ 'format' ], $smarty_math_result);\n        } else {\n            $template->assign($params[ 'assign' ], sprintf($params[ 'format' ], $smarty_math_result));\n        }\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/modifier.capitalize.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifier\n */\n\n/**\n * Smarty capitalize modifier plugin\n * Type:     modifier\n * Name:     capitalize\n * Purpose:  capitalize words in the string\n * {@internal {$string|capitalize:true:true} is the fastest option for MBString enabled systems }}\n *\n * @param string  $string    string to capitalize\n * @param boolean $uc_digits also capitalize \"x123\" to \"X123\"\n * @param boolean $lc_rest   capitalize first letters, lowercase all following letters \"aAa\" to \"Aaa\"\n *\n * @return string capitalized string\n * @author Monte Ohrt <monte at ohrt dot com>\n * @author Rodney Rehm\n */\nfunction smarty_modifier_capitalize($string, $uc_digits = false, $lc_rest = false)\n{\n    if (Smarty::$_MBSTRING) {\n        if ($lc_rest) {\n            // uppercase (including hyphenated words)\n            $upper_string = mb_convert_case($string, MB_CASE_TITLE, Smarty::$_CHARSET);\n        } else {\n            // uppercase word breaks\n            $upper_string = preg_replace_callback(\"!(^|[^\\p{L}'])([\\p{Ll}])!S\" . Smarty::$_UTF8_MODIFIER,\n                                                  'smarty_mod_cap_mbconvert_cb', $string);\n        }\n        // check uc_digits case\n        if (!$uc_digits) {\n            if (preg_match_all(\"!\\b([\\p{L}]*[\\p{N}]+[\\p{L}]*)\\b!\" . Smarty::$_UTF8_MODIFIER, $string, $matches,\n                               PREG_OFFSET_CAPTURE)) {\n                foreach ($matches[ 1 ] as $match) {\n                    $upper_string =\n                        substr_replace($upper_string, mb_strtolower($match[ 0 ], Smarty::$_CHARSET), $match[ 1 ],\n                                       strlen($match[ 0 ]));\n                }\n            }\n        }\n        $upper_string =\n            preg_replace_callback(\"!((^|\\s)['\\\"])(\\w)!\" . Smarty::$_UTF8_MODIFIER, 'smarty_mod_cap_mbconvert2_cb',\n                                  $upper_string);\n        return $upper_string;\n    }\n\n    // lowercase first\n    if ($lc_rest) {\n        $string = strtolower($string);\n    }\n    // uppercase (including hyphenated words)\n    $upper_string =\n        preg_replace_callback(\"!(^|[^\\p{L}'])([\\p{Ll}])!S\" . Smarty::$_UTF8_MODIFIER, 'smarty_mod_cap_ucfirst_cb',\n                              $string);\n    // check uc_digits case\n    if (!$uc_digits) {\n        if (preg_match_all(\"!\\b([\\p{L}]*[\\p{N}]+[\\p{L}]*)\\b!\" . Smarty::$_UTF8_MODIFIER, $string, $matches,\n                           PREG_OFFSET_CAPTURE)) {\n            foreach ($matches[ 1 ] as $match) {\n                $upper_string =\n                    substr_replace($upper_string, strtolower($match[ 0 ]), $match[ 1 ], strlen($match[ 0 ]));\n            }\n        }\n    }\n    $upper_string = preg_replace_callback(\"!((^|\\s)['\\\"])(\\w)!\" . Smarty::$_UTF8_MODIFIER, 'smarty_mod_cap_ucfirst2_cb',\n                                          $upper_string);\n    return $upper_string;\n}\n\n/*\n *\n * Bug: create_function() use exhausts memory when used in long loops\n * Fix: use declared functions for callbacks instead of using create_function()\n * Note: This can be fixed using anonymous functions instead, but that requires PHP >= 5.3\n *\n * @author Kyle Renfrow\n */\n/**\n * @param $matches\n *\n * @return string\n */\nfunction smarty_mod_cap_mbconvert_cb($matches)\n{\n    return stripslashes($matches[ 1 ]) . mb_convert_case(stripslashes($matches[ 2 ]), MB_CASE_UPPER, Smarty::$_CHARSET);\n}\n/**\n * @param $matches\n *\n * @return string\n */\nfunction smarty_mod_cap_mbconvert2_cb($matches)\n{\n    return stripslashes($matches[ 1 ]) . mb_convert_case(stripslashes($matches[ 3 ]), MB_CASE_UPPER, Smarty::$_CHARSET);\n}\n/**\n * @param $matches\n *\n * @return string\n */\nfunction smarty_mod_cap_ucfirst_cb($matches)\n{\n    return stripslashes($matches[ 1 ]) . ucfirst(stripslashes($matches[ 2 ]));\n}\n/**\n * @param $matches\n *\n * @return string\n */\nfunction smarty_mod_cap_ucfirst2_cb($matches)\n{\n    return stripslashes($matches[ 1 ]) . ucfirst(stripslashes($matches[ 3 ]));\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/modifier.date_format.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifier\n */\n\n/**\n * Smarty date_format modifier plugin\n * Type:     modifier\n * Name:     date_format\n * Purpose:  format datestamps via strftime\n * Input:\n *          - string: input date string\n *          - format: strftime format for output\n *          - default_date: default date if $string is empty\n *\n * @link   http://www.smarty.net/manual/en/language.modifier.date.format.php date_format (Smarty online manual)\n * @author Monte Ohrt <monte at ohrt dot com>\n *\n * @param string $string       input date string\n * @param string $format       strftime format for output\n * @param string $default_date default date if $string is empty\n * @param string $formatter    either 'strftime' or 'auto'\n *\n * @return string |void\n * @uses   smarty_make_timestamp()\n */\nfunction smarty_modifier_date_format($string, $format = null, $default_date = '', $formatter = 'auto')\n{\n    if ($format === null) {\n        $format = Smarty::$_DATE_FORMAT;\n    }\n    /**\n     * require_once the {@link shared.make_timestamp.php} plugin\n     */\n    static $is_loaded = false;\n    if (!$is_loaded) {\n        if (!is_callable('smarty_make_timestamp')) {\n            require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php');\n        }\n        $is_loaded = true;\n    }\n    if ($string !== '' && $string !== '0000-00-00' && $string !== '0000-00-00 00:00:00') {\n        $timestamp = smarty_make_timestamp($string);\n    } elseif ($default_date !== '') {\n        $timestamp = smarty_make_timestamp($default_date);\n    } else {\n        return;\n    }\n    if ($formatter === 'strftime' || ($formatter === 'auto' && strpos($format, '%') !== false)) {\n        if (Smarty::$_IS_WINDOWS) {\n            $_win_from = array('%D',\n                               '%h',\n                               '%n',\n                               '%r',\n                               '%R',\n                               '%t',\n                               '%T');\n            $_win_to = array('%m/%d/%y',\n                             '%b',\n                             \"\\n\",\n                             '%I:%M:%S %p',\n                             '%H:%M',\n                             \"\\t\",\n                             '%H:%M:%S');\n            if (strpos($format, '%e') !== false) {\n                $_win_from[] = '%e';\n                $_win_to[] = sprintf('%\\' 2d', date('j', $timestamp));\n            }\n            if (strpos($format, '%l') !== false) {\n                $_win_from[] = '%l';\n                $_win_to[] = sprintf('%\\' 2d', date('h', $timestamp));\n            }\n            $format = str_replace($_win_from, $_win_to, $format);\n        }\n\n        return strftime($format, $timestamp);\n    } else {\n        return date($format, $timestamp);\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/modifier.debug_print_var.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage Debug\n */\n\n/**\n * Smarty debug_print_var modifier plugin\n * Type:     modifier\n * Name:     debug_print_var\n * Purpose:  formats variable contents for display in the console\n *\n * @author Monte Ohrt <monte at ohrt dot com>\n *\n * @param array|object $var     variable to be formatted\n * @param int          $max     maximum recursion depth if $var is an array or object\n * @param int          $length  maximum string length if $var is a string\n * @param int          $depth   actual recursion depth\n * @param array        $objects processed objects in actual depth to prevent recursive object processing\n *\n * @return string\n */\nfunction smarty_modifier_debug_print_var($var, $max = 10, $length = 40, $depth = 0, $objects = array())\n{\n    $_replace = array(\"\\n\" => '\\n', \"\\r\" => '\\r', \"\\t\" => '\\t');\n    switch (gettype($var)) {\n        case 'array' :\n            $results = '<b>Array (' . count($var) . ')</b>';\n            if ($depth === $max) {\n                break;\n            }\n            foreach ($var as $curr_key => $curr_val) {\n                $results .= '<br>' . str_repeat('&nbsp;', $depth * 2) . '<b>' . strtr($curr_key, $_replace) .\n                            '</b> =&gt; ' .\n                            smarty_modifier_debug_print_var($curr_val, $max, $length, ++ $depth, $objects);\n                $depth --;\n            }\n            break;\n\n        case 'object' :\n            $object_vars = get_object_vars($var);\n            $results = '<b>' . get_class($var) . ' Object (' . count($object_vars) . ')</b>';\n            if (in_array($var, $objects)) {\n                $results .= ' called recursive';\n                break;\n            }\n            if ($depth === $max) {\n                break;\n            }\n            $objects[] = $var;\n            foreach ($object_vars as $curr_key => $curr_val) {\n                $results .= '<br>' . str_repeat('&nbsp;', $depth * 2) . '<b> -&gt;' . strtr($curr_key, $_replace) .\n                            '</b> = ' . smarty_modifier_debug_print_var($curr_val, $max, $length, ++ $depth, $objects);\n                $depth --;\n            }\n            break;\n\n        case 'boolean' :\n        case 'NULL' :\n        case 'resource' :\n            if (true === $var) {\n                $results = 'true';\n            } elseif (false === $var) {\n                $results = 'false';\n            } elseif (null === $var) {\n                $results = 'null';\n            } else {\n                $results = htmlspecialchars((string) $var);\n            }\n            $results = '<i>' . $results . '</i>';\n            break;\n\n        case 'integer' :\n        case 'float' :\n            $results = htmlspecialchars((string) $var);\n            break;\n\n        case 'string' :\n            $results = strtr($var, $_replace);\n            if (Smarty::$_MBSTRING) {\n                if (mb_strlen($var, Smarty::$_CHARSET) > $length) {\n                    $results = mb_substr($var, 0, $length - 3, Smarty::$_CHARSET) . '...';\n                }\n            } else {\n                if (isset($var[ $length ])) {\n                    $results = substr($var, 0, $length - 3) . '...';\n                }\n            }\n\n            $results = htmlspecialchars('\"' . $results . '\"', ENT_QUOTES, Smarty::$_CHARSET);\n            break;\n\n        case 'unknown type' :\n        default :\n            $results = strtr((string) $var, $_replace);\n            if (Smarty::$_MBSTRING) {\n                if (mb_strlen($results, Smarty::$_CHARSET) > $length) {\n                    $results = mb_substr($results, 0, $length - 3, Smarty::$_CHARSET) . '...';\n                }\n            } else {\n                if (strlen($results) > $length) {\n                    $results = substr($results, 0, $length - 3) . '...';\n                }\n            }\n\n            $results = htmlspecialchars($results, ENT_QUOTES, Smarty::$_CHARSET);\n    }\n\n    return $results;\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/modifier.escape.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifier\n */\n\n/**\n * Smarty escape modifier plugin\n * Type:     modifier\n * Name:     escape\n * Purpose:  escape string for output\n *\n * @link   http://www.smarty.net/docs/en/language.modifier.escape\n * @author Monte Ohrt <monte at ohrt dot com>\n *\n * @param string  $string        input string\n * @param string  $esc_type      escape type\n * @param string  $char_set      character set, used for htmlspecialchars() or htmlentities()\n * @param boolean $double_encode encode already encoded entitites again, used for htmlspecialchars() or htmlentities()\n *\n * @return string escaped input string\n */\nfunction smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $double_encode = true)\n{\n    static $_double_encode = null;\n    static $is_loaded1 = false;\n    if ($_double_encode === null) {\n        $_double_encode = version_compare(PHP_VERSION, '5.2.3', '>=');\n    }\n\n    if (!$char_set) {\n        $char_set = Smarty::$_CHARSET;\n    }\n\n    switch ($esc_type) {\n        case 'html':\n            if ($_double_encode) {\n                // php >=5.3.2 - go native\n                return htmlspecialchars($string, ENT_QUOTES, $char_set, $double_encode);\n            } else {\n                if ($double_encode) {\n                    // php <5.2.3 - only handle double encoding\n                    return htmlspecialchars($string, ENT_QUOTES, $char_set);\n                } else {\n                    // php <5.2.3 - prevent double encoding\n                    $string = preg_replace('!&(#?\\w+);!', '%%%SMARTY_START%%%\\\\1%%%SMARTY_END%%%', $string);\n                    $string = htmlspecialchars($string, ENT_QUOTES, $char_set);\n                    $string = str_replace(array('%%%SMARTY_START%%%',\n                                                '%%%SMARTY_END%%%'), array('&',\n                                                                           ';'), $string);\n\n                    return $string;\n                }\n            }\n\n        case 'htmlall':\n            if (Smarty::$_MBSTRING) {\n                // mb_convert_encoding ignores htmlspecialchars()\n                if ($_double_encode) {\n                    // php >=5.3.2 - go native\n                    $string = htmlspecialchars($string, ENT_QUOTES, $char_set, $double_encode);\n                } else {\n                    if ($double_encode) {\n                        // php <5.2.3 - only handle double encoding\n                        $string = htmlspecialchars($string, ENT_QUOTES, $char_set);\n                    } else {\n                        // php <5.2.3 - prevent double encoding\n                        $string = preg_replace('!&(#?\\w+);!', '%%%SMARTY_START%%%\\\\1%%%SMARTY_END%%%', $string);\n                        $string = htmlspecialchars($string, ENT_QUOTES, $char_set);\n                        $string =\n                            str_replace(array('%%%SMARTY_START%%%',\n                                              '%%%SMARTY_END%%%'), array('&',\n                                                                         ';'), $string);\n\n                        return $string;\n                    }\n                }\n\n                // htmlentities() won't convert everything, so use mb_convert_encoding\n                return mb_convert_encoding($string, 'HTML-ENTITIES', $char_set);\n            }\n\n            // no MBString fallback\n            if ($_double_encode) {\n                return htmlentities($string, ENT_QUOTES, $char_set, $double_encode);\n            } else {\n                if ($double_encode) {\n                    return htmlentities($string, ENT_QUOTES, $char_set);\n                } else {\n                    $string = preg_replace('!&(#?\\w+);!', '%%%SMARTY_START%%%\\\\1%%%SMARTY_END%%%', $string);\n                    $string = htmlentities($string, ENT_QUOTES, $char_set);\n                    $string = str_replace(array('%%%SMARTY_START%%%',\n                                                '%%%SMARTY_END%%%'), array('&',\n                                                                           ';'), $string);\n\n                    return $string;\n                }\n            }\n\n        case 'url':\n            return rawurlencode($string);\n\n        case 'urlpathinfo':\n            return str_replace('%2F', '/', rawurlencode($string));\n\n        case 'quotes':\n            // escape unescaped single quotes\n            return preg_replace(\"%(?<!\\\\\\\\)'%\", \"\\\\'\", $string);\n\n        case 'hex':\n            // escape every byte into hex\n            // Note that the UTF-8 encoded character ä will be represented as %c3%a4\n            $return = '';\n            $_length = strlen($string);\n            for ($x = 0; $x < $_length; $x ++) {\n                $return .= '%' . bin2hex($string[ $x ]);\n            }\n\n            return $return;\n\n        case 'hexentity':\n            $return = '';\n            if (Smarty::$_MBSTRING) {\n                if (!$is_loaded1) {\n                    if (!is_callable('smarty_mb_to_unicode')) {\n                        require_once(SMARTY_PLUGINS_DIR . 'shared.mb_unicode.php');\n                        $is_loaded1 = true;\n                    }\n                }\n                $return = '';\n                foreach (smarty_mb_to_unicode($string, Smarty::$_CHARSET) as $unicode) {\n                    $return .= '&#x' . strtoupper(dechex($unicode)) . ';';\n                }\n\n                return $return;\n            }\n            // no MBString fallback\n            $_length = strlen($string);\n            for ($x = 0; $x < $_length; $x ++) {\n                $return .= '&#x' . bin2hex($string[ $x ]) . ';';\n            }\n\n            return $return;\n\n        case 'decentity':\n            $return = '';\n            if (Smarty::$_MBSTRING) {\n                if (!$is_loaded1) {\n                    if (!is_callable('smarty_mb_to_unicode')) {\n                        require_once(SMARTY_PLUGINS_DIR . 'shared.mb_unicode.php');\n                    }\n                    $is_loaded1 = true;\n                }\n                $return = '';\n                foreach (smarty_mb_to_unicode($string, Smarty::$_CHARSET) as $unicode) {\n                    $return .= '&#' . $unicode . ';';\n                }\n\n                return $return;\n            }\n            // no MBString fallback\n            $_length = strlen($string);\n            for ($x = 0; $x < $_length; $x ++) {\n                $return .= '&#' . ord($string[ $x ]) . ';';\n            }\n\n            return $return;\n\n        case 'javascript':\n            // escape quotes and backslashes, newlines, etc.\n            return strtr($string, array('\\\\' => '\\\\\\\\',\n                                        \"'\" => \"\\\\'\",\n                                        '\"' => '\\\\\"',\n                                        \"\\r\" => '\\\\r',\n                                        \"\\n\" => '\\\\n',\n                                        '</' => '<\\/'));\n\n        case 'mail':\n            if (Smarty::$_MBSTRING) {\n                if (!is_callable('smarty_mb_str_replace')) {\n                    require_once(SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php');\n                }\n                return smarty_mb_str_replace(array('@',\n                                                   '.'), array(' [AT] ',\n                                                               ' [DOT] '), $string);\n            }\n            // no MBString fallback\n            return str_replace(array('@',\n                                     '.'), array(' [AT] ',\n                                                 ' [DOT] '), $string);\n\n        case 'nonstd':\n            // escape non-standard chars, such as ms document quotes\n            $return = '';\n            if (Smarty::$_MBSTRING) {\n                if (!$is_loaded1) {\n                    if (!is_callable('smarty_mb_to_unicode')) {\n                        require_once(SMARTY_PLUGINS_DIR . 'shared.mb_unicode.php');\n                    }\n                    $is_loaded1 = true;\n                }\n                foreach (smarty_mb_to_unicode($string, Smarty::$_CHARSET) as $unicode) {\n                    if ($unicode >= 126) {\n                        $return .= '&#' . $unicode . ';';\n                    } else {\n                        $return .= chr($unicode);\n                    }\n                }\n\n                return $return;\n            }\n\n            $_length = strlen($string);\n            for ($_i = 0; $_i < $_length; $_i ++) {\n                $_ord = ord(substr($string, $_i, 1));\n                // non-standard char, escape it\n                if ($_ord >= 126) {\n                    $return .= '&#' . $_ord . ';';\n                } else {\n                    $return .= substr($string, $_i, 1);\n                }\n            }\n\n            return $return;\n\n        default:\n            return $string;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/modifier.mb_wordwrap.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifier\n */\n/**\n * Smarty wordwrap modifier plugin\n * Type:     modifier\n * Name:     mb_wordwrap\n * Purpose:  Wrap a string to a given number of characters\n *\n\n * @link   http://php.net/manual/en/function.wordwrap.php for similarity\n *\n * @param  string  $str   the string to wrap\n * @param  int     $width the width of the output\n * @param  string  $break the character used to break the line\n * @param  boolean $cut   ignored parameter, just for the sake of\n *\n * @return string  wrapped string\n * @author Rodney Rehm\n */\nfunction smarty_modifier_mb_wordwrap($str, $width = 75, $break = \"\\n\", $cut = false)\n{\n    // break words into tokens using white space as a delimiter\n    $tokens = preg_split('!(\\s)!S' . Smarty::$_UTF8_MODIFIER, $str, -1, PREG_SPLIT_NO_EMPTY + PREG_SPLIT_DELIM_CAPTURE);\n    $length = 0;\n    $t = '';\n    $_previous = false;\n    $_space = false;\n\n    foreach ($tokens as $_token) {\n        $token_length = mb_strlen($_token, Smarty::$_CHARSET);\n        $_tokens = array($_token);\n        if ($token_length > $width) {\n            if ($cut) {\n                $_tokens = preg_split('!(.{' . $width . '})!S' . Smarty::$_UTF8_MODIFIER,\n                                      $_token,\n                                      -1,\n                                      PREG_SPLIT_NO_EMPTY + PREG_SPLIT_DELIM_CAPTURE);\n            }\n        }\n\n        foreach ($_tokens as $token) {\n            $_space = !!preg_match('!^\\s$!S' . Smarty::$_UTF8_MODIFIER, $token);\n            $token_length = mb_strlen($token, Smarty::$_CHARSET);\n            $length += $token_length;\n\n            if ($length > $width) {\n                // remove space before inserted break\n                if ($_previous) {\n                    $t = mb_substr($t, 0, -1, Smarty::$_CHARSET);\n                }\n\n                if (!$_space) {\n                    // add the break before the token\n                    if (!empty($t)) {\n                        $t .= $break;\n                    }\n                    $length = $token_length;\n                }\n            } else if ($token === \"\\n\") {\n                // hard break must reset counters\n                $length = 0;\n            }\n            $_previous = $_space;\n            // add the token\n            $t .= $token;\n        }\n    }\n\n    return $t;\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/modifier.regex_replace.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifier\n */\n\n/**\n * Smarty regex_replace modifier plugin\n * Type:     modifier\n * Name:     regex_replace\n * Purpose:  regular expression search/replace\n *\n * @link    http://smarty.php.net/manual/en/language.modifier.regex.replace.php\n *          regex_replace (Smarty online manual)\n * @author  Monte Ohrt <monte at ohrt dot com>\n *\n * @param string       $string  input string\n * @param string|array $search  regular expression(s) to search for\n * @param string|array $replace string(s) that should be replaced\n * @param int          $limit   the maximum number of replacements\n *\n * @return string\n */\nfunction smarty_modifier_regex_replace($string, $search, $replace, $limit = - 1)\n{\n    if (is_array($search)) {\n        foreach ($search as $idx => $s) {\n            $search[ $idx ] = _smarty_regex_replace_check($s);\n        }\n    } else {\n        $search = _smarty_regex_replace_check($search);\n    }\n\n    return preg_replace($search, $replace, $string, $limit);\n}\n\n/**\n * @param  string $search string(s) that should be replaced\n *\n * @return string\n * @ignore\n */\nfunction _smarty_regex_replace_check($search)\n{\n    // null-byte injection detection\n    // anything behind the first null-byte is ignored\n    if (($pos = strpos($search, \"\\0\")) !== false) {\n        $search = substr($search, 0, $pos);\n    }\n    // remove eval-modifier from $search\n    if (preg_match('!([a-zA-Z\\s]+)$!s', $search, $match) && (strpos($match[ 1 ], 'e') !== false)) {\n        $search = substr($search, 0, - strlen($match[ 1 ])) . preg_replace('![e\\s]+!', '', $match[ 1 ]);\n    }\n\n    return $search;\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/modifier.replace.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifier\n */\n\n/**\n * Smarty replace modifier plugin\n * Type:     modifier\n * Name:     replace\n * Purpose:  simple search/replace\n *\n * @link   http://smarty.php.net/manual/en/language.modifier.replace.php replace (Smarty online manual)\n * @author Monte Ohrt <monte at ohrt dot com>\n * @author Uwe Tews\n *\n * @param string $string  input string\n * @param string $search  text to search for\n * @param string $replace replacement text\n *\n * @return string\n */\nfunction smarty_modifier_replace($string, $search, $replace)\n{\n    static $is_loaded = false;\n    if (Smarty::$_MBSTRING) {\n        if (!$is_loaded) {\n            if (!is_callable('smarty_mb_str_replace')) {\n                require_once(SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php');\n            }\n            $is_loaded = true;\n        }\n         return smarty_mb_str_replace($search, $replace, $string);\n    }\n\n    return str_replace($search, $replace, $string);\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/modifier.spacify.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifier\n */\n\n/**\n * Smarty spacify modifier plugin\n * Type:     modifier\n * Name:     spacify\n * Purpose:  add spaces between characters in a string\n *\n * @link   http://smarty.php.net/manual/en/language.modifier.spacify.php spacify (Smarty online manual)\n * @author Monte Ohrt <monte at ohrt dot com>\n *\n * @param string $string       input string\n * @param string $spacify_char string to insert between characters.\n *\n * @return string\n */\nfunction smarty_modifier_spacify($string, $spacify_char = ' ')\n{\n    // well… what about charsets besides latin and UTF-8?\n    return implode($spacify_char, preg_split('//' . Smarty::$_UTF8_MODIFIER, $string, - 1, PREG_SPLIT_NO_EMPTY));\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/modifier.truncate.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifier\n */\n\n/**\n * Smarty truncate modifier plugin\n * Type:     modifier\n * Name:     truncate\n * Purpose:  Truncate a string to a certain length if necessary,\n *               optionally splitting in the middle of a word, and\n *               appending the $etc string or inserting $etc into the middle.\n *\n * @link   http://smarty.php.net/manual/en/language.modifier.truncate.php truncate (Smarty online manual)\n * @author Monte Ohrt <monte at ohrt dot com>\n *\n * @param string  $string      input string\n * @param integer $length      length of truncated text\n * @param string  $etc         end string\n * @param boolean $break_words truncate at word boundary\n * @param boolean $middle      truncate in the middle of text\n *\n * @return string truncated string\n */\nfunction smarty_modifier_truncate($string, $length = 80, $etc = '...', $break_words = false, $middle = false)\n{\n    if ($length === 0) {\n        return '';\n    }\n\n    if (Smarty::$_MBSTRING) {\n        if (mb_strlen($string, Smarty::$_CHARSET) > $length) {\n            $length -= min($length, mb_strlen($etc, Smarty::$_CHARSET));\n            if (!$break_words && !$middle) {\n                $string = preg_replace('/\\s+?(\\S+)?$/' . Smarty::$_UTF8_MODIFIER, '',\n                                       mb_substr($string, 0, $length + 1, Smarty::$_CHARSET));\n            }\n            if (!$middle) {\n                return mb_substr($string, 0, $length, Smarty::$_CHARSET) . $etc;\n            }\n\n            return mb_substr($string, 0, $length / 2, Smarty::$_CHARSET) . $etc .\n                   mb_substr($string, - $length / 2, $length, Smarty::$_CHARSET);\n        }\n\n        return $string;\n    }\n\n    // no MBString fallback\n    if (isset($string[ $length ])) {\n        $length -= min($length, strlen($etc));\n        if (!$break_words && !$middle) {\n            $string = preg_replace('/\\s+?(\\S+)?$/', '', substr($string, 0, $length + 1));\n        }\n        if (!$middle) {\n            return substr($string, 0, $length) . $etc;\n        }\n\n        return substr($string, 0, $length / 2) . $etc . substr($string, - $length / 2);\n    }\n\n    return $string;\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/modifiercompiler.cat.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty cat modifier plugin\n * Type:     modifier\n * Name:     cat\n * Date:     Feb 24, 2003\n * Purpose:  catenate a value to a variable\n * Input:    string to catenate\n * Example:  {$var|cat:\"foo\"}\n *\n * @link     http://smarty.php.net/manual/en/language.modifier.cat.php cat\n *           (Smarty online manual)\n * @author   Uwe Tews\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\nfunction smarty_modifiercompiler_cat($params)\n{\n    return '(' . implode(').(', $params) . ')';\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/modifiercompiler.count_characters.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty count_characters modifier plugin\n * Type:     modifier\n * Name:     count_characters\n * Purpose:  count the number of characters in a text\n *\n * @link   http://www.smarty.net/manual/en/language.modifier.count.characters.php count_characters (Smarty online manual)\n * @author Uwe Tews\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\nfunction smarty_modifiercompiler_count_characters($params)\n{\n    if (!isset($params[ 1 ]) || $params[ 1 ] !== 'true') {\n        return 'preg_match_all(\\'/[^\\s]/' . Smarty::$_UTF8_MODIFIER . '\\',' . $params[ 0 ] . ', $tmp)';\n    }\n    if (Smarty::$_MBSTRING) {\n        return 'mb_strlen(' . $params[ 0 ] . ', \\'' . addslashes(Smarty::$_CHARSET) . '\\')';\n    }\n    // no MBString fallback\n    return 'strlen(' . $params[ 0 ] . ')';\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/modifiercompiler.count_paragraphs.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty count_paragraphs modifier plugin\n * Type:     modifier\n * Name:     count_paragraphs\n * Purpose:  count the number of paragraphs in a text\n *\n * @link    http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php\n *          count_paragraphs (Smarty online manual)\n * @author  Uwe Tews\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\nfunction smarty_modifiercompiler_count_paragraphs($params)\n{\n    // count \\r or \\n characters\n    return '(preg_match_all(\\'#[\\r\\n]+#\\', ' . $params[ 0 ] . ', $tmp)+1)';\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/modifiercompiler.count_sentences.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty count_sentences modifier plugin\n * Type:     modifier\n * Name:     count_sentences\n * Purpose:  count the number of sentences in a text\n *\n * @link    http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php\n *          count_sentences (Smarty online manual)\n * @author  Uwe Tews\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\nfunction smarty_modifiercompiler_count_sentences($params)\n{\n    // find periods, question marks, exclamation marks with a word before but not after.\n    return 'preg_match_all(\"#\\w[\\.\\?\\!](\\W|$)#S' . Smarty::$_UTF8_MODIFIER . '\", ' . $params[ 0 ] . ', $tmp)';\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/modifiercompiler.count_words.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty count_words modifier plugin\n * Type:     modifier\n * Name:     count_words\n * Purpose:  count the number of words in a text\n *\n * @link   http://www.smarty.net/manual/en/language.modifier.count.words.php count_words (Smarty online manual)\n * @author Uwe Tews\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\nfunction smarty_modifiercompiler_count_words($params)\n{\n    if (Smarty::$_MBSTRING) {\n        // return 'preg_match_all(\\'#[\\w\\pL]+#' . Smarty::$_UTF8_MODIFIER . '\\', ' . $params[0] . ', $tmp)';\n        // expression taken from http://de.php.net/manual/en/function.str-word-count.php#85592\n        return 'preg_match_all(\\'/\\p{L}[\\p{L}\\p{Mn}\\p{Pd}\\\\\\'\\x{2019}]*/' . Smarty::$_UTF8_MODIFIER . '\\', ' .\n               $params[ 0 ] . ', $tmp)';\n    }\n    // no MBString fallback\n    return 'str_word_count(' . $params[ 0 ] . ')';\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/modifiercompiler.default.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty default modifier plugin\n * Type:     modifier\n * Name:     default\n * Purpose:  designate default value for empty variables\n *\n * @link   http://www.smarty.net/manual/en/language.modifier.default.php default (Smarty online manual)\n * @author Uwe Tews\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\nfunction smarty_modifiercompiler_default($params)\n{\n    $output = $params[ 0 ];\n    if (!isset($params[ 1 ])) {\n        $params[ 1 ] = \"''\";\n    }\n\n    array_shift($params);\n    foreach ($params as $param) {\n        $output = '(($tmp = @' . $output . ')===null||$tmp===\\'\\' ? ' . $param . ' : $tmp)';\n    }\n\n    return $output;\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/modifiercompiler.escape.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty escape modifier plugin\n * Type:     modifier\n * Name:     escape\n * Purpose:  escape string for output\n *\n * @link   http://www.smarty.net/docsv2/en/language.modifier.escape count_characters (Smarty online manual)\n * @author Rodney Rehm\n *\n * @param array $params parameters\n * @param       $compiler\n *\n * @return string with compiled code\n */\nfunction smarty_modifiercompiler_escape($params, $compiler)\n{\n    static $_double_encode = null;\n    static $is_loaded = false;\n    if (!$is_loaded) {\n        if (!is_callable('smarty_literal_compiler_param')) {\n            require_once(SMARTY_PLUGINS_DIR . 'shared.literal_compiler_param.php');\n        }\n        $is_loaded = true;\n    }\n    if ($_double_encode === null) {\n        $_double_encode = version_compare(PHP_VERSION, '5.2.3', '>=');\n    }\n\n    try {\n        $esc_type = smarty_literal_compiler_param($params, 1, 'html');\n        $char_set = smarty_literal_compiler_param($params, 2, Smarty::$_CHARSET);\n        $double_encode = smarty_literal_compiler_param($params, 3, true);\n\n        if (!$char_set) {\n            $char_set = Smarty::$_CHARSET;\n        }\n\n        switch ($esc_type) {\n            case 'html':\n                if ($_double_encode) {\n                    return 'htmlspecialchars(' . $params[ 0 ] . ', ENT_QUOTES, ' . var_export($char_set, true) . ', ' .\n                           var_export($double_encode, true) . ')';\n                } elseif ($double_encode) {\n                    return 'htmlspecialchars(' . $params[ 0 ] . ', ENT_QUOTES, ' . var_export($char_set, true) . ')';\n                } else {\n                    // fall back to modifier.escape.php\n                }\n\n            case 'htmlall':\n                if (Smarty::$_MBSTRING) {\n                    if ($_double_encode) {\n                        // php >=5.2.3 - go native\n                        return 'mb_convert_encoding(htmlspecialchars(' . $params[ 0 ] . ', ENT_QUOTES, ' .\n                               var_export($char_set, true) . ', ' . var_export($double_encode, true) .\n                               '), \"HTML-ENTITIES\", ' . var_export($char_set, true) . ')';\n                    } elseif ($double_encode) {\n                        // php <5.2.3 - only handle double encoding\n                        return 'mb_convert_encoding(htmlspecialchars(' . $params[ 0 ] . ', ENT_QUOTES, ' .\n                               var_export($char_set, true) . '), \"HTML-ENTITIES\", ' . var_export($char_set, true) . ')';\n                    } else {\n                        // fall back to modifier.escape.php\n                    }\n                }\n\n                // no MBString fallback\n                if ($_double_encode) {\n                    // php >=5.2.3 - go native\n                    return 'htmlentities(' . $params[ 0 ] . ', ENT_QUOTES, ' . var_export($char_set, true) . ', ' .\n                           var_export($double_encode, true) . ')';\n                } elseif ($double_encode) {\n                    // php <5.2.3 - only handle double encoding\n                    return 'htmlentities(' . $params[ 0 ] . ', ENT_QUOTES, ' . var_export($char_set, true) . ')';\n                } else {\n                    // fall back to modifier.escape.php\n                }\n\n            case 'url':\n                return 'rawurlencode(' . $params[ 0 ] . ')';\n\n            case 'urlpathinfo':\n                return 'str_replace(\"%2F\", \"/\", rawurlencode(' . $params[ 0 ] . '))';\n\n            case 'quotes':\n                // escape unescaped single quotes\n                return 'preg_replace(\"%(?<!\\\\\\\\\\\\\\\\)\\'%\", \"\\\\\\'\",' . $params[ 0 ] . ')';\n\n            case 'javascript':\n                // escape quotes and backslashes, newlines, etc.\n                return 'strtr(' . $params[ 0 ] .\n                       ', array(\"\\\\\\\\\" => \"\\\\\\\\\\\\\\\\\", \"\\'\" => \"\\\\\\\\\\'\", \"\\\"\" => \"\\\\\\\\\\\"\", \"\\\\r\" => \"\\\\\\\\r\", \"\\\\n\" => \"\\\\\\n\", \"</\" => \"<\\/\" ))';\n        }\n    }\n    catch (SmartyException $e) {\n        // pass through to regular plugin fallback\n    }\n\n    // could not optimize |escape call, so fallback to regular plugin\n    if ($compiler->template->caching && ($compiler->tag_nocache | $compiler->nocache)) {\n        $compiler->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ 'escape' ][ 'modifier' ][ 'file' ] =\n            SMARTY_PLUGINS_DIR . 'modifier.escape.php';\n        $compiler->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ 'escape' ][ 'modifier' ][ 'function' ] =\n            'smarty_modifier_escape';\n    } else {\n        $compiler->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ 'escape' ][ 'modifier' ][ 'file' ] =\n            SMARTY_PLUGINS_DIR . 'modifier.escape.php';\n        $compiler->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ 'escape' ][ 'modifier' ][ 'function' ] =\n            'smarty_modifier_escape';\n    }\n\n    return 'smarty_modifier_escape(' . join(', ', $params) . ')';\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/modifiercompiler.from_charset.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty from_charset modifier plugin\n * Type:     modifier\n * Name:     from_charset\n * Purpose:  convert character encoding from $charset to internal encoding\n *\n * @author Rodney Rehm\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\nfunction smarty_modifiercompiler_from_charset($params)\n{\n    if (!Smarty::$_MBSTRING) {\n        // FIXME: (rodneyrehm) shouldn't this throw an error?\n        return $params[ 0 ];\n    }\n\n    if (!isset($params[ 1 ])) {\n        $params[ 1 ] = '\"ISO-8859-1\"';\n    }\n\n    return 'mb_convert_encoding(' . $params[ 0 ] . ', \"' . addslashes(Smarty::$_CHARSET) . '\", ' . $params[ 1 ] . ')';\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/modifiercompiler.indent.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty indent modifier plugin\n * Type:     modifier\n * Name:     indent\n * Purpose:  indent lines of text\n *\n * @link   http://www.smarty.net/manual/en/language.modifier.indent.php indent (Smarty online manual)\n * @author Uwe Tews\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\n\nfunction smarty_modifiercompiler_indent($params)\n{\n    if (!isset($params[ 1 ])) {\n        $params[ 1 ] = 4;\n    }\n    if (!isset($params[ 2 ])) {\n        $params[ 2 ] = \"' '\";\n    }\n\n    return 'preg_replace(\\'!^!m\\',str_repeat(' . $params[ 2 ] . ',' . $params[ 1 ] . '),' . $params[ 0 ] . ')';\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/modifiercompiler.lower.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty lower modifier plugin\n * Type:     modifier\n * Name:     lower\n * Purpose:  convert string to lowercase\n *\n * @link   http://www.smarty.net/manual/en/language.modifier.lower.php lower (Smarty online manual)\n * @author Monte Ohrt <monte at ohrt dot com>\n * @author Uwe Tews\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\n\nfunction smarty_modifiercompiler_lower($params)\n{\n    if (Smarty::$_MBSTRING) {\n        return 'mb_strtolower(' . $params[ 0 ] . ', \\'' . addslashes(Smarty::$_CHARSET) . '\\')';\n    }\n    // no MBString fallback\n    return 'strtolower(' . $params[ 0 ] . ')';\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/modifiercompiler.noprint.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty noprint modifier plugin\n * Type:     modifier\n * Name:     noprint\n * Purpose:  return an empty string\n *\n * @author   Uwe Tews\n * @return string with compiled code\n */\nfunction smarty_modifiercompiler_noprint()\n{\n    return \"''\";\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/modifiercompiler.string_format.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty string_format modifier plugin\n * Type:     modifier\n * Name:     string_format\n * Purpose:  format strings via sprintf\n *\n * @link   http://www.smarty.net/manual/en/language.modifier.string.format.php string_format (Smarty online manual)\n * @author Uwe Tews\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\nfunction smarty_modifiercompiler_string_format($params)\n{\n    return 'sprintf(' . $params[ 1 ] . ',' . $params[ 0 ] . ')';\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/modifiercompiler.strip.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty strip modifier plugin\n * Type:     modifier\n * Name:     strip\n * Purpose:  Replace all repeated spaces, newlines, tabs\n *              with a single space or supplied replacement string.\n * Example:  {$var|strip} {$var|strip:\"&nbsp;\"}\n * Date:     September 25th, 2002\n *\n * @link   http://www.smarty.net/manual/en/language.modifier.strip.php strip (Smarty online manual)\n * @author Uwe Tews\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\n\nfunction smarty_modifiercompiler_strip($params)\n{\n    if (!isset($params[ 1 ])) {\n        $params[ 1 ] = \"' '\";\n    }\n\n    return \"preg_replace('!\\s+!\" . Smarty::$_UTF8_MODIFIER . \"', {$params[1]},{$params[0]})\";\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/modifiercompiler.strip_tags.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty strip_tags modifier plugin\n * Type:     modifier\n * Name:     strip_tags\n * Purpose:  strip html tags from text\n *\n * @link   http://www.smarty.net/docs/en/language.modifier.strip.tags.tpl strip_tags (Smarty online manual)\n * @author Uwe Tews\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\nfunction smarty_modifiercompiler_strip_tags($params)\n{\n    if (!isset($params[ 1 ]) || $params[ 1 ] === true || trim($params[ 1 ], '\"') === 'true') {\n        return \"preg_replace('!<[^>]*?>!', ' ', {$params[0]})\";\n    } else {\n        return 'strip_tags(' . $params[ 0 ] . ')';\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/modifiercompiler.to_charset.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty to_charset modifier plugin\n * Type:     modifier\n * Name:     to_charset\n * Purpose:  convert character encoding from internal encoding to $charset\n *\n * @author Rodney Rehm\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\nfunction smarty_modifiercompiler_to_charset($params)\n{\n    if (!Smarty::$_MBSTRING) {\n        // FIXME: (rodneyrehm) shouldn't this throw an error?\n        return $params[ 0 ];\n    }\n\n    if (!isset($params[ 1 ])) {\n        $params[ 1 ] = '\"ISO-8859-1\"';\n    }\n\n    return 'mb_convert_encoding(' . $params[ 0 ] . ', ' . $params[ 1 ] . ', \"' . addslashes(Smarty::$_CHARSET) . '\")';\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/modifiercompiler.unescape.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty unescape modifier plugin\n * Type:     modifier\n * Name:     unescape\n * Purpose:  unescape html entities\n *\n * @author Rodney Rehm\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\nfunction smarty_modifiercompiler_unescape($params)\n{\n    if (!isset($params[ 1 ])) {\n        $params[ 1 ] = 'html';\n    }\n    if (!isset($params[ 2 ])) {\n        $params[ 2 ] = '\\'' . addslashes(Smarty::$_CHARSET) . '\\'';\n    } else {\n        $params[ 2 ] = \"'{$params[ 2 ]}'\";\n    }\n\n    switch (trim($params[ 1 ], '\"\\'')) {\n        case 'entity':\n        case 'htmlall':\n            if (Smarty::$_MBSTRING) {\n                return 'mb_convert_encoding(' . $params[ 0 ] . ', ' . $params[ 2 ] . ', \\'HTML-ENTITIES\\')';\n            }\n\n            return 'html_entity_decode(' . $params[ 0 ] . ', ENT_NOQUOTES, ' . $params[ 2 ] . ')';\n\n        case 'html':\n            return 'htmlspecialchars_decode(' . $params[ 0 ] . ', ENT_QUOTES)';\n\n        case 'url':\n            return 'rawurldecode(' . $params[ 0 ] . ')';\n\n        default:\n            return $params[ 0 ];\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/modifiercompiler.upper.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty upper modifier plugin\n * Type:     modifier\n * Name:     lower\n * Purpose:  convert string to uppercase\n *\n * @link   http://smarty.php.net/manual/en/language.modifier.upper.php lower (Smarty online manual)\n * @author Uwe Tews\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\nfunction smarty_modifiercompiler_upper($params)\n{\n    if (Smarty::$_MBSTRING) {\n        return 'mb_strtoupper(' . $params[ 0 ] . ', \\'' . addslashes(Smarty::$_CHARSET) . '\\')';\n    }\n    // no MBString fallback\n    return 'strtoupper(' . $params[ 0 ] . ')';\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/modifiercompiler.wordwrap.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n/**\n * Smarty wordwrap modifier plugin\n * Type:     modifier\n * Name:     wordwrap\n * Purpose:  wrap a string of text at a given length\n *\n * @link   http://smarty.php.net/manual/en/language.modifier.wordwrap.php wordwrap (Smarty online manual)\n * @author Uwe Tews\n *\n * @param array                                 $params parameters\n * @param \\Smarty_Internal_TemplateCompilerBase $compiler\n *\n * @return string with compiled code\n * @throws \\SmartyException\n */\nfunction smarty_modifiercompiler_wordwrap($params, Smarty_Internal_TemplateCompilerBase $compiler)\n{\n    if (!isset($params[ 1 ])) {\n        $params[ 1 ] = 80;\n    }\n    if (!isset($params[ 2 ])) {\n        $params[ 2 ] = '\"\\n\"';\n    }\n    if (!isset($params[ 3 ])) {\n        $params[ 3 ] = 'false';\n    }\n    $function = 'wordwrap';\n    if (Smarty::$_MBSTRING) {\n        $function = $compiler->getPlugin('mb_wordwrap','modifier');\n    }\n    return $function . '(' . $params[ 0 ] . ',' . $params[ 1 ] . ',' . $params[ 2 ] . ',' . $params[ 3 ] . ')';\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/outputfilter.trimwhitespace.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsFilter\n */\n\n/**\n * Smarty trimwhitespace outputfilter plugin\n * Trim unnecessary whitespace from HTML markup.\n *\n * @author   Rodney Rehm\n *\n * @param string $source input string\n *\n * @return string filtered output\n * @todo     substr_replace() is not overloaded by mbstring.func_overload - so this function might fail!\n */\nfunction smarty_outputfilter_trimwhitespace($source)\n{\n    $store = array();\n    $_store = 0;\n    $_offset = 0;\n\n    // Unify Line-Breaks to \\n\n    $source = preg_replace('/\\015\\012|\\015|\\012/', \"\\n\", $source);\n\n    // capture Internet Explorer and KnockoutJS Conditional Comments\n    if (preg_match_all('#<!--((\\[[^\\]]+\\]>.*?<!\\[[^\\]]+\\])|(\\s*/?ko\\s+.+))-->#is', $source, $matches,\n                       PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) {\n        foreach ($matches as $match) {\n            $store[] = $match[ 0 ][ 0 ];\n            $_length = strlen($match[ 0 ][ 0 ]);\n            $replace = '@!@SMARTY:' . $_store . ':SMARTY@!@';\n            $source = substr_replace($source, $replace, $match[ 0 ][ 1 ] - $_offset, $_length);\n\n            $_offset += $_length - strlen($replace);\n            $_store ++;\n        }\n    }\n\n    // Strip all HTML-Comments\n    // yes, even the ones in <script> - see http://stackoverflow.com/a/808850/515124\n    $source = preg_replace('#<!--.*?-->#ms', '', $source);\n\n    // capture html elements not to be messed with\n    $_offset = 0;\n    if (preg_match_all('#(<script[^>]*>.*?</script[^>]*>)|(<textarea[^>]*>.*?</textarea[^>]*>)|(<pre[^>]*>.*?</pre[^>]*>)#is',\n                       $source, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) {\n        foreach ($matches as $match) {\n            $store[] = $match[ 0 ][ 0 ];\n            $_length = strlen($match[ 0 ][ 0 ]);\n            $replace = '@!@SMARTY:' . $_store . ':SMARTY@!@';\n            $source = substr_replace($source, $replace, $match[ 0 ][ 1 ] - $_offset, $_length);\n\n            $_offset += $_length - strlen($replace);\n            $_store ++;\n        }\n    }\n\n    $expressions = array(// replace multiple spaces between tags by a single space\n                         // can't remove them entirely, becaue that might break poorly implemented CSS display:inline-block elements\n                         '#(:SMARTY@!@|>)\\s+(?=@!@SMARTY:|<)#s' => '\\1 \\2',\n                         // remove spaces between attributes (but not in attribute values!)\n                         '#(([a-z0-9]\\s*=\\s*(\"[^\"]*?\")|(\\'[^\\']*?\\'))|<[a-z0-9_]+)\\s+([a-z/>])#is' => '\\1 \\5',\n                         // note: for some very weird reason trim() seems to remove spaces inside attributes.\n                         // maybe a \\0 byte or something is interfering?\n                         '#^\\s+<#Ss' => '<', '#>\\s+$#Ss' => '>',);\n\n    $source = preg_replace(array_keys($expressions), array_values($expressions), $source);\n    // note: for some very weird reason trim() seems to remove spaces inside attributes.\n    // maybe a \\0 byte or something is interfering?\n    // $source = trim( $source );\n\n    $_offset = 0;\n    if (preg_match_all('#@!@SMARTY:([0-9]+):SMARTY@!@#is', $source, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) {\n        foreach ($matches as $match) {\n            $_length = strlen($match[ 0 ][ 0 ]);\n            $replace = $store[ $match[ 1 ][ 0 ] ];\n            $source = substr_replace($source, $replace, $match[ 0 ][ 1 ] + $_offset, $_length);\n\n            $_offset += strlen($replace) - $_length;\n            $_store ++;\n        }\n    }\n\n    return $source;\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/shared.escape_special_chars.php",
    "content": "<?php\n/**\n * Smarty shared plugin\n *\n * @package    Smarty\n * @subpackage PluginsShared\n */\n\n/**\n * escape_special_chars common function\n * Function: smarty_function_escape_special_chars\n * Purpose:  used by other smarty functions to escape\n *           special chars except for already escaped ones\n *\n * @author   Monte Ohrt <monte at ohrt dot com>\n *\n * @param  string $string text that should by escaped\n *\n * @return string\n */\nfunction smarty_function_escape_special_chars($string)\n{\n    if (!is_array($string)) {\n        if (version_compare(PHP_VERSION, '5.2.3', '>=')) {\n            $string = htmlspecialchars($string, ENT_COMPAT, Smarty::$_CHARSET, false);\n        } else {\n            $string = preg_replace('!&(#?\\w+);!', '%%%SMARTY_START%%%\\\\1%%%SMARTY_END%%%', $string);\n            $string = htmlspecialchars($string);\n            $string = str_replace(array('%%%SMARTY_START%%%', '%%%SMARTY_END%%%'), array('&', ';'), $string);\n        }\n    }\n\n    return $string;\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/shared.literal_compiler_param.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsShared\n */\n\n/**\n * evaluate compiler parameter\n *\n * @param array   $params  parameter array as given to the compiler function\n * @param integer $index   array index of the parameter to convert\n * @param mixed   $default value to be returned if the parameter is not present\n *\n * @return mixed evaluated value of parameter or $default\n * @throws SmartyException if parameter is not a literal (but an expression, variable, …)\n * @author Rodney Rehm\n */\nfunction smarty_literal_compiler_param($params, $index, $default = null)\n{\n    // not set, go default\n    if (!isset($params[ $index ])) {\n        return $default;\n    }\n    // test if param is a literal\n    if (!preg_match('/^([\\'\"]?)[a-zA-Z0-9-]+(\\\\1)$/', $params[ $index ])) {\n        throw new SmartyException('$param[' . $index .\n                                  '] is not a literal and is thus not evaluatable at compile time');\n    }\n\n    $t = null;\n    eval(\"\\$t = \" . $params[ $index ] . \";\");\n\n    return $t;\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/shared.make_timestamp.php",
    "content": "<?php\n/**\n * Smarty shared plugin\n *\n * @package    Smarty\n * @subpackage PluginsShared\n */\n\n/**\n * Function: smarty_make_timestamp\n * Purpose:  used by other smarty functions to make a timestamp from a string.\n *\n * @author   Monte Ohrt <monte at ohrt dot com>\n *\n * @param DateTime|int|string $string date object, timestamp or string that can be converted using strtotime()\n *\n * @return int\n */\nfunction smarty_make_timestamp($string)\n{\n    if (empty($string)) {\n        // use \"now\":\n        return time();\n    } elseif ($string instanceof DateTime ||\n              (interface_exists('DateTimeInterface', false) && $string instanceof DateTimeInterface)\n    ) {\n        return (int) $string->format('U'); // PHP 5.2 BC\n    } elseif (strlen($string) === 14 && ctype_digit($string)) {\n        // it is mysql timestamp format of YYYYMMDDHHMMSS?\n        return mktime(substr($string, 8, 2), substr($string, 10, 2), substr($string, 12, 2), substr($string, 4, 2),\n                      substr($string, 6, 2), substr($string, 0, 4));\n    } elseif (is_numeric($string)) {\n        // it is a numeric string, we handle it as timestamp\n        return (int) $string;\n    } else {\n        // strtotime should handle it\n        $time = strtotime($string);\n        if ($time === - 1 || $time === false) {\n            // strtotime() was not able to parse $string, use \"now\":\n            return time();\n        }\n\n        return $time;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/shared.mb_str_replace.php",
    "content": "<?php\n/**\n * Smarty shared plugin\n *\n * @package    Smarty\n * @subpackage PluginsShared\n */\nif (!function_exists('smarty_mb_str_replace')) {\n    /**\n     * Multibyte string replace\n     *\n     * @param  string|string[] $search  the string to be searched\n     * @param  string|string[] $replace the replacement string\n     * @param  string          $subject the source string\n     * @param  int             &$count  number of matches found\n     *\n     * @return string replaced string\n     * @author Rodney Rehm\n     */\n    function smarty_mb_str_replace($search, $replace, $subject, &$count = 0)\n    {\n        if (!is_array($search) && is_array($replace)) {\n            return false;\n        }\n        if (is_array($subject)) {\n            // call mb_replace for each single string in $subject\n            foreach ($subject as &$string) {\n                $string = smarty_mb_str_replace($search, $replace, $string, $c);\n                $count += $c;\n            }\n        } else if (is_array($search)) {\n            if (!is_array($replace)) {\n                foreach ($search as &$string) {\n                    $subject = smarty_mb_str_replace($string, $replace, $subject, $c);\n                    $count += $c;\n                }\n            } else {\n                $n = max(count($search), count($replace));\n                while ($n--) {\n                    $subject = smarty_mb_str_replace(current($search), current($replace), $subject, $c);\n                    $count += $c;\n                    next($search);\n                    next($replace);\n                }\n            }\n        } else {\n            $parts = mb_split(preg_quote($search), $subject);\n            $count = count($parts) - 1;\n            $subject = implode($replace, $parts);\n        }\n        return $subject;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/shared.mb_unicode.php",
    "content": "<?php\n/**\n * Smarty shared plugin\n *\n * @package    Smarty\n * @subpackage PluginsShared\n */\n\n/**\n * convert characters to their decimal unicode equivalents\n *\n * @link   http://www.ibm.com/developerworks/library/os-php-unicode/index.html#listing3 for inspiration\n *\n * @param string $string   characters to calculate unicode of\n * @param string $encoding encoding of $string, if null mb_internal_encoding() is used\n *\n * @return array sequence of unicodes\n * @author Rodney Rehm\n */\nfunction smarty_mb_to_unicode($string, $encoding = null)\n{\n    if ($encoding) {\n        $expanded = mb_convert_encoding($string, 'UTF-32BE', $encoding);\n    } else {\n        $expanded = mb_convert_encoding($string, 'UTF-32BE');\n    }\n\n    return unpack('N*', $expanded);\n}\n\n/**\n * convert unicodes to the character of given encoding\n *\n * @link   http://www.ibm.com/developerworks/library/os-php-unicode/index.html#listing3 for inspiration\n *\n * @param integer|array $unicode  single unicode or list of unicodes to convert\n * @param string        $encoding encoding of returned string, if null mb_internal_encoding() is used\n *\n * @return string unicode as character sequence in given $encoding\n * @author Rodney Rehm\n */\nfunction smarty_mb_from_unicode($unicode, $encoding = null)\n{\n    $t = '';\n    if (!$encoding) {\n        $encoding = mb_internal_encoding();\n    }\n    foreach ((array) $unicode as $utf32be) {\n        $character = pack('N*', $utf32be);\n        $t .= mb_convert_encoding($character, $encoding, 'UTF-32BE');\n    }\n\n    return $t;\n}\n"
  },
  {
    "path": "Extend/Package/smarty/plugins/variablefilter.htmlspecialchars.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsFilter\n */\n/**\n * Smarty htmlspecialchars variablefilter plugin\n *\n * @param string                    $source input string\n * @param \\Smarty_Internal_Template $template\n *\n * @return string filtered output\n */\nfunction smarty_variablefilter_htmlspecialchars($source, Smarty_Internal_Template $template)\n{\n    return htmlspecialchars($source, ENT_QUOTES, Smarty::$_CHARSET);\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_cacheresource.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin\n *\n * @package    Smarty\n * @subpackage Cacher\n */\n\n/**\n * Cache Handler API\n *\n * @package    Smarty\n * @subpackage Cacher\n * @author     Rodney Rehm\n */\nabstract class Smarty_CacheResource\n{\n    /**\n     * resource types provided by the core\n     *\n     * @var array\n     */\n    protected static $sysplugins = array('file' => 'smarty_internal_cacheresource_file.php',);\n\n    /**\n     * populate Cached Object with meta data from Resource\n     *\n     * @param Smarty_Template_Cached   $cached    cached object\n     * @param Smarty_Internal_Template $_template template object\n     *\n     * @return void\n     */\n    abstract public function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template);\n\n    /**\n     * populate Cached Object with timestamp and exists from Resource\n     *\n     * @param Smarty_Template_Cached $cached\n     *\n     * @return void\n     */\n    abstract public function populateTimestamp(Smarty_Template_Cached $cached);\n\n    /**\n     * Read the cached template and process header\n     *\n     * @param Smarty_Internal_Template $_template template object\n     * @param Smarty_Template_Cached   $cached    cached object\n     * @param boolean                  $update    flag if called because cache update\n     *\n     * @return boolean true or false if the cached content does not exist\n     */\n    abstract public function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached = null,\n                                     $update = false);\n\n    /**\n     * Write the rendered template output to cache\n     *\n     * @param Smarty_Internal_Template $_template template object\n     * @param string                   $content   content to cache\n     *\n     * @return boolean success\n     */\n    abstract public function writeCachedContent(Smarty_Internal_Template $_template, $content);\n\n    /**\n     * Read cached template from cache\n     *\n     * @param  Smarty_Internal_Template $_template template object\n     *\n     * @return string  content\n     */\n    abstract function readCachedContent(Smarty_Internal_Template $_template);\n\n    /**\n     * Return cached content\n     *\n     * @param Smarty_Internal_Template $_template template object\n     *\n     * @return null|string\n     */\n    public function getCachedContent(Smarty_Internal_Template $_template)\n    {\n        if ($_template->cached->handler->process($_template)) {\n            ob_start();\n            $unifunc = $_template->cached->unifunc;\n            $unifunc($_template);\n            return ob_get_clean();\n        }\n\n        return null;\n    }\n\n    /**\n     * Empty cache\n     *\n     * @param Smarty  $smarty   Smarty object\n     * @param integer $exp_time expiration time (number of seconds, not timestamp)\n     *\n     * @return integer number of cache files deleted\n     */\n    abstract public function clearAll(Smarty $smarty, $exp_time = null);\n\n    /**\n     * Empty cache for a specific template\n     *\n     * @param Smarty  $smarty        Smarty object\n     * @param string  $resource_name template name\n     * @param string  $cache_id      cache id\n     * @param string  $compile_id    compile id\n     * @param integer $exp_time      expiration time (number of seconds, not timestamp)\n     *\n     * @return integer number of cache files deleted\n     */\n    abstract public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time);\n\n    /**\n     * @param Smarty                 $smarty\n     * @param Smarty_Template_Cached $cached\n     *\n     * @return bool|null\n     */\n    public function locked(Smarty $smarty, Smarty_Template_Cached $cached)\n    {\n        // theoretically locking_timeout should be checked against time_limit (max_execution_time)\n        $start = microtime(true);\n        $hadLock = null;\n        while ($this->hasLock($smarty, $cached)) {\n            $hadLock = true;\n            if (microtime(true) - $start > $smarty->locking_timeout) {\n                // abort waiting for lock release\n                return false;\n            }\n            sleep(1);\n        }\n\n        return $hadLock;\n    }\n\n    /**\n     * Check is cache is locked for this template\n     *\n     * @param Smarty                 $smarty\n     * @param Smarty_Template_Cached $cached\n     *\n     * @return bool\n     */\n    public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached)\n    {\n        // check if lock exists\n        return false;\n    }\n\n    /**\n     * Lock cache for this template\n     *\n     * @param Smarty                 $smarty\n     * @param Smarty_Template_Cached $cached\n     *\n     * @return bool\n     */\n    public function acquireLock(Smarty $smarty, Smarty_Template_Cached $cached)\n    {\n        // create lock\n        return true;\n    }\n\n    /**\n     * Unlock cache for this template\n     *\n     * @param Smarty                 $smarty\n     * @param Smarty_Template_Cached $cached\n     *\n     * @return bool\n     */\n    public function releaseLock(Smarty $smarty, Smarty_Template_Cached $cached)\n    {\n        // release lock\n        return true;\n    }\n\n    /**\n     * Load Cache Resource Handler\n     *\n     * @param Smarty $smarty Smarty object\n     * @param string $type   name of the cache resource\n     *\n     * @throws SmartyException\n     * @return Smarty_CacheResource Cache Resource Handler\n     */\n    public static function load(Smarty $smarty, $type = null)\n    {\n        if (!isset($type)) {\n            $type = $smarty->caching_type;\n        }\n\n        // try smarty's cache\n        if (isset($smarty->_cache[ 'cacheresource_handlers' ][ $type ])) {\n            return $smarty->_cache[ 'cacheresource_handlers' ][ $type ];\n        }\n\n        // try registered resource\n        if (isset($smarty->registered_cache_resources[ $type ])) {\n            // do not cache these instances as they may vary from instance to instance\n            return $smarty->_cache[ 'cacheresource_handlers' ][ $type ] = $smarty->registered_cache_resources[ $type ];\n        }\n        // try sysplugins dir\n        if (isset(self::$sysplugins[ $type ])) {\n            $cache_resource_class = 'Smarty_Internal_CacheResource_' . ucfirst($type);\n            return $smarty->_cache[ 'cacheresource_handlers' ][ $type ] = new $cache_resource_class();\n        }\n        // try plugins dir\n        $cache_resource_class = 'Smarty_CacheResource_' . ucfirst($type);\n        if ($smarty->loadPlugin($cache_resource_class)) {\n            return $smarty->_cache[ 'cacheresource_handlers' ][ $type ] = new $cache_resource_class();\n        }\n        // give up\n        throw new SmartyException(\"Unable to load cache resource '{$type}'\");\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_cacheresource_custom.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin\n *\n * @package    Smarty\n * @subpackage Cacher\n */\n\n/**\n * Cache Handler API\n *\n * @package    Smarty\n * @subpackage Cacher\n * @author     Rodney Rehm\n */\nabstract class Smarty_CacheResource_Custom extends Smarty_CacheResource\n{\n    /**\n     * fetch cached content and its modification time from data source\n     *\n     * @param  string  $id         unique cache content identifier\n     * @param  string  $name       template name\n     * @param  string  $cache_id   cache id\n     * @param  string  $compile_id compile id\n     * @param  string  $content    cached content\n     * @param  integer $mtime      cache modification timestamp (epoch)\n     *\n     * @return void\n     */\n    abstract protected function fetch($id, $name, $cache_id, $compile_id, &$content, &$mtime);\n\n    /**\n     * Fetch cached content's modification timestamp from data source\n     * {@internal implementing this method is optional.\n     *  Only implement it if modification times can be accessed faster than loading the complete cached content.}}\n     *\n     * @param  string $id         unique cache content identifier\n     * @param  string $name       template name\n     * @param  string $cache_id   cache id\n     * @param  string $compile_id compile id\n     *\n     * @return integer|boolean timestamp (epoch) the template was modified, or false if not found\n     */\n    protected function fetchTimestamp($id, $name, $cache_id, $compile_id)\n    {\n        return false;\n    }\n\n    /**\n     * Save content to cache\n     *\n     * @param  string       $id         unique cache content identifier\n     * @param  string       $name       template name\n     * @param  string       $cache_id   cache id\n     * @param  string       $compile_id compile id\n     * @param  integer|null $exp_time   seconds till expiration or null\n     * @param  string       $content    content to cache\n     *\n     * @return boolean      success\n     */\n    abstract protected function save($id, $name, $cache_id, $compile_id, $exp_time, $content);\n\n    /**\n     * Delete content from cache\n     *\n     * @param  string|null  $name       template name\n     * @param  string|null  $cache_id   cache id\n     * @param  string|null  $compile_id compile id\n     * @param  integer|null $exp_time   seconds till expiration time in seconds or null\n     *\n     * @return integer      number of deleted caches\n     */\n    abstract protected function delete($name, $cache_id, $compile_id, $exp_time);\n\n    /**\n     * populate Cached Object with meta data from Resource\n     *\n     * @param  Smarty_Template_Cached   $cached    cached object\n     * @param  Smarty_Internal_Template $_template template object\n     *\n     * @return void\n     */\n    public function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template)\n    {\n        $_cache_id = isset($cached->cache_id) ? preg_replace('![^\\w\\|]+!', '_', $cached->cache_id) : null;\n        $_compile_id = isset($cached->compile_id) ? preg_replace('![^\\w]+!', '_', $cached->compile_id) : null;\n        $path = $cached->source->uid . $_cache_id . $_compile_id;\n        $cached->filepath = sha1($path);\n        if ($_template->smarty->cache_locking) {\n            $cached->lock_id = sha1('lock.' . $path);\n        }\n        $this->populateTimestamp($cached);\n    }\n\n    /**\n     * populate Cached Object with timestamp and exists from Resource\n     *\n     * @param Smarty_Template_Cached $cached\n     *\n     * @return void\n     */\n    public function populateTimestamp(Smarty_Template_Cached $cached)\n    {\n        $mtime =\n            $this->fetchTimestamp($cached->filepath, $cached->source->name, $cached->cache_id, $cached->compile_id);\n        if ($mtime !== null) {\n            $cached->timestamp = $mtime;\n            $cached->exists = !!$cached->timestamp;\n\n            return;\n        }\n        $timestamp = null;\n        $this->fetch($cached->filepath, $cached->source->name, $cached->cache_id, $cached->compile_id, $cached->content,\n                     $timestamp);\n        $cached->timestamp = isset($timestamp) ? $timestamp : false;\n        $cached->exists = !!$cached->timestamp;\n    }\n\n    /**\n     * Read the cached template and process the header\n     *\n     * @param \\Smarty_Internal_Template $_smarty_tpl do not change variable name, is used by compiled template\n     * @param  Smarty_Template_Cached   $cached      cached object\n     * @param boolean                   $update      flag if called because cache update\n     *\n     * @return boolean                 true or false if the cached content does not exist\n     */\n    public function process(Smarty_Internal_Template $_smarty_tpl, Smarty_Template_Cached $cached = null,\n                            $update = false)\n    {\n        if (!$cached) {\n            $cached = $_smarty_tpl->cached;\n        }\n        $content = $cached->content ? $cached->content : null;\n        $timestamp = $cached->timestamp ? $cached->timestamp : null;\n        if ($content === null || !$timestamp) {\n            $this->fetch($_smarty_tpl->cached->filepath, $_smarty_tpl->source->name, $_smarty_tpl->cache_id,\n                         $_smarty_tpl->compile_id, $content, $timestamp);\n        }\n        if (isset($content)) {\n            eval('?>' . $content);\n            $cached->content = null;\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * Write the rendered template output to cache\n     *\n     * @param  Smarty_Internal_Template $_template template object\n     * @param  string                   $content   content to cache\n     *\n     * @return boolean                  success\n     */\n    public function writeCachedContent(Smarty_Internal_Template $_template, $content)\n    {\n        return $this->save($_template->cached->filepath, $_template->source->name, $_template->cache_id,\n                           $_template->compile_id, $_template->cache_lifetime, $content);\n    }\n\n    /**\n     * Read cached template from cache\n     *\n     * @param  Smarty_Internal_Template $_template template object\n     *\n     * @return string|boolean  content\n     */\n    public function readCachedContent(Smarty_Internal_Template $_template)\n    {\n        $content = $_template->cached->content ? $_template->cached->content : null;\n        $timestamp = null;\n        if ($content === null) {\n            $timestamp = null;\n            $this->fetch($_template->cached->filepath, $_template->source->name, $_template->cache_id,\n                         $_template->compile_id, $content, $timestamp);\n        }\n        if (isset($content)) {\n            return $content;\n        }\n        return false;\n    }\n\n    /**\n     * Empty cache\n     *\n     * @param  Smarty  $smarty   Smarty object\n     * @param  integer $exp_time expiration time (number of seconds, not timestamp)\n     *\n     * @return integer number of cache files deleted\n     */\n    public function clearAll(Smarty $smarty, $exp_time = null)\n    {\n        return $this->delete(null, null, null, $exp_time);\n    }\n\n    /**\n     * Empty cache for a specific template\n     *\n     * @param  Smarty  $smarty        Smarty object\n     * @param  string  $resource_name template name\n     * @param  string  $cache_id      cache id\n     * @param  string  $compile_id    compile id\n     * @param  integer $exp_time      expiration time (number of seconds, not timestamp)\n     *\n     * @return int number of cache files deleted\n     * @throws \\SmartyException\n     */\n    public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)\n    {\n        $cache_name = null;\n\n        if (isset($resource_name)) {\n            $source = Smarty_Template_Source::load(null, $smarty, $resource_name);\n            if ($source->exists) {\n                $cache_name = $source->name;\n            } else {\n                return 0;\n            }\n        }\n\n        return $this->delete($cache_name, $cache_id, $compile_id, $exp_time);\n    }\n\n    /**\n     * Check is cache is locked for this template\n     *\n     * @param  Smarty                 $smarty Smarty object\n     * @param  Smarty_Template_Cached $cached cached object\n     *\n     * @return boolean               true or false if cache is locked\n     */\n    public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached)\n    {\n        $id = $cached->lock_id;\n        $name = $cached->source->name . '.lock';\n\n        $mtime = $this->fetchTimestamp($id, $name, $cached->cache_id, $cached->compile_id);\n        if ($mtime === null) {\n            $this->fetch($id, $name, $cached->cache_id, $cached->compile_id, $content, $mtime);\n        }\n        return $mtime && ($t = time()) - $mtime < $smarty->locking_timeout;\n    }\n\n    /**\n     * Lock cache for this template\n     *\n     * @param Smarty                 $smarty Smarty object\n     * @param Smarty_Template_Cached $cached cached object\n     *\n     * @return bool|void\n     */\n    public function acquireLock(Smarty $smarty, Smarty_Template_Cached $cached)\n    {\n        $cached->is_locked = true;\n        $id = $cached->lock_id;\n        $name = $cached->source->name . '.lock';\n        $this->save($id, $name, $cached->cache_id, $cached->compile_id, $smarty->locking_timeout, '');\n    }\n\n    /**\n     * Unlock cache for this template\n     *\n     * @param Smarty                 $smarty Smarty object\n     * @param Smarty_Template_Cached $cached cached object\n     *\n     * @return bool|void\n     */\n    public function releaseLock(Smarty $smarty, Smarty_Template_Cached $cached)\n    {\n        $cached->is_locked = false;\n        $name = $cached->source->name . '.lock';\n        $this->delete($name, $cached->cache_id, $cached->compile_id, null);\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_cacheresource_keyvaluestore.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin\n *\n * @package    Smarty\n * @subpackage Cacher\n */\n\n/**\n * Smarty Cache Handler Base for Key/Value Storage Implementations\n * This class implements the functionality required to use simple key/value stores\n * for hierarchical cache groups. key/value stores like memcache or APC do not support\n * wildcards in keys, therefore a cache group cannot be cleared like \"a|*\" - which\n * is no problem to filesystem and RDBMS implementations.\n * This implementation is based on the concept of invalidation. While one specific cache\n * can be identified and cleared, any range of caches cannot be identified. For this reason\n * each level of the cache group hierarchy can have its own value in the store. These values\n * are nothing but microtimes, telling us when a particular cache group was cleared for the\n * last time. These keys are evaluated for every cache read to determine if the cache has\n * been invalidated since it was created and should hence be treated as inexistent.\n * Although deep hierarchies are possible, they are not recommended. Try to keep your\n * cache groups as shallow as possible. Anything up 3-5 parents should be ok. So\n * »a|b|c« is a good depth where »a|b|c|d|e|f|g|h|i|j|k« isn't. Try to join correlating\n * cache groups: if your cache groups look somewhat like »a|b|$page|$items|$whatever«\n * consider using »a|b|c|$page-$items-$whatever« instead.\n *\n * @package    Smarty\n * @subpackage Cacher\n * @author     Rodney Rehm\n */\nabstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource\n{\n    /**\n     * cache for contents\n     *\n     * @var array\n     */\n    protected $contents = array();\n\n    /**\n     * cache for timestamps\n     *\n     * @var array\n     */\n    protected $timestamps = array();\n\n    /**\n     * populate Cached Object with meta data from Resource\n     *\n     * @param  Smarty_Template_Cached   $cached    cached object\n     * @param  Smarty_Internal_Template $_template template object\n     *\n     * @return void\n     */\n    public function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template)\n    {\n        $cached->filepath = $_template->source->uid . '#' . $this->sanitize($cached->source->resource) . '#' .\n                            $this->sanitize($cached->cache_id) . '#' . $this->sanitize($cached->compile_id);\n\n        $this->populateTimestamp($cached);\n    }\n\n    /**\n     * populate Cached Object with timestamp and exists from Resource\n     *\n     * @param  Smarty_Template_Cached $cached cached object\n     *\n     * @return void\n     */\n    public function populateTimestamp(Smarty_Template_Cached $cached)\n    {\n        if (!$this->fetch($cached->filepath, $cached->source->name, $cached->cache_id, $cached->compile_id, $content,\n                          $timestamp, $cached->source->uid)\n        ) {\n            return;\n        }\n        $cached->content = $content;\n        $cached->timestamp = (int) $timestamp;\n        $cached->exists = !!$cached->timestamp;\n    }\n\n    /**\n     * Read the cached template and process the header\n     *\n     * @param \\Smarty_Internal_Template $_smarty_tpl do not change variable name, is used by compiled template\n     * @param  Smarty_Template_Cached   $cached      cached object\n     * @param boolean                   $update      flag if called because cache update\n     *\n     * @return boolean                 true or false if the cached content does not exist\n     */\n    public function process(Smarty_Internal_Template $_smarty_tpl, Smarty_Template_Cached $cached = null,\n                            $update = false)\n    {\n        if (!$cached) {\n            $cached = $_smarty_tpl->cached;\n        }\n        $content = $cached->content ? $cached->content : null;\n        $timestamp = $cached->timestamp ? $cached->timestamp : null;\n        if ($content === null || !$timestamp) {\n            if (!$this->fetch($_smarty_tpl->cached->filepath, $_smarty_tpl->source->name, $_smarty_tpl->cache_id,\n                              $_smarty_tpl->compile_id, $content, $timestamp, $_smarty_tpl->source->uid)\n            ) {\n                return false;\n            }\n        }\n        if (isset($content)) {\n            eval('?>' . $content);\n\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * Write the rendered template output to cache\n     *\n     * @param  Smarty_Internal_Template $_template template object\n     * @param  string                   $content   content to cache\n     *\n     * @return boolean                  success\n     */\n    public function writeCachedContent(Smarty_Internal_Template $_template, $content)\n    {\n        $this->addMetaTimestamp($content);\n\n        return $this->write(array($_template->cached->filepath => $content), $_template->cache_lifetime);\n    }\n\n    /**\n     * Read cached template from cache\n     *\n     * @param  Smarty_Internal_Template $_template template object\n     *\n     * @return string|false  content\n     */\n    public function readCachedContent(Smarty_Internal_Template $_template)\n    {\n        $content = $_template->cached->content ? $_template->cached->content : null;\n        $timestamp = null;\n        if ($content === null) {\n            if (!$this->fetch($_template->cached->filepath, $_template->source->name, $_template->cache_id,\n                              $_template->compile_id, $content, $timestamp, $_template->source->uid)\n            ) {\n                return false;\n            }\n        }\n        if (isset($content)) {\n            return $content;\n        }\n        return false;\n    }\n\n    /**\n     * Empty cache\n     * {@internal the $exp_time argument is ignored altogether }}\n     *\n     * @param  Smarty  $smarty   Smarty object\n     * @param  integer $exp_time expiration time [being ignored]\n     *\n     * @return integer number of cache files deleted [always -1]\n     * @uses purge() to clear the whole store\n     * @uses invalidate() to mark everything outdated if purge() is inapplicable\n     */\n    public function clearAll(Smarty $smarty, $exp_time = null)\n    {\n        if (!$this->purge()) {\n            $this->invalidate(null);\n        }\n        return - 1;\n    }\n\n    /**\n     * Empty cache for a specific template\n     * {@internal the $exp_time argument is ignored altogether}}\n     *\n     * @param  Smarty  $smarty        Smarty object\n     * @param  string  $resource_name template name\n     * @param  string  $cache_id      cache id\n     * @param  string  $compile_id    compile id\n     * @param  integer $exp_time      expiration time [being ignored]\n     *\n     * @return int number of cache files deleted [always -1]\n     * @throws \\SmartyException\n     * @uses buildCachedFilepath() to generate the CacheID\n     * @uses invalidate() to mark CacheIDs parent chain as outdated\n     * @uses delete() to remove CacheID from cache\n     */\n    public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)\n    {\n        $uid = $this->getTemplateUid($smarty, $resource_name);\n        $cid = $uid . '#' . $this->sanitize($resource_name) . '#' . $this->sanitize($cache_id) . '#' .\n               $this->sanitize($compile_id);\n        $this->delete(array($cid));\n        $this->invalidate($cid, $resource_name, $cache_id, $compile_id, $uid);\n        return - 1;\n    }\n\n    /**\n     * Get template's unique ID\n     *\n     * @param  Smarty $smarty        Smarty object\n     * @param  string $resource_name template name\n     *\n     * @return string filepath of cache file\n     * @throws \\SmartyException\n     *\n     */\n    protected function getTemplateUid(Smarty $smarty, $resource_name)\n    {\n        if (isset($resource_name)) {\n            $source = Smarty_Template_Source::load(null, $smarty, $resource_name);\n            if ($source->exists) {\n                return $source->uid;\n            }\n        }\n        return '';\n    }\n\n    /**\n     * Sanitize CacheID components\n     *\n     * @param  string $string CacheID component to sanitize\n     *\n     * @return string sanitized CacheID component\n     */\n    protected function sanitize($string)\n    {\n        $string = trim($string, '|');\n        if (!$string) {\n            return '';\n        }\n        return preg_replace('#[^\\w\\|]+#S', '_', $string);\n    }\n\n    /**\n     * Fetch and prepare a cache object.\n     *\n     * @param  string  $cid           CacheID to fetch\n     * @param  string  $resource_name template name\n     * @param  string  $cache_id      cache id\n     * @param  string  $compile_id    compile id\n     * @param  string  $content       cached content\n     * @param  integer &$timestamp    cached timestamp (epoch)\n     * @param  string  $resource_uid  resource's uid\n     *\n     * @return boolean success\n     */\n    protected function fetch($cid, $resource_name = null, $cache_id = null, $compile_id = null, &$content = null,\n                             &$timestamp = null, $resource_uid = null)\n    {\n        $t = $this->read(array($cid));\n        $content = !empty($t[ $cid ]) ? $t[ $cid ] : null;\n        $timestamp = null;\n\n        if ($content && ($timestamp = $this->getMetaTimestamp($content))) {\n            $invalidated =\n                $this->getLatestInvalidationTimestamp($cid, $resource_name, $cache_id, $compile_id, $resource_uid);\n            if ($invalidated > $timestamp) {\n                $timestamp = null;\n                $content = null;\n            }\n        }\n\n        return !!$content;\n    }\n\n    /**\n     * Add current microtime to the beginning of $cache_content\n     * {@internal the header uses 8 Bytes, the first 4 Bytes are the seconds, the second 4 Bytes are the microseconds}}\n     *\n     * @param string &$content the content to be cached\n     */\n    protected function addMetaTimestamp(&$content)\n    {\n        $mt = explode(' ', microtime());\n        $ts = pack('NN', $mt[ 1 ], (int) ($mt[ 0 ] * 100000000));\n        $content = $ts . $content;\n    }\n\n    /**\n     * Extract the timestamp the $content was cached\n     *\n     * @param  string &$content the cached content\n     *\n     * @return float  the microtime the content was cached\n     */\n    protected function getMetaTimestamp(&$content)\n    {\n        extract(unpack('N1s/N1m/a*content', $content));\n        /**\n         * @var  int $s\n         * @var  int $m\n         */\n        return $s + ($m / 100000000);\n    }\n\n    /**\n     * Invalidate CacheID\n     *\n     * @param  string $cid           CacheID\n     * @param  string $resource_name template name\n     * @param  string $cache_id      cache id\n     * @param  string $compile_id    compile id\n     * @param  string $resource_uid  source's uid\n     *\n     * @return void\n     */\n    protected function invalidate($cid = null, $resource_name = null, $cache_id = null, $compile_id = null,\n                                  $resource_uid = null)\n    {\n        $now = microtime(true);\n        $key = null;\n        // invalidate everything\n        if (!$resource_name && !$cache_id && !$compile_id) {\n            $key = 'IVK#ALL';\n        } // invalidate all caches by template\n        else {\n            if ($resource_name && !$cache_id && !$compile_id) {\n                $key = 'IVK#TEMPLATE#' . $resource_uid . '#' . $this->sanitize($resource_name);\n            } // invalidate all caches by cache group\n            else {\n                if (!$resource_name && $cache_id && !$compile_id) {\n                    $key = 'IVK#CACHE#' . $this->sanitize($cache_id);\n                } // invalidate all caches by compile id\n                else {\n                    if (!$resource_name && !$cache_id && $compile_id) {\n                        $key = 'IVK#COMPILE#' . $this->sanitize($compile_id);\n                    } // invalidate by combination\n                    else {\n                        $key = 'IVK#CID#' . $cid;\n                    }\n                }\n            }\n        }\n        $this->write(array($key => $now));\n    }\n\n    /**\n     * Determine the latest timestamp known to the invalidation chain\n     *\n     * @param  string $cid           CacheID to determine latest invalidation timestamp of\n     * @param  string $resource_name template name\n     * @param  string $cache_id      cache id\n     * @param  string $compile_id    compile id\n     * @param  string $resource_uid  source's filepath\n     *\n     * @return float  the microtime the CacheID was invalidated\n     */\n    protected function getLatestInvalidationTimestamp($cid, $resource_name = null, $cache_id = null, $compile_id = null,\n                                                      $resource_uid = null)\n    {\n        // abort if there is no CacheID\n        if (false && !$cid) {\n            return 0;\n        }\n        // abort if there are no InvalidationKeys to check\n        if (!($_cid = $this->listInvalidationKeys($cid, $resource_name, $cache_id, $compile_id, $resource_uid))) {\n            return 0;\n        }\n\n        // there are no InValidationKeys\n        if (!($values = $this->read($_cid))) {\n            return 0;\n        }\n        // make sure we're dealing with floats\n        $values = array_map('floatval', $values);\n\n        return max($values);\n    }\n\n    /**\n     * Translate a CacheID into the list of applicable InvalidationKeys.\n     * Splits 'some|chain|into|an|array' into array( '#clearAll#', 'some', 'some|chain', 'some|chain|into', ... )\n     *\n     * @param  string $cid           CacheID to translate\n     * @param  string $resource_name template name\n     * @param  string $cache_id      cache id\n     * @param  string $compile_id    compile id\n     * @param  string $resource_uid  source's filepath\n     *\n     * @return array  list of InvalidationKeys\n     * @uses $invalidationKeyPrefix to prepend to each InvalidationKey\n     */\n    protected function listInvalidationKeys($cid, $resource_name = null, $cache_id = null, $compile_id = null,\n                                            $resource_uid = null)\n    {\n        $t = array('IVK#ALL');\n        $_name = $_compile = '#';\n        if ($resource_name) {\n            $_name .= $resource_uid . '#' . $this->sanitize($resource_name);\n            $t[] = 'IVK#TEMPLATE' . $_name;\n        }\n        if ($compile_id) {\n            $_compile .= $this->sanitize($compile_id);\n            $t[] = 'IVK#COMPILE' . $_compile;\n        }\n        $_name .= '#';\n        $cid = trim($cache_id, '|');\n        if (!$cid) {\n            return $t;\n        }\n        $i = 0;\n        while (true) {\n            // determine next delimiter position\n            $i = strpos($cid, '|', $i);\n            // add complete CacheID if there are no more delimiters\n            if ($i === false) {\n                $t[] = 'IVK#CACHE#' . $cid;\n                $t[] = 'IVK#CID' . $_name . $cid . $_compile;\n                $t[] = 'IVK#CID' . $_name . $_compile;\n                break;\n            }\n            $part = substr($cid, 0, $i);\n            // add slice to list\n            $t[] = 'IVK#CACHE#' . $part;\n            $t[] = 'IVK#CID' . $_name . $part . $_compile;\n            // skip past delimiter position\n            $i ++;\n        }\n\n        return $t;\n    }\n\n    /**\n     * Check is cache is locked for this template\n     *\n     * @param  Smarty                 $smarty Smarty object\n     * @param  Smarty_Template_Cached $cached cached object\n     *\n     * @return boolean               true or false if cache is locked\n     */\n    public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached)\n    {\n        $key = 'LOCK#' . $cached->filepath;\n        $data = $this->read(array($key));\n\n        return $data && time() - $data[ $key ] < $smarty->locking_timeout;\n    }\n\n    /**\n     * Lock cache for this template\n     *\n     * @param Smarty                 $smarty Smarty object\n     * @param Smarty_Template_Cached $cached cached object\n     *\n     * @return bool|void\n     */\n    public function acquireLock(Smarty $smarty, Smarty_Template_Cached $cached)\n    {\n        $cached->is_locked = true;\n        $key = 'LOCK#' . $cached->filepath;\n        $this->write(array($key => time()), $smarty->locking_timeout);\n    }\n\n    /**\n     * Unlock cache for this template\n     *\n     * @param Smarty                 $smarty Smarty object\n     * @param Smarty_Template_Cached $cached cached object\n     *\n     * @return bool|void\n     */\n    public function releaseLock(Smarty $smarty, Smarty_Template_Cached $cached)\n    {\n        $cached->is_locked = false;\n        $key = 'LOCK#' . $cached->filepath;\n        $this->delete(array($key));\n    }\n\n    /**\n     * Read values for a set of keys from cache\n     *\n     * @param  array $keys list of keys to fetch\n     *\n     * @return array list of values with the given keys used as indexes\n     */\n    abstract protected function read(array $keys);\n\n    /**\n     * Save values for a set of keys to cache\n     *\n     * @param  array $keys   list of values to save\n     * @param  int   $expire expiration time\n     *\n     * @return boolean true on success, false on failure\n     */\n    abstract protected function write(array $keys, $expire = null);\n\n    /**\n     * Remove values from cache\n     *\n     * @param  array $keys list of keys to delete\n     *\n     * @return boolean true on success, false on failure\n     */\n    abstract protected function delete(array $keys);\n\n    /**\n     * Remove *all* values from cache\n     *\n     * @return boolean true on success, false on failure\n     */\n    protected function purge()\n    {\n        return false;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_data.php",
    "content": "<?php\n/**\n * Smarty Plugin Data\n * This file contains the data object\n *\n * @package    Smarty\n * @subpackage Template\n * @author     Uwe Tews\n */\n\n/**\n * class for the Smarty data object\n * The Smarty data object will hold Smarty variables in the current scope\n *\n * @package    Smarty\n * @subpackage Template\n */\nclass Smarty_Data extends Smarty_Internal_Data\n{\n    /**\n     * Counter\n     *\n     * @var int\n     */\n    static $count = 0;\n\n    /**\n     * Data block name\n     *\n     * @var string\n     */\n    public $dataObjectName = '';\n\n    /**\n     * Smarty object\n     *\n     * @var Smarty\n     */\n    public $smarty = null;\n\n    /**\n     * create Smarty data object\n     *\n     * @param Smarty|array                    $_parent parent template\n     * @param Smarty|Smarty_Internal_Template $smarty  global smarty instance\n     * @param string                          $name    optional data block name\n     *\n     * @throws SmartyException\n     */\n    public function __construct($_parent = null, $smarty = null, $name = null)\n    {\n        parent::__construct();\n        self::$count ++;\n        $this->dataObjectName = 'Data_object ' . (isset($name) ? \"'{$name}'\" : self::$count);\n        $this->smarty = $smarty;\n        if (is_object($_parent)) {\n            // when object set up back pointer\n            $this->parent = $_parent;\n        } elseif (is_array($_parent)) {\n            // set up variable values\n            foreach ($_parent as $_key => $_val) {\n                $this->tpl_vars[ $_key ] = new Smarty_Variable($_val);\n            }\n        } elseif ($_parent !== null) {\n            throw new SmartyException('Wrong type for template variables');\n        }\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_block.php",
    "content": "<?php\n\n/**\n * Smarty {block} tag class\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Block\n{\n    /**\n     * Block name\n     *\n     * @var string\n     */\n    public $name = '';\n\n    /**\n     * Hide attribute\n     *\n     * @var bool\n     */\n    public $hide = false;\n\n    /**\n     * Append attribute\n     *\n     * @var bool\n     */\n    public $append = false;\n\n    /**\n     * prepend attribute\n     *\n     * @var bool\n     */\n    public $prepend = false;\n\n    /**\n     * Block calls $smarty.block.child\n     *\n     * @var bool\n     */\n    public $callsChild = false;\n\n    /**\n     * Inheritance child block\n     *\n     * @var Smarty_Internal_Block|null\n     */\n    public $child = null;\n\n    /**\n     * Inheritance calling parent block\n     *\n     * @var Smarty_Internal_Block|null\n     */\n    public $parent = null;\n\n    /**\n     * Inheritance Template index\n     *\n     * @var int\n     */\n    public $tplIndex = 0;\n\n    /**\n     * Smarty_Internal_Block constructor.\n     * - if outer level {block} of child template ($state === 1) save it as child root block\n     * - otherwise process inheritance and render\n     *\n     * @param string   $name     block name\n     * @param int|null $tplIndex index of outer level {block} if nested\n     */\n    public function __construct($name, $tplIndex)\n    {\n        $this->name = $name;\n        $this->tplIndex = $tplIndex;\n    }\n\n    /**\n     * Compiled block code overloaded by {block} class\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     */\n    public function callBlock(Smarty_Internal_Template $tpl)\n    {\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_cacheresource_file.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin CacheResource File\n *\n * @package    Smarty\n * @subpackage Cacher\n * @author     Uwe Tews\n * @author     Rodney Rehm\n */\n/**\n * This class does contain all necessary methods for the HTML cache on file system\n * Implements the file system as resource for the HTML cache Version ussing nocache inserts.\n *\n * @package    Smarty\n * @subpackage Cacher\n */\nclass Smarty_Internal_CacheResource_File extends Smarty_CacheResource\n{\n    /**\n     * populate Cached Object with meta data from Resource\n     *\n     * @param Smarty_Template_Cached   $cached    cached object\n     * @param Smarty_Internal_Template $_template template object\n     *\n     * @return void\n     */\n    public function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template)\n    {\n        $source = &$_template->source;\n        $smarty = &$_template->smarty;\n        $_compile_dir_sep = $smarty->use_sub_dirs ? DIRECTORY_SEPARATOR : '^';\n        $_filepath = sha1($source->uid . $smarty->_joined_template_dir);\n        $cached->filepath = $smarty->getCacheDir();\n        if (isset($_template->cache_id)) {\n            $cached->filepath .= preg_replace(array('![^\\w|]+!',\n                                                    '![|]+!'),\n                                              array('_',\n                                                    $_compile_dir_sep),\n                                              $_template->cache_id) . $_compile_dir_sep;\n        }\n        if (isset($_template->compile_id)) {\n            $cached->filepath .= preg_replace('![^\\w]+!', '_', $_template->compile_id) . $_compile_dir_sep;\n        }\n        // if use_sub_dirs, break file into directories\n        if ($smarty->use_sub_dirs) {\n            $cached->filepath .= $_filepath[ 0 ] . $_filepath[ 1 ] . DIRECTORY_SEPARATOR . $_filepath[ 2 ] .\n                                 $_filepath[ 3 ] .\n                                 DIRECTORY_SEPARATOR .\n                                 $_filepath[ 4 ] . $_filepath[ 5 ] . DIRECTORY_SEPARATOR;\n        }\n        $cached->filepath .= $_filepath;\n        $basename = $source->handler->getBasename($source);\n        if (!empty($basename)) {\n            $cached->filepath .= '.' . $basename;\n        }\n        if ($smarty->cache_locking) {\n            $cached->lock_id = $cached->filepath . '.lock';\n        }\n        $cached->filepath .= '.php';\n        $cached->timestamp = $cached->exists = is_file($cached->filepath);\n        if ($cached->exists) {\n            $cached->timestamp = filemtime($cached->filepath);\n        }\n    }\n\n    /**\n     * populate Cached Object with timestamp and exists from Resource\n     *\n     * @param Smarty_Template_Cached $cached cached object\n     *\n     * @return void\n     */\n    public function populateTimestamp(Smarty_Template_Cached $cached)\n    {\n        $cached->timestamp = $cached->exists = is_file($cached->filepath);\n        if ($cached->exists) {\n            $cached->timestamp = filemtime($cached->filepath);\n        }\n    }\n\n    /**\n     * Read the cached template and process its header\n     *\n     * @param \\Smarty_Internal_Template $_smarty_tpl do not change variable name, is used by compiled template\n     * @param Smarty_Template_Cached    $cached      cached object\n     * @param bool                      $update      flag if called because cache update\n     *\n     * @return boolean true or false if the cached content does not exist\n     */\n    public function process(Smarty_Internal_Template $_smarty_tpl,\n                            Smarty_Template_Cached $cached = null,\n                            $update = false)\n    {\n        $_smarty_tpl->cached->valid = false;\n        if ($update && defined('HHVM_VERSION')) {\n            eval('?>' . file_get_contents($_smarty_tpl->cached->filepath));\n            return true;\n        } else {\n            return @include $_smarty_tpl->cached->filepath;\n        }\n    }\n\n    /**\n     * Write the rendered template output to cache\n     *\n     * @param Smarty_Internal_Template $_template template object\n     * @param string                   $content   content to cache\n     *\n     * @return bool success\n     * @throws \\SmartyException\n     */\n    public function writeCachedContent(Smarty_Internal_Template $_template, $content)\n    {\n        if ($_template->smarty->ext->_writeFile->writeFile($_template->cached->filepath,\n                                                           $content,\n                                                           $_template->smarty) === true\n        ) {\n            if (function_exists('opcache_invalidate') &&\n                (!function_exists('ini_get') || strlen(ini_get('opcache.restrict_api'))) < 1\n            ) {\n                opcache_invalidate($_template->cached->filepath, true);\n            } else if (function_exists('apc_compile_file')) {\n                apc_compile_file($_template->cached->filepath);\n            }\n            $cached = $_template->cached;\n            $cached->timestamp = $cached->exists = is_file($cached->filepath);\n            if ($cached->exists) {\n                $cached->timestamp = filemtime($cached->filepath);\n                return true;\n            }\n        }\n        return false;\n    }\n\n    /**\n     * Read cached template from cache\n     *\n     * @param  Smarty_Internal_Template $_template template object\n     *\n     * @return string  content\n     */\n    public function readCachedContent(Smarty_Internal_Template $_template)\n    {\n        if (is_file($_template->cached->filepath)) {\n            return file_get_contents($_template->cached->filepath);\n        }\n        return false;\n    }\n\n    /**\n     * Empty cache\n     *\n     * @param Smarty  $smarty\n     * @param integer $exp_time expiration time (number of seconds, not timestamp)\n     *\n     * @return integer number of cache files deleted\n     */\n    public function clearAll(Smarty $smarty, $exp_time = null)\n    {\n        return $smarty->ext->_cacheResourceFile->clear($smarty, null, null, null, $exp_time);\n    }\n\n    /**\n     * Empty cache for a specific template\n     *\n     * @param Smarty  $smarty\n     * @param string  $resource_name template name\n     * @param string  $cache_id      cache id\n     * @param string  $compile_id    compile id\n     * @param integer $exp_time      expiration time (number of seconds, not timestamp)\n     *\n     * @return integer number of cache files deleted\n     */\n    public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)\n    {\n        return $smarty->ext->_cacheResourceFile->clear($smarty, $resource_name, $cache_id, $compile_id, $exp_time);\n    }\n\n    /**\n     * Check is cache is locked for this template\n     *\n     * @param Smarty                 $smarty Smarty object\n     * @param Smarty_Template_Cached $cached cached object\n     *\n     * @return boolean true or false if cache is locked\n     */\n    public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached)\n    {\n        if (version_compare(PHP_VERSION, '5.3.0', '>=')) {\n            clearstatcache(true, $cached->lock_id);\n        } else {\n            clearstatcache();\n        }\n        if (is_file($cached->lock_id)) {\n            $t = filemtime($cached->lock_id);\n            return $t && (time() - $t < $smarty->locking_timeout);\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * Lock cache for this template\n     *\n     * @param Smarty                 $smarty Smarty object\n     * @param Smarty_Template_Cached $cached cached object\n     *\n     * @return bool|void\n     */\n    public function acquireLock(Smarty $smarty, Smarty_Template_Cached $cached)\n    {\n        $cached->is_locked = true;\n        touch($cached->lock_id);\n    }\n\n    /**\n     * Unlock cache for this template\n     *\n     * @param Smarty                 $smarty Smarty object\n     * @param Smarty_Template_Cached $cached cached object\n     *\n     * @return bool|void\n     */\n    public function releaseLock(Smarty $smarty, Smarty_Template_Cached $cached)\n    {\n        $cached->is_locked = false;\n        @unlink($cached->lock_id);\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_append.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Append\n * Compiles the {append} tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Append Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Append extends Smarty_Internal_Compile_Assign\n{\n    /**\n     * Compiles code for the {append} tag\n     *\n     * @param  array                                $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param  array                                $parameter array with compilation parameter\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)\n    {\n        // the following must be assigned at runtime because it will be overwritten in parent class\n        $this->required_attributes = array('var', 'value');\n        $this->shorttag_order = array('var', 'value');\n        $this->optional_attributes = array('scope', 'index');\n        $this->mapCache = array();\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        // map to compile assign attributes\n        if (isset($_attr[ 'index' ])) {\n            $_params[ 'smarty_internal_index' ] = '[' . $_attr[ 'index' ] . ']';\n            unset($_attr[ 'index' ]);\n        } else {\n            $_params[ 'smarty_internal_index' ] = '[]';\n        }\n        $_new_attr = array();\n        foreach ($_attr as $key => $value) {\n            $_new_attr[] = array($key => $value);\n        }\n        // call compile assign\n        return parent::compile($_new_attr, $compiler, $_params);\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_assign.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Assign\n * Compiles the {assign} tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Assign Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Assign extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $option_flags = array('nocache', 'noscope');\n\n   /**\n     * Valid scope names\n     *\n     * @var array\n     */\n    public $valid_scopes = array('local' => Smarty::SCOPE_LOCAL, 'parent' => Smarty::SCOPE_PARENT,\n                                 'root' => Smarty::SCOPE_ROOT, 'global' => Smarty::SCOPE_GLOBAL,\n                                 'tpl_root' => Smarty::SCOPE_TPL_ROOT, 'smarty' => Smarty::SCOPE_SMARTY);\n\n    /**\n     * Compiles code for the {assign} tag\n     *\n     * @param  array                                $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param  array                                $parameter array with compilation parameter\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)\n    {\n        // the following must be assigned at runtime because it will be overwritten in Smarty_Internal_Compile_Append\n        $this->required_attributes = array('var', 'value');\n        $this->shorttag_order = array('var', 'value');\n        $this->optional_attributes = array('scope');\n        $this->mapCache = array();\n        $_nocache = false;\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        // nocache ?\n        if ($_var = $compiler->getId($_attr[ 'var' ])) {\n            $_var = \"'{$_var}'\";\n        } else {\n            $_var = $_attr[ 'var' ];\n        }\n        if ($compiler->tag_nocache || $compiler->nocache) {\n            $_nocache = true;\n            // create nocache var to make it know for further compiling\n            $compiler->setNocacheInVariable($_attr[ 'var' ]);\n        }\n        // scope setup\n        if ($_attr[ 'noscope' ]) {\n            $_scope = - 1;\n        } else {\n            $_scope = $compiler->convertScope($_attr, $this->valid_scopes);\n        }\n        // optional parameter\n        $_params = '';\n        if ($_nocache || $_scope) {\n            $_params .= ' ,' . var_export($_nocache, true);\n        }\n        if ($_scope) {\n            $_params .= ' ,' . $_scope;\n        }\n        if (isset($parameter[ 'smarty_internal_index' ])) {\n            $output =\n                \"<?php \\$_tmp_array = isset(\\$_smarty_tpl->tpl_vars[{$_var}]) ? \\$_smarty_tpl->tpl_vars[{$_var}]->value : array();\\n\";\n            $output .= \"if (!is_array(\\$_tmp_array) || \\$_tmp_array instanceof ArrayAccess) {\\n\";\n            $output .= \"settype(\\$_tmp_array, 'array');\\n\";\n            $output .= \"}\\n\";\n            $output .= \"\\$_tmp_array{$parameter['smarty_internal_index']} = {$_attr['value']};\\n\";\n            $output .= \"\\$_smarty_tpl->_assignInScope({$_var}, \\$_tmp_array{$_params});?>\";\n        } else {\n            $output = \"<?php \\$_smarty_tpl->_assignInScope({$_var}, {$_attr['value']}{$_params});?>\";\n        }\n        return $output;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_block.php",
    "content": "<?php\n/*\n * This file is part of Smarty.\n *\n * (c) 2015 Uwe Tews\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\n/**\n * Smarty Internal Plugin Compile Block Class\n *\n * @author Uwe Tews <uwe.tews@googlemail.com>\n */\nclass Smarty_Internal_Compile_Block extends Smarty_Internal_Compile_Shared_Inheritance\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $required_attributes = array('name');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $shorttag_order = array('name');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $option_flags = array('hide', 'nocache');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('assign');\n\n    /**\n     * Saved compiler object\n     *\n     * @var Smarty_Internal_TemplateCompilerBase\n     */\n    public $compiler = null;\n\n    /**\n     * Compiles code for the {block} tag\n     *\n     * @param  array                                 $args     array with attributes from parser\n     * @param  \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        if (!isset($compiler->_cache['blockNesting'])) {\n            $compiler->_cache['blockNesting'] = 0;\n        }\n        if ($compiler->_cache['blockNesting'] === 0) {\n            // make sure that inheritance gets initialized in template code\n            $this->registerInit($compiler);\n            $this->option_flags = array('hide', 'nocache', 'append', 'prepend');\n        } else {\n            $this->option_flags = array('hide', 'nocache');\n        }\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        $compiler->_cache['blockNesting']++;\n        $_className = 'Block_' . preg_replace('![^\\w]+!', '_', uniqid(rand(), true));\n        $compiler->_cache['blockName'][ $compiler->_cache['blockNesting'] ] = $_attr['name'];\n        $compiler->_cache['blockClass'][ $compiler->_cache['blockNesting'] ] = $_className;\n        $compiler->_cache['blockParams'][ $compiler->_cache['blockNesting'] ] = array();\n        $compiler->_cache['blockParams'][1]['subBlocks'][ trim($_attr['name'], '\"\\'') ][] = $_className;\n        $this->openTag($compiler,\n                       'block',\n                       array($_attr, $compiler->nocache, $compiler->parser->current_buffer,\n                             $compiler->template->compiled->has_nocache_code,\n                             $compiler->template->caching));\n        // must whole block be nocache ?\n        if ($compiler->tag_nocache) {\n            $i = 0;\n        }\n        $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;\n        // $compiler->suppressNocacheProcessing = true;\n        if ($_attr['nocache'] === true) {\n            //$compiler->trigger_template_error('nocache option not allowed', $compiler->parser->lex->taglineno);\n        }\n        $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template();\n        $compiler->template->compiled->has_nocache_code = false;\n        $compiler->suppressNocacheProcessing = true;\n    }\n\n    /**\n     * Compiles code for the {$smarty.block.parent} or {$smarty.block.child}tag\n     *\n     * @param  array                                $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param  array                                $parameter array with compilation parameter\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     */\n    public function compileSpecialVariable($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)\n    {\n        $name = isset($parameter[1]) ? $compiler->getId($parameter[1]) : false;\n        if (!$name) {\n            $compiler->trigger_template_error(\"invalid '\\$smarty.block' expected '\\$smarty.block.child' or '\\$smarty.block.parent'\",\n                                              null,\n                                              true);\n        }\n        if (!isset($compiler->_cache['blockNesting'])) {\n            $compiler->trigger_template_error(\" '\\$smarty.block.{$name}' used outside {block} tags \",\n                                              $compiler->parser->lex->taglineno);\n        }\n        $compiler->suppressNocacheProcessing = true;\n        switch ($name) {\n            case 'child':\n                $compiler->_cache['blockParams'][ $compiler->_cache['blockNesting'] ]['callsChild'] = 'true';\n                return '$_smarty_tpl->inheritance->callChild($_smarty_tpl, $this, true)';\n                break;\n            case 'parent':\n                return '$_smarty_tpl->inheritance->callParent($_smarty_tpl, $this, null, true)';\n                break;\n            default:\n                $compiler->trigger_template_error(\"invalid '\\$smarty.block.{$name}' expected '\\$smarty.block.child' or '\\$smarty.block.parent'\",\n                                                  null,\n                                                  true);\n        }\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile BlockClose Class\n *\n */\nclass Smarty_Internal_Compile_Blockclose extends Smarty_Internal_Compile_Shared_Inheritance\n{\n    /**\n     * Compiles code for the {/block} tag\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     * @internal param array $parameter array with compilation parameter\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        list($_attr, $_nocache, $_buffer, $_has_nocache_code, $_caching) = $this->closeTag($compiler, array('block'));\n        // init block parameter\n        $_block = $compiler->_cache['blockParams'][ $compiler->_cache['blockNesting'] ];\n        unset($compiler->_cache['blockParams'][ $compiler->_cache['blockNesting'] ]);\n        $_name = $_attr['name'];\n        $_assign = isset($_attr['assign']) ? $_attr['assign'] : null;\n        unset($_attr['assign'], $_attr['name']);\n        foreach ($_attr as $name => $stat) {\n            if ((is_bool($stat) && $stat !== false) || (!is_bool($stat) && $stat !== 'false')) {\n                $_block[ $name ] = 'true';\n            }\n        }\n        $_className = $compiler->_cache['blockClass'][ $compiler->_cache['blockNesting'] ];\n        // get compiled block code\n        $_functionCode = $compiler->parser->current_buffer;\n        // setup buffer for template function code\n        $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template();\n\n        $output = \"<?php\\n\";\n        $output .= \"/* {block {$_name}} */\\n\";\n        $output .= \"class {$_className} extends Smarty_Internal_Block\\n\";\n        $output .= \"{\\n\";\n        foreach ($_block as $property => $value) {\n            $output .= \"public \\${$property} = \" . var_export($value, true) . \";\\n\";\n        }\n        $output .= \"public function callBlock(Smarty_Internal_Template \\$_smarty_tpl) {\\n\";\n        //$output .= \"/*/%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%*/\\n\";\n        if ($compiler->template->compiled->has_nocache_code) {\n            $output .= \"\\$_smarty_tpl->cached->hashes['{$compiler->template->compiled->nocache_hash}'] = true;\\n\";\n        }\n        if (isset($_assign)) {\n            $output .= \"ob_start();\\n\";\n        }\n        $output .= \"?>\\n\";\n        $compiler->parser->current_buffer->append_subtree($compiler->parser,\n                                                          new Smarty_Internal_ParseTree_Tag($compiler->parser,\n                                                                                            $output));\n        $compiler->parser->current_buffer->append_subtree($compiler->parser, $_functionCode);\n        $output = \"<?php\\n\";\n        if (isset($_assign)) {\n            $output .= \"\\$_smarty_tpl->assign({$_assign}, ob_get_clean());\\n\";\n        }\n        $output .= \"}\\n\";\n        $output .= \"}\\n\";\n        $output .= \"/* {/block {$_name}} */\\n\\n\";\n        $output .= \"?>\\n\";\n        $compiler->parser->current_buffer->append_subtree($compiler->parser,\n                                                          new Smarty_Internal_ParseTree_Tag($compiler->parser,\n                                                                                            $output));\n        $compiler->blockOrFunctionCode .= $f = $compiler->parser->current_buffer->to_smarty_php($compiler->parser);\n        $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template();\n        // nocache plugins must be copied\n        if (!empty($compiler->template->compiled->required_plugins['nocache'])) {\n            foreach ($compiler->template->compiled->required_plugins['nocache'] as $plugin => $tmp) {\n                foreach ($tmp as $type => $data) {\n                    $compiler->parent_compiler->template->compiled->required_plugins['compiled'][ $plugin ][ $type ] =\n                        $data;\n                }\n            }\n        }\n\n        // restore old status\n        $compiler->template->compiled->has_nocache_code = $_has_nocache_code;\n        $compiler->tag_nocache = $compiler->nocache;\n        $compiler->nocache = $_nocache;\n        $compiler->parser->current_buffer = $_buffer;\n        $output = \"<?php \\n\";\n        if ($compiler->_cache['blockNesting'] === 1) {\n            $output .= \"\\$_smarty_tpl->inheritance->instanceBlock(\\$_smarty_tpl, '$_className', $_name);\\n\";\n        } else {\n            $output .= \"\\$_smarty_tpl->inheritance->instanceBlock(\\$_smarty_tpl, '$_className', $_name, \\$this->tplIndex);\\n\";\n        }\n        $output .= \"?>\\n\";\n        $compiler->_cache['blockNesting']--;\n        if ($compiler->_cache['blockNesting'] === 0) {\n            unset($compiler->_cache['blockNesting']);\n        }\n        $compiler->suppressNocacheProcessing = true;\n        return $output;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_break.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Break\n * Compiles the {break} tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Break Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Break extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('levels');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $shorttag_order = array('levels');\n\n    /**\n    * Tag name may be overloaded by Smarty_Internal_Compile_Continue\n    *\n    * @var string\n    */\n    public $tag = 'break';\n\n    /**\n     * Compiles code for the {break} tag\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        list($levels, $foreachLevels) = $this->checkLevels($args, $compiler);\n        $output = \"<?php \";\n        if ($foreachLevels > 0 && $this->tag === 'continue') {\n            $foreachLevels--;\n        }\n        if ($foreachLevels > 0) {\n            /* @var Smarty_Internal_Compile_Foreach $foreachCompiler */\n            $foreachCompiler = $compiler->getTagCompiler('foreach');\n            $output .= $foreachCompiler->compileRestore($foreachLevels);\n        }\n        $output .= \"{$this->tag} {$levels};?>\";\n        return $output;\n    }\n\n    /**\n     * check attributes and return array of break and foreach levels\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return array\n     * @throws \\SmartyCompilerException\n     */\n    public function checkLevels($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        static $_is_loopy = array('for' => true, 'foreach' => true, 'while' => true, 'section' => true);\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n\n        if ($_attr[ 'nocache' ] === true) {\n            $compiler->trigger_template_error('nocache option not allowed', null, true);\n        }\n\n        if (isset($_attr[ 'levels' ])) {\n            if (!is_numeric($_attr[ 'levels' ])) {\n                $compiler->trigger_template_error('level attribute must be a numeric constant', null, true);\n            }\n            $levels = $_attr[ 'levels' ];\n        } else {\n            $levels = 1;\n        }\n        $level_count = $levels;\n        $stack_count = count($compiler->_tag_stack) - 1;\n        $foreachLevels = 0;\n        $lastTag = '';\n        while ($level_count > 0 && $stack_count >= 0) {\n            if (isset($_is_loopy[ $compiler->_tag_stack[ $stack_count ][ 0 ] ])) {\n                $lastTag = $compiler->_tag_stack[ $stack_count ][ 0 ];\n                if ($level_count === 0) {\n                    break;\n                }\n                $level_count --;\n                if ($compiler->_tag_stack[ $stack_count ][ 0 ] === 'foreach') {\n                    $foreachLevels ++;\n                }\n            }\n            $stack_count --;\n        }\n        if ($level_count !== 0) {\n            $compiler->trigger_template_error(\"cannot {$this->tag} {$levels} level(s)\", null, true);\n        }\n        if ($lastTag === 'foreach' && $this->tag === 'break' && $foreachLevels > 0) {\n            $foreachLevels --;\n        }\n        return array($levels, $foreachLevels);\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_call.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Function_Call\n * Compiles the calls of user defined tags defined by {function}\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Function_Call Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Call extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $required_attributes = array('name');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $shorttag_order = array('name');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('_any');\n\n    /**\n     * Compiles the calls of user defined tags defined by {function}\n     *\n     * @param  array  $args     array with attributes from parser\n     * @param  object $compiler compiler object\n     *\n     * @return string compiled code\n     */\n    public function compile($args, $compiler)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        // save possible attributes\n        if (isset($_attr[ 'assign' ])) {\n            // output will be stored in a smarty variable instead of being displayed\n            $_assign = $_attr[ 'assign' ];\n        }\n        //$_name = trim($_attr['name'], \"''\");\n        $_name = $_attr[ 'name' ];\n        unset($_attr[ 'name' ], $_attr[ 'assign' ], $_attr[ 'nocache' ]);\n        // set flag (compiled code of {function} must be included in cache file\n        if (!$compiler->template->caching || $compiler->nocache || $compiler->tag_nocache) {\n            $_nocache = 'true';\n        } else {\n            $_nocache = 'false';\n        }\n        $_paramsArray = array();\n        foreach ($_attr as $_key => $_value) {\n            if (is_int($_key)) {\n                $_paramsArray[] = \"$_key=>$_value\";\n            } else {\n                $_paramsArray[] = \"'$_key'=>$_value\";\n            }\n        }\n        $_params = 'array(' . implode(',', $_paramsArray) . ')';\n        //$compiler->suppressNocacheProcessing = true;\n        // was there an assign attribute\n        if (isset($_assign)) {\n            $_output =\n                \"<?php ob_start();\\n\\$_smarty_tpl->smarty->ext->_tplFunction->callTemplateFunction(\\$_smarty_tpl, {$_name}, {$_params}, {$_nocache});\\n\\$_smarty_tpl->assign({$_assign}, ob_get_clean());?>\\n\";\n        } else {\n            $_output =\n                \"<?php \\$_smarty_tpl->smarty->ext->_tplFunction->callTemplateFunction(\\$_smarty_tpl, {$_name}, {$_params}, {$_nocache});?>\\n\";\n        }\n        return $_output;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_capture.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Capture\n * Compiles the {capture} tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Capture Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Capture extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $shorttag_order = array('name');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('name', 'assign', 'append');\n\n    /**\n     * Compiles code for the {$smarty.capture.xxx}\n     *\n     * @param  array                            $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase$compiler  compiler object\n     * @param  array                            $parameter array with compilation parameter\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     */\n    public static function compileSpecialVariable($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter = null)\n    {\n        $tag = trim($parameter[ 0 ], '\"\\'');\n        $name = isset($parameter[ 1 ]) ? $compiler->getId($parameter[ 1 ]) : null;\n        if (!$name) {\n            //$compiler->trigger_template_error(\"missing or illegal \\$smarty.{$tag} name attribute\", null, true);\n        }\n        return '$_smarty_tpl->smarty->ext->_capture->getBuffer($_smarty_tpl'.(isset($name)?\", '{$name}')\":')');\n    }\n\n    /**\n     * Compiles code for the {capture} tag\n     *\n     * @param  array                            $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     * @param null                              $parameter\n     *\n     * @return string compiled code\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter = null)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args, $parameter, 'capture');\n\n        $buffer = isset($_attr[ 'name' ]) ? $_attr[ 'name' ] : \"'default'\";\n        $assign = isset($_attr[ 'assign' ]) ? $_attr[ 'assign' ] : 'null';\n        $append = isset($_attr[ 'append' ]) ? $_attr[ 'append' ] : 'null';\n\n        $compiler->_cache[ 'capture_stack' ][] = array($compiler->nocache);\n        // maybe nocache because of nocache variables\n        $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;\n        $_output = \"<?php \\$_smarty_tpl->smarty->ext->_capture->open(\\$_smarty_tpl, $buffer, $assign, $append);?>\";\n\n        return $_output;\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile Captureclose Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_CaptureClose extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {/capture} tag\n     *\n     * @param  array                            $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     * @param null                              $parameter\n     *\n     * @return string compiled code\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args, $parameter, '/capture');\n        // must endblock be nocache?\n        if ($compiler->nocache) {\n            $compiler->tag_nocache = true;\n        }\n\n        list($compiler->nocache) = array_pop($compiler->_cache[ 'capture_stack' ]);\n\n        return \"<?php \\$_smarty_tpl->smarty->ext->_capture->close(\\$_smarty_tpl);?>\";\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_config_load.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Config Load\n * Compiles the {config load} tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Config Load Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Config_Load extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $required_attributes = array('file');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $shorttag_order = array('file', 'section');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('section', 'scope');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $option_flags = array('nocache', 'noscope');\n\n    /**\n     * Valid scope names\n     *\n     * @var array\n     */\n    public $valid_scopes = array('local' => Smarty::SCOPE_LOCAL, 'parent' => Smarty::SCOPE_PARENT,\n                                 'root' => Smarty::SCOPE_ROOT, 'tpl_root' => Smarty::SCOPE_TPL_ROOT,\n                                 'smarty' => Smarty::SCOPE_SMARTY, 'global' => Smarty::SCOPE_SMARTY);\n\n    /**\n     * Compiles code for the {config_load} tag\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n\n        if ($_attr[ 'nocache' ] === true) {\n            $compiler->trigger_template_error('nocache option not allowed', null, true);\n        }\n\n        // save possible attributes\n        $conf_file = $_attr[ 'file' ];\n        if (isset($_attr[ 'section' ])) {\n            $section = $_attr[ 'section' ];\n        } else {\n            $section = 'null';\n        }\n        // scope setup\n        if ($_attr[ 'noscope' ]) {\n            $_scope = - 1;\n        } else {\n            $_scope = $compiler->convertScope($_attr, $this->valid_scopes);\n        }\n\n        // create config object\n        $_output =\n            \"<?php\\n\\$_smarty_tpl->smarty->ext->configLoad->_loadConfigFile(\\$_smarty_tpl, {$conf_file}, {$section}, {$_scope});\\n?>\\n\";\n\n        return $_output;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_continue.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Continue\n * Compiles the {continue} tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Continue Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Continue extends Smarty_Internal_Compile_Break\n{\n    /**\n    * Tag name\n    *\n    * @var string\n    */\n    public $tag = 'continue';\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_debug.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Debug\n * Compiles the {debug} tag.\n * It opens a window the the Smarty Debugging Console.\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Debug Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Debug extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {debug} tag\n     *\n     * @param  array  $args     array with attributes from parser\n     * @param  object $compiler compiler object\n     *\n     * @return string compiled code\n     */\n    public function compile($args, $compiler)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n\n        // compile always as nocache\n        $compiler->tag_nocache = true;\n\n        // display debug template\n        $_output =\n            \"<?php \\$_smarty_debug = new Smarty_Internal_Debug;\\n \\$_smarty_debug->display_debug(\\$_smarty_tpl);\\n\";\n        $_output .= \"unset(\\$_smarty_debug);\\n?>\";\n        return $_output;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_eval.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Eval\n * Compiles the {eval} tag.\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Eval Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Eval extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $required_attributes = array('var');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('assign');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $shorttag_order = array('var', 'assign');\n\n    /**\n     * Compiles code for the {eval} tag\n     *\n     * @param  array  $args     array with attributes from parser\n     * @param  object $compiler compiler object\n     *\n     * @return string compiled code\n     */\n    public function compile($args, $compiler)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        if (isset($_attr[ 'assign' ])) {\n            // output will be stored in a smarty variable instead of being displayed\n            $_assign = $_attr[ 'assign' ];\n        }\n\n        // create template object\n        $_output = \"\\$_template = new {$compiler->smarty->template_class}('eval:'.{$_attr[ 'var' ]}, \\$_smarty_tpl->smarty, \\$_smarty_tpl);\";\n        //was there an assign attribute?\n        if (isset($_assign)) {\n            $_output .= \"\\$_smarty_tpl->assign($_assign,\\$_template->fetch());\";\n        } else {\n            $_output .= 'echo $_template->fetch();';\n        }\n\n        return \"<?php $_output ?>\";\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_extends.php",
    "content": "<?php\n\n/**\n * Smarty Internal Plugin Compile extend\n * Compiles the {extends} tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile extend Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Extends extends Smarty_Internal_Compile_Shared_Inheritance\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $required_attributes = array('file');\n\n    /**\n     * Array of names of optional attribute required by tag\n     * use array('_any') if there is no restriction of attributes names\n     *\n     * @var array\n     */\n    public $optional_attributes = array('extends_resource');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $shorttag_order = array('file');\n\n    /**\n     * Compiles code for the {extends} tag extends: resource\n     *\n     * @param array                                 $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     * @throws \\SmartyException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        if ($_attr[ 'nocache' ] === true) {\n            $compiler->trigger_template_error('nocache option not allowed', $compiler->parser->lex->line - 1);\n        }\n        if (strpos($_attr[ 'file' ], '$_tmp') !== false) {\n            $compiler->trigger_template_error('illegal value for file attribute', $compiler->parser->lex->line - 1);\n        }\n        // add code to initialize inheritance\n        $this->registerInit($compiler, true);\n        $file = trim($_attr[ 'file' ], '\\'\"');\n        if (strlen($file) > 8 && substr($file, 0, 8) === 'extends:') {\n            // generate code for each template\n            $files = array_reverse(explode('|', substr($file, 8)));\n            $i = 0;\n            foreach ($files as $file) {\n                if ($file[ 0 ] === '\"') {\n                    $file = trim($file, '\".');\n                } else {\n                    $file = \"'{$file}'\";\n                }\n                $i ++;\n                if ($i === count($files) && isset($_attr[ 'extends_resource' ])) {\n                    $this->compileEndChild($compiler);\n                }\n                $this->compileInclude($compiler, $file);\n            }\n            if (!isset($_attr[ 'extends_resource' ])) {\n                $this->compileEndChild($compiler);\n            }\n        } else {\n            $this->compileEndChild($compiler, $_attr[ 'file' ]);\n        }\n        $compiler->has_code = false;\n        return '';\n    }\n\n    /**\n     * Add code for inheritance endChild() method to end of template\n     *\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler\n     * @param null|string                           $template optional inheritance parent template\n     *\n     * @throws \\SmartyCompilerException\n     * @throws \\SmartyException\n     */\n    private function compileEndChild(Smarty_Internal_TemplateCompilerBase $compiler, $template = null)\n    {\n        $inlineUids = '';\n        if (isset($template) && $compiler->smarty->merge_compiled_includes) {\n            $code = $compiler->compileTag('include', array($template, array('scope' => 'parent')));\n            if (preg_match('/([,][\\s]*[\\'][a-z0-9]+[\\'][,][\\s]*[\\']content.*[\\'])[)]/', $code, $match)) {\n                $inlineUids = $match[ 1 ];\n            }\n        }\n        $compiler->parser->template_postfix[] = new Smarty_Internal_ParseTree_Tag($compiler->parser,\n                                                                                  '<?php $_smarty_tpl->inheritance->endChild($_smarty_tpl' .\n                                                                                  (isset($template) ?\n                                                                                      \", {$template}{$inlineUids}\" :\n                                                                                      '') . \");\\n?>\");\n    }\n\n    /**\n     * Add code for including subtemplate to end of template\n     *\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler\n     * @param  string                               $template subtemplate name\n     *\n     * @throws \\SmartyCompilerException\n     * @throws \\SmartyException\n     */\n    private function compileInclude(Smarty_Internal_TemplateCompilerBase $compiler, $template)\n    {\n        $compiler->parser->template_postfix[] = new Smarty_Internal_ParseTree_Tag($compiler->parser,\n                                                                                  $compiler->compileTag('include',\n                                                                                                        array($template,\n                                                                                                              array('scope' => 'parent'))));\n    }\n\n    /**\n     * Create source code for {extends} from source components array\n     *\n     * @param []\\Smarty_Internal_Template_Source $components\n     *\n     * @return string\n     */\n    public static function extendsSourceArrayCode($components)\n    {\n        $resources = array();\n        foreach ($components as $source) {\n            $resources[] = $source->resource;\n        }\n        return '{extends file=\\'extends:' . join('|', $resources) . '\\' extends_resource=true}';\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_for.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile For\n * Compiles the {for} {forelse} {/for} tags\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile For Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_For extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {for} tag\n     * Smarty 3 does implement two different syntax's:\n     * - {for $var in $array}\n     * For looping over arrays or iterators\n     * - {for $x=0; $x<$y; $x++}\n     * For general loops\n     * The parser is generating different sets of attribute by which this compiler can\n     * determine which syntax is used.\n     *\n     * @param  array  $args      array with attributes from parser\n     * @param  object $compiler  compiler object\n     * @param  array  $parameter array with compilation parameter\n     *\n     * @return string compiled code\n     */\n    public function compile($args, $compiler, $parameter)\n    {\n        $compiler->loopNesting ++;\n        if ($parameter === 0) {\n            $this->required_attributes = array('start', 'to');\n            $this->optional_attributes = array('max', 'step');\n        } else {\n            $this->required_attributes = array('start', 'ifexp', 'var', 'step');\n            $this->optional_attributes = array();\n        }\n        $this->mapCache = array();\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n\n        $output = \"<?php\\n\";\n        if ($parameter === 1) {\n            foreach ($_attr[ 'start' ] as $_statement) {\n                if (is_array($_statement[ 'var' ])) {\n                    $var = $_statement[ 'var' ][ 'var' ];\n                    $index = $_statement[ 'var' ][ 'smarty_internal_index' ];\n                } else {\n                    $var = $_statement[ 'var' ];\n                    $index = '';\n                }\n                $output .= \"\\$_smarty_tpl->tpl_vars[$var] = new Smarty_Variable(null, \\$_smarty_tpl->isRenderingCache);\\n\";\n                $output .= \"\\$_smarty_tpl->tpl_vars[$var]->value{$index} = {$_statement['value']};\\n\";\n            }\n            if (is_array($_attr[ 'var' ])) {\n                $var = $_attr[ 'var' ][ 'var' ];\n                $index = $_attr[ 'var' ][ 'smarty_internal_index' ];\n            } else {\n                $var = $_attr[ 'var' ];\n                $index = '';\n            }\n            $output .= \"if ($_attr[ifexp]) {\\nfor (\\$_foo=true;$_attr[ifexp]; \\$_smarty_tpl->tpl_vars[$var]->value{$index}$_attr[step]) {\\n\";\n        } else {\n            $_statement = $_attr[ 'start' ];\n            if (is_array($_statement[ 'var' ])) {\n                $var = $_statement[ 'var' ][ 'var' ];\n                $index = $_statement[ 'var' ][ 'smarty_internal_index' ];\n            } else {\n                $var = $_statement[ 'var' ];\n                $index = '';\n            }\n            $output .= \"\\$_smarty_tpl->tpl_vars[$var] = new Smarty_Variable(null, \\$_smarty_tpl->isRenderingCache);\";\n            if (isset($_attr[ 'step' ])) {\n                $output .= \"\\$_smarty_tpl->tpl_vars[$var]->step = $_attr[step];\";\n            } else {\n                $output .= \"\\$_smarty_tpl->tpl_vars[$var]->step = 1;\";\n            }\n            if (isset($_attr[ 'max' ])) {\n                $output .= \"\\$_smarty_tpl->tpl_vars[$var]->total = (int) min(ceil((\\$_smarty_tpl->tpl_vars[$var]->step > 0 ? $_attr[to]+1 - ($_statement[value]) : $_statement[value]-($_attr[to])+1)/abs(\\$_smarty_tpl->tpl_vars[$var]->step)),$_attr[max]);\\n\";\n            } else {\n                $output .= \"\\$_smarty_tpl->tpl_vars[$var]->total = (int) ceil((\\$_smarty_tpl->tpl_vars[$var]->step > 0 ? $_attr[to]+1 - ($_statement[value]) : $_statement[value]-($_attr[to])+1)/abs(\\$_smarty_tpl->tpl_vars[$var]->step));\\n\";\n            }\n            $output .= \"if (\\$_smarty_tpl->tpl_vars[$var]->total > 0) {\\n\";\n            $output .= \"for (\\$_smarty_tpl->tpl_vars[$var]->value{$index} = $_statement[value], \\$_smarty_tpl->tpl_vars[$var]->iteration = 1;\\$_smarty_tpl->tpl_vars[$var]->iteration <= \\$_smarty_tpl->tpl_vars[$var]->total;\\$_smarty_tpl->tpl_vars[$var]->value{$index} += \\$_smarty_tpl->tpl_vars[$var]->step, \\$_smarty_tpl->tpl_vars[$var]->iteration++) {\\n\";\n            $output .= \"\\$_smarty_tpl->tpl_vars[$var]->first = \\$_smarty_tpl->tpl_vars[$var]->iteration === 1;\";\n            $output .= \"\\$_smarty_tpl->tpl_vars[$var]->last = \\$_smarty_tpl->tpl_vars[$var]->iteration === \\$_smarty_tpl->tpl_vars[$var]->total;\";\n        }\n        $output .= '?>';\n\n        $this->openTag($compiler, 'for', array('for', $compiler->nocache));\n        // maybe nocache because of nocache variables\n        $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;\n        // return compiled code\n        return $output;\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile Forelse Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Forelse extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {forelse} tag\n     *\n     * @param  array  $args      array with attributes from parser\n     * @param  object $compiler  compiler object\n     * @param  array  $parameter array with compilation parameter\n     *\n     * @return string compiled code\n     */\n    public function compile($args, $compiler, $parameter)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n\n        list($openTag, $nocache) = $this->closeTag($compiler, array('for'));\n        $this->openTag($compiler, 'forelse', array('forelse', $nocache));\n\n        return \"<?php }} else { ?>\";\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile Forclose Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Forclose extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {/for} tag\n     *\n     * @param  array  $args      array with attributes from parser\n     * @param  object $compiler  compiler object\n     * @param  array  $parameter array with compilation parameter\n     *\n     * @return string compiled code\n     */\n    public function compile($args, $compiler, $parameter)\n    {\n        $compiler->loopNesting --;\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        // must endblock be nocache?\n        if ($compiler->nocache) {\n            $compiler->tag_nocache = true;\n        }\n\n        list($openTag, $compiler->nocache) = $this->closeTag($compiler, array('for', 'forelse'));\n\n        $output = \"<?php }\\n\";\n        if ($openTag !== 'forelse') {\n            $output .= \"}\\n\";\n        }\n        $output .= \"?>\";\n        return $output;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_foreach.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Foreach\n * Compiles the {foreach} {foreachelse} {/foreach} tags\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Foreach Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Foreach extends Smarty_Internal_Compile_Private_ForeachSection\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $required_attributes = array('from', 'item');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('name', 'key', 'properties');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $shorttag_order = array('from', 'item', 'key', 'name');\n\n    /**\n     * counter\n     *\n     * @var int\n     */\n    public $counter = 0;\n\n    /**\n     * Name of this tag\n     *\n     * @var string\n     */\n    public $tagName = 'foreach';\n\n    /**\n     * Valid properties of $smarty.foreach.name.xxx variable\n     *\n     * @var array\n     */\n    public $nameProperties = array('first', 'last', 'index', 'iteration', 'show', 'total');\n\n    /**\n     * Valid properties of $item@xxx variable\n     *\n     * @var array\n     */\n    public $itemProperties = array('first', 'last', 'index', 'iteration', 'show', 'total', 'key');\n\n    /**\n     * Flag if tag had name attribute\n     *\n     * @var bool\n     */\n    public $isNamed = false;\n\n    /**\n     * Compiles code for the {foreach} tag\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     * @throws \\SmartyException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        $compiler->loopNesting ++;\n        // init\n        $this->isNamed = false;\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        $from = $_attr[ 'from' ];\n        $item = $compiler->getId($_attr[ 'item' ]);\n        if ($item === false) {\n            $item = $compiler->getVariableName($_attr[ 'item' ]);\n        }\n        $key = $name = null;\n        $attributes = array('item' => $item);\n        if (isset($_attr[ 'key' ])) {\n            $key = $compiler->getId($_attr[ 'key' ]);\n            if ($key === false) {\n                $key = $compiler->getVariableName($_attr[ 'key' ]);\n            }\n            $attributes[ 'key' ] = $key;\n        }\n        if (isset($_attr[ 'name' ])) {\n            $this->isNamed = true;\n            $name = $attributes[ 'name' ] = $compiler->getId($_attr[ 'name' ]);\n        }\n        foreach ($attributes as $a => $v) {\n            if ($v === false) {\n                $compiler->trigger_template_error(\"'{$a}' attribute/variable has illegal value\", null, true);\n            }\n        }\n        $fromName = $compiler->getVariableName($_attr[ 'from' ]);\n        if ($fromName) {\n            foreach (array('item', 'key') as $a) {\n                if (isset($attributes[ $a ]) && $attributes[ $a ] === $fromName) {\n                    $compiler->trigger_template_error(\"'{$a}' and 'from' may not have same variable name '{$fromName}'\",\n                                                      null, true);\n                }\n            }\n        }\n\n        $itemVar = \"\\$_smarty_tpl->tpl_vars['{$item}']\";\n        $local = '$__foreach_' . $attributes[ 'item' ] . '_' . $this->counter ++ . '_';\n        // search for used tag attributes\n        $itemAttr = array();\n        $namedAttr = array();\n        $this->scanForProperties($attributes, $compiler);\n        if (!empty($this->matchResults[ 'item' ])) {\n            $itemAttr = $this->matchResults[ 'item' ];\n        }\n        if (!empty($this->matchResults[ 'named' ])) {\n            $namedAttr = $this->matchResults[ 'named' ];\n        }\n        if (isset($_attr[ 'properties' ]) && preg_match_all('/[\\'](.*?)[\\']/', $_attr[ 'properties' ], $match)) {\n            foreach ($match[ 1 ] as $prop) {\n                if (in_array($prop, $this->itemProperties)) {\n                    $itemAttr[ $prop ] = true;\n                } else {\n                    $compiler->trigger_template_error(\"Invalid property '{$prop}'\", null, true);\n                }\n            }\n            if ($this->isNamed) {\n                foreach ($match[ 1 ] as $prop) {\n                    if (in_array($prop, $this->nameProperties)) {\n                        $nameAttr[ $prop ] = true;\n                    } else {\n                        $compiler->trigger_template_error(\"Invalid property '{$prop}'\", null, true);\n                    }\n                }\n            }\n        }\n        if (isset($itemAttr[ 'first' ])) {\n            $itemAttr[ 'index' ] = true;\n        }\n        if (isset($namedAttr[ 'first' ])) {\n            $namedAttr[ 'index' ] = true;\n        }\n        if (isset($namedAttr[ 'last' ])) {\n            $namedAttr[ 'iteration' ] = true;\n            $namedAttr[ 'total' ] = true;\n        }\n        if (isset($itemAttr[ 'last' ])) {\n            $itemAttr[ 'iteration' ] = true;\n            $itemAttr[ 'total' ] = true;\n        }\n        if (isset($namedAttr[ 'show' ])) {\n            $namedAttr[ 'total' ] = true;\n        }\n        if (isset($itemAttr[ 'show' ])) {\n            $itemAttr[ 'total' ] = true;\n        }\n        $keyTerm = '';\n        if (isset($attributes[ 'key' ])) {\n            $keyTerm = \"\\$_smarty_tpl->tpl_vars['{$key}']->value => \";\n        }\n        if (isset($itemAttr[ 'key' ])) {\n            $keyTerm = \"{$itemVar}->key => \";\n        }\n        if ($this->isNamed) {\n            $foreachVar = \"\\$_smarty_tpl->tpl_vars['__smarty_foreach_{$attributes['name']}']\";\n        }\n        $needTotal = isset($itemAttr[ 'total' ]);\n        // Register tag\n        $this->openTag($compiler, 'foreach',\n                       array('foreach', $compiler->nocache, $local, $itemVar, empty($itemAttr) ? 1 : 2));\n        // maybe nocache because of nocache variables\n        $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;\n        // generate output code\n        $output = \"<?php\\n\";\n        $output .= \"\\$_from = \\$_smarty_tpl->smarty->ext->_foreach->init(\\$_smarty_tpl, $from, \" .\n                   var_export($item, true);\n        if ($name || $needTotal || $key) {\n            $output .= ', ' . var_export($needTotal, true);\n        }\n        if ($name || $key) {\n            $output .= ', ' . var_export($key, true);\n        }\n        if ($name) {\n            $output .= ', ' . var_export($name, true) . ', ' . var_export($namedAttr, true);\n        }\n        $output .= \");\\n\";\n        if (isset($itemAttr[ 'show' ])) {\n            $output .= \"{$itemVar}->show = ({$itemVar}->total > 0);\\n\";\n        }\n        if (isset($itemAttr[ 'iteration' ])) {\n            $output .= \"{$itemVar}->iteration = 0;\\n\";\n        }\n        if (isset($itemAttr[ 'index' ])) {\n            $output .= \"{$itemVar}->index = -1;\\n\";\n        }\n        $output .= \"if (\\$_from !== null) {\\n\";\n        $output .= \"foreach (\\$_from as {$keyTerm}{$itemVar}->value) {\\n\";\n        if (isset($attributes[ 'key' ]) && isset($itemAttr[ 'key' ])) {\n            $output .= \"\\$_smarty_tpl->tpl_vars['{$key}']->value = {$itemVar}->key;\\n\";\n        }\n        if (isset($itemAttr[ 'iteration' ])) {\n            $output .= \"{$itemVar}->iteration++;\\n\";\n        }\n        if (isset($itemAttr[ 'index' ])) {\n            $output .= \"{$itemVar}->index++;\\n\";\n        }\n        if (isset($itemAttr[ 'first' ])) {\n            $output .= \"{$itemVar}->first = !{$itemVar}->index;\\n\";\n        }\n        if (isset($itemAttr[ 'last' ])) {\n            $output .= \"{$itemVar}->last = {$itemVar}->iteration === {$itemVar}->total;\\n\";\n        }\n        if (isset($foreachVar)) {\n            if (isset($namedAttr[ 'iteration' ])) {\n                $output .= \"{$foreachVar}->value['iteration']++;\\n\";\n            }\n            if (isset($namedAttr[ 'index' ])) {\n                $output .= \"{$foreachVar}->value['index']++;\\n\";\n            }\n            if (isset($namedAttr[ 'first' ])) {\n                $output .= \"{$foreachVar}->value['first'] = !{$foreachVar}->value['index'];\\n\";\n            }\n            if (isset($namedAttr[ 'last' ])) {\n                $output .= \"{$foreachVar}->value['last'] = {$foreachVar}->value['iteration'] === {$foreachVar}->value['total'];\\n\";\n            }\n        }\n        if (!empty($itemAttr)) {\n            $output .= \"{$local}saved = {$itemVar};\\n\";\n        }\n        $output .= '?>';\n\n        return $output;\n    }\n\n    /**\n     * Compiles code for to restore saved template variables\n     *\n     * @param int $levels number of levels to restore\n     *\n     * @return string compiled code\n     */\n    public function compileRestore($levels)\n    {\n        return \"\\$_smarty_tpl->smarty->ext->_foreach->restore(\\$_smarty_tpl, {$levels});\";\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile Foreachelse Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Foreachelse extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {foreachelse} tag\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n\n        list($openTag, $nocache, $local, $itemVar, $restore) = $this->closeTag($compiler, array('foreach'));\n        $this->openTag($compiler, 'foreachelse', array('foreachelse', $nocache, $local, $itemVar, 0));\n        $output = \"<?php\\n\";\n        if ($restore === 2) {\n            $output .= \"{$itemVar} = {$local}saved;\\n\";\n        }\n        $output .= \"}\\n} else {\\n?>\";\n        return $output;\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile Foreachclose Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Foreachclose extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {/foreach} tag\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n      */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        $compiler->loopNesting --;\n        // must endblock be nocache?\n        if ($compiler->nocache) {\n            $compiler->tag_nocache = true;\n        }\n\n        list($openTag, $compiler->nocache, $local, $itemVar, $restore) =\n            $this->closeTag($compiler, array('foreach', 'foreachelse'));\n        $output = \"<?php\\n\";\n\n        if ($restore === 2) {\n            $output .= \"{$itemVar} = {$local}saved;\\n\";\n        }\n        if ($restore > 0) {\n            $output .= \"}\\n\";\n        }\n        $output .= \"}\\n\";\n        /* @var Smarty_Internal_Compile_Foreach $foreachCompiler */\n        $foreachCompiler = $compiler->getTagCompiler('foreach');\n        $output .= $foreachCompiler->compileRestore(1);\n        $output .= \"?>\";\n        return $output;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_function.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Function\n * Compiles the {function} {/function} tags\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Function Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase\n{\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $required_attributes = array('name');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $shorttag_order = array('name');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('_any');\n\n    /**\n     * Compiles code for the {function} tag\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return bool true\n     * @throws \\SmartyCompilerException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n\n        if ($_attr[ 'nocache' ] === true) {\n            $compiler->trigger_template_error('nocache option not allowed', null, true);\n        }\n        unset($_attr[ 'nocache' ]);\n        $_name = trim($_attr[ 'name' ], '\\'\"');\n        $compiler->parent_compiler->tpl_function[ $_name ] = array();\n        $save = array($_attr, $compiler->parser->current_buffer, $compiler->template->compiled->has_nocache_code,\n                      $compiler->template->caching);\n        $this->openTag($compiler, 'function', $save);\n        // Init temporary context\n        $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template();\n        $compiler->template->compiled->has_nocache_code = false;\n        return true;\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile Functionclose Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase\n{\n\n    /**\n     * Compiler object\n     *\n     * @var object\n     */\n    private $compiler = null;\n\n    /**\n     * Compiles code for the {/function} tag\n     *\n     * @param  array                                       $args     array with attributes from parser\n     * @param object|\\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return bool true\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        $this->compiler = $compiler;\n        $saved_data = $this->closeTag($compiler, array('function'));\n        $_attr = $saved_data[ 0 ];\n        $_name = trim($_attr[ 'name' ], '\\'\"');\n        $compiler->parent_compiler->tpl_function[ $_name ][ 'compiled_filepath' ] =\n            $compiler->parent_compiler->template->compiled->filepath;\n        $compiler->parent_compiler->tpl_function[ $_name ][ 'uid' ] = $compiler->template->source->uid;\n        $_parameter = $_attr;\n        unset($_parameter[ 'name' ]);\n        // default parameter\n        $_paramsArray = array();\n        foreach ($_parameter as $_key => $_value) {\n            if (is_int($_key)) {\n                $_paramsArray[] = \"$_key=>$_value\";\n            } else {\n                $_paramsArray[] = \"'$_key'=>$_value\";\n            }\n        }\n        if (!empty($_paramsArray)) {\n            $_params = 'array(' . implode(',', $_paramsArray) . ')';\n            $_paramsCode = \"\\$params = array_merge($_params, \\$params);\\n\";\n        } else {\n            $_paramsCode = '';\n        }\n        $_functionCode = $compiler->parser->current_buffer;\n        // setup buffer for template function code\n        $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template();\n\n        $_funcName = \"smarty_template_function_{$_name}_{$compiler->template->compiled->nocache_hash}\";\n        $_funcNameCaching = $_funcName . '_nocache';\n        if ($compiler->template->compiled->has_nocache_code) {\n            $compiler->parent_compiler->tpl_function[ $_name ][ 'call_name_caching' ] = $_funcNameCaching;\n            $output = \"<?php\\n\";\n            $output .= \"/* {$_funcNameCaching} */\\n\";\n            $output .= \"if (!function_exists('{$_funcNameCaching}')) {\\n\";\n            $output .= \"function {$_funcNameCaching} (Smarty_Internal_Template \\$_smarty_tpl,\\$params) {\\n\";\n            $output .= \"ob_start();\\n\";\n            $output .= \"\\$_smarty_tpl->compiled->has_nocache_code = true;\\n\";\n            $output .= $_paramsCode;\n            $output .= \"foreach (\\$params as \\$key => \\$value) {\\n\\$_smarty_tpl->tpl_vars[\\$key] = new Smarty_Variable(\\$value, \\$_smarty_tpl->isRenderingCache);\\n}\";\n            $output .= \"\\$params = var_export(\\$params, true);\\n\";\n            $output .= \"echo \\\"/*%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%*/<?php \";\n            $output .= \"\\\\\\$_smarty_tpl->smarty->ext->_tplFunction->saveTemplateVariables(\\\\\\$_smarty_tpl, '{$_name}');\\nforeach (\\$params as \\\\\\$key => \\\\\\$value) {\\n\\\\\\$_smarty_tpl->tpl_vars[\\\\\\$key] = new Smarty_Variable(\\\\\\$value, \\\\\\$_smarty_tpl->isRenderingCache);\\n}\\n?>\";\n            $output .= \"/*/%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%*/\\n\\\";?>\";\n            $compiler->parser->current_buffer->append_subtree($compiler->parser,\n                                                              new Smarty_Internal_ParseTree_Tag($compiler->parser,\n                                                                                                $output));\n            $compiler->parser->current_buffer->append_subtree($compiler->parser, $_functionCode);\n            $output = \"<?php echo \\\"/*%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%*/<?php \";\n            $output .= \"\\\\\\$_smarty_tpl->smarty->ext->_tplFunction->restoreTemplateVariables(\\\\\\$_smarty_tpl, '{$_name}');?>\\n\";\n            $output .= \"/*/%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%*/\\\";\\n?>\";\n            $output .= \"<?php echo str_replace('{$compiler->template->compiled->nocache_hash}', \\$_smarty_tpl->compiled->nocache_hash, ob_get_clean());\\n\";\n            $output .= \"}\\n}\\n\";\n            $output .= \"/*/ {$_funcName}_nocache */\\n\\n\";\n            $output .= \"?>\\n\";\n            $compiler->parser->current_buffer->append_subtree($compiler->parser,\n                                                              new Smarty_Internal_ParseTree_Tag($compiler->parser,\n                                                                                                $output));\n            $_functionCode = new Smarty_Internal_ParseTree_Tag($compiler->parser,\n                                                               preg_replace_callback(\"/((<\\?php )?echo '\\/\\*%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%\\*\\/([\\S\\s]*?)\\/\\*\\/%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%\\*\\/';(\\?>\\n)?)/\",\n                                                                                     array($this, 'removeNocache'),\n                                                                                     $_functionCode->to_smarty_php($compiler->parser)));\n        }\n        $compiler->parent_compiler->tpl_function[ $_name ][ 'call_name' ] = $_funcName;\n        $output = \"<?php\\n\";\n        $output .= \"/* {$_funcName} */\\n\";\n        $output .= \"if (!function_exists('{$_funcName}')) {\\n\";\n        $output .= \"function {$_funcName}(Smarty_Internal_Template \\$_smarty_tpl,\\$params) {\\n\";\n        $output .= $_paramsCode;\n        $output .= \"foreach (\\$params as \\$key => \\$value) {\\n\\$_smarty_tpl->tpl_vars[\\$key] = new Smarty_Variable(\\$value, \\$_smarty_tpl->isRenderingCache);\\n}?>\";\n        $compiler->parser->current_buffer->append_subtree($compiler->parser,\n                                                          new Smarty_Internal_ParseTree_Tag($compiler->parser,\n                                                                                            $output));\n        $compiler->parser->current_buffer->append_subtree($compiler->parser, $_functionCode);\n        $output = \"<?php\\n}}\\n\";\n        $output .= \"/*/ {$_funcName} */\\n\\n\";\n        $output .= \"?>\\n\";\n        $compiler->parser->current_buffer->append_subtree($compiler->parser,\n                                                          new Smarty_Internal_ParseTree_Tag($compiler->parser,\n                                                                                            $output));\n        $compiler->parent_compiler->blockOrFunctionCode .= $compiler->parser->current_buffer->to_smarty_php($compiler->parser);\n        // nocache plugins must be copied\n        if (!empty($compiler->template->compiled->required_plugins[ 'nocache' ])) {\n            foreach ($compiler->template->compiled->required_plugins[ 'nocache' ] as $plugin => $tmp) {\n                foreach ($tmp as $type => $data) {\n                    $compiler->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin ][ $type ] =\n                        $data;\n                }\n            }\n        }\n        // restore old buffer\n\n        $compiler->parser->current_buffer = $saved_data[ 1 ];\n        // restore old status\n        $compiler->template->compiled->has_nocache_code = $saved_data[ 2 ];\n        $compiler->template->caching = $saved_data[ 3 ];\n        return true;\n    }\n\n    /**\n     * Remove nocache code\n     *\n     * @param $match\n     *\n     * @return string\n     */\n    function removeNocache($match)\n    {\n        $code =\n            preg_replace(\"/((<\\?php )?echo '\\/\\*%%SmartyNocache:{$this->compiler->template->compiled->nocache_hash}%%\\*\\/)|(\\/\\*\\/%%SmartyNocache:{$this->compiler->template->compiled->nocache_hash}%%\\*\\/';(\\?>\\n)?)/\",\n                         '', $match[ 0 ]);\n        $code = str_replace(array('\\\\\\'', '\\\\\\\\\\''), array('\\'', '\\\\\\''), $code);\n        return $code;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_if.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile If\n * Compiles the {if} {else} {elseif} {/if} tags\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile If Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_If extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {if} tag\n     *\n     * @param array                                 $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param array                                 $parameter array with compilation parameter\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        $this->openTag($compiler, 'if', array(1, $compiler->nocache));\n        // must whole block be nocache ?\n        $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;\n\n        if (!isset($parameter['if condition'])) {\n            $compiler->trigger_template_error('missing if condition', null, true);\n        }\n\n        if (is_array($parameter[ 'if condition' ])) {\n            if (is_array($parameter[ 'if condition' ][ 'var' ])) {\n                $var = $parameter[ 'if condition' ][ 'var' ][ 'var' ];\n            } else {\n                $var = $parameter[ 'if condition' ][ 'var' ];\n            }\n            if ($compiler->nocache) {\n                // create nocache var to make it know for further compiling\n                $compiler->setNocacheInVariable($var);\n            }\n            $prefixVar = $compiler->getNewPrefixVariable();\n            $_output = \"<?php {$prefixVar} = {$parameter[ 'if condition' ][ 'value' ]};?>\\n\";\n            $assignAttr = array();\n            $assignAttr[][ 'value' ] = $prefixVar;\n            $assignCompiler = new Smarty_Internal_Compile_Assign();\n            if (is_array($parameter[ 'if condition' ][ 'var' ])) {\n                $assignAttr[][ 'var' ] = $parameter[ 'if condition' ][ 'var' ][ 'var' ];\n                $_output .= $assignCompiler->compile($assignAttr, $compiler,\n                                                    array('smarty_internal_index' => $parameter[ 'if condition' ][ 'var' ][ 'smarty_internal_index' ]));\n            } else {\n                $assignAttr[][ 'var' ] = $parameter[ 'if condition' ][ 'var' ];\n                $_output .= $assignCompiler->compile($assignAttr, $compiler, array());\n            }\n            $_output .= \"<?php if ({$prefixVar}) {?>\";\n            return $_output;\n        } else {\n            return \"<?php if ({$parameter['if condition']}) {?>\";\n        }\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile Else Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Else extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {else} tag\n     *\n     * @param array                                 $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n      */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        list($nesting, $compiler->tag_nocache) = $this->closeTag($compiler, array('if', 'elseif'));\n        $this->openTag($compiler, 'else', array($nesting, $compiler->tag_nocache));\n\n        return '<?php } else { ?>';\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile ElseIf Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Elseif extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {elseif} tag\n     *\n     * @param array                                 $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param array                                 $parameter array with compilation parameter\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n\n        list($nesting, $compiler->tag_nocache) = $this->closeTag($compiler, array('if', 'elseif'));\n\n        if (!isset($parameter['if condition'])) {\n            $compiler->trigger_template_error('missing elseif condition', null, true);\n        }\n\n        $assignCode = '';\n        $var = '';\n        if (is_array($parameter[ 'if condition' ])) {\n            $condition_by_assign = true;\n            if (is_array($parameter[ 'if condition' ][ 'var' ])) {\n                $var = $parameter[ 'if condition' ][ 'var' ][ 'var' ];\n            } else {\n                $var = $parameter[ 'if condition' ][ 'var' ];\n            }\n            if ($compiler->nocache) {\n                // create nocache var to make it know for further compiling\n                $compiler->setNocacheInVariable($var);\n            }\n            $prefixVar = $compiler->getNewPrefixVariable();\n            $assignCode = \"<?php {$prefixVar} = {$parameter[ 'if condition' ][ 'value' ]};?>\\n\";\n            $assignCompiler = new Smarty_Internal_Compile_Assign();\n            $assignAttr = array();\n            $assignAttr[][ 'value' ] = $prefixVar;\n            if (is_array($parameter[ 'if condition' ][ 'var' ])) {\n                $assignAttr[][ 'var' ] = $parameter[ 'if condition' ][ 'var' ][ 'var' ];\n                $assignCode .= $assignCompiler->compile($assignAttr, $compiler,\n                                                       array('smarty_internal_index' => $parameter[ 'if condition' ][ 'var' ][ 'smarty_internal_index' ]));\n            } else {\n                $assignAttr[][ 'var' ] = $parameter[ 'if condition' ][ 'var' ];\n                $assignCode .= $assignCompiler->compile($assignAttr, $compiler, array());\n            }\n        } else {\n            $condition_by_assign = false;\n        }\n\n        $prefixCode = $compiler->getPrefixCode();\n        if (empty($prefixCode)) {\n            if ($condition_by_assign) {\n                $this->openTag($compiler, 'elseif', array($nesting + 1, $compiler->tag_nocache));\n                $_output = $compiler->appendCode(\"<?php } else {\\n?>\", $assignCode);\n                return $compiler->appendCode($_output, \"<?php if ({$prefixVar}) {?>\");\n            } else {\n                $this->openTag($compiler, 'elseif', array($nesting, $compiler->tag_nocache));\n                return \"<?php } elseif ({$parameter['if condition']}) {?>\";\n            }\n        } else {\n            $_output = $compiler->appendCode(\"<?php } else {\\n?>\", $prefixCode);\n            $this->openTag($compiler, 'elseif', array($nesting + 1, $compiler->tag_nocache));\n            if ($condition_by_assign) {\n                $_output = $compiler->appendCode($_output, $assignCode);\n                return $compiler->appendCode($_output, \"<?php if ({$prefixVar}) {?>\");\n            } else {\n                return $compiler->appendCode($_output, \"<?php if ({$parameter['if condition']}) {?>\");\n            }\n        }\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile Ifclose Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Ifclose extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {/if} tag\n     *\n     * @param array                                 $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        // must endblock be nocache?\n        if ($compiler->nocache) {\n            $compiler->tag_nocache = true;\n        }\n        list($nesting, $compiler->nocache) = $this->closeTag($compiler, array('if', 'else', 'elseif'));\n        $tmp = '';\n        for ($i = 0; $i < $nesting; $i ++) {\n            $tmp .= '}';\n        }\n\n        return \"<?php {$tmp}?>\";\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_include.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Include\n * Compiles the {include} tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n/**\n * Smarty Internal Plugin Compile Include Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase\n{\n    /**\n     * caching mode to create nocache code but no cache file\n     */\n    const CACHING_NOCACHE_CODE = 9999;\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $required_attributes = array('file');\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $shorttag_order = array('file');\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $option_flags = array('nocache', 'inline', 'caching');\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('_any');\n    /**\n     * Valid scope names\n     *\n     * @var array\n     */\n    public $valid_scopes = array('parent' => Smarty::SCOPE_PARENT, 'root' => Smarty::SCOPE_ROOT,\n                                 'global' => Smarty::SCOPE_GLOBAL, 'tpl_root' => Smarty::SCOPE_TPL_ROOT,\n                                 'smarty' => Smarty::SCOPE_SMARTY);\n\n    /**\n     * Compiles code for the {include} tag\n     *\n     * @param  array                                  $args     array with attributes from parser\n     * @param  Smarty_Internal_SmartyTemplateCompiler $compiler compiler object\n     *\n     * @return string\n     * @throws \\Exception\n     * @throws \\SmartyCompilerException\n     * @throws \\SmartyException\n     */\n    public function compile($args, Smarty_Internal_SmartyTemplateCompiler $compiler)\n    {\n        $uid = $t_hash = null;\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        $fullResourceName = $source_resource = $_attr[ 'file' ];\n        $variable_template = false;\n        $cache_tpl = false;\n        // parse resource_name\n        if (preg_match('/^([\\'\"])(([A-Za-z0-9_\\-]{2,})[:])?(([^$()]+)|(.+))\\1$/', $source_resource, $match)) {\n            $type = !empty($match[ 3 ]) ? $match[ 3 ] : $compiler->template->smarty->default_resource_type;\n            $name = !empty($match[ 5 ]) ? $match[ 5 ] : $match[ 6 ];\n            $handler = Smarty_Resource::load($compiler->smarty, $type);\n            if ($handler->recompiled || $handler->uncompiled) {\n                $variable_template = true;\n            }\n            if (!$variable_template) {\n                if ($type !== 'string') {\n                    $fullResourceName = \"{$type}:{$name}\";\n                    $compiled = $compiler->parent_compiler->template->compiled;\n                    if (isset($compiled->includes[ $fullResourceName ])) {\n                        $compiled->includes[ $fullResourceName ]++;\n                        $cache_tpl = true;\n                    } else {\n                        if (\"{$compiler->template->source->type}:{$compiler->template->source->name}\" ==\n                            $fullResourceName\n                        ) {\n                            // recursive call of current template\n                            $compiled->includes[ $fullResourceName ] = 2;\n                            $cache_tpl = true;\n                        } else {\n                            $compiled->includes[ $fullResourceName ] = 1;\n                        }\n                    }\n                    $fullResourceName = $match[ 1 ] . $fullResourceName . $match[ 1 ];\n                }\n            }\n            if (empty($match[ 5 ])) {\n                $variable_template = true;\n            }\n        } else {\n            $variable_template = true;\n        }\n        // scope setup\n        $_scope = $compiler->convertScope($_attr, $this->valid_scopes);\n        // set flag to cache subtemplate object when called within loop or template name is variable.\n        if ($cache_tpl || $variable_template || $compiler->loopNesting > 0) {\n            $_cache_tpl = 'true';\n        } else {\n            $_cache_tpl = 'false';\n        }\n        // assume caching is off\n        $_caching = Smarty::CACHING_OFF;\n        $call_nocache = $compiler->tag_nocache || $compiler->nocache;\n        // caching was on and {include} is not in nocache mode\n        if ($compiler->template->caching && !$compiler->nocache && !$compiler->tag_nocache) {\n            $_caching = self::CACHING_NOCACHE_CODE;\n        }\n        // flag if included template code should be merged into caller\n        $merge_compiled_includes = ($compiler->smarty->merge_compiled_includes || $_attr[ 'inline' ] === true) &&\n                                   !$compiler->template->source->handler->recompiled;\n        if ($merge_compiled_includes) {\n            // variable template name ?\n            if ($variable_template) {\n                $merge_compiled_includes = false;\n            }\n            // variable compile_id?\n            if (isset($_attr[ 'compile_id' ]) && $compiler->isVariable($_attr[ 'compile_id' ])) {\n                $merge_compiled_includes = false;\n            }\n        }\n        /*\n        * if the {include} tag provides individual parameter for caching or compile_id\n        * the subtemplate must not be included into the common cache file and is treated like\n        * a call in nocache mode.\n        *\n        */\n        if ($_attr[ 'nocache' ] !== true && $_attr[ 'caching' ]) {\n            $_caching = $_new_caching = (int)$_attr[ 'caching' ];\n            $call_nocache = true;\n        } else {\n            $_new_caching = Smarty::CACHING_LIFETIME_CURRENT;\n        }\n        if (isset($_attr[ 'cache_lifetime' ])) {\n            $_cache_lifetime = $_attr[ 'cache_lifetime' ];\n            $call_nocache = true;\n            $_caching = $_new_caching;\n        } else {\n            $_cache_lifetime = '$_smarty_tpl->cache_lifetime';\n        }\n        if (isset($_attr[ 'cache_id' ])) {\n            $_cache_id = $_attr[ 'cache_id' ];\n            $call_nocache = true;\n            $_caching = $_new_caching;\n        } else {\n            $_cache_id = '$_smarty_tpl->cache_id';\n        }\n        if (isset($_attr[ 'compile_id' ])) {\n            $_compile_id = $_attr[ 'compile_id' ];\n        } else {\n            $_compile_id = '$_smarty_tpl->compile_id';\n        }\n        // if subtemplate will be called in nocache mode do not merge\n        if ($compiler->template->caching && $call_nocache) {\n            $merge_compiled_includes = false;\n        }\n        // assign attribute\n        if (isset($_attr[ 'assign' ])) {\n            // output will be stored in a smarty variable instead of being displayed\n            if ($_assign = $compiler->getId($_attr[ 'assign' ])) {\n                $_assign = \"'{$_assign}'\";\n                if ($compiler->tag_nocache || $compiler->nocache || $call_nocache) {\n                    // create nocache var to make it know for further compiling\n                    $compiler->setNocacheInVariable($_attr[ 'assign' ]);\n                }\n            } else {\n                $_assign = $_attr[ 'assign' ];\n            }\n        }\n        $has_compiled_template = false;\n        if ($merge_compiled_includes) {\n            $c_id = isset($_attr[ 'compile_id' ]) ? $_attr[ 'compile_id' ] : $compiler->template->compile_id;\n            // we must observe different compile_id and caching\n            $t_hash = sha1($c_id . ($_caching ? '--caching' : '--nocaching'));\n            $compiler->smarty->allow_ambiguous_resources = true;\n            /* @var Smarty_Internal_Template $tpl */\n            $tpl = new $compiler->smarty->template_class (trim($fullResourceName, '\"\\''), $compiler->smarty,\n                                                          $compiler->template, $compiler->template->cache_id, $c_id,\n                                                          $_caching);\n            $uid = $tpl->source->type . $tpl->source->uid;\n            if (!isset($compiler->parent_compiler->mergedSubTemplatesData[ $uid ][ $t_hash ])) {\n                $has_compiled_template = $this->compileInlineTemplate($compiler, $tpl, $t_hash);\n            } else {\n                $has_compiled_template = true;\n            }\n            unset($tpl);\n        }\n        // delete {include} standard attributes\n        unset($_attr[ 'file' ], $_attr[ 'assign' ], $_attr[ 'cache_id' ], $_attr[ 'compile_id' ], $_attr[ 'cache_lifetime' ], $_attr[ 'nocache' ], $_attr[ 'caching' ], $_attr[ 'scope' ], $_attr[ 'inline' ]);\n        // remaining attributes must be assigned as smarty variable\n        $_vars = 'array()';\n        if (!empty($_attr)) {\n            $_pairs = array();\n            // create variables\n            foreach ($_attr as $key => $value) {\n                $_pairs[] = \"'$key'=>$value\";\n            }\n            $_vars = 'array(' . join(',', $_pairs) . ')';\n        }\n        $update_compile_id = $compiler->template->caching && !$compiler->tag_nocache && !$compiler->nocache &&\n                             $_compile_id !== '$_smarty_tpl->compile_id';\n        if ($has_compiled_template && !$call_nocache) {\n            $_output = \"<?php\\n\";\n            if ($update_compile_id) {\n                $_output .= $compiler->makeNocacheCode(\"\\$_compile_id_save[] = \\$_smarty_tpl->compile_id;\\n\\$_smarty_tpl->compile_id = {$_compile_id};\\n\");\n            }\n            if (!empty($_attr) && $_caching === 9999 && $compiler->template->caching) {\n                $_vars_nc = \"foreach ($_vars as \\$ik => \\$iv) {\\n\";\n                $_vars_nc .= \"\\$_smarty_tpl->tpl_vars[\\$ik] =  new Smarty_Variable(\\$iv);\\n\";\n                $_vars_nc .= \"}\\n\";\n                $_output .= substr($compiler->processNocacheCode('<?php ' . $_vars_nc . \"?>\\n\", true), 6, -3);\n            }\n            if (isset($_assign)) {\n                $_output .= \"ob_start();\\n\";\n            }\n            $_output .= \"\\$_smarty_tpl->_subTemplateRender({$fullResourceName}, {$_cache_id}, {$_compile_id}, {$_caching}, {$_cache_lifetime}, {$_vars}, {$_scope}, {$_cache_tpl}, '{$compiler->parent_compiler->mergedSubTemplatesData[$uid][$t_hash]['uid']}', '{$compiler->parent_compiler->mergedSubTemplatesData[$uid][$t_hash]['func']}');\\n\";\n            if (isset($_assign)) {\n                $_output .= \"\\$_smarty_tpl->assign({$_assign}, ob_get_clean());\\n\";\n            }\n            if ($update_compile_id) {\n                $_output .= $compiler->makeNocacheCode(\"\\$_smarty_tpl->compile_id = array_pop(\\$_compile_id_save);\\n\");\n            }\n            $_output .= \"?>\";\n            return $_output;\n        }\n        if ($call_nocache) {\n            $compiler->tag_nocache = true;\n        }\n        $_output = \"<?php \";\n        if ($update_compile_id) {\n            $_output .= \"\\$_compile_id_save[] = \\$_smarty_tpl->compile_id;\\n\\$_smarty_tpl->compile_id = {$_compile_id};\\n\";\n        }\n        // was there an assign attribute\n        if (isset($_assign)) {\n            $_output .= \"ob_start();\\n\";\n        }\n        $_output .= \"\\$_smarty_tpl->_subTemplateRender({$fullResourceName}, $_cache_id, $_compile_id, $_caching, $_cache_lifetime, $_vars, $_scope, {$_cache_tpl});\\n\";\n        if (isset($_assign)) {\n            $_output .= \"\\$_smarty_tpl->assign({$_assign}, ob_get_clean());\\n\";\n        }\n        if ($update_compile_id) {\n            $_output .= \"\\$_smarty_tpl->compile_id = array_pop(\\$_compile_id_save);\\n\";\n        }\n        $_output .= \"?>\";\n        return $_output;\n    }\n\n    /**\n     * Compile inline sub template\n     *\n     * @param \\Smarty_Internal_SmartyTemplateCompiler $compiler\n     * @param \\Smarty_Internal_Template               $tpl\n     * @param  string                                 $t_hash\n     *\n     * @return bool\n     * @throws \\Exception\n     * @throws \\SmartyException\n     */\n    public function compileInlineTemplate(Smarty_Internal_SmartyTemplateCompiler $compiler,\n                                          Smarty_Internal_Template $tpl,\n                                          $t_hash)\n    {\n        $uid = $tpl->source->type . $tpl->source->uid;\n        if (!($tpl->source->handler->uncompiled) && $tpl->source->exists) {\n            $compiler->parent_compiler->mergedSubTemplatesData[ $uid ][ $t_hash ][ 'uid' ] = $tpl->source->uid;\n            if (isset($compiler->template->inheritance)) {\n                $tpl->inheritance = clone $compiler->template->inheritance;\n            }\n            $tpl->compiled = new Smarty_Template_Compiled();\n            $tpl->compiled->nocache_hash = $compiler->parent_compiler->template->compiled->nocache_hash;\n            $tpl->loadCompiler();\n            // save unique function name\n            $compiler->parent_compiler->mergedSubTemplatesData[ $uid ][ $t_hash ][ 'func' ] =\n            $tpl->compiled->unifunc = 'content_' . str_replace(array('.', ','), '_', uniqid('', true));\n            // make sure whole chain gets compiled\n            $tpl->mustCompile = true;\n            $compiler->parent_compiler->mergedSubTemplatesData[ $uid ][ $t_hash ][ 'nocache_hash' ] =\n                $tpl->compiled->nocache_hash;\n            if ($compiler->template->source->type === 'file') {\n                $sourceInfo = $compiler->template->source->filepath;\n            } else {\n                $basename = $compiler->template->source->handler->getBasename($compiler->template->source);\n                $sourceInfo = $compiler->template->source->type . ':' .\n                              ($basename ? $basename : $compiler->template->source->name);\n            }\n            // get compiled code\n            $compiled_code = \"<?php\\n\\n\";\n            $compiled_code .= \"/* Start inline template \\\"{$sourceInfo}\\\" =============================*/\\n\";\n            $compiled_code .= \"function {$tpl->compiled->unifunc} (Smarty_Internal_Template \\$_smarty_tpl) {\\n\";\n            $compiled_code .= \"?>\\n\" . $tpl->compiler->compileTemplateSource($tpl, null, $compiler->parent_compiler);\n            $compiled_code .= \"<?php\\n\";\n            $compiled_code .= \"}\\n?>\\n\";\n            $compiled_code .= $tpl->compiler->postFilter($tpl->compiler->blockOrFunctionCode);\n            $compiled_code .= \"<?php\\n\\n\";\n            $compiled_code .= \"/* End inline template \\\"{$sourceInfo}\\\" =============================*/\\n\";\n            $compiled_code .= '?>';\n            unset($tpl->compiler);\n            if ($tpl->compiled->has_nocache_code) {\n                // replace nocache_hash\n                $compiled_code =\n                    str_replace(\"{$tpl->compiled->nocache_hash}\",\n                                $compiler->template->compiled->nocache_hash,\n                                $compiled_code);\n                $compiler->template->compiled->has_nocache_code = true;\n            }\n            $compiler->parent_compiler->mergedSubTemplatesCode[ $tpl->compiled->unifunc ] = $compiled_code;\n            return true;\n        } else {\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_include_php.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Include PHP\n * Compiles the {include_php} tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n/**\n * Smarty Internal Plugin Compile Insert Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Include_Php extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $required_attributes = array('file');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $shorttag_order = array('file');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('once', 'assign');\n\n    /**\n     * Compiles code for the {include_php} tag\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string\n     * @throws \\SmartyCompilerException\n     * @throws \\SmartyException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        if (!($compiler->smarty instanceof SmartyBC)) {\n            throw new SmartyException(\"{include_php} is deprecated, use SmartyBC class to enable\");\n        }\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        /** @var Smarty_Internal_Template $_smarty_tpl\n         * used in evaluated code\n         */\n        $_smarty_tpl = $compiler->template;\n        $_filepath = false;\n        $_file = null;\n        eval('$_file = @' . $_attr[ 'file' ] . ';');\n        if (!isset($compiler->smarty->security_policy) && file_exists($_file)) {\n            $_filepath = $compiler->smarty->_realpath($_file, true);\n        } else {\n            if (isset($compiler->smarty->security_policy)) {\n                $_dir = $compiler->smarty->security_policy->trusted_dir;\n            } else {\n                $_dir = $compiler->smarty->trusted_dir;\n            }\n            if (!empty($_dir)) {\n                foreach ((array)$_dir as $_script_dir) {\n                    $_path = $compiler->smarty->_realpath($_script_dir . DIRECTORY_SEPARATOR . $_file, true);\n                    if (file_exists($_path)) {\n                        $_filepath = $_path;\n                        break;\n                    }\n                }\n            }\n        }\n        if ($_filepath === false) {\n            $compiler->trigger_template_error(\"{include_php} file '{$_file}' is not readable\", null, true);\n        }\n        if (isset($compiler->smarty->security_policy)) {\n            $compiler->smarty->security_policy->isTrustedPHPDir($_filepath);\n        }\n        if (isset($_attr[ 'assign' ])) {\n            // output will be stored in a smarty variable instead of being displayed\n            $_assign = $_attr[ 'assign' ];\n        }\n        $_once = '_once';\n        if (isset($_attr[ 'once' ])) {\n            if ($_attr[ 'once' ] === 'false') {\n                $_once = '';\n            }\n        }\n        if (isset($_assign)) {\n            return \"<?php ob_start();\\ninclude{$_once} ('{$_filepath}');\\n\\$_smarty_tpl->assign({$_assign},ob_get_clean());\\n?>\";\n        } else {\n            return \"<?php include{$_once} ('{$_filepath}');?>\\n\";\n        }\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_insert.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Insert\n * Compiles the {insert} tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Insert Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $required_attributes = array('name');\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $shorttag_order = array('name');\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('_any');\n\n    /**\n     * Compiles code for the {insert} tag\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     * @throws \\SmartyException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        $nocacheParam = $compiler->template->caching && ($compiler->tag_nocache || $compiler->nocache);\n        if (!$nocacheParam) {\n            // do not compile as nocache code\n            $compiler->suppressNocacheProcessing = true;\n        }\n        $compiler->tag_nocache = true;\n        $_smarty_tpl = $compiler->template;\n        $_name = null;\n        $_script = null;\n        $_output = '<?php ';\n        // save possible attributes\n        eval('$_name = @' . $_attr[ 'name' ] . ';');\n        if (isset($_attr[ 'assign' ])) {\n            // output will be stored in a smarty variable instead of being displayed\n            $_assign = $_attr[ 'assign' ];\n            // create variable to make sure that the compiler knows about its nocache status\n            $var = trim($_attr[ 'assign' ], '\\'');\n            if (isset($compiler->template->tpl_vars[ $var ])) {\n                $compiler->template->tpl_vars[ $var ]->nocache = true;\n            } else {\n                $compiler->template->tpl_vars[ $var ] = new Smarty_Variable(null, true);\n            }\n        }\n        if (isset($_attr[ 'script' ])) {\n            // script which must be included\n            $_function = \"smarty_insert_{$_name}\";\n            $_smarty_tpl = $compiler->template;\n            $_filepath = false;\n            eval('$_script = @' . $_attr[ 'script' ] . ';');\n            if (!isset($compiler->smarty->security_policy) && file_exists($_script)) {\n                $_filepath = $_script;\n            } else {\n                if (isset($compiler->smarty->security_policy)) {\n                    $_dir = $compiler->smarty->security_policy->trusted_dir;\n                } else {\n                    $_dir = $compiler->smarty instanceof SmartyBC ? $compiler->smarty->trusted_dir : null;\n                }\n                if (!empty($_dir)) {\n                    foreach ((array)$_dir as $_script_dir) {\n                        $_script_dir = rtrim($_script_dir, '/\\\\') . DIRECTORY_SEPARATOR;\n                        if (file_exists($_script_dir . $_script)) {\n                            $_filepath = $_script_dir . $_script;\n                            break;\n                        }\n                    }\n                }\n            }\n            if ($_filepath === false) {\n                $compiler->trigger_template_error(\"{insert} missing script file '{$_script}'\", null, true);\n            }\n            // code for script file loading\n            $_output .= \"require_once '{$_filepath}' ;\";\n            require_once $_filepath;\n            if (!is_callable($_function)) {\n                $compiler->trigger_template_error(\" {insert} function '{$_function}' is not callable in script file '{$_script}'\",\n                                                  null,\n                                                  true);\n            }\n        } else {\n            $_filepath = 'null';\n            $_function = \"insert_{$_name}\";\n            // function in PHP script ?\n            if (!is_callable($_function)) {\n                // try plugin\n                if (!$_function = $compiler->getPlugin($_name, 'insert')) {\n                    $compiler->trigger_template_error(\"{insert} no function or plugin found for '{$_name}'\",\n                                                      null,\n                                                      true);\n                }\n            }\n        }\n        // delete {insert} standard attributes\n        unset($_attr[ 'name' ], $_attr[ 'assign' ], $_attr[ 'script' ], $_attr[ 'nocache' ]);\n        // convert attributes into parameter array string\n        $_paramsArray = array();\n        foreach ($_attr as $_key => $_value) {\n            $_paramsArray[] = \"'$_key' => $_value\";\n        }\n        $_params = 'array(' . implode(\", \", $_paramsArray) . ')';\n        // call insert\n        if (isset($_assign)) {\n            if ($_smarty_tpl->caching && !$nocacheParam) {\n                $_output .= \"echo Smarty_Internal_Nocache_Insert::compile ('{$_function}',{$_params}, \\$_smarty_tpl, '{$_filepath}',{$_assign});?>\";\n            } else {\n                $_output .= \"\\$_smarty_tpl->assign({$_assign} , {$_function} ({$_params},\\$_smarty_tpl), true);?>\";\n            }\n        } else {\n            if ($_smarty_tpl->caching && !$nocacheParam) {\n                $_output .= \"echo Smarty_Internal_Nocache_Insert::compile ('{$_function}',{$_params}, \\$_smarty_tpl, '{$_filepath}');?>\";\n            } else {\n                $_output .= \"echo {$_function}({$_params},\\$_smarty_tpl);?>\";\n            }\n        }\n        return $_output;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_ldelim.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Ldelim\n * Compiles the {ldelim} tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Ldelim Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Ldelim extends Smarty_Internal_CompileBase\n{\n   /**\n     * Compiles code for the {ldelim} tag\n     * This tag does output the left delimiter\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        $_attr = $this->getAttributes($compiler, $args);\n        if ($_attr[ 'nocache' ] === true) {\n            $compiler->trigger_template_error('nocache option not allowed', null, true);\n        }\n        return $compiler->smarty->left_delimiter;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_make_nocache.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Make_Nocache\n * Compiles the {make_nocache} tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Make_Nocache Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Make_Nocache extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $option_flags = array();\n\n    /**\n     * Array of names of required attribute required by tag\n     *\n     * @var array\n     */\n    public $required_attributes = array('var');\n\n    /**\n     * Shorttag attribute order defined by its names\n     *\n     * @var array\n     */\n    public $shorttag_order = array('var');\n\n    /**\n     * Compiles code for the {make_nocache} tag\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n      */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        if ($compiler->template->caching) {\n            $output = \"<?php \\$_smarty_tpl->smarty->ext->_make_nocache->save(\\$_smarty_tpl, {$_attr[ 'var' ]});\\n?>\\n\";\n            $compiler->template->compiled->has_nocache_code = true;\n            $compiler->suppressNocacheProcessing = true;\n            return $output;\n        } else {\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_nocache.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Nocache\n * Compiles the {nocache} {/nocache} tags.\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Nocache Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Nocache extends Smarty_Internal_CompileBase\n{\n    /**\n     * Array of names of valid option flags\n     *\n     * @var array\n     */\n    public $option_flags = array();\n\n    /**\n     * Compiles code for the {nocache} tag\n     * This tag does not generate compiled output. It only sets a compiler flag.\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return bool\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        $_attr = $this->getAttributes($compiler, $args);\n        $this->openTag($compiler, 'nocache', array($compiler->nocache));\n        // enter nocache mode\n        $compiler->nocache = true;\n        // this tag does not return compiled code\n        $compiler->has_code = false;\n\n        return true;\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile Nocacheclose Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Nocacheclose extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {/nocache} tag\n     * This tag does not generate compiled output. It only sets a compiler flag.\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return bool\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        $_attr = $this->getAttributes($compiler, $args);\n        // leave nocache mode\n        list($compiler->nocache) = $this->closeTag($compiler, array('nocache'));\n        // this tag does not return compiled code\n        $compiler->has_code = false;\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_private_block_plugin.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Block Plugin\n * Compiles code for the execution of block plugin\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Block Plugin Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('_any');\n\n    /**\n     * nesting level\n     *\n     * @var int\n     */\n    public $nesting = 0;\n\n    /**\n     * Compiles code for the execution of block plugin\n     *\n     * @param  array                                $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param  array                                $parameter array with compilation parameter\n     * @param  string                               $tag       name of block plugin\n     * @param  string                               $function  PHP function name\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     * @throws \\SmartyException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter, $tag, $function = null)\n    {\n        if (!isset($tag[ 5 ]) || substr($tag, - 5) !== 'close') {\n            // opening tag of block plugin\n            // check and get attributes\n            $_attr = $this->getAttributes($compiler, $args);\n            $this->nesting ++;\n            unset($_attr[ 'nocache' ]);\n            list($callback, $_paramsArray, $callable) = $this->setup($compiler, $_attr, $tag, $function);\n            $_params = 'array(' . implode(',', $_paramsArray) . ')';\n\n            // compile code\n            $output = \"<?php \";\n            if (is_array($callback)) {\n                $output .= \"\\$_block_plugin{$this->nesting} = isset({$callback[0]}) ? {$callback[0]} : null;\\n\";\n                $callback = \"\\$_block_plugin{$this->nesting}{$callback[1]}\";\n            }\n            if (isset($callable)) {\n                $output .= \"if (!is_callable({$callable})) {\\nthrow new SmartyException('block tag \\'{$tag}\\' not callable or registered');\\n}\\n\";\n            }\n            $output .= \"\\$_smarty_tpl->smarty->_cache['_tag_stack'][] = array('{$tag}', {$_params});\\n\";\n            $output .= \"\\$_block_repeat=true;\\necho {$callback}({$_params}, null, \\$_smarty_tpl, \\$_block_repeat);\\nwhile (\\$_block_repeat) {\\nob_start();?>\";\n            $this->openTag($compiler, $tag, array($_params, $compiler->nocache, $callback));\n            // maybe nocache because of nocache variables or nocache plugin\n            $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;\n        } else {\n            // must endblock be nocache?\n            if ($compiler->nocache) {\n                $compiler->tag_nocache = true;\n            }\n            // closing tag of block plugin, restore nocache\n            list($_params, $compiler->nocache, $callback) = $this->closeTag($compiler, substr($tag, 0, - 5));\n            // compile code\n            if (!isset($parameter[ 'modifier_list' ])) {\n                $mod_pre = $mod_post = $mod_content = '';\n                $mod_content2 = 'ob_get_clean()';\n            } else {\n                $mod_content2 = \"\\$_block_content{$this->nesting}\";\n                $mod_content = \"\\$_block_content{$this->nesting} = ob_get_clean();\\n\";\n                $mod_pre = \"ob_start();\\n\";\n                $mod_post = 'echo ' . $compiler->compileTag('private_modifier', array(),\n                                                            array('modifierlist' => $parameter[ 'modifier_list' ],\n                                                                  'value' => 'ob_get_clean()')) . \";\\n\";\n            }\n            $output = \"<?php {$mod_content}\\$_block_repeat=false;\\n{$mod_pre}echo {$callback}({$_params}, {$mod_content2}, \\$_smarty_tpl, \\$_block_repeat);\\n{$mod_post}}\\n\";\n            $output .= 'array_pop($_smarty_tpl->smarty->_cache[\\'_tag_stack\\']);?>';\n        }\n        return $output;\n    }\n\n    /**\n     * Setup callback and parameter array\n     *\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler\n     * @param  array                                $_attr attributes\n     * @param  string                               $tag\n     * @param  string                               $function\n     *\n     * @return array\n     */\n    public function setup(Smarty_Internal_TemplateCompilerBase $compiler, $_attr, $tag, $function)\n    {\n        $_paramsArray = array();\n        foreach ($_attr as $_key => $_value) {\n            if (is_int($_key)) {\n                $_paramsArray[] = \"$_key=>$_value\";\n            } else {\n                $_paramsArray[] = \"'$_key'=>$_value\";\n            }\n        }\n        return array($function, $_paramsArray, null);\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_private_foreachsection.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile ForeachSection\n * Shared methods for {foreach} {section} tags\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile ForeachSection Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Private_ForeachSection extends Smarty_Internal_CompileBase\n{\n\n    /**\n     * Preg search pattern\n     *\n     * @var string\n     */\n    private $propertyPreg = '';\n\n    /**\n     * Offsets in preg match result\n     *\n     * @var array\n     */\n    private $resultOffsets = array();\n\n    /**\n     * Start offset\n     *\n     * @var int\n     */\n    private $startOffset = 0;\n\n    /**\n     * Name of this tag\n     *\n     * @var string\n     */\n    public $tagName = '';\n\n    /**\n     * Valid properties of $smarty.xxx variable\n     *\n     * @var array\n     */\n    public $nameProperties = array();\n\n    /**\n     * {section} tag has no item properties\n     *\n     * @var array\n     */\n    public $itemProperties = null;\n\n    /**\n     * {section} tag has always name attribute\n     *\n     * @var bool\n     */\n    public $isNamed = true;\n\n    /**\n     * @var array\n     */\n    public $matchResults = array();\n\n    /**\n     * Scan sources for used tag attributes\n     *\n     * @param  array                                $attributes\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler\n     *\n     * @throws \\SmartyException\n     */\n    public function scanForProperties($attributes, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        $this->propertyPreg = '~(';\n        $this->startOffset = 0;\n        $this->resultOffsets = array();\n        $this->matchResults = array('named' => array(), 'item' => array());\n        if ($this->isNamed) {\n            $this->buildPropertyPreg(true, $attributes);\n        }\n        if (isset($this->itemProperties)) {\n            if ($this->isNamed) {\n                $this->propertyPreg .= '|';\n            }\n            $this->buildPropertyPreg(false, $attributes);\n        }\n        $this->propertyPreg .= ')\\W~i';\n        // Template source\n        $this->matchTemplateSource($compiler);\n        // Parent template source\n        $this->matchParentTemplateSource($compiler);\n        // {block} source\n        $this->matchBlockSource($compiler);\n    }\n\n    /**\n     * Build property preg string\n     *\n     * @param bool  $named\n     * @param array $attributes\n     */\n    public function buildPropertyPreg($named, $attributes)\n    {\n        if ($named) {\n            $this->resultOffsets[ 'named' ] = $this->startOffset + 3;\n            $this->propertyPreg .= \"([\\$]smarty[.]{$this->tagName}[.]{$attributes['name']}[.](\";\n            $properties = $this->nameProperties;\n        } else {\n            $this->resultOffsets[ 'item' ] = $this->startOffset + 3;\n            $this->propertyPreg .= \"([\\$]{$attributes['item']}[@](\";\n            $properties = $this->itemProperties;\n        }\n        $this->startOffset += count($properties) + 2;\n        $propName = reset($properties);\n        while ($propName) {\n            $this->propertyPreg .= \"({$propName})\";\n            $propName = next($properties);\n            if ($propName) {\n                $this->propertyPreg .= '|';\n            }\n        }\n        $this->propertyPreg .= '))';\n    }\n\n    /**\n     * Find matches in source string\n     *\n     * @param string $source\n     */\n    public function matchProperty($source)\n    {\n        preg_match_all($this->propertyPreg, $source, $match, PREG_SET_ORDER);\n        foreach ($this->resultOffsets as $key => $offset) {\n            foreach ($match as $m) {\n                if (isset($m[ $offset ]) && !empty($m[ $offset ])) {\n                    $this->matchResults[ $key ][ strtolower($m[ $offset ]) ] = true;\n                }\n            }\n        }\n    }\n\n    /**\n     * Find matches in template source\n     *\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler\n     */\n    public function matchTemplateSource(Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        $this->matchProperty($compiler->parser->lex->data);\n    }\n\n    /**\n     * Find matches in all parent template source\n     *\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler\n     *\n     * @throws \\SmartyException\n     */\n    public function matchParentTemplateSource(Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        // search parent compiler template source\n        $nextCompiler = $compiler;\n        while ($nextCompiler !== $nextCompiler->parent_compiler) {\n            $nextCompiler = $nextCompiler->parent_compiler;\n            if ($compiler !== $nextCompiler) {\n                // get template source\n                $_content = $nextCompiler->template->source->getContent();\n                if ($_content !== '') {\n                    // run pre filter if required\n                    if ((isset($nextCompiler->smarty->autoload_filters[ 'pre' ]) ||\n                         isset($nextCompiler->smarty->registered_filters[ 'pre' ]))\n                    ) {\n                        $_content = $nextCompiler->smarty->ext->_filterHandler->runFilter('pre', $_content,\n                                                                                          $nextCompiler->template);\n                    }\n                    $this->matchProperty($_content);\n                }\n            }\n        }\n    }\n\n    /**\n     * Find matches in {block} tag source\n     *\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler\n     */\n    public function matchBlockSource(Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n    }\n\n    /**\n     * Compiles code for the {$smarty.foreach.xxx} or {$smarty.section.xxx}tag\n     *\n     * @param  array                                $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param  array                                $parameter array with compilation parameter\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     */\n    public function compileSpecialVariable($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)\n    {\n        $tag = strtolower(trim($parameter[ 0 ], '\"\\''));\n        $name = isset($parameter[ 1 ]) ? $compiler->getId($parameter[ 1 ]) : false;\n        if (!$name) {\n            $compiler->trigger_template_error(\"missing or illegal \\$smarty.{$tag} name attribute\", null, true);\n        }\n        $property = isset($parameter[ 2 ]) ? strtolower($compiler->getId($parameter[ 2 ])) : false;\n        if (!$property || !in_array($property, $this->nameProperties)) {\n            $compiler->trigger_template_error(\"missing or illegal \\$smarty.{$tag} property attribute\", null, true);\n        }\n        $tagVar = \"'__smarty_{$tag}_{$name}'\";\n        return \"(isset(\\$_smarty_tpl->tpl_vars[{$tagVar}]->value['{$property}']) ? \\$_smarty_tpl->tpl_vars[{$tagVar}]->value['{$property}'] : null)\";\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_private_function_plugin.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Function Plugin\n * Compiles code for the execution of function plugin\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Function Plugin Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Private_Function_Plugin extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $required_attributes = array();\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('_any');\n\n    /**\n     * Compiles code for the execution of function plugin\n     *\n     * @param  array                                $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param  array                                $parameter array with compilation parameter\n     * @param  string                               $tag       name of function plugin\n     * @param  string                               $function  PHP function name\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     * @throws \\SmartyException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter, $tag, $function)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n\n        unset($_attr[ 'nocache' ]);\n        // convert attributes into parameter array string\n        $_paramsArray = array();\n        foreach ($_attr as $_key => $_value) {\n            if (is_int($_key)) {\n                $_paramsArray[] = \"$_key=>$_value\";\n            } else {\n                $_paramsArray[] = \"'$_key'=>$_value\";\n            }\n        }\n        $_params = 'array(' . implode(',', $_paramsArray) . ')';\n        // compile code\n        $output = \"{$function}({$_params},\\$_smarty_tpl)\";\n        if (!empty($parameter[ 'modifierlist' ])) {\n            $output = $compiler->compileTag('private_modifier', array(),\n                                            array('modifierlist' => $parameter[ 'modifierlist' ],\n                                                  'value' => $output));\n        }\n        $output = \"<?php echo {$output};?>\\n\";\n        return $output;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_private_modifier.php",
    "content": "<?php\n\n/**\n * Smarty Internal Plugin Compile Modifier\n * Compiles code for modifier execution\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Modifier Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Private_Modifier extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for modifier execution\n     *\n     * @param  array                                $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param  array                                $parameter array with compilation parameter\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     * @throws \\SmartyException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        $output = $parameter[ 'value' ];\n        // loop over list of modifiers\n        foreach ($parameter[ 'modifierlist' ] as $single_modifier) {\n            /* @var string $modifier */\n            $modifier = $single_modifier[ 0 ];\n            $single_modifier[ 0 ] = $output;\n            $params = implode(',', $single_modifier);\n            // check if we know already the type of modifier\n            if (isset($compiler->known_modifier_type[ $modifier ])) {\n                $modifier_types = array($compiler->known_modifier_type[ $modifier ]);\n            } else {\n                $modifier_types = array(1, 2, 3, 4, 5, 6);\n            }\n            foreach ($modifier_types as $type) {\n                switch ($type) {\n                    case 1:\n                        // registered modifier\n                        if (isset($compiler->smarty->registered_plugins[ Smarty::PLUGIN_MODIFIER ][ $modifier ])) {\n                            if (is_callable($compiler->smarty->registered_plugins[ Smarty::PLUGIN_MODIFIER ][ $modifier ][ 0 ])) {\n                                $output =\n                                    sprintf('call_user_func_array($_smarty_tpl->registered_plugins[ \\'%s\\' ][ %s ][ 0 ], array( %s ))',\n                                            Smarty::PLUGIN_MODIFIER, var_export($modifier, true), $params);\n                                $compiler->known_modifier_type[ $modifier ] = $type;\n                                break 2;\n                            }\n                        }\n                        break;\n                    case 2:\n                        // registered modifier compiler\n                        if (isset($compiler->smarty->registered_plugins[ Smarty::PLUGIN_MODIFIERCOMPILER ][ $modifier ][ 0 ])) {\n                            $output =\n                                call_user_func($compiler->smarty->registered_plugins[ Smarty::PLUGIN_MODIFIERCOMPILER ][ $modifier ][ 0 ],\n                                               $single_modifier, $compiler->smarty);\n                            $compiler->known_modifier_type[ $modifier ] = $type;\n                            break 2;\n                        }\n                        break;\n                    case 3:\n                        // modifiercompiler plugin\n                        if ($compiler->smarty->loadPlugin('smarty_modifiercompiler_' . $modifier)) {\n                            // check if modifier allowed\n                            if (!is_object($compiler->smarty->security_policy) ||\n                                $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler)\n                            ) {\n                                $plugin = 'smarty_modifiercompiler_' . $modifier;\n                                $output = $plugin($single_modifier, $compiler);\n                            }\n                            $compiler->known_modifier_type[ $modifier ] = $type;\n                            break 2;\n                        }\n                        break;\n                    case 4:\n                        // modifier plugin\n                        if ($function = $compiler->getPlugin($modifier, Smarty::PLUGIN_MODIFIER)) {\n                            // check if modifier allowed\n                            if (!is_object($compiler->smarty->security_policy) ||\n                                $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler)\n                            ) {\n                                $output = \"{$function}({$params})\";\n                            }\n                            $compiler->known_modifier_type[ $modifier ] = $type;\n                            break 2;\n                        }\n                        break;\n                    case 5:\n                        // PHP function\n                        if (is_callable($modifier)) {\n                            // check if modifier allowed\n                            if (!is_object($compiler->smarty->security_policy) ||\n                                $compiler->smarty->security_policy->isTrustedPhpModifier($modifier, $compiler)\n                            ) {\n                                $output = \"{$modifier}({$params})\";\n                            }\n                            $compiler->known_modifier_type[ $modifier ] = $type;\n                            break 2;\n                        }\n                        break;\n                    case 6:\n                        // default plugin handler\n                        if (isset($compiler->default_handler_plugins[ Smarty::PLUGIN_MODIFIER ][ $modifier ]) ||\n                            (is_callable($compiler->smarty->default_plugin_handler_func) &&\n                             $compiler->getPluginFromDefaultHandler($modifier, Smarty::PLUGIN_MODIFIER))\n                        ) {\n                            $function = $compiler->default_handler_plugins[ Smarty::PLUGIN_MODIFIER ][ $modifier ][ 0 ];\n                            // check if modifier allowed\n                            if (!is_object($compiler->smarty->security_policy) ||\n                                $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler)\n                            ) {\n                                if (!is_array($function)) {\n                                    $output = \"{$function}({$params})\";\n                                } else {\n                                    if (is_object($function[ 0 ])) {\n                                        $output =  $function[ 0 ] . '->'. $function[ 1 ] . '(' . $params . ')';\n                                    } else {\n                                        $output = $function[ 0 ] . '::' . $function[ 1 ] . '(' . $params . ')';\n                                    }\n                                }\n                            }\n                            if (isset($compiler->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $modifier ][ Smarty::PLUGIN_MODIFIER ][ 'file' ]) ||\n                                isset($compiler->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $modifier ][ Smarty::PLUGIN_MODIFIER ][ 'file' ])\n                            ) {\n                                // was a plugin\n                                $compiler->known_modifier_type[ $modifier ] = 4;\n                            } else {\n                                $compiler->known_modifier_type[ $modifier ] = $type;\n                            }\n                            break 2;\n                        }\n                }\n            }\n            if (!isset($compiler->known_modifier_type[ $modifier ])) {\n                $compiler->trigger_template_error(\"unknown modifier '{$modifier}'\", null, true);\n            }\n        }\n\n        return $output;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_private_object_block_function.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Object Block Function\n * Compiles code for registered objects as block function\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Object Block Function Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Private_Object_Block_Function extends Smarty_Internal_Compile_Private_Block_Plugin\n{\n    /**\n     * Setup callback and parameter array\n     *\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler\n     * @param  array                                $_attr attributes\n     * @param  string                               $tag\n     * @param  string                               $method\n     *\n     * @return array\n     */\n    public function setup(Smarty_Internal_TemplateCompilerBase $compiler, $_attr, $tag, $method)\n    {\n        $_paramsArray = array();\n        foreach ($_attr as $_key => $_value) {\n            if (is_int($_key)) {\n                $_paramsArray[] = \"$_key=>$_value\";\n            } else {\n                $_paramsArray[] = \"'$_key'=>$_value\";\n            }\n        }\n        $callback = array(\"\\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]\", \"->{$method}\");\n        return array($callback, $_paramsArray, \"array(\\$_block_plugin{$this->nesting}, '{$method}')\");\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_private_object_function.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Object Function\n * Compiles code for registered objects as function\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Object Function Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Private_Object_Function extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('_any');\n\n    /**\n     * Compiles code for the execution of function plugin\n     *\n     * @param  array                                $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param  array                                $parameter array with compilation parameter\n     * @param  string                               $tag       name of function\n     * @param  string                               $method    name of method to call\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     * @throws \\SmartyException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter, $tag, $method)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        unset($_attr[ 'nocache' ]);\n        $_assign = null;\n        if (isset($_attr[ 'assign' ])) {\n            $_assign = $_attr[ 'assign' ];\n            unset($_attr[ 'assign' ]);\n        }\n        // method or property ?\n        if (is_callable(array($compiler->smarty->registered_objects[ $tag ][ 0 ], $method))) {\n            // convert attributes into parameter array string\n            if ($compiler->smarty->registered_objects[ $tag ][ 2 ]) {\n                $_paramsArray = array();\n                foreach ($_attr as $_key => $_value) {\n                    if (is_int($_key)) {\n                        $_paramsArray[] = \"$_key=>$_value\";\n                    } else {\n                        $_paramsArray[] = \"'$_key'=>$_value\";\n                    }\n                }\n                $_params = 'array(' . implode(',', $_paramsArray) . ')';\n                $output = \"\\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}({$_params},\\$_smarty_tpl)\";\n            } else {\n                $_params = implode(',', $_attr);\n                $output = \"\\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}({$_params})\";\n            }\n        } else {\n            // object property\n            $output = \"\\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}\";\n        }\n        if (!empty($parameter[ 'modifierlist' ])) {\n            $output = $compiler->compileTag('private_modifier', array(),\n                                            array('modifierlist' => $parameter[ 'modifierlist' ], 'value' => $output));\n        }\n        if (empty($_assign)) {\n            return \"<?php echo {$output};?>\\n\";\n        } else {\n            return \"<?php \\$_smarty_tpl->assign({$_assign},{$output});?>\\n\";\n        }\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_private_php.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile PHP Expression\n * Compiles any tag which will output an expression or variable\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile PHP Expression Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase\n{\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $required_attributes = array('code', 'type');\n\n    /**\n     * Compiles code for generating output from any expression\n     *\n     * @param array                                 $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param array                                 $parameter array with compilation parameter\n     *\n     * @return string\n     * @throws \\SmartyException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        $compiler->has_code = false;\n        if ($_attr[ 'type' ] === 'xml') {\n            $compiler->tag_nocache = true;\n            $output = addcslashes($_attr[ 'code' ], \"'\\\\\");\n            $compiler->parser->current_buffer->append_subtree($compiler->parser,\n                                                              new Smarty_Internal_ParseTree_Tag($compiler->parser,\n                                                                                                $compiler->processNocacheCode(\"<?php echo '{$output}';?>\",\n                                                                                                                              true)));\n            return '';\n        }\n        if ($_attr[ 'type' ] !== 'tag') {\n            if ($compiler->php_handling === Smarty::PHP_REMOVE) {\n                return '';\n            } elseif ($compiler->php_handling === Smarty::PHP_QUOTE) {\n                $output =\n                    preg_replace_callback('#(<\\?(?:php|=)?)|(<%)|(<script\\s+language\\s*=\\s*[\"\\']?\\s*php\\s*[\"\\']?\\s*>)|(\\?>)|(%>)|(<\\/script>)#i',\n                                          array($this, 'quote'), $_attr[ 'code' ]);\n                $compiler->parser->current_buffer->append_subtree($compiler->parser,\n                                                                  new Smarty_Internal_ParseTree_Text($output));\n                return '';\n            } elseif ($compiler->php_handling === Smarty::PHP_PASSTHRU || $_attr[ 'type' ] === 'unmatched') {\n                $compiler->tag_nocache = true;\n                $output = addcslashes($_attr[ 'code' ], \"'\\\\\");\n                $compiler->parser->current_buffer->append_subtree($compiler->parser,\n                                                                  new Smarty_Internal_ParseTree_Tag($compiler->parser,\n                                                                                                    $compiler->processNocacheCode(\"<?php echo '{$output}';?>\",\n                                                                                                                                  true)));\n                return '';\n            } elseif ($compiler->php_handling === Smarty::PHP_ALLOW) {\n                if (!($compiler->smarty instanceof SmartyBC)) {\n                    $compiler->trigger_template_error('$smarty->php_handling PHP_ALLOW not allowed. Use SmartyBC to enable it',\n                                                      null, true);\n                }\n                $compiler->has_code = true;\n                return $_attr[ 'code' ];\n            } else {\n                $compiler->trigger_template_error('Illegal $smarty->php_handling value', null, true);\n            }\n        } else {\n            $compiler->has_code = true;\n            if (!($compiler->smarty instanceof SmartyBC)) {\n                $compiler->trigger_template_error('{php}{/php} tags not allowed. Use SmartyBC to enable them', null,\n                                                  true);\n            }\n            $ldel = preg_quote($compiler->smarty->left_delimiter, '#');\n            $rdel = preg_quote($compiler->smarty->right_delimiter, '#');\n            preg_match(\"#^({$ldel}php\\\\s*)((.)*?)({$rdel})#\", $_attr[ 'code' ], $match);\n            if (!empty($match[ 2 ])) {\n                if ('nocache' === trim($match[ 2 ])) {\n                    $compiler->tag_nocache = true;\n                } else {\n                    $compiler->trigger_template_error(\"illegal value of option flag '{$match[2]}'\", null, true);\n                }\n            }\n            return preg_replace(array(\"#^{$ldel}\\\\s*php\\\\s*(.)*?{$rdel}#\", \"#{$ldel}\\\\s*/\\\\s*php\\\\s*{$rdel}$#\"),\n                                array('<?php ', '?>'), $_attr[ 'code' ]);\n        }\n    }\n\n    /**\n     * Lexer code for PHP tags\n     *\n     * This code has been moved from lexer here fo easier debugging and maintenance\n     *\n     * @param Smarty_Internal_Templatelexer $lex\n     *\n     * @throws \\SmartyCompilerException\n     */\n    public function parsePhp(Smarty_Internal_Templatelexer $lex)\n    {\n        $lex->token = Smarty_Internal_Templateparser::TP_PHP;\n        $close = 0;\n        $lex->taglineno = $lex->line;\n        $closeTag = '?>';\n        if (strpos($lex->value, '<?xml') === 0) {\n            $lex->is_xml = true;\n            $lex->phpType = 'xml';\n            return;\n        } elseif (strpos($lex->value, '<?') === 0) {\n            $lex->phpType = 'php';\n        } elseif (strpos($lex->value, '<%') === 0) {\n            $lex->phpType = 'asp';\n            $closeTag = '%>';\n        } elseif (strpos($lex->value, '%>') === 0) {\n            $lex->phpType = 'unmatched';\n        } elseif (strpos($lex->value, '?>') === 0) {\n            if ($lex->is_xml) {\n                $lex->is_xml = false;\n                $lex->phpType = 'xml';\n                return;\n            }\n            $lex->phpType = 'unmatched';\n        } elseif (strpos($lex->value, '<s') === 0) {\n            $lex->phpType = 'script';\n            $closeTag = '</script>';\n        } elseif (strpos($lex->value, $lex->smarty->left_delimiter) === 0) {\n            if ($lex->isAutoLiteral()) {\n                $lex->token = Smarty_Internal_Templateparser::TP_TEXT;\n                return;\n            }\n            $closeTag = \"{$lex->smarty->left_delimiter}/php{$lex->smarty->right_delimiter}\";\n            if ($lex->value === $closeTag) {\n                $lex->compiler->trigger_template_error(\"unexpected closing tag '{$closeTag}'\");\n            }\n            $lex->phpType = 'tag';\n        }\n        if ($lex->phpType === 'unmatched') {\n            return;\n        }\n        if (($lex->phpType === 'php' || $lex->phpType === 'asp') &&\n            ($lex->compiler->php_handling === Smarty::PHP_PASSTHRU || $lex->compiler->php_handling === Smarty::PHP_QUOTE)\n        ) {\n            return;\n        }\n        $start = $lex->counter + strlen($lex->value);\n        $body = true;\n        if (preg_match('~' . preg_quote($closeTag, '~') . '~i', $lex->data, $match, PREG_OFFSET_CAPTURE, $start)) {\n            $close = $match[ 0 ][ 1 ];\n        } else {\n            $lex->compiler->trigger_template_error(\"missing closing tag '{$closeTag}'\");\n        }\n        while ($body) {\n            if (preg_match('~([/][*])|([/][/][^\\n]*)|(\\'[^\\'\\\\\\\\]*(?:\\\\.[^\\'\\\\\\\\]*)*\\')|(\"[^\"\\\\\\\\]*(?:\\\\.[^\"\\\\\\\\]*)*\")~',\n                           $lex->data, $match, PREG_OFFSET_CAPTURE, $start)) {\n                $value = $match[ 0 ][ 0 ];\n                $from = $pos = $match[ 0 ][ 1 ];\n                if ($pos > $close) {\n                    $body = false;\n                } else {\n                    $start = $pos + strlen($value);\n                    $phpCommentStart = $value === '/*';\n                    if ($phpCommentStart) {\n                        $phpCommentEnd = preg_match('~([*][/])~', $lex->data, $match, PREG_OFFSET_CAPTURE, $start);\n                        if ($phpCommentEnd) {\n                            $pos2 = $match[ 0 ][ 1 ];\n                            $start = $pos2 + strlen($match[ 0 ][ 0 ]);\n                        }\n                    }\n                    while ($close > $pos && $close < $start) {\n                        if (preg_match('~' . preg_quote($closeTag, '~') . '~i', $lex->data, $match, PREG_OFFSET_CAPTURE,\n                                       $from)) {\n                            $close = $match[ 0 ][ 1 ];\n                            $from = $close + strlen($match[ 0 ][ 0 ]);\n                        } else {\n                            $lex->compiler->trigger_template_error(\"missing closing tag '{$closeTag}'\");\n                        }\n                    }\n                    if ($phpCommentStart && (!$phpCommentEnd || $pos2 > $close)) {\n                        $lex->taglineno = $lex->line + substr_count(substr($lex->data, $lex->counter, $start), \"\\n\");\n                        $lex->compiler->trigger_template_error(\"missing PHP comment closing tag '*/'\");\n                    }\n                }\n            } else {\n                $body = false;\n            }\n        }\n        $lex->value = substr($lex->data, $lex->counter, $close + strlen($closeTag) - $lex->counter);\n    }\n\n    /*\n     * Call back function for $php_handling = PHP_QUOTE\n     *\n     */\n    /**\n     * @param $match\n     *\n     * @return string\n     */\n    private function quote($match)\n    {\n        return htmlspecialchars($match[ 0 ], ENT_QUOTES);\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_private_print_expression.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Print Expression\n * Compiles any tag which will output an expression or variable\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Print Expression Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('assign');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $option_flags = array('nocache', 'nofilter');\n\n    /**\n     * Compiles code for generating output from any expression\n     *\n     * @param array                                 $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param array                                 $parameter array with compilation parameter\n     *\n     * @return string\n     * @throws \\SmartyException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        $output = $parameter[ 'value' ];\n        // tag modifier\n        if (!empty($parameter[ 'modifierlist' ])) {\n            $output = $compiler->compileTag('private_modifier', array(),\n                                            array('modifierlist' => $parameter[ 'modifierlist' ],\n                                                  'value' => $output));\n        }\n        if (isset($_attr[ 'assign' ])) {\n            // assign output to variable\n            return \"<?php \\$_smarty_tpl->assign({$_attr['assign']},{$output});?>\";\n        } else {\n            // display value\n            if (!$_attr[ 'nofilter' ]) {\n                // default modifier\n                if (!empty($compiler->smarty->default_modifiers)) {\n                    if (empty($compiler->default_modifier_list)) {\n                        $modifierlist = array();\n                        foreach ($compiler->smarty->default_modifiers as $key => $single_default_modifier) {\n                            preg_match_all('/(\\'[^\\'\\\\\\\\]*(?:\\\\\\\\.[^\\'\\\\\\\\]*)*\\'|\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*\"|:|[^:]+)/',\n                                           $single_default_modifier, $mod_array);\n                            for ($i = 0, $count = count($mod_array[ 0 ]); $i < $count; $i ++) {\n                                if ($mod_array[ 0 ][ $i ] !== ':') {\n                                    $modifierlist[ $key ][] = $mod_array[ 0 ][ $i ];\n                                }\n                            }\n                        }\n                        $compiler->default_modifier_list = $modifierlist;\n                    }\n                    $output = $compiler->compileTag('private_modifier', array(),\n                                                    array('modifierlist' => $compiler->default_modifier_list,\n                                                          'value' => $output));\n                }\n                // autoescape html\n                if ($compiler->template->smarty->escape_html) {\n                    $output = \"htmlspecialchars({$output}, ENT_QUOTES, '\" . addslashes(Smarty::$_CHARSET) . \"')\";\n                }\n                // loop over registered filters\n                if (!empty($compiler->template->smarty->registered_filters[ Smarty::FILTER_VARIABLE ])) {\n                    foreach ($compiler->template->smarty->registered_filters[ Smarty::FILTER_VARIABLE ] as $key =>\n                             $function) {\n                        if (!is_array($function)) {\n                            $output = \"{$function}({$output},\\$_smarty_tpl)\";\n                        } elseif (is_object($function[ 0 ])) {\n                            $output =\n                                \"\\$_smarty_tpl->smarty->registered_filters[Smarty::FILTER_VARIABLE]['{$key}'][0]->{$function[1]}({$output},\\$_smarty_tpl)\";\n                        } else {\n                            $output = \"{$function[0]}::{$function[1]}({$output},\\$_smarty_tpl)\";\n                        }\n                    }\n                }\n                // auto loaded filters\n                if (isset($compiler->smarty->autoload_filters[ Smarty::FILTER_VARIABLE ])) {\n                    foreach ((array) $compiler->template->smarty->autoload_filters[ Smarty::FILTER_VARIABLE ] as $name)\n                    {\n                        $result = $this->compile_variable_filter($compiler, $name, $output);\n                        if ($result !== false) {\n                            $output = $result;\n                        } else {\n                            // not found, throw exception\n                            throw new SmartyException(\"Unable to load variable filter '{$name}'\");\n                        }\n                    }\n                }\n                foreach ($compiler->variable_filters as $filter) {\n                    if (count($filter) === 1 &&\n                        ($result = $this->compile_variable_filter($compiler, $filter[ 0 ], $output)) !== false\n                    ) {\n                        $output = $result;\n                    } else {\n                        $output = $compiler->compileTag('private_modifier', array(),\n                                                        array('modifierlist' => array($filter), 'value' => $output));\n                    }\n                }\n            }\n            $output = \"<?php echo {$output};?>\\n\";\n        }\n\n        return $output;\n    }\n\n    /**\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     * @param string                                $name     name of variable filter\n     * @param string                                $output   embedded output\n     *\n     * @return string\n     * @throws \\SmartyException\n     */\n    private function compile_variable_filter(Smarty_Internal_TemplateCompilerBase $compiler, $name, $output)\n    {\n       $function= $compiler->getPlugin($name, 'variablefilter');\n       if ($function) {\n            return \"{$function}({$output},\\$_smarty_tpl)\";\n       } else {\n            // not found\n            return false;\n       }\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_private_registered_block.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Registered Block\n * Compiles code for the execution of a registered block function\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Registered Block Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Private_Registered_Block extends Smarty_Internal_Compile_Private_Block_Plugin\n{\n    /**\n     * Setup callback, parameter array and nocache mode\n     *\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler\n     * @param  array                                $_attr attributes\n     * @param  string                               $tag\n     * @param  null                                 $function\n     *\n     * @return array\n     */\n    public function setup(Smarty_Internal_TemplateCompilerBase $compiler, $_attr, $tag, $function)\n    {\n        if (isset($compiler->smarty->registered_plugins[ Smarty::PLUGIN_BLOCK ][ $tag ])) {\n            $tag_info = $compiler->smarty->registered_plugins[ Smarty::PLUGIN_BLOCK ][ $tag ];\n            $callback = $tag_info[ 0 ];\n            if (is_array($callback)) {\n                if (is_object($callback[ 0 ])) {\n                    $callable = \"array(\\$_block_plugin{$this->nesting}, '{$callback[1]}')\";\n                    $callback =\n                        array(\"\\$_smarty_tpl->smarty->registered_plugins['block']['{$tag}'][0][0]\", \"->{$callback[1]}\");\n                } else {\n                    $callable = \"array(\\$_block_plugin{$this->nesting}, '{$callback[1]}')\";\n                    $callback =\n                        array(\"\\$_smarty_tpl->smarty->registered_plugins['block']['{$tag}'][0][0]\", \"::{$callback[1]}\");\n                }\n            } else {\n                $callable = \"\\$_block_plugin{$this->nesting}\";\n                $callback = array(\"\\$_smarty_tpl->smarty->registered_plugins['block']['{$tag}'][0]\", '');\n            }\n        } else {\n            $tag_info = $compiler->default_handler_plugins[ Smarty::PLUGIN_BLOCK ][ $tag ];\n            $callback = $tag_info[ 0 ];\n            if (is_array($callback)) {\n                $callable = \"array('{$callback[0]}', '{$callback[1]}')\";\n                $callback = \"{$callback[1]}::{$callback[1]}\";\n            } else {\n                $callable = null;\n            }\n        }\n        $compiler->tag_nocache = !$tag_info[ 1 ] | $compiler->tag_nocache;\n        $_paramsArray = array();\n        foreach ($_attr as $_key => $_value) {\n            if (is_int($_key)) {\n                $_paramsArray[] = \"$_key=>$_value\";\n            } elseif ($compiler->template->caching && in_array($_key, $tag_info[ 2 ])) {\n                $_value = str_replace('\\'', \"^#^\", $_value);\n                $_paramsArray[] = \"'$_key'=>^#^.var_export($_value,true).^#^\";\n            } else {\n                $_paramsArray[] = \"'$_key'=>$_value\";\n            }\n        }\n        return array($callback, $_paramsArray, $callable);\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_private_registered_function.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Registered Function\n * Compiles code for the execution of a registered function\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Registered Function Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Private_Registered_Function extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('_any');\n\n    /**\n     * Compiles code for the execution of a registered function\n     *\n     * @param  array                                $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param  array                                $parameter array with compilation parameter\n     * @param  string                               $tag       name of function\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     * @throws \\SmartyException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter, $tag)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        unset($_attr[ 'nocache' ]);\n        if (isset($compiler->smarty->registered_plugins[ Smarty::PLUGIN_FUNCTION ][ $tag ])) {\n            $tag_info = $compiler->smarty->registered_plugins[ Smarty::PLUGIN_FUNCTION ][ $tag ];\n            $is_registered = true;\n        } else {\n             $tag_info = $compiler->default_handler_plugins[ Smarty::PLUGIN_FUNCTION ][ $tag ];\n             $is_registered = false;\n        }\n        // not cacheable?\n        $compiler->tag_nocache = $compiler->tag_nocache || !$tag_info[ 1 ];\n        // convert attributes into parameter array string\n        $_paramsArray = array();\n        foreach ($_attr as $_key => $_value) {\n            if (is_int($_key)) {\n                $_paramsArray[] = \"$_key=>$_value\";\n            } elseif ($compiler->template->caching && in_array($_key, $tag_info[ 2 ])) {\n                $_value = str_replace('\\'', \"^#^\", $_value);\n                $_paramsArray[] = \"'$_key'=>^#^.var_export($_value,true).^#^\";\n            } else {\n                $_paramsArray[] = \"'$_key'=>$_value\";\n            }\n        }\n        $_params = 'array(' . implode(',', $_paramsArray) . ')';\n        // compile code\n        if ($is_registered) {\n            $output =\n                \"call_user_func_array( \\$_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['{$tag}'][0], array( {$_params},\\$_smarty_tpl ) )\";\n        } else {\n            $function = $tag_info[ 0 ];\n            if (!is_array($function)) {\n                $output = \"{$function}({$_params},\\$_smarty_tpl)\";\n            } else {\n                $output = \"{$function[0]}::{$function[1]}({$_params},\\$_smarty_tpl)\";\n            }\n        }\n        if (!empty($parameter[ 'modifierlist' ])) {\n            $output = $compiler->compileTag('private_modifier', array(),\n                                            array('modifierlist' => $parameter[ 'modifierlist' ],\n                                                  'value' => $output));\n        }\n        $output = \"<?php echo {$output};?>\\n\";\n        return $output;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_private_special_variable.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Special Smarty Variable\n * Compiles the special $smarty variables\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile special Smarty Variable Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the special $smarty variables\n     *\n     * @param  array                                       $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase        $compiler compiler object\n     * @param                                              $parameter\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)\n    {\n        $_index = preg_split(\"/\\]\\[/\", substr($parameter, 1, strlen($parameter) - 2));\n        $variable = strtolower($compiler->getId($_index[ 0 ]));\n        if ($variable === false) {\n            $compiler->trigger_template_error(\"special \\$Smarty variable name index can not be variable\", null, true);\n        }\n        if (!isset($compiler->smarty->security_policy) ||\n            $compiler->smarty->security_policy->isTrustedSpecialSmartyVar($variable, $compiler)\n        ) {\n            switch ($variable) {\n                case 'foreach':\n                case 'section':\n                    if (!isset(Smarty_Internal_TemplateCompilerBase::$_tag_objects[ $variable ])) {\n                        $class = 'Smarty_Internal_Compile_' . ucfirst($variable);\n                        Smarty_Internal_TemplateCompilerBase::$_tag_objects[ $variable ] = new $class;\n                    }\n                    return Smarty_Internal_TemplateCompilerBase::$_tag_objects[ $variable ]->compileSpecialVariable(array(), $compiler, $_index);\n                case 'capture':\n                    if (class_exists('Smarty_Internal_Compile_Capture')) {\n                        return Smarty_Internal_Compile_Capture::compileSpecialVariable(array(), $compiler, $_index);\n                    }\n                    return '';\n                case 'now':\n                    return 'time()';\n                case 'block':\n                    $tag = $compiler->getTagCompiler('block');\n                    return $tag->compileSpecialVariable(array(), $compiler, $_index);\n                case 'cookies':\n                    if (isset($compiler->smarty->security_policy) &&\n                        !$compiler->smarty->security_policy->allow_super_globals\n                    ) {\n                        $compiler->trigger_template_error(\"(secure mode) super globals not permitted\");\n                        break;\n                    }\n                    $compiled_ref = '$_COOKIE';\n                    break;\n                case 'get':\n                case 'post':\n                case 'env':\n                case 'server':\n                case 'session':\n                case 'request':\n                    if (isset($compiler->smarty->security_policy) &&\n                        !$compiler->smarty->security_policy->allow_super_globals\n                    ) {\n                        $compiler->trigger_template_error(\"(secure mode) super globals not permitted\");\n                        break;\n                    }\n                    $compiled_ref = '$_' . strtoupper($variable);\n                    break;\n\n                case 'template':\n                    return 'basename($_smarty_tpl->source->filepath)';\n\n                case 'template_object':\n                    return '$_smarty_tpl';\n\n                case 'current_dir':\n                    return 'dirname($_smarty_tpl->source->filepath)';\n\n                case 'version':\n                    return \"Smarty::SMARTY_VERSION\";\n\n                case 'const':\n                    if (isset($compiler->smarty->security_policy) &&\n                        !$compiler->smarty->security_policy->allow_constants\n                    ) {\n                        $compiler->trigger_template_error(\"(secure mode) constants not permitted\");\n                        break;\n                    }\n                    if (strpos($_index[ 1 ], '$') === false && strpos($_index[ 1 ], '\\'') === false) {\n                        return \"@constant('{$_index[1]}')\";\n                    } else {\n                        return \"@constant({$_index[1]})\";\n                    }\n\n                case 'config':\n                    if (isset($_index[ 2 ])) {\n                        return \"(is_array(\\$tmp = \\$_smarty_tpl->smarty->ext->configload->_getConfigVariable(\\$_smarty_tpl, $_index[1])) ? \\$tmp[$_index[2]] : null)\";\n                    } else {\n                        return \"\\$_smarty_tpl->smarty->ext->configload->_getConfigVariable(\\$_smarty_tpl, $_index[1])\";\n                    }\n                case 'ldelim':\n                    return \"\\$_smarty_tpl->smarty->left_delimiter\";\n                case 'rdelim':\n                    return \"\\$_smarty_tpl->smarty->right_delimiter\";\n                default:\n                    $compiler->trigger_template_error('$smarty.' . trim($_index[ 0 ], '\\'') . ' is not defined');\n                    break;\n            }\n            if (isset($_index[ 1 ])) {\n                array_shift($_index);\n                foreach ($_index as $_ind) {\n                    $compiled_ref = $compiled_ref . \"[$_ind]\";\n                }\n            }\n            return $compiled_ref;\n        }\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_rdelim.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Rdelim\n * Compiles the {rdelim} tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Rdelim Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Rdelim extends Smarty_Internal_Compile_Ldelim\n{\n    /**\n     * Compiles code for the {rdelim} tag\n     * This tag does output the right delimiter.\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        parent::compile($args,$compiler);\n        return $compiler->smarty->right_delimiter;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_section.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Section\n * Compiles the {section} {sectionelse} {/section} tags\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Section Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_ForeachSection\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $required_attributes = array('name', 'loop');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $shorttag_order = array('name', 'loop');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('start', 'step', 'max', 'show', 'properties');\n\n    /**\n     * counter\n     *\n     * @var int\n     */\n    public $counter = 0;\n\n    /**\n     * Name of this tag\n     *\n     * @var string\n     */\n    public $tagName = 'section';\n\n    /**\n     * Valid properties of $smarty.section.name.xxx variable\n     *\n     * @var array\n     */\n    public $nameProperties = array('first', 'last', 'index', 'iteration', 'show', 'total', 'rownum', 'index_prev',\n                                   'index_next', 'loop');\n\n    /**\n     * {section} tag has no item properties\n     *\n     * @var array\n     */\n    public $itemProperties = null;\n\n    /**\n     * {section} tag has always name attribute\n     *\n     * @var bool\n     */\n    public $isNamed = true;\n\n    /**\n     * Compiles code for the {section} tag\n     *\n     * @param  array                                 $args     array with attributes from parser\n     * @param  \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     * @throws \\SmartyException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        $compiler->loopNesting ++;\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        $attributes = array('name' => $compiler->getId($_attr[ 'name' ]));\n        unset($_attr[ 'name' ]);\n        foreach ($attributes as $a => $v) {\n            if ($v === false) {\n                $compiler->trigger_template_error(\"'{$a}' attribute/variable has illegal value\", null, true);\n            }\n        }\n        $local = \"\\$__section_{$attributes['name']}_\" . $this->counter ++ . '_';\n        $sectionVar = \"\\$_smarty_tpl->tpl_vars['__smarty_section_{$attributes['name']}']\";\n        $this->openTag($compiler, 'section', array('section', $compiler->nocache, $local, $sectionVar));\n        // maybe nocache because of nocache variables\n        $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;\n\n        $initLocal =\n            array('saved' => \"isset(\\$_smarty_tpl->tpl_vars['__smarty_section_{$attributes['name']}']) ? \\$_smarty_tpl->tpl_vars['__smarty_section_{$attributes['name']}'] : false\",);\n        $initNamedProperty = array();\n        $initFor = array();\n        $incFor = array();\n        $cmpFor = array();\n        $propValue = array('index' => \"{$sectionVar}->value['index']\", 'show' => 'true', 'step' => 1,\n                           'iteration' => \"{$local}iteration\",\n\n        );\n        $propType = array('index' => 2, 'iteration' => 2, 'show' => 0, 'step' => 0,);\n        // search for used tag attributes\n        $this->scanForProperties($attributes, $compiler);\n        if (!empty($this->matchResults[ 'named' ])) {\n            $namedAttr = $this->matchResults[ 'named' ];\n        }\n        if (isset($_attr[ 'properties' ]) && preg_match_all(\"/['](.*?)[']/\", $_attr[ 'properties' ], $match)) {\n            foreach ($match[ 1 ] as $prop) {\n                if (in_array($prop, $this->nameProperties)) {\n                    $namedAttr[ $prop ] = true;\n                } else {\n                    $compiler->trigger_template_error(\"Invalid property '{$prop}'\", null, true);\n                }\n            }\n        }\n        $namedAttr[ 'index' ] = true;\n        $output = \"<?php\\n\";\n        foreach ($_attr as $attr_name => $attr_value) {\n            switch ($attr_name) {\n                case 'loop':\n                    if (is_numeric($attr_value)) {\n                        $v = (int) $attr_value;\n                        $t = 0;\n                    } else {\n                        $v = \"(is_array(@\\$_loop=$attr_value) ? count(\\$_loop) : max(0, (int) \\$_loop))\";\n                        $t = 1;\n                    }\n                    if ($t === 1) {\n                        $initLocal[ 'loop' ] = $v;\n                        $v = \"{$local}loop\";\n                    }\n                    break;\n                case 'show':\n                    if (is_bool($attr_value)) {\n                        $v = $attr_value ? 'true' : 'false';\n                        $t = 0;\n                    } else {\n                        $v = \"(bool) $attr_value\";\n                        $t = 3;\n                    }\n                    break;\n                case 'step':\n                    if (is_numeric($attr_value)) {\n                        $v = (int) $attr_value;\n                        $v = ($v === 0) ? 1 : $v;\n                        $t = 0;\n                        break;\n                    }\n                    $initLocal[ 'step' ] = \"((int)@$attr_value) === 0 ? 1 : (int)@$attr_value\";\n                    $v = \"{$local}step\";\n                    $t = 2;\n                    break;\n\n                case 'max':\n                case 'start':\n                    if (is_numeric($attr_value)) {\n                        $v = (int) $attr_value;\n                        $t = 0;\n                        break;\n                    }\n                    $v = \"(int)@$attr_value\";\n                    $t = 3;\n                    break;\n            }\n            if ($t === 3 && $compiler->getId($attr_value)) {\n                $t = 1;\n            }\n            $propValue[ $attr_name ] = $v;\n            $propType[ $attr_name ] = $t;\n        }\n\n        if (isset($namedAttr[ 'step' ])) {\n            $initNamedProperty[ 'step' ] = $propValue[ 'step' ];\n        }\n        if (isset($namedAttr[ 'iteration' ])) {\n            $propValue[ 'iteration' ] = \"{$sectionVar}->value['iteration']\";\n        }\n        $incFor[ 'iteration' ] = \"{$propValue['iteration']}++\";\n        $initFor[ 'iteration' ] = \"{$propValue['iteration']} = 1\";\n\n        if ($propType[ 'step' ] === 0) {\n            if ($propValue[ 'step' ] === 1) {\n                $incFor[ 'index' ] = \"{$sectionVar}->value['index']++\";\n            } elseif ($propValue[ 'step' ] > 1) {\n                $incFor[ 'index' ] = \"{$sectionVar}->value['index'] += {$propValue['step']}\";\n            } else {\n                $incFor[ 'index' ] = \"{$sectionVar}->value['index'] -= \" . - $propValue[ 'step' ];\n            }\n        } else {\n            $incFor[ 'index' ] = \"{$sectionVar}->value['index'] += {$propValue['step']}\";\n        }\n\n        if (!isset($propValue[ 'max' ])) {\n            $propValue[ 'max' ] = $propValue[ 'loop' ];\n            $propType[ 'max' ] = $propType[ 'loop' ];\n        } elseif ($propType[ 'max' ] !== 0) {\n            $propValue[ 'max' ] = \"{$propValue['max']} < 0 ? {$propValue['loop']} : {$propValue['max']}\";\n            $propType[ 'max' ] = 1;\n        } else {\n            if ($propValue[ 'max' ] < 0) {\n                $propValue[ 'max' ] = $propValue[ 'loop' ];\n                $propType[ 'max' ] = $propType[ 'loop' ];\n            }\n        }\n\n        if (!isset($propValue[ 'start' ])) {\n            $start_code =\n                array(1 => \"{$propValue['step']} > 0 ? \", 2 => '0', 3 => ' : ', 4 => $propValue[ 'loop' ], 5 => ' - 1');\n            if ($propType[ 'loop' ] === 0) {\n                $start_code[ 5 ] = '';\n                $start_code[ 4 ] = $propValue[ 'loop' ] - 1;\n            }\n            if ($propType[ 'step' ] === 0) {\n                if ($propValue[ 'step' ] > 0) {\n                    $start_code = array(1 => '0');\n                    $propType[ 'start' ] = 0;\n                } else {\n                    $start_code[ 1 ] = $start_code[ 2 ] = $start_code[ 3 ] = '';\n                    $propType[ 'start' ] = $propType[ 'loop' ];\n                }\n            } else {\n                $propType[ 'start' ] = 1;\n            }\n            $propValue[ 'start' ] = join('', $start_code);\n        } else {\n            $start_code =\n                array(1 => \"{$propValue['start']} < 0 ? \", 2 => 'max(', 3 => \"{$propValue['step']} > 0 ? \", 4 => '0',\n                      5 => ' : ', 6 => '-1', 7 => ', ', 8 => \"{$propValue['start']} + {$propValue['loop']}\", 10 => ')',\n                      11 => ' : ', 12 => 'min(', 13 => $propValue[ 'start' ], 14 => ', ',\n                      15 => \"{$propValue['step']} > 0 ? \", 16 => $propValue[ 'loop' ], 17 => ' : ',\n                      18 => $propType[ 'loop' ] === 0 ? $propValue[ 'loop' ] - 1 : \"{$propValue['loop']} - 1\",\n                      19 => ')');\n            if ($propType[ 'step' ] === 0) {\n                $start_code[ 3 ] = $start_code[ 5 ] = $start_code[ 15 ] = $start_code[ 17 ] = '';\n                if ($propValue[ 'step' ] > 0) {\n                    $start_code[ 6 ] = $start_code[ 18 ] = '';\n                } else {\n                    $start_code[ 4 ] = $start_code[ 16 ] = '';\n                }\n            }\n            if ($propType[ 'start' ] === 0) {\n                if ($propType[ 'loop' ] === 0) {\n                    $start_code[ 8 ] = $propValue[ 'start' ] + $propValue[ 'loop' ];\n                }\n                $propType[ 'start' ] = $propType[ 'step' ] + $propType[ 'loop' ];\n                $start_code[ 1 ] = '';\n                if ($propValue[ 'start' ] < 0) {\n                    for ($i = 11; $i <= 19; $i ++) {\n                        $start_code[ $i ] = '';\n                    }\n                    if ($propType[ 'start' ] === 0) {\n                        $start_code = array(max($propValue[ 'step' ] > 0 ? 0 : - 1,\n                                                $propValue[ 'start' ] + $propValue[ 'loop' ]));\n                    }\n                } else {\n                    for ($i = 1; $i <= 11; $i ++) {\n                        $start_code[ $i ] = '';\n                    }\n                    if ($propType[ 'start' ] === 0) {\n                        $start_code =\n                            array(min($propValue[ 'step' ] > 0 ? $propValue[ 'loop' ] : $propValue[ 'loop' ] - 1,\n                                      $propValue[ 'start' ]));\n                    }\n                }\n            }\n            $propValue[ 'start' ] = join('', $start_code);\n        }\n        if ($propType[ 'start' ] !== 0) {\n            $initLocal[ 'start' ] = $propValue[ 'start' ];\n            $propValue[ 'start' ] = \"{$local}start\";\n        }\n\n        $initFor[ 'index' ] = \"{$sectionVar}->value['index'] = {$propValue['start']}\";\n\n        if (!isset($_attr[ 'start' ]) && !isset($_attr[ 'step' ]) && !isset($_attr[ 'max' ])) {\n            $propValue[ 'total' ] = $propValue[ 'loop' ];\n            $propType[ 'total' ] = $propType[ 'loop' ];\n        } else {\n            $propType[ 'total' ] =\n                $propType[ 'start' ] + $propType[ 'loop' ] + $propType[ 'step' ] + $propType[ 'max' ];\n            if ($propType[ 'total' ] === 0) {\n                $propValue[ 'total' ] =\n                    min(ceil(($propValue[ 'step' ] > 0 ? $propValue[ 'loop' ] - $propValue[ 'start' ] :\n                                 (int) $propValue[ 'start' ] + 1) / abs($propValue[ 'step' ])), $propValue[ 'max' ]);\n            } else {\n                $total_code = array(1 => 'min(', 2 => 'ceil(', 3 => '(', 4 => \"{$propValue['step']} > 0 ? \",\n                                    5 => $propValue[ 'loop' ], 6 => ' - ', 7 => $propValue[ 'start' ], 8 => ' : ',\n                                    9 => $propValue[ 'start' ], 10 => '+ 1', 11 => ')', 12 => '/ ', 13 => 'abs(',\n                                    14 => $propValue[ 'step' ], 15 => ')', 16 => ')', 17 => \", {$propValue['max']})\",);\n                if (!isset($propValue[ 'max' ])) {\n                    $total_code[ 1 ] = $total_code[ 17 ] = '';\n                }\n                if ($propType[ 'loop' ] + $propType[ 'start' ] === 0) {\n                    $total_code[ 5 ] = $propValue[ 'loop' ] - $propValue[ 'start' ];\n                    $total_code[ 6 ] = $total_code[ 7 ] = '';\n                }\n                if ($propType[ 'start' ] === 0) {\n                    $total_code[ 9 ] = (int) $propValue[ 'start' ] + 1;\n                    $total_code[ 10 ] = '';\n                }\n                if ($propType[ 'step' ] === 0) {\n                    $total_code[ 13 ] = $total_code[ 15 ] = '';\n                    if ($propValue[ 'step' ] === 1 || $propValue[ 'step' ] === - 1) {\n                        $total_code[ 2 ] = $total_code[ 12 ] = $total_code[ 14 ] = $total_code[ 16 ] = '';\n                    } elseif ($propValue[ 'step' ] < 0) {\n                        $total_code[ 14 ] = - $propValue[ 'step' ];\n                    }\n                    $total_code[ 4 ] = '';\n                    if ($propValue[ 'step' ] > 0) {\n                        $total_code[ 8 ] = $total_code[ 9 ] = $total_code[ 10 ] = '';\n                    } else {\n                        $total_code[ 5 ] = $total_code[ 6 ] = $total_code[ 7 ] = $total_code[ 8 ] = '';\n                    }\n                }\n                $propValue[ 'total' ] = join('', $total_code);\n            }\n        }\n\n        if (isset($namedAttr[ 'loop' ])) {\n            $initNamedProperty[ 'loop' ] = \"'loop' => {$propValue['loop']}\";\n        }\n        if (isset($namedAttr[ 'total' ])) {\n            $initNamedProperty[ 'total' ] = \"'total' => {$propValue['total']}\";\n            if ($propType[ 'total' ] > 0) {\n                $propValue[ 'total' ] = \"{$sectionVar}->value['total']\";\n            }\n        } elseif ($propType[ 'total' ] > 0) {\n            $initLocal[ 'total' ] = $propValue[ 'total' ];\n            $propValue[ 'total' ] = \"{$local}total\";\n        }\n\n        $cmpFor[ 'iteration' ] = \"{$propValue['iteration']} <= {$propValue['total']}\";\n\n        foreach ($initLocal as $key => $code) {\n            $output .= \"{$local}{$key} = {$code};\\n\";\n        }\n\n        $_vars = 'array(' . join(', ', $initNamedProperty) . ')';\n        $output .= \"{$sectionVar} = new Smarty_Variable({$_vars});\\n\";\n        $cond_code = \"{$propValue['total']} !== 0\";\n        if ($propType[ 'total' ] === 0) {\n            if ($propValue[ 'total' ] === 0) {\n                $cond_code = 'false';\n            } else {\n                $cond_code = 'true';\n            }\n        }\n        if ($propType[ 'show' ] > 0) {\n            $output .= \"{$local}show = {$propValue['show']} ? {$cond_code} : false;\\n\";\n            $output .= \"if ({$local}show) {\\n\";\n        } elseif ($propValue[ 'show' ] === 'true') {\n            $output .= \"if ({$cond_code}) {\\n\";\n        } else {\n            $output .= \"if (false) {\\n\";\n        }\n        $jinit = join(', ', $initFor);\n        $jcmp = join(', ', $cmpFor);\n        $jinc = join(', ', $incFor);\n        $output .= \"for ({$jinit}; {$jcmp}; {$jinc}){\\n\";\n        if (isset($namedAttr[ 'rownum' ])) {\n            $output .= \"{$sectionVar}->value['rownum'] = {$propValue['iteration']};\\n\";\n        }\n        if (isset($namedAttr[ 'index_prev' ])) {\n            $output .= \"{$sectionVar}->value['index_prev'] = {$propValue['index']} - {$propValue['step']};\\n\";\n        }\n        if (isset($namedAttr[ 'index_next' ])) {\n            $output .= \"{$sectionVar}->value['index_next'] = {$propValue['index']} + {$propValue['step']};\\n\";\n        }\n        if (isset($namedAttr[ 'first' ])) {\n            $output .= \"{$sectionVar}->value['first'] = ({$propValue['iteration']} === 1);\\n\";\n        }\n        if (isset($namedAttr[ 'last' ])) {\n            $output .= \"{$sectionVar}->value['last'] = ({$propValue['iteration']} === {$propValue['total']});\\n\";\n        }\n        $output .= '?>';\n\n        return $output;\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile Sectionelse Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Sectionelse extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {sectionelse} tag\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n\n        list($openTag, $nocache, $local, $sectionVar) = $this->closeTag($compiler, array('section'));\n        $this->openTag($compiler, 'sectionelse', array('sectionelse', $nocache, $local, $sectionVar));\n\n        return \"<?php }} else {\\n ?>\";\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile Sectionclose Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Sectionclose extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {/section} tag\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        $compiler->loopNesting --;\n        // must endblock be nocache?\n        if ($compiler->nocache) {\n            $compiler->tag_nocache = true;\n        }\n\n        list($openTag, $compiler->nocache, $local, $sectionVar) =\n            $this->closeTag($compiler, array('section', 'sectionelse'));\n\n        $output = \"<?php\\n\";\n        if ($openTag === 'sectionelse') {\n            $output .= \"}\\n\";\n        } else {\n            $output .= \"}\\n}\\n\";\n        }\n        $output .= \"if ({$local}saved) {\\n\";\n        $output .= \"{$sectionVar} = {$local}saved;\\n\";\n        $output .= \"}\\n\";\n        $output .= '?>';\n\n        return $output;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_setfilter.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Setfilter\n * Compiles code for setfilter tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Setfilter Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Setfilter extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for setfilter tag\n     *\n     * @param  array                                $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param  array                                $parameter array with compilation parameter\n     *\n     * @return string compiled code\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)\n    {\n        $compiler->variable_filter_stack[] = $compiler->variable_filters;\n        $compiler->variable_filters = $parameter[ 'modifier_list' ];\n        // this tag does not return compiled code\n        $compiler->has_code = false;\n\n        return true;\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile Setfilterclose Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Setfilterclose extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {/setfilter} tag\n     * This tag does not generate compiled output. It resets variable filter.\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        $_attr = $this->getAttributes($compiler, $args);\n        // reset variable filter to previous state\n        if (count($compiler->variable_filter_stack)) {\n            $compiler->variable_filters = array_pop($compiler->variable_filter_stack);\n        } else {\n            $compiler->variable_filters = array();\n        }\n        // this tag does not return compiled code\n        $compiler->has_code = false;\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_shared_inheritance.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Shared Inheritance\n * Shared methods for {extends} and {block} tags\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Shared Inheritance Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Shared_Inheritance extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compile inheritance initialization code as prefix\n     *\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler\n     * @param bool|false                            $initChildSequence if true force child template\n     */\n    static function postCompile(Smarty_Internal_TemplateCompilerBase $compiler, $initChildSequence = false)\n    {\n        $compiler->prefixCompiledCode .= \"<?php \\$_smarty_tpl->_loadInheritance();\\n\\$_smarty_tpl->inheritance->init(\\$_smarty_tpl, \" .\n                                         var_export($initChildSequence, true) . \");\\n?>\\n\";\n    }\n\n    /**\n     * Register post compile callback to compile inheritance initialization code\n     *\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler\n     * @param bool|false                            $initChildSequence if true force child template\n     */\n    public function registerInit(Smarty_Internal_TemplateCompilerBase $compiler, $initChildSequence = false)\n    {\n        if ($initChildSequence || !isset($compiler->_cache['inheritanceInit'])) {\n            $compiler->registerPostCompileCallback(array('Smarty_Internal_Compile_Shared_Inheritance', 'postCompile'),\n                                                   array($initChildSequence),\n                                                   'inheritanceInit',\n                                                   $initChildSequence);\n\n            $compiler->_cache['inheritanceInit'] = true;\n        }\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compile_while.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile While\n * Compiles the {while} tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile While Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_While extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {while} tag\n     *\n     * @param  array                                $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param  array                                $parameter array with compilation parameter\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)\n    {\n        $compiler->loopNesting ++;\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        $this->openTag($compiler, 'while', $compiler->nocache);\n\n        if (!array_key_exists('if condition', $parameter)) {\n            $compiler->trigger_template_error('missing while condition', null, true);\n        }\n\n        // maybe nocache because of nocache variables\n        $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;\n        if (is_array($parameter[ 'if condition' ])) {\n            if ($compiler->nocache) {\n                // create nocache var to make it know for further compiling\n                if (is_array($parameter[ 'if condition' ][ 'var' ])) {\n                    $var = $parameter[ 'if condition' ][ 'var' ][ 'var' ];\n                } else {\n                    $var = $parameter[ 'if condition' ][ 'var' ];\n                }\n                $compiler->setNocacheInVariable($var);\n            }\n            $prefixVar = $compiler->getNewPrefixVariable();\n            $assignCompiler = new Smarty_Internal_Compile_Assign();\n            $assignAttr = array();\n            $assignAttr[][ 'value' ] = $prefixVar;\n            if (is_array($parameter[ 'if condition' ][ 'var' ])) {\n                $assignAttr[][ 'var' ] = $parameter[ 'if condition' ][ 'var' ][ 'var' ];\n                $_output = \"<?php while ({$prefixVar} = {$parameter[ 'if condition' ][ 'value' ]}) {?>\";\n                $_output .= $assignCompiler->compile($assignAttr, $compiler,\n                                                     array('smarty_internal_index' => $parameter[ 'if condition' ][ 'var' ][ 'smarty_internal_index' ]));\n            } else {\n                $assignAttr[][ 'var' ] = $parameter[ 'if condition' ][ 'var' ];\n                $_output = \"<?php while ({$prefixVar} = {$parameter[ 'if condition' ][ 'value' ]}) {?>\";\n                $_output .= $assignCompiler->compile($assignAttr, $compiler, array());\n            }\n\n            return $_output;\n        } else {\n            return \"<?php\\n while ({$parameter['if condition']}) {?>\";\n        }\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile Whileclose Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Whileclose extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {/while} tag\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        $compiler->loopNesting --;\n        // must endblock be nocache?\n        if ($compiler->nocache) {\n            $compiler->tag_nocache = true;\n        }\n        $compiler->nocache = $this->closeTag($compiler, array('while'));\n        return \"<?php }?>\\n\";\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_compilebase.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin CompileBase\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * This class does extend all internal compile plugins\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nabstract class Smarty_Internal_CompileBase\n{\n    /**\n     * Array of names of required attribute required by tag\n     *\n     * @var array\n     */\n    public $required_attributes = array();\n\n    /**\n     * Array of names of optional attribute required by tag\n     * use array('_any') if there is no restriction of attributes names\n     *\n     * @var array\n     */\n    public $optional_attributes = array();\n\n    /**\n     * Shorttag attribute order defined by its names\n     *\n     * @var array\n     */\n    public $shorttag_order = array();\n\n    /**\n     * Array of names of valid option flags\n     *\n     * @var array\n     */\n    public $option_flags = array('nocache');\n\n    /**\n     * Mapping array for boolean option value\n     *\n     * @var array\n     */\n    public $optionMap = array(1 => true, 0 => false, 'true' => true, 'false' => false);\n\n    /**\n     * Mapping array with attributes as key\n     *\n     * @var array\n     */\n    public $mapCache = array();\n\n    /**\n     * This function checks if the attributes passed are valid\n     * The attributes passed for the tag to compile are checked against the list of required and\n     * optional attributes. Required attributes must be present. Optional attributes are check against\n     * the corresponding list. The keyword '_any' specifies that any attribute will be accepted\n     * as valid\n     *\n     * @param  object $compiler   compiler object\n     * @param  array  $attributes attributes applied to the tag\n     *\n     * @return array  of mapped attributes for further processing\n     */\n    public function getAttributes($compiler, $attributes)\n    {\n        $_indexed_attr = array();\n        if (!isset($this->mapCache[ 'option' ])) {\n            $this->mapCache[ 'option' ] = array_fill_keys($this->option_flags, true);\n        }\n        foreach ($attributes as $key => $mixed) {\n            // shorthand ?\n            if (!is_array($mixed)) {\n                // option flag ?\n                if (isset($this->mapCache[ 'option' ][ trim($mixed, '\\'\"') ])) {\n                    $_indexed_attr[ trim($mixed, '\\'\"') ] = true;\n                    // shorthand attribute ?\n                } elseif (isset($this->shorttag_order[ $key ])) {\n                    $_indexed_attr[ $this->shorttag_order[ $key ] ] = $mixed;\n                } else {\n                    // too many shorthands\n                    $compiler->trigger_template_error('too many shorthand attributes', null, true);\n                }\n                // named attribute\n            } else {\n                foreach ($mixed as $k => $v) {\n                    // option flag?\n                    if (isset($this->mapCache[ 'option' ][ $k ])) {\n                        if (is_bool($v)) {\n                            $_indexed_attr[ $k ] = $v;\n                        } else {\n                            if (is_string($v)) {\n                                $v = trim($v, '\\'\" ');\n                            }\n                            if (isset($this->optionMap[ $v ])) {\n                                $_indexed_attr[ $k ] = $this->optionMap[ $v ];\n                            } else {\n                                $compiler->trigger_template_error(\"illegal value '\" . var_export($v, true) .\n                                                                  \"' for option flag '{$k}'\", null, true);\n                            }\n                        }\n                        // must be named attribute\n                    } else {\n                        $_indexed_attr[ $k ] = $v;\n                    }\n                }\n            }\n        }\n        // check if all required attributes present\n        foreach ($this->required_attributes as $attr) {\n            if (!isset($_indexed_attr[ $attr ])) {\n                $compiler->trigger_template_error(\"missing '{$attr}' attribute\", null, true);\n            }\n        }\n        // check for not allowed attributes\n        if ($this->optional_attributes !== array('_any')) {\n            if (!isset($this->mapCache[ 'all' ])) {\n                $this->mapCache[ 'all' ] =\n                    array_fill_keys(array_merge($this->required_attributes, $this->optional_attributes,\n                                                $this->option_flags), true);\n            }\n            foreach ($_indexed_attr as $key => $dummy) {\n                if (!isset($this->mapCache[ 'all' ][ $key ]) && $key !== 0) {\n                    $compiler->trigger_template_error(\"unexpected '{$key}' attribute\", null, true);\n                }\n            }\n        }\n        // default 'false' for all option flags not set\n        foreach ($this->option_flags as $flag) {\n            if (!isset($_indexed_attr[ $flag ])) {\n                $_indexed_attr[ $flag ] = false;\n            }\n        }\n        if (isset($_indexed_attr[ 'nocache' ]) && $_indexed_attr[ 'nocache' ]) {\n            $compiler->tag_nocache = true;\n        }\n        return $_indexed_attr;\n    }\n\n    /**\n     * Push opening tag name on stack\n     * Optionally additional data can be saved on stack\n     *\n     * @param object $compiler compiler object\n     * @param string $openTag  the opening tag's name\n     * @param mixed  $data     optional data saved\n     */\n    public function openTag($compiler, $openTag, $data = null)\n    {\n        array_push($compiler->_tag_stack, array($openTag, $data));\n    }\n\n    /**\n     * Pop closing tag\n     * Raise an error if this stack-top doesn't match with expected opening tags\n     *\n     * @param  object       $compiler    compiler object\n     * @param  array|string $expectedTag the expected opening tag names\n     *\n     * @return mixed        any type the opening tag's name or saved data\n     */\n    public function closeTag($compiler, $expectedTag)\n    {\n        if (count($compiler->_tag_stack) > 0) {\n            // get stacked info\n            list($_openTag, $_data) = array_pop($compiler->_tag_stack);\n            // open tag must match with the expected ones\n            if (in_array($_openTag, (array) $expectedTag)) {\n                if (is_null($_data)) {\n                    // return opening tag\n                    return $_openTag;\n                } else {\n                    // return restored data\n                    return $_data;\n                }\n            }\n            // wrong nesting of tags\n            $compiler->trigger_template_error(\"unclosed '{$compiler->smarty->left_delimiter}{$_openTag}{$compiler->smarty->right_delimiter}' tag\");\n\n            return;\n        }\n        // wrong nesting of tags\n        $compiler->trigger_template_error('unexpected closing tag', null, true);\n\n        return;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_config_file_compiler.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Config File Compiler\n * This is the config file compiler class. It calls the lexer and parser to\n * perform the compiling.\n *\n * @package    Smarty\n * @subpackage Config\n * @author     Uwe Tews\n */\n\n/**\n * Main config file compiler class\n *\n * @package    Smarty\n * @subpackage Config\n */\nclass Smarty_Internal_Config_File_Compiler\n{\n    /**\n     * Lexer class name\n     *\n     * @var string\n     */\n    public $lexer_class;\n\n    /**\n     * Parser class name\n     *\n     * @var string\n     */\n    public $parser_class;\n\n    /**\n     * Lexer object\n     *\n     * @var object\n     */\n    public $lex;\n\n    /**\n     * Parser object\n     *\n     * @var object\n     */\n    public $parser;\n\n    /**\n     * Smarty object\n     *\n     * @var Smarty object\n     */\n    public $smarty;\n\n    /**\n     * Smarty object\n     *\n     * @var Smarty_Internal_Template object\n     */\n    public $template;\n\n    /**\n     * Compiled config data sections and variables\n     *\n     * @var array\n     */\n    public $config_data = array();\n\n    /**\n     * compiled config data must always be written\n     *\n     * @var bool\n     */\n    public $write_compiled_code = true;\n\n    /**\n     * Initialize compiler\n     *\n     * @param string $lexer_class  class name\n     * @param string $parser_class class name\n     * @param Smarty $smarty       global instance\n     */\n    public function __construct($lexer_class, $parser_class, Smarty $smarty)\n    {\n        $this->smarty = $smarty;\n        // get required plugins\n        $this->lexer_class = $lexer_class;\n        $this->parser_class = $parser_class;\n        $this->smarty = $smarty;\n        $this->config_data[ 'sections' ] = array();\n        $this->config_data[ 'vars' ] = array();\n    }\n\n    /**\n     * Method to compile Smarty config source.\n     *\n     * @param Smarty_Internal_Template $template\n     *\n     * @return bool true if compiling succeeded, false if it failed\n     * @throws \\SmartyException\n     */\n    public function compileTemplate(Smarty_Internal_Template $template)\n    {\n        $this->template = $template;\n        $this->template->compiled->file_dependency[ $this->template->source->uid ] =\n            array($this->template->source->filepath,\n                  $this->template->source->getTimeStamp(),\n                  $this->template->source->type);\n        if ($this->smarty->debugging) {\n            if (!isset($this->smarty->_debug)) {\n                $this->smarty->_debug = new Smarty_Internal_Debug();\n            }\n            $this->smarty->_debug->start_compile($this->template);\n        }\n        // init the lexer/parser to compile the config file\n        /* @var Smarty_Internal_ConfigFileLexer $this ->lex */\n        $this->lex = new $this->lexer_class(str_replace(array(\"\\r\\n\",\n                                                              \"\\r\"), \"\\n\", $template->source->getContent()) . \"\\n\",\n                                            $this);\n        /* @var Smarty_Internal_ConfigFileParser $this ->parser */\n        $this->parser = new $this->parser_class($this->lex, $this);\n\n        if (function_exists('mb_internal_encoding')\n            && function_exists('ini_get')\n            && ((int) ini_get('mbstring.func_overload')) & 2\n        ) {\n            $mbEncoding = mb_internal_encoding();\n            mb_internal_encoding('ASCII');\n        } else {\n            $mbEncoding = null;\n        }\n        if ($this->smarty->_parserdebug) {\n            $this->parser->PrintTrace();\n        }\n        // get tokens from lexer and parse them\n        while ($this->lex->yylex()) {\n            if ($this->smarty->_parserdebug) {\n                echo \"<br>Parsing  {$this->parser->yyTokenName[$this->lex->token]} Token {$this->lex->value} Line {$this->lex->line} \\n\";\n            }\n            $this->parser->doParse($this->lex->token, $this->lex->value);\n        }\n        // finish parsing process\n        $this->parser->doParse(0, 0);\n\n        if ($mbEncoding) {\n            mb_internal_encoding($mbEncoding);\n        }\n        if ($this->smarty->debugging) {\n            $this->smarty->_debug->end_compile($this->template);\n        }\n        // template header code\n        $template_header =\n            \"<?php /* Smarty version \" . Smarty::SMARTY_VERSION . \", created on \" . strftime(\"%Y-%m-%d %H:%M:%S\") .\n            \"\\n\";\n        $template_header .= \"         compiled from '{$this->template->source->filepath}' */ ?>\\n\";\n\n        $code = '<?php $_smarty_tpl->smarty->ext->configLoad->_loadConfigVars($_smarty_tpl, ' .\n                var_export($this->config_data, true) . '); ?>';\n        return $template_header . $this->template->smarty->ext->_codeFrame->create($this->template, $code);\n    }\n\n    /**\n     * display compiler error messages without dying\n     * If parameter $args is empty it is a parser detected syntax error.\n     * In this case the parser is called to obtain information about expected tokens.\n     * If parameter $args contains a string this is used as error message\n     *\n     * @param string $args individual error message or null\n     *\n     * @throws SmartyCompilerException\n     */\n    public function trigger_config_file_error($args = null)\n    {\n        // get config source line which has error\n        $line = $this->lex->line;\n        if (isset($args)) {\n            // $line--;\n        }\n        $match = preg_split(\"/\\n/\", $this->lex->data);\n        $error_text =\n            \"Syntax error in config file '{$this->template->source->filepath}' on line {$line} '{$match[$line - 1]}' \";\n        if (isset($args)) {\n            // individual error message\n            $error_text .= $args;\n        } else {\n            // expected token from parser\n            foreach ($this->parser->yy_get_expected_tokens($this->parser->yymajor) as $token) {\n                $exp_token = $this->parser->yyTokenName[ $token ];\n                if (isset($this->lex->smarty_token_names[ $exp_token ])) {\n                    // token type from lexer\n                    $expect[] = '\"' . $this->lex->smarty_token_names[ $exp_token ] . '\"';\n                } else {\n                    // otherwise internal token name\n                    $expect[] = $this->parser->yyTokenName[ $token ];\n                }\n            }\n            // output parser error message\n            $error_text .= ' - Unexpected \"' . $this->lex->value . '\", expected one of: ' . implode(' , ', $expect);\n        }\n        throw new SmartyCompilerException($error_text);\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_configfilelexer.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Configfilelexer\n *\n * This is the lexer to break the config file source into tokens\n *\n * @package    Smarty\n * @subpackage Config\n * @author     Uwe Tews\n */\n\n/**\n * Smarty_Internal_Configfilelexer\n *\n * This is the config file lexer.\n * It is generated from the smarty_internal_configfilelexer.plex file\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Configfilelexer\n{\n    const START              = 1;\n    const VALUE              = 2;\n    const NAKED_STRING_VALUE = 3;\n    const COMMENT            = 4;\n    const SECTION            = 5;\n    const TRIPPLE            = 6;\n    /**\n     * Source\n     *\n     * @var string\n     */\n    public $data;\n    /**\n     * Source length\n     *\n     * @var int\n     */\n    public $dataLength = null;\n    /**\n     * byte counter\n     *\n     * @var int\n     */\n    public $counter;\n    /**\n     * token number\n     *\n     * @var int\n     */\n    public $token;\n    /**\n     * token value\n     *\n     * @var string\n     */\n    public $value;\n    /**\n     * current line\n     *\n     * @var int\n     */\n    public $line;\n    /**\n     * state number\n     *\n     * @var int\n     */\n    public $state = 1;\n    /**\n     * Smarty object\n     *\n     * @var Smarty\n     */\n    public $smarty = null;\n    /**\n     * trace file\n     *\n     * @var resource\n     */\n    public $yyTraceFILE;\n    /**\n     * trace prompt\n     *\n     * @var string\n     */\n    public $yyTracePrompt;\n    /**\n     * state names\n     *\n     * @var array\n     */\n    public $state_name = array(1 => 'START', 2 => 'VALUE', 3 => 'NAKED_STRING_VALUE', 4 => 'COMMENT', 5 => 'SECTION',\n                               6 => 'TRIPPLE');\n    /**\n     * token names\n     *\n     * @var array\n     */\n    public $smarty_token_names = array(        // Text for parser error messages\n    );\n    /**\n     * compiler object\n     *\n     * @var Smarty_Internal_Config_File_Compiler\n     */\n    private $compiler = null;\n    /**\n     * copy of config_booleanize\n     *\n     * @var bool\n     */\n    private $configBooleanize = false;\n    /**\n     * storage for assembled token patterns\n     *\n     * @var string\n     */\n    private $yy_global_pattern1 = null;\n    private $yy_global_pattern2 = null;\n    private $yy_global_pattern3 = null;\n    private $yy_global_pattern4 = null;\n    private $yy_global_pattern5 = null;\n    private $yy_global_pattern6 = null;\n    private $_yy_state          = 1;\n    private $_yy_stack          = array();\n\n    /**\n     * constructor\n     *\n     * @param   string                             $data template source\n     * @param Smarty_Internal_Config_File_Compiler $compiler\n     */\n    function __construct($data, Smarty_Internal_Config_File_Compiler $compiler)\n    {\n        $this->data = $data . \"\\n\"; //now all lines are \\n-terminated\n        $this->dataLength = strlen($data);\n        $this->counter = 0;\n        if (preg_match('/^\\xEF\\xBB\\xBF/', $this->data, $match)) {\n            $this->counter += strlen($match[ 0 ]);\n        }\n        $this->line = 1;\n        $this->compiler = $compiler;\n        $this->smarty = $compiler->smarty;\n        $this->configBooleanize = $this->smarty->config_booleanize;\n    }\n\n    public function replace($input)\n    {\n        return $input;\n    } // end function\n\n    public function PrintTrace()\n    {\n        $this->yyTraceFILE = fopen('php://output', 'w');\n        $this->yyTracePrompt = '<br>';\n    }\n\n    public function yylex()\n    {\n        return $this->{'yylex' . $this->_yy_state}();\n    }\n\n    public function yypushstate($state)\n    {\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE,\n                    \"%sState push %s\\n\",\n                    $this->yyTracePrompt,\n                    isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] :\n                        $this->_yy_state);\n        }\n        array_push($this->_yy_stack, $this->_yy_state);\n        $this->_yy_state = $state;\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE,\n                    \"%snew State %s\\n\",\n                    $this->yyTracePrompt,\n                    isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] :\n                        $this->_yy_state);\n        }\n    }\n\n    public function yypopstate()\n    {\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE,\n                    \"%sState pop %s\\n\",\n                    $this->yyTracePrompt,\n                    isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] :\n                        $this->_yy_state);\n        }\n        $this->_yy_state = array_pop($this->_yy_stack);\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE,\n                    \"%snew State %s\\n\",\n                    $this->yyTracePrompt,\n                    isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] :\n                        $this->_yy_state);\n        }\n    }\n\n    public function yybegin($state)\n    {\n        $this->_yy_state = $state;\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE,\n                    \"%sState set %s\\n\",\n                    $this->yyTracePrompt,\n                    isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] :\n                        $this->_yy_state);\n        }\n    }\n\n    public function yylex1()\n    {\n        if (!isset($this->yy_global_pattern1)) {\n            $this->yy_global_pattern1 =\n                $this->replace(\"/\\G(#|;)|\\G(\\\\[)|\\G(\\\\])|\\G(=)|\\G([ \\t\\r]+)|\\G(\\n)|\\G([0-9]*[a-zA-Z_]\\\\w*)|\\G([\\S\\s])/isS\");\n        }\n        if (!isset($this->dataLength)) {\n            $this->dataLength = strlen($this->data);\n        }\n        if ($this->counter >= $this->dataLength) {\n            return false; // end of input\n        }\n        do {\n            if (preg_match($this->yy_global_pattern1, $this->data, $yymatches, 0, $this->counter)) {\n                if (!isset($yymatches[ 0 ][ 1 ])) {\n                    $yymatches = preg_grep(\"/(.|\\s)+/\", $yymatches);\n                } else {\n                    $yymatches = array_filter($yymatches);\n                }\n                if (empty($yymatches)) {\n                    throw new Exception('Error: lexing failed because a rule matched' .\n                                        ' an empty string.  Input \"' . substr($this->data,\n                                                                              $this->counter,\n                                                                              5) . '... state START');\n                }\n                next($yymatches); // skip global match\n                $this->token = key($yymatches); // token number\n                $this->value = current($yymatches); // token value\n                $r = $this->{'yy_r1_' . $this->token}();\n                if ($r === null) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    // accept this token\n                    return true;\n                } else if ($r === true) {\n                    // we have changed state\n                    // process this token in the new state\n                    return $this->yylex();\n                } else if ($r === false) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    if ($this->counter >= $this->dataLength) {\n                        return false; // end of input\n                    }\n                    // skip this token\n                    continue;\n                }\n            } else {\n                throw new Exception('Unexpected input at line' . $this->line .\n                                    ': ' . $this->data[ $this->counter ]);\n            }\n            break;\n        } while (true);\n    }\n\n    function yy_r1_1()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_COMMENTSTART;\n        $this->yypushstate(self::COMMENT);\n    }\n\n    function yy_r1_2()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_OPENB;\n        $this->yypushstate(self::SECTION);\n    }\n\n    function yy_r1_3()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_CLOSEB;\n    }\n\n    function yy_r1_4()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_EQUAL;\n        $this->yypushstate(self::VALUE);\n    } // end function\n\n    function yy_r1_5()\n    {\n        return false;\n    }\n\n    function yy_r1_6()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_NEWLINE;\n    }\n\n    function yy_r1_7()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_ID;\n    }\n\n    function yy_r1_8()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_OTHER;\n    }\n\n    public function yylex2()\n    {\n        if (!isset($this->yy_global_pattern2)) {\n            $this->yy_global_pattern2 =\n                $this->replace(\"/\\G([ \\t\\r]+)|\\G(\\\\d+\\\\.\\\\d+(?=[ \\t\\r]*[\\n#;]))|\\G(\\\\d+(?=[ \\t\\r]*[\\n#;]))|\\G(\\\"\\\"\\\")|\\G('[^'\\\\\\\\]*(?:\\\\\\\\.[^'\\\\\\\\]*)*'(?=[ \\t\\r]*[\\n#;]))|\\G(\\\"[^\\\"\\\\\\\\]*(?:\\\\\\\\.[^\\\"\\\\\\\\]*)*\\\"(?=[ \\t\\r]*[\\n#;]))|\\G([a-zA-Z]+(?=[ \\t\\r]*[\\n#;]))|\\G([^\\n]+?(?=[ \\t\\r]*\\n))|\\G(\\n)/isS\");\n        }\n        if (!isset($this->dataLength)) {\n            $this->dataLength = strlen($this->data);\n        }\n        if ($this->counter >= $this->dataLength) {\n            return false; // end of input\n        }\n        do {\n            if (preg_match($this->yy_global_pattern2, $this->data, $yymatches, 0, $this->counter)) {\n                if (!isset($yymatches[ 0 ][ 1 ])) {\n                    $yymatches = preg_grep(\"/(.|\\s)+/\", $yymatches);\n                } else {\n                    $yymatches = array_filter($yymatches);\n                }\n                if (empty($yymatches)) {\n                    throw new Exception('Error: lexing failed because a rule matched' .\n                                        ' an empty string.  Input \"' . substr($this->data,\n                                                                              $this->counter,\n                                                                              5) . '... state VALUE');\n                }\n                next($yymatches); // skip global match\n                $this->token = key($yymatches); // token number\n                $this->value = current($yymatches); // token value\n                $r = $this->{'yy_r2_' . $this->token}();\n                if ($r === null) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    // accept this token\n                    return true;\n                } else if ($r === true) {\n                    // we have changed state\n                    // process this token in the new state\n                    return $this->yylex();\n                } else if ($r === false) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    if ($this->counter >= $this->dataLength) {\n                        return false; // end of input\n                    }\n                    // skip this token\n                    continue;\n                }\n            } else {\n                throw new Exception('Unexpected input at line' . $this->line .\n                                    ': ' . $this->data[ $this->counter ]);\n            }\n            break;\n        } while (true);\n    }\n\n    function yy_r2_1()\n    {\n        return false;\n    }\n\n    function yy_r2_2()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_FLOAT;\n        $this->yypopstate();\n    }\n\n    function yy_r2_3()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_INT;\n        $this->yypopstate();\n    }\n\n    function yy_r2_4()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_TRIPPLE_QUOTES;\n        $this->yypushstate(self::TRIPPLE);\n    }\n\n    function yy_r2_5()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_SINGLE_QUOTED_STRING;\n        $this->yypopstate();\n    }\n\n    function yy_r2_6()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_DOUBLE_QUOTED_STRING;\n        $this->yypopstate();\n    } // end function\n\n    function yy_r2_7()\n    {\n        if (!$this->configBooleanize ||\n            !in_array(strtolower($this->value), array('true', 'false', 'on', 'off', 'yes', 'no'))) {\n            $this->yypopstate();\n            $this->yypushstate(self::NAKED_STRING_VALUE);\n            return true; //reprocess in new state\n        } else {\n            $this->token = Smarty_Internal_Configfileparser::TPC_BOOL;\n            $this->yypopstate();\n        }\n    }\n\n    function yy_r2_8()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING;\n        $this->yypopstate();\n    }\n\n    function yy_r2_9()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING;\n        $this->value = '';\n        $this->yypopstate();\n    } // end function\n\n    public function yylex3()\n    {\n        if (!isset($this->yy_global_pattern3)) {\n            $this->yy_global_pattern3 = $this->replace(\"/\\G([^\\n]+?(?=[ \\t\\r]*\\n))/isS\");\n        }\n        if (!isset($this->dataLength)) {\n            $this->dataLength = strlen($this->data);\n        }\n        if ($this->counter >= $this->dataLength) {\n            return false; // end of input\n        }\n        do {\n            if (preg_match($this->yy_global_pattern3, $this->data, $yymatches, 0, $this->counter)) {\n                if (!isset($yymatches[ 0 ][ 1 ])) {\n                    $yymatches = preg_grep(\"/(.|\\s)+/\", $yymatches);\n                } else {\n                    $yymatches = array_filter($yymatches);\n                }\n                if (empty($yymatches)) {\n                    throw new Exception('Error: lexing failed because a rule matched' .\n                                        ' an empty string.  Input \"' . substr($this->data,\n                                                                              $this->counter,\n                                                                              5) . '... state NAKED_STRING_VALUE');\n                }\n                next($yymatches); // skip global match\n                $this->token = key($yymatches); // token number\n                $this->value = current($yymatches); // token value\n                $r = $this->{'yy_r3_' . $this->token}();\n                if ($r === null) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    // accept this token\n                    return true;\n                } else if ($r === true) {\n                    // we have changed state\n                    // process this token in the new state\n                    return $this->yylex();\n                } else if ($r === false) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    if ($this->counter >= $this->dataLength) {\n                        return false; // end of input\n                    }\n                    // skip this token\n                    continue;\n                }\n            } else {\n                throw new Exception('Unexpected input at line' . $this->line .\n                                    ': ' . $this->data[ $this->counter ]);\n            }\n            break;\n        } while (true);\n    }\n\n    function yy_r3_1()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING;\n        $this->yypopstate();\n    }\n\n    public function yylex4()\n    {\n        if (!isset($this->yy_global_pattern4)) {\n            $this->yy_global_pattern4 = $this->replace(\"/\\G([ \\t\\r]+)|\\G([^\\n]+?(?=[ \\t\\r]*\\n))|\\G(\\n)/isS\");\n        }\n        if (!isset($this->dataLength)) {\n            $this->dataLength = strlen($this->data);\n        }\n        if ($this->counter >= $this->dataLength) {\n            return false; // end of input\n        }\n        do {\n            if (preg_match($this->yy_global_pattern4, $this->data, $yymatches, 0, $this->counter)) {\n                if (!isset($yymatches[ 0 ][ 1 ])) {\n                    $yymatches = preg_grep(\"/(.|\\s)+/\", $yymatches);\n                } else {\n                    $yymatches = array_filter($yymatches);\n                }\n                if (empty($yymatches)) {\n                    throw new Exception('Error: lexing failed because a rule matched' .\n                                        ' an empty string.  Input \"' . substr($this->data,\n                                                                              $this->counter,\n                                                                              5) . '... state COMMENT');\n                }\n                next($yymatches); // skip global match\n                $this->token = key($yymatches); // token number\n                $this->value = current($yymatches); // token value\n                $r = $this->{'yy_r4_' . $this->token}();\n                if ($r === null) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    // accept this token\n                    return true;\n                } else if ($r === true) {\n                    // we have changed state\n                    // process this token in the new state\n                    return $this->yylex();\n                } else if ($r === false) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    if ($this->counter >= $this->dataLength) {\n                        return false; // end of input\n                    }\n                    // skip this token\n                    continue;\n                }\n            } else {\n                throw new Exception('Unexpected input at line' . $this->line .\n                                    ': ' . $this->data[ $this->counter ]);\n            }\n            break;\n        } while (true);\n    }\n\n    function yy_r4_1()\n    {\n        return false;\n    }\n\n    function yy_r4_2()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING;\n    } // end function\n\n    function yy_r4_3()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_NEWLINE;\n        $this->yypopstate();\n    }\n\n    public function yylex5()\n    {\n        if (!isset($this->yy_global_pattern5)) {\n            $this->yy_global_pattern5 = $this->replace(\"/\\G(\\\\.)|\\G(.*?(?=[\\.=[\\]\\r\\n]))/isS\");\n        }\n        if (!isset($this->dataLength)) {\n            $this->dataLength = strlen($this->data);\n        }\n        if ($this->counter >= $this->dataLength) {\n            return false; // end of input\n        }\n        do {\n            if (preg_match($this->yy_global_pattern5, $this->data, $yymatches, 0, $this->counter)) {\n                if (!isset($yymatches[ 0 ][ 1 ])) {\n                    $yymatches = preg_grep(\"/(.|\\s)+/\", $yymatches);\n                } else {\n                    $yymatches = array_filter($yymatches);\n                }\n                if (empty($yymatches)) {\n                    throw new Exception('Error: lexing failed because a rule matched' .\n                                        ' an empty string.  Input \"' . substr($this->data,\n                                                                              $this->counter,\n                                                                              5) . '... state SECTION');\n                }\n                next($yymatches); // skip global match\n                $this->token = key($yymatches); // token number\n                $this->value = current($yymatches); // token value\n                $r = $this->{'yy_r5_' . $this->token}();\n                if ($r === null) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    // accept this token\n                    return true;\n                } else if ($r === true) {\n                    // we have changed state\n                    // process this token in the new state\n                    return $this->yylex();\n                } else if ($r === false) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    if ($this->counter >= $this->dataLength) {\n                        return false; // end of input\n                    }\n                    // skip this token\n                    continue;\n                }\n            } else {\n                throw new Exception('Unexpected input at line' . $this->line .\n                                    ': ' . $this->data[ $this->counter ]);\n            }\n            break;\n        } while (true);\n    }\n\n    function yy_r5_1()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_DOT;\n    }\n\n    function yy_r5_2()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_SECTION;\n        $this->yypopstate();\n    } // end function\n\n    public function yylex6()\n    {\n        if (!isset($this->yy_global_pattern6)) {\n            $this->yy_global_pattern6 = $this->replace(\"/\\G(\\\"\\\"\\\"(?=[ \\t\\r]*[\\n#;]))|\\G([\\S\\s])/isS\");\n        }\n        if (!isset($this->dataLength)) {\n            $this->dataLength = strlen($this->data);\n        }\n        if ($this->counter >= $this->dataLength) {\n            return false; // end of input\n        }\n        do {\n            if (preg_match($this->yy_global_pattern6, $this->data, $yymatches, 0, $this->counter)) {\n                if (!isset($yymatches[ 0 ][ 1 ])) {\n                    $yymatches = preg_grep(\"/(.|\\s)+/\", $yymatches);\n                } else {\n                    $yymatches = array_filter($yymatches);\n                }\n                if (empty($yymatches)) {\n                    throw new Exception('Error: lexing failed because a rule matched' .\n                                        ' an empty string.  Input \"' . substr($this->data,\n                                                                              $this->counter,\n                                                                              5) . '... state TRIPPLE');\n                }\n                next($yymatches); // skip global match\n                $this->token = key($yymatches); // token number\n                $this->value = current($yymatches); // token value\n                $r = $this->{'yy_r6_' . $this->token}();\n                if ($r === null) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    // accept this token\n                    return true;\n                } else if ($r === true) {\n                    // we have changed state\n                    // process this token in the new state\n                    return $this->yylex();\n                } else if ($r === false) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    if ($this->counter >= $this->dataLength) {\n                        return false; // end of input\n                    }\n                    // skip this token\n                    continue;\n                }\n            } else {\n                throw new Exception('Unexpected input at line' . $this->line .\n                                    ': ' . $this->data[ $this->counter ]);\n            }\n            break;\n        } while (true);\n    }\n\n    function yy_r6_1()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_TRIPPLE_QUOTES_END;\n        $this->yypopstate();\n        $this->yypushstate(self::START);\n    }\n\n    function yy_r6_2()\n    {\n        $to = strlen($this->data);\n        preg_match(\"/\\\"\\\"\\\"[ \\t\\r]*[\\n#;]/\", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter);\n        if (isset($match[ 0 ][ 1 ])) {\n            $to = $match[ 0 ][ 1 ];\n        } else {\n            $this->compiler->trigger_template_error('missing or misspelled literal closing tag');\n        }\n        $this->value = substr($this->data, $this->counter, $to - $this->counter);\n        $this->token = Smarty_Internal_Configfileparser::TPC_TRIPPLE_TEXT;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_configfileparser.php",
    "content": "<?php\n\nclass TPC_yyStackEntry\n{\n    public $stateno;       /* The state-number */\n    public $major;         /* The major token value.  This is the code\n                     ** number for the token at this stack level */\n    public $minor; /* The user-supplied minor token value.  This\n                     ** is the value of the token  */\n}\n\n#line 12 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n\n/**\n * Smarty Internal Plugin Configfileparse\n *\n * This is the config file parser.\n * It is generated from the smarty_internal_configfileparser.y file\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Configfileparser\n{\n    #line 25 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    const TPC_OPENB                = 1;\n    const TPC_SECTION              = 2;\n    const TPC_CLOSEB               = 3;\n    const TPC_DOT                  = 4;\n    const TPC_ID                   = 5;\n    const TPC_EQUAL                = 6;\n    const TPC_FLOAT                = 7;\n    const TPC_INT                  = 8;\n    const TPC_BOOL                 = 9;\n    const TPC_SINGLE_QUOTED_STRING = 10;\n    const TPC_DOUBLE_QUOTED_STRING = 11;\n    const TPC_TRIPPLE_QUOTES       = 12;\n    const TPC_TRIPPLE_TEXT         = 13;\n    const TPC_TRIPPLE_QUOTES_END   = 14;\n    const TPC_NAKED_STRING         = 15;\n    const TPC_OTHER                = 16;\n    const TPC_NEWLINE              = 17;\n    const TPC_COMMENTSTART         = 18;\n    const YY_NO_ACTION             = 60;\n    const YY_ACCEPT_ACTION         = 59;\n    const YY_ERROR_ACTION          = 58;\n    const YY_SZ_ACTTAB             = 38;\n    const YY_SHIFT_USE_DFLT        = -8;\n    const YY_SHIFT_MAX             = 19;\n    const YY_REDUCE_USE_DFLT       = -21;\n    const YY_REDUCE_MAX            = 10;\n    const YYNOCODE                 = 29;\n    const YYSTACKDEPTH             = 100;\n    const YYNSTATE                 = 36;\n    const YYNRULE                  = 22;\n    const YYERRORSYMBOL            = 19;\n    const YYERRSYMDT               = 'yy0';\n    const YYFALLBACK               = 0;\n    static public $yy_action        = array(\n        29, 30, 34, 33, 24, 13, 19, 25, 35, 21,\n        59, 8, 3, 1, 20, 12, 14, 31, 20, 12,\n        15, 17, 23, 18, 27, 26, 4, 5, 6, 32,\n        2, 11, 28, 22, 16, 9, 7, 10,\n    );\n    static public $yy_lookahead     = array(\n        7, 8, 9, 10, 11, 12, 5, 27, 15, 16,\n        20, 21, 23, 23, 17, 18, 13, 14, 17, 18,\n        15, 2, 17, 4, 25, 26, 6, 3, 3, 14,\n        23, 1, 24, 17, 2, 25, 22, 25,\n    );\n    static public $yy_shift_ofst    = array(\n        -8, 1, 1, 1, -7, -3, -3, 30, -8, -8,\n        -8, 19, 5, 3, 15, 16, 24, 25, 32, 20,\n    );\n    static public $yy_reduce_ofst   = array(\n        -10, -1, -1, -1, -20, 10, 12, 8, 14, 7,\n        -11,\n    );\n    static public $yyExpectedTokens = array(\n        array(),\n        array(5, 17, 18,),\n        array(5, 17, 18,),\n        array(5, 17, 18,),\n        array(7, 8, 9, 10, 11, 12, 15, 16,),\n        array(17, 18,),\n        array(17, 18,),\n        array(1,),\n        array(),\n        array(),\n        array(),\n        array(2, 4,),\n        array(15, 17,),\n        array(13, 14,),\n        array(14,),\n        array(17,),\n        array(3,),\n        array(3,),\n        array(2,),\n        array(6,),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n    );\n    static public $yy_default       = array(\n        44, 37, 41, 40, 58, 58, 58, 36, 39, 44,\n        44, 58, 58, 58, 58, 58, 58, 58, 58, 58,\n        55, 54, 57, 56, 50, 45, 43, 42, 38, 46,\n        47, 52, 51, 49, 48, 53,\n    );\n    public static $yyFallback       = array();\n    public static $yyRuleName       = array(\n        'start ::= global_vars sections',\n        'global_vars ::= var_list',\n        'sections ::= sections section',\n        'sections ::=',\n        'section ::= OPENB SECTION CLOSEB newline var_list',\n        'section ::= OPENB DOT SECTION CLOSEB newline var_list',\n        'var_list ::= var_list newline',\n        'var_list ::= var_list var',\n        'var_list ::=',\n        'var ::= ID EQUAL value',\n        'value ::= FLOAT',\n        'value ::= INT',\n        'value ::= BOOL',\n        'value ::= SINGLE_QUOTED_STRING',\n        'value ::= DOUBLE_QUOTED_STRING',\n        'value ::= TRIPPLE_QUOTES TRIPPLE_TEXT TRIPPLE_QUOTES_END',\n        'value ::= TRIPPLE_QUOTES TRIPPLE_QUOTES_END',\n        'value ::= NAKED_STRING',\n        'value ::= OTHER',\n        'newline ::= NEWLINE',\n        'newline ::= COMMENTSTART NEWLINE',\n        'newline ::= COMMENTSTART NAKED_STRING NEWLINE',\n    );\n    public static $yyRuleInfo       = array(\n        array(0 => 20, 1 => 2),\n        array(0 => 21, 1 => 1),\n        array(0 => 22, 1 => 2),\n        array(0 => 22, 1 => 0),\n        array(0 => 24, 1 => 5),\n        array(0 => 24, 1 => 6),\n        array(0 => 23, 1 => 2),\n        array(0 => 23, 1 => 2),\n        array(0 => 23, 1 => 0),\n        array(0 => 26, 1 => 3),\n        array(0 => 27, 1 => 1),\n        array(0 => 27, 1 => 1),\n        array(0 => 27, 1 => 1),\n        array(0 => 27, 1 => 1),\n        array(0 => 27, 1 => 1),\n        array(0 => 27, 1 => 3),\n        array(0 => 27, 1 => 2),\n        array(0 => 27, 1 => 1),\n        array(0 => 27, 1 => 1),\n        array(0 => 25, 1 => 1),\n        array(0 => 25, 1 => 2),\n        array(0 => 25, 1 => 3),\n    );\n    public static $yyReduceMap      = array(\n        0  => 0,\n        2  => 0,\n        3  => 0,\n        19 => 0,\n        20 => 0,\n        21 => 0,\n        1  => 1,\n        4  => 4,\n        5  => 5,\n        6  => 6,\n        7  => 7,\n        8  => 8,\n        9  => 9,\n        10 => 10,\n        11 => 11,\n        12 => 12,\n        13 => 13,\n        14 => 14,\n        15 => 15,\n        16 => 16,\n        17 => 17,\n        18 => 17,\n    );\n    /**\n     * helper map\n     *\n     * @var array\n     */\n    private static $escapes_single = array('\\\\' => '\\\\',\n                                           '\\'' => '\\'');\n    /**\n     * result status\n     *\n     * @var bool\n     */\n    public $successful = true;\n    /**\n     * return value\n     *\n     * @var mixed\n     */\n    public $retvalue = 0;\n    /**\n     * @var\n     */\n    public $yymajor;\n    /**\n     * compiler object\n     *\n     * @var Smarty_Internal_Config_File_Compiler\n     */\n    public $compiler = null;\n    /**\n     * smarty object\n     *\n     * @var Smarty\n     */\n    public $smarty      = null;\n    public $yyTraceFILE;\n    public $yyTracePrompt;\n    public $yyidx;\n    public $yyerrcnt;\n    public $yystack     = array();\n    public $yyTokenName = array(\n        '$', 'OPENB', 'SECTION', 'CLOSEB',\n        'DOT', 'ID', 'EQUAL', 'FLOAT',\n        'INT', 'BOOL', 'SINGLE_QUOTED_STRING', 'DOUBLE_QUOTED_STRING',\n        'TRIPPLE_QUOTES', 'TRIPPLE_TEXT', 'TRIPPLE_QUOTES_END', 'NAKED_STRING',\n        'OTHER', 'NEWLINE', 'COMMENTSTART', 'error',\n        'start', 'global_vars', 'sections', 'var_list',\n        'section', 'newline', 'var', 'value',\n    );\n    /**\n     * lexer object\n     *\n     * @var Smarty_Internal_Configfilelexer\n     */\n    private $lex;\n    /**\n     * internal error flag\n     *\n     * @var bool\n     */\n    private $internalError = false;\n    /**\n     * copy of config_overwrite property\n     *\n     * @var bool\n     */\n    private $configOverwrite = false;\n    /**\n     * copy of config_read_hidden property\n     *\n     * @var bool\n     */\n    private $configReadHidden = false;\n    private $_retvalue;\n\n    /**\n     * constructor\n     *\n     * @param Smarty_Internal_Configfilelexer      $lex\n     * @param Smarty_Internal_Config_File_Compiler $compiler\n     */\n    function __construct(Smarty_Internal_Configfilelexer $lex, Smarty_Internal_Config_File_Compiler $compiler)\n    {\n        $this->lex = $lex;\n        $this->smarty = $compiler->smarty;\n        $this->compiler = $compiler;\n        $this->configOverwrite = $this->smarty->config_overwrite;\n        $this->configReadHidden = $this->smarty->config_read_hidden;\n    }\n\n    public static function yy_destructor($yymajor, $yypminor)\n    {\n        switch ($yymajor) {\n            default:\n                break;   /* If no destructor action specified: do nothing */\n        }\n    }\n\n    /**\n     * parse single quoted string\n     *  remove outer quotes\n     *  unescape inner quotes\n     *\n     * @param string $qstr\n     *\n     * @return string\n     */\n    private static function parse_single_quoted_string($qstr)\n    {\n        $escaped_string = substr($qstr, 1, strlen($qstr) - 2); //remove outer quotes\n        $ss = preg_split('/(\\\\\\\\.)/', $escaped_string, -1, PREG_SPLIT_DELIM_CAPTURE);\n        $str = '';\n        foreach ($ss as $s) {\n            if (strlen($s) === 2 && $s[ 0 ] === '\\\\') {\n                if (isset(self::$escapes_single[ $s[ 1 ] ])) {\n                    $s = self::$escapes_single[ $s[ 1 ] ];\n                }\n            }\n            $str .= $s;\n        }\n        return $str;\n    }                    /* Index of top element in stack */\n    /**\n     * parse double quoted string\n     *\n     * @param string $qstr\n     *\n     * @return string\n     */\n    private static function parse_double_quoted_string($qstr)\n    {\n        $inner_str = substr($qstr, 1, strlen($qstr) - 2);\n        return stripcslashes($inner_str);\n    }                 /* Shifts left before out of the error */\n    /**\n     * parse triple quoted string\n     *\n     * @param string $qstr\n     *\n     * @return string\n     */\n    private static function parse_tripple_double_quoted_string($qstr)\n    {\n        return stripcslashes($qstr);\n    }  /* The parser's stack */\n    public function Trace($TraceFILE, $zTracePrompt)\n    {\n        if (!$TraceFILE) {\n            $zTracePrompt = 0;\n        } else if (!$zTracePrompt) {\n            $TraceFILE = 0;\n        }\n        $this->yyTraceFILE = $TraceFILE;\n        $this->yyTracePrompt = $zTracePrompt;\n    }\n\n    public function PrintTrace()\n    {\n        $this->yyTraceFILE = fopen('php://output', 'w');\n        $this->yyTracePrompt = '<br>';\n    }\n\n    public function tokenName($tokenType)\n    {\n        if ($tokenType === 0) {\n            return 'End of Input';\n        }\n        if ($tokenType > 0 && $tokenType < count($this->yyTokenName)) {\n            return $this->yyTokenName[ $tokenType ];\n        } else {\n            return 'Unknown';\n        }\n    }\n\n    public function yy_pop_parser_stack()\n    {\n        if (empty($this->yystack)) {\n            return;\n        }\n        $yytos = array_pop($this->yystack);\n        if ($this->yyTraceFILE && $this->yyidx >= 0) {\n            fwrite($this->yyTraceFILE,\n                   $this->yyTracePrompt . 'Popping ' . $this->yyTokenName[ $yytos->major ] .\n                   \"\\n\");\n        }\n        $yymajor = $yytos->major;\n        self::yy_destructor($yymajor, $yytos->minor);\n        $this->yyidx--;\n        return $yymajor;\n    }\n\n    public function __destruct()\n    {\n        while ($this->yystack !== Array()) {\n            $this->yy_pop_parser_stack();\n        }\n        if (is_resource($this->yyTraceFILE)) {\n            fclose($this->yyTraceFILE);\n        }\n    }\n\n    public function yy_get_expected_tokens($token)\n    {\n        static $res3 = array();\n        static $res4 = array();\n        $state = $this->yystack[ $this->yyidx ]->stateno;\n        $expected = self::$yyExpectedTokens[ $state ];\n        if (isset($res3[ $state ][ $token ])) {\n            if ($res3[ $state ][ $token ]) {\n                return $expected;\n            }\n        } else {\n            if ($res3[ $state ][ $token ] = in_array($token, self::$yyExpectedTokens[ $state ], true)) {\n                return $expected;\n            }\n        }\n        $stack = $this->yystack;\n        $yyidx = $this->yyidx;\n        do {\n            $yyact = $this->yy_find_shift_action($token);\n            if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {\n                // reduce action\n                $done = 0;\n                do {\n                    if ($done++ === 100) {\n                        $this->yyidx = $yyidx;\n                        $this->yystack = $stack;\n                        // too much recursion prevents proper detection\n                        // so give up\n                        return array_unique($expected);\n                    }\n                    $yyruleno = $yyact - self::YYNSTATE;\n                    $this->yyidx -= self::$yyRuleInfo[ $yyruleno ][ 1 ];\n                    $nextstate = $this->yy_find_reduce_action(\n                        $this->yystack[ $this->yyidx ]->stateno,\n                        self::$yyRuleInfo[ $yyruleno ][ 0 ]);\n                    if (isset(self::$yyExpectedTokens[ $nextstate ])) {\n                        $expected = array_merge($expected, self::$yyExpectedTokens[ $nextstate ]);\n                        if (isset($res4[ $nextstate ][ $token ])) {\n                            if ($res4[ $nextstate ][ $token ]) {\n                                $this->yyidx = $yyidx;\n                                $this->yystack = $stack;\n                                return array_unique($expected);\n                            }\n                        } else {\n                            if ($res4[ $nextstate ][ $token ] =\n                                in_array($token, self::$yyExpectedTokens[ $nextstate ], true)) {\n                                $this->yyidx = $yyidx;\n                                $this->yystack = $stack;\n                                return array_unique($expected);\n                            }\n                        }\n                    }\n                    if ($nextstate < self::YYNSTATE) {\n                        // we need to shift a non-terminal\n                        $this->yyidx++;\n                        $x = new TPC_yyStackEntry;\n                        $x->stateno = $nextstate;\n                        $x->major = self::$yyRuleInfo[ $yyruleno ][ 0 ];\n                        $this->yystack[ $this->yyidx ] = $x;\n                        continue 2;\n                    } else if ($nextstate === self::YYNSTATE + self::YYNRULE + 1) {\n                        $this->yyidx = $yyidx;\n                        $this->yystack = $stack;\n                        // the last token was just ignored, we can't accept\n                        // by ignoring input, this is in essence ignoring a\n                        // syntax error!\n                        return array_unique($expected);\n                    } else if ($nextstate === self::YY_NO_ACTION) {\n                        $this->yyidx = $yyidx;\n                        $this->yystack = $stack;\n                        // input accepted, but not shifted (I guess)\n                        return $expected;\n                    } else {\n                        $yyact = $nextstate;\n                    }\n                } while (true);\n            }\n            break;\n        } while (true);\n        $this->yyidx = $yyidx;\n        $this->yystack = $stack;\n        return array_unique($expected);\n    }\n\n    public function yy_is_expected_token($token)\n    {\n        static $res = array();\n        static $res2 = array();\n        if ($token === 0) {\n            return true; // 0 is not part of this\n        }\n        $state = $this->yystack[ $this->yyidx ]->stateno;\n        if (isset($res[ $state ][ $token ])) {\n            if ($res[ $state ][ $token ]) {\n                return true;\n            }\n        } else {\n            if ($res[ $state ][ $token ] = in_array($token, self::$yyExpectedTokens[ $state ], true)) {\n                return true;\n            }\n        }\n        $stack = $this->yystack;\n        $yyidx = $this->yyidx;\n        do {\n            $yyact = $this->yy_find_shift_action($token);\n            if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {\n                // reduce action\n                $done = 0;\n                do {\n                    if ($done++ === 100) {\n                        $this->yyidx = $yyidx;\n                        $this->yystack = $stack;\n                        // too much recursion prevents proper detection\n                        // so give up\n                        return true;\n                    }\n                    $yyruleno = $yyact - self::YYNSTATE;\n                    $this->yyidx -= self::$yyRuleInfo[ $yyruleno ][ 1 ];\n                    $nextstate = $this->yy_find_reduce_action(\n                        $this->yystack[ $this->yyidx ]->stateno,\n                        self::$yyRuleInfo[ $yyruleno ][ 0 ]);\n                    if (isset($res2[ $nextstate ][ $token ])) {\n                        if ($res2[ $nextstate ][ $token ]) {\n                            $this->yyidx = $yyidx;\n                            $this->yystack = $stack;\n                            return true;\n                        }\n                    } else {\n                        if ($res2[ $nextstate ][ $token ] = (isset(self::$yyExpectedTokens[ $nextstate ]) &&\n                                                             in_array($token,\n                                                                      self::$yyExpectedTokens[ $nextstate ],\n                                                                      true))) {\n                            $this->yyidx = $yyidx;\n                            $this->yystack = $stack;\n                            return true;\n                        }\n                    }\n                    if ($nextstate < self::YYNSTATE) {\n                        // we need to shift a non-terminal\n                        $this->yyidx++;\n                        $x = new TPC_yyStackEntry;\n                        $x->stateno = $nextstate;\n                        $x->major = self::$yyRuleInfo[ $yyruleno ][ 0 ];\n                        $this->yystack[ $this->yyidx ] = $x;\n                        continue 2;\n                    } else if ($nextstate === self::YYNSTATE + self::YYNRULE + 1) {\n                        $this->yyidx = $yyidx;\n                        $this->yystack = $stack;\n                        if (!$token) {\n                            // end of input: this is valid\n                            return true;\n                        }\n                        // the last token was just ignored, we can't accept\n                        // by ignoring input, this is in essence ignoring a\n                        // syntax error!\n                        return false;\n                    } else if ($nextstate === self::YY_NO_ACTION) {\n                        $this->yyidx = $yyidx;\n                        $this->yystack = $stack;\n                        // input accepted, but not shifted (I guess)\n                        return true;\n                    } else {\n                        $yyact = $nextstate;\n                    }\n                } while (true);\n            }\n            break;\n        } while (true);\n        $this->yyidx = $yyidx;\n        $this->yystack = $stack;\n        return true;\n    }\n\n    public function yy_find_shift_action($iLookAhead)\n    {\n        $stateno = $this->yystack[ $this->yyidx ]->stateno;\n        /* if ($this->yyidx < 0) return self::YY_NO_ACTION;  */\n        if (!isset(self::$yy_shift_ofst[ $stateno ])) {\n            // no shift actions\n            return self::$yy_default[ $stateno ];\n        }\n        $i = self::$yy_shift_ofst[ $stateno ];\n        if ($i === self::YY_SHIFT_USE_DFLT) {\n            return self::$yy_default[ $stateno ];\n        }\n        if ($iLookAhead === self::YYNOCODE) {\n            return self::YY_NO_ACTION;\n        }\n        $i += $iLookAhead;\n        if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||\n            self::$yy_lookahead[ $i ] != $iLookAhead) {\n            if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback)\n                && ($iFallback = self::$yyFallback[ $iLookAhead ]) != 0) {\n                if ($this->yyTraceFILE) {\n                    fwrite($this->yyTraceFILE,\n                           $this->yyTracePrompt . 'FALLBACK ' .\n                           $this->yyTokenName[ $iLookAhead ] . ' => ' .\n                           $this->yyTokenName[ $iFallback ] . \"\\n\");\n                }\n                return $this->yy_find_shift_action($iFallback);\n            }\n            return self::$yy_default[ $stateno ];\n        } else {\n            return self::$yy_action[ $i ];\n        }\n    }\n\n    public function yy_find_reduce_action($stateno, $iLookAhead)\n    {\n        /* $stateno = $this->yystack[$this->yyidx]->stateno; */\n        if (!isset(self::$yy_reduce_ofst[ $stateno ])) {\n            return self::$yy_default[ $stateno ];\n        }\n        $i = self::$yy_reduce_ofst[ $stateno ];\n        if ($i === self::YY_REDUCE_USE_DFLT) {\n            return self::$yy_default[ $stateno ];\n        }\n        if ($iLookAhead === self::YYNOCODE) {\n            return self::YY_NO_ACTION;\n        }\n        $i += $iLookAhead;\n        if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||\n            self::$yy_lookahead[ $i ] != $iLookAhead) {\n            return self::$yy_default[ $stateno ];\n        } else {\n            return self::$yy_action[ $i ];\n        }\n    }\n\n    public function yy_shift($yyNewState, $yyMajor, $yypMinor)\n    {\n        $this->yyidx++;\n        if ($this->yyidx >= self::YYSTACKDEPTH) {\n            $this->yyidx--;\n            if ($this->yyTraceFILE) {\n                fprintf($this->yyTraceFILE, \"%sStack Overflow!\\n\", $this->yyTracePrompt);\n            }\n            while ($this->yyidx >= 0) {\n                $this->yy_pop_parser_stack();\n            }\n            #line 239 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n            $this->internalError = true;\n            $this->compiler->trigger_config_file_error('Stack overflow in configfile parser');\n            return;\n        }\n        $yytos = new TPC_yyStackEntry;\n        $yytos->stateno = $yyNewState;\n        $yytos->major = $yyMajor;\n        $yytos->minor = $yypMinor;\n        $this->yystack[] = $yytos;\n        if ($this->yyTraceFILE && $this->yyidx > 0) {\n            fprintf($this->yyTraceFILE,\n                    \"%sShift %d\\n\",\n                    $this->yyTracePrompt,\n                    $yyNewState);\n            fprintf($this->yyTraceFILE, \"%sStack:\", $this->yyTracePrompt);\n            for ($i = 1; $i <= $this->yyidx; $i++) {\n                fprintf($this->yyTraceFILE,\n                        \" %s\",\n                        $this->yyTokenName[ $this->yystack[ $i ]->major ]);\n            }\n            fwrite($this->yyTraceFILE, \"\\n\");\n        }\n    }\n\n    function yy_r0()\n    {\n        $this->_retvalue = null;\n    }\n\n    function yy_r1()\n    {\n        $this->add_global_vars($this->yystack[ $this->yyidx + 0 ]->minor);\n        $this->_retvalue = null;\n    }\n\n    function yy_r4()\n    {\n        $this->add_section_vars($this->yystack[ $this->yyidx + -3 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor);\n        $this->_retvalue = null;\n    }\n\n    #line 245 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    function yy_r5()\n    {\n        if ($this->configReadHidden) {\n            $this->add_section_vars($this->yystack[ $this->yyidx + -3 ]->minor,\n                                    $this->yystack[ $this->yyidx + 0 ]->minor);\n        }\n        $this->_retvalue = null;\n    }\n\n    #line 250 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    function yy_r6()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor;\n    }\n\n    #line 264 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    function yy_r7()\n    {\n        $this->_retvalue =\n            array_merge($this->yystack[ $this->yyidx + -1 ]->minor, array($this->yystack[ $this->yyidx + 0 ]->minor));\n    }\n\n    #line 269 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    function yy_r8()\n    {\n        $this->_retvalue = array();\n    }\n\n    #line 277 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    function yy_r9()\n    {\n        $this->_retvalue = array('key'   => $this->yystack[ $this->yyidx + -2 ]->minor,\n                                 'value' => $this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 281 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    function yy_r10()\n    {\n        $this->_retvalue = (float)$this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 285 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    function yy_r11()\n    {\n        $this->_retvalue = (int)$this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 291 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    function yy_r12()\n    {\n        $this->_retvalue = $this->parse_bool($this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 296 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    function yy_r13()\n    {\n        $this->_retvalue = self::parse_single_quoted_string($this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 300 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    function yy_r14()\n    {\n        $this->_retvalue = self::parse_double_quoted_string($this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 304 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    function yy_r15()\n    {\n        $this->_retvalue = self::parse_tripple_double_quoted_string($this->yystack[ $this->yyidx + -1 ]->minor);\n    }\n\n    #line 308 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    function yy_r16()\n    {\n        $this->_retvalue = '';\n    }\n\n    #line 312 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    function yy_r17()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 316 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    public function yy_reduce($yyruleno)\n    {\n        if ($this->yyTraceFILE && $yyruleno >= 0\n            && $yyruleno < count(self::$yyRuleName)) {\n            fprintf($this->yyTraceFILE,\n                    \"%sReduce (%d) [%s].\\n\",\n                    $this->yyTracePrompt,\n                    $yyruleno,\n                    self::$yyRuleName[ $yyruleno ]);\n        }\n        $this->_retvalue = $yy_lefthand_side = null;\n        if (isset(self::$yyReduceMap[ $yyruleno ])) {\n            // call the action\n            $this->_retvalue = null;\n            $this->{'yy_r' . self::$yyReduceMap[ $yyruleno ]}();\n            $yy_lefthand_side = $this->_retvalue;\n        }\n        $yygoto = self::$yyRuleInfo[ $yyruleno ][ 0 ];\n        $yysize = self::$yyRuleInfo[ $yyruleno ][ 1 ];\n        $this->yyidx -= $yysize;\n        for ($i = $yysize; $i; $i--) {\n            // pop all of the right-hand side parameters\n            array_pop($this->yystack);\n        }\n        $yyact = $this->yy_find_reduce_action($this->yystack[ $this->yyidx ]->stateno, $yygoto);\n        if ($yyact < self::YYNSTATE) {\n            if (!$this->yyTraceFILE && $yysize) {\n                $this->yyidx++;\n                $x = new TPC_yyStackEntry;\n                $x->stateno = $yyact;\n                $x->major = $yygoto;\n                $x->minor = $yy_lefthand_side;\n                $this->yystack[ $this->yyidx ] = $x;\n            } else {\n                $this->yy_shift($yyact, $yygoto, $yy_lefthand_side);\n            }\n        } else if ($yyact === self::YYNSTATE + self::YYNRULE + 1) {\n            $this->yy_accept();\n        }\n    }\n\n    #line 320 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    public function yy_parse_failed()\n    {\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE, \"%sFail!\\n\", $this->yyTracePrompt);\n        }\n        while ($this->yyidx >= 0) {\n            $this->yy_pop_parser_stack();\n        }\n    }\n\n    #line 324 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    public function yy_syntax_error($yymajor, $TOKEN)\n    {\n        #line 232 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n        $this->internalError = true;\n        $this->yymajor = $yymajor;\n        $this->compiler->trigger_config_file_error();\n    }\n\n    public function yy_accept()\n    {\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE, \"%sAccept!\\n\", $this->yyTracePrompt);\n        }\n        while ($this->yyidx >= 0) {\n            $this->yy_pop_parser_stack();\n        }\n        #line 225 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n        $this->successful = !$this->internalError;\n        $this->internalError = false;\n        $this->retvalue = $this->_retvalue;\n    }\n\n    public function doParse($yymajor, $yytokenvalue)\n    {\n        $yyerrorhit = 0;   /* True if yymajor has invoked an error */\n        if ($this->yyidx === null || $this->yyidx < 0) {\n            $this->yyidx = 0;\n            $this->yyerrcnt = -1;\n            $x = new TPC_yyStackEntry;\n            $x->stateno = 0;\n            $x->major = 0;\n            $this->yystack = array();\n            $this->yystack[] = $x;\n        }\n        $yyendofinput = ($yymajor == 0);\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE,\n                    \"%sInput %s\\n\",\n                    $this->yyTracePrompt,\n                    $this->yyTokenName[ $yymajor ]);\n        }\n        do {\n            $yyact = $this->yy_find_shift_action($yymajor);\n            if ($yymajor < self::YYERRORSYMBOL &&\n                !$this->yy_is_expected_token($yymajor)) {\n                // force a syntax error\n                $yyact = self::YY_ERROR_ACTION;\n            }\n            if ($yyact < self::YYNSTATE) {\n                $this->yy_shift($yyact, $yymajor, $yytokenvalue);\n                $this->yyerrcnt--;\n                if ($yyendofinput && $this->yyidx >= 0) {\n                    $yymajor = 0;\n                } else {\n                    $yymajor = self::YYNOCODE;\n                }\n            } else if ($yyact < self::YYNSTATE + self::YYNRULE) {\n                $this->yy_reduce($yyact - self::YYNSTATE);\n            } else if ($yyact === self::YY_ERROR_ACTION) {\n                if ($this->yyTraceFILE) {\n                    fprintf($this->yyTraceFILE,\n                            \"%sSyntax Error!\\n\",\n                            $this->yyTracePrompt);\n                }\n                if (self::YYERRORSYMBOL) {\n                    if ($this->yyerrcnt < 0) {\n                        $this->yy_syntax_error($yymajor, $yytokenvalue);\n                    }\n                    $yymx = $this->yystack[ $this->yyidx ]->major;\n                    if ($yymx === self::YYERRORSYMBOL || $yyerrorhit) {\n                        if ($this->yyTraceFILE) {\n                            fprintf($this->yyTraceFILE,\n                                    \"%sDiscard input token %s\\n\",\n                                    $this->yyTracePrompt,\n                                    $this->yyTokenName[ $yymajor ]);\n                        }\n                        $this->yy_destructor($yymajor, $yytokenvalue);\n                        $yymajor = self::YYNOCODE;\n                    } else {\n                        while ($this->yyidx >= 0 &&\n                               $yymx !== self::YYERRORSYMBOL &&\n                               ($yyact = $this->yy_find_shift_action(self::YYERRORSYMBOL)) >= self::YYNSTATE\n                        ) {\n                            $this->yy_pop_parser_stack();\n                        }\n                        if ($this->yyidx < 0 || $yymajor == 0) {\n                            $this->yy_destructor($yymajor, $yytokenvalue);\n                            $this->yy_parse_failed();\n                            $yymajor = self::YYNOCODE;\n                        } else if ($yymx !== self::YYERRORSYMBOL) {\n                            $u2 = 0;\n                            $this->yy_shift($yyact, self::YYERRORSYMBOL, $u2);\n                        }\n                    }\n                    $this->yyerrcnt = 3;\n                    $yyerrorhit = 1;\n                } else {\n                    if ($this->yyerrcnt <= 0) {\n                        $this->yy_syntax_error($yymajor, $yytokenvalue);\n                    }\n                    $this->yyerrcnt = 3;\n                    $this->yy_destructor($yymajor, $yytokenvalue);\n                    if ($yyendofinput) {\n                        $this->yy_parse_failed();\n                    }\n                    $yymajor = self::YYNOCODE;\n                }\n            } else {\n                $this->yy_accept();\n                $yymajor = self::YYNOCODE;\n            }\n        } while ($yymajor !== self::YYNOCODE && $this->yyidx >= 0);\n    }\n\n    /**\n     * parse optional boolean keywords\n     *\n     * @param string $str\n     *\n     * @return bool\n     */\n    private function parse_bool($str)\n    {\n        $str = strtolower($str);\n        if (in_array($str, array('on', 'yes', 'true'))) {\n            $res = true;\n        } else {\n            $res = false;\n        }\n        return $res;\n    }\n\n    /**\n     * set a config variable in target array\n     *\n     * @param array $var\n     * @param array $target_array\n     */\n    private function set_var(array $var, array &$target_array)\n    {\n        $key = $var[ 'key' ];\n        $value = $var[ 'value' ];\n        if ($this->configOverwrite || !isset($target_array[ 'vars' ][ $key ])) {\n            $target_array[ 'vars' ][ $key ] = $value;\n        } else {\n            settype($target_array[ 'vars' ][ $key ], 'array');\n            $target_array[ 'vars' ][ $key ][] = $value;\n        }\n    }\n\n    /**\n     * add config variable to global vars\n     *\n     * @param array $vars\n     */\n    private function add_global_vars(array $vars)\n    {\n        if (!isset($this->compiler->config_data[ 'vars' ])) {\n            $this->compiler->config_data[ 'vars' ] = array();\n        }\n        foreach ($vars as $var) {\n            $this->set_var($var, $this->compiler->config_data);\n        }\n    }\n\n    /**\n     * add config variable to section\n     *\n     * @param string $section_name\n     * @param array  $vars\n     */\n    private function add_section_vars($section_name, array $vars)\n    {\n        if (!isset($this->compiler->config_data[ 'sections' ][ $section_name ][ 'vars' ])) {\n            $this->compiler->config_data[ 'sections' ][ $section_name ][ 'vars' ] = array();\n        }\n        foreach ($vars as $var) {\n            $this->set_var($var, $this->compiler->config_data[ 'sections' ][ $section_name ]);\n        }\n    }\n}\n\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_data.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Data\n * This file contains the basic classes and methods for template and variable creation\n *\n * @package    Smarty\n * @subpackage Template\n * @author     Uwe Tews\n */\n\n/**\n * Base class with template and variable methods\n *\n * @package    Smarty\n * @subpackage Template\n *\n * @property int    $scope\n * @property Smarty $smarty\n * The following methods will be dynamically loaded by the extension handler when they are called.\n * They are located in a corresponding Smarty_Internal_Method_xxxx class\n *\n * @method mixed _getConfigVariable(string $varName, bool $errorEnable = true)\n * @method mixed getConfigVariable(string $varName, bool $errorEnable = true)\n * @method mixed getConfigVars(string $varName = null, bool $searchParents = true)\n * @method mixed getGlobal(string $varName = null)\n * @method mixed getStreamVariable(string $variable)\n * @method Smarty_Internal_Data clearAssign(mixed $tpl_var)\n * @method Smarty_Internal_Data clearAllAssign()\n * @method Smarty_Internal_Data clearConfig(string $varName = null)\n * @method Smarty_Internal_Data configLoad(string $config_file, mixed $sections = null, string $scope = 'local')\n */\nabstract class Smarty_Internal_Data\n{\n    /**\n     * This object type (Smarty = 1, template = 2, data = 4)\n     *\n     * @var int\n     */\n    public $_objType = 4;\n\n    /**\n     * name of class used for templates\n     *\n     * @var string\n     */\n    public $template_class = 'Smarty_Internal_Template';\n\n    /**\n     * template variables\n     *\n     * @var Smarty_Variable[]\n     */\n    public $tpl_vars = array();\n\n    /**\n     * parent template (if any)\n     *\n     * @var Smarty|Smarty_Internal_Template|Smarty_Data\n     */\n    public $parent = null;\n\n    /**\n     * configuration settings\n     *\n     * @var string[]\n     */\n    public $config_vars = array();\n\n    /**\n     * extension handler\n     *\n     * @var Smarty_Internal_Extension_Handler\n     */\n    public $ext = null;\n\n    /**\n     * Smarty_Internal_Data constructor.\n     *\n     * Install extension handler\n     */\n    public function __construct()\n    {\n        $this->ext = new Smarty_Internal_Extension_Handler();\n        $this->ext->objType = $this->_objType;\n    }\n\n    /**\n     * assigns a Smarty variable\n     *\n     * @param  array|string $tpl_var the template variable name(s)\n     * @param  mixed        $value   the value to assign\n     * @param  boolean      $nocache if true any output of this variable will be not cached\n     *\n     * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for\n     *                              chaining\n     */\n    public function assign($tpl_var, $value = null, $nocache = false)\n    {\n        if (is_array($tpl_var)) {\n            foreach ($tpl_var as $_key => $_val) {\n                $this->assign($_key, $_val, $nocache);\n            }\n        } else {\n            if ($tpl_var !== '') {\n                if ($this->_objType === 2) {\n                    /** @var  Smarty_Internal_Template $this */\n                    $this->_assignInScope($tpl_var, $value, $nocache);\n                } else {\n                    $this->tpl_vars[ $tpl_var ] = new Smarty_Variable($value, $nocache);\n                }\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * appends values to template variables\n     *\n     * @api  Smarty::append()\n     * @link http://www.smarty.net/docs/en/api.append.tpl\n     *\n     * @param  array|string $tpl_var                                           the template variable name(s)\n     * @param  mixed        $value                                             the value to append\n     * @param  bool         $merge                                             flag if array elements shall be merged\n     * @param  bool         $nocache                                           if true any output of this variable will\n     *                                                                         be not cached\n     *\n     * @return \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty\n     */\n    public function append($tpl_var, $value = null, $merge = false, $nocache = false)\n    {\n        return $this->ext->append->append($this, $tpl_var, $value, $merge, $nocache);\n    }\n\n    /**\n     * assigns a global Smarty variable\n     *\n     * @param  string  $varName the global variable name\n     * @param  mixed   $value   the value to assign\n     * @param  boolean $nocache if true any output of this variable will be not cached\n     *\n     * @return \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty\n     */\n    public function assignGlobal($varName, $value = null, $nocache = false)\n    {\n        return $this->ext->assignGlobal->assignGlobal($this, $varName, $value, $nocache);\n    }\n\n    /**\n     * appends values to template variables by reference\n     *\n     * @param  string  $tpl_var the template variable name\n     * @param  mixed   &$value  the referenced value to append\n     * @param  boolean $merge   flag if array elements shall be merged\n     *\n     * @return \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty\n     */\n    public function appendByRef($tpl_var, &$value, $merge = false)\n    {\n        return $this->ext->appendByRef->appendByRef($this, $tpl_var, $value, $merge);\n    }\n\n    /**\n     * assigns values to template variables by reference\n     *\n     * @param string   $tpl_var the template variable name\n     * @param          $value\n     * @param  boolean $nocache if true any output of this variable will be not cached\n     *\n     * @return \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty\n     */\n    public function assignByRef($tpl_var, &$value, $nocache = false)\n    {\n        return $this->ext->assignByRef->assignByRef($this, $tpl_var, $value, $nocache);\n    }\n\n    /**\n     * Returns a single or all template variables\n     *\n     * @api  Smarty::getTemplateVars()\n     * @link http://www.smarty.net/docs/en/api.get.template.vars.tpl\n     *\n     * @param  string                                                 $varName       variable name or null\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $_ptr          optional pointer to data object\n     * @param  bool                                                   $searchParents include parent templates?\n     *\n     * @return mixed variable value or or array of variables\n     */\n    public function getTemplateVars($varName = null, Smarty_Internal_Data $_ptr = null, $searchParents = true)\n    {\n        return $this->ext->getTemplateVars->getTemplateVars($this, $varName, $_ptr, $searchParents);\n    }\n\n    /**\n     * gets the object of a Smarty variable\n     *\n     * @param  string               $variable      the name of the Smarty variable\n     * @param  Smarty_Internal_Data $_ptr          optional pointer to data object\n     * @param  boolean              $searchParents search also in parent data\n     * @param bool                  $error_enable\n     *\n     * @return Smarty_Variable|Smarty_Undefined_Variable the object of the variable\n     * @deprecated since 3.1.28 please use Smarty_Internal_Data::getTemplateVars() instead.\n     */\n    public function getVariable($variable = null, Smarty_Internal_Data $_ptr = null, $searchParents = true,\n                                $error_enable = true)\n    {\n        return $this->ext->getTemplateVars->_getVariable($this, $variable, $_ptr, $searchParents, $error_enable);\n    }\n\n    /**\n     * Follow the parent chain an merge template and config variables\n     *\n     * @param \\Smarty_Internal_Data|null $data\n     */\n    public function _mergeVars(Smarty_Internal_Data $data = null)\n    {\n        if (isset($data)) {\n            if (!empty($this->tpl_vars)) {\n                $data->tpl_vars = array_merge($this->tpl_vars, $data->tpl_vars);\n            }\n            if (!empty($this->config_vars)) {\n                $data->config_vars = array_merge($this->config_vars, $data->config_vars);\n            }\n        } else {\n            $data = $this;\n        }\n        if (isset($this->parent)) {\n            $this->parent->_mergeVars($data);\n        }\n    }\n\n    /**\n     * Return true if this instance is a Data obj\n     *\n     * @return bool\n     */\n    public function _isDataObj()\n    {\n        return $this->_objType === 4;\n    }\n\n    /**\n     * Return true if this instance is a template obj\n     *\n     * @return bool\n     */\n    public function _isTplObj()\n    {\n        return $this->_objType === 2;\n    }\n\n    /**\n     * Return true if this instance is a Smarty obj\n     *\n     * @return bool\n     */\n    public function _isSmartyObj()\n    {\n        return $this->_objType === 1;\n    }\n\n    /**\n     * Get Smarty object\n     *\n     * @return Smarty\n     */\n    public function _getSmartyObj()\n    {\n        return $this->smarty;\n    }\n\n    /**\n     * Handle unknown class methods\n     *\n     * @param string $name unknown method-name\n     * @param array  $args argument array\n     *\n     * @return mixed\n     * @throws SmartyException\n     */\n    public function __call($name, $args)\n    {\n        return $this->ext->_callExternalMethod($this, $name, $args);\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_debug.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Debug\n * Class to collect data for the Smarty Debugging Console\n *\n * @package    Smarty\n * @subpackage Debug\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Debug Class\n *\n * @package    Smarty\n * @subpackage Debug\n */\nclass Smarty_Internal_Debug extends Smarty_Internal_Data\n{\n    /**\n     * template data\n     *\n     * @var array\n     */\n    public $template_data = array();\n\n    /**\n     * List of uid's which shall be ignored\n     *\n     * @var array\n     */\n    public $ignore_uid = array();\n\n    /**\n     * Index of display() and fetch() calls\n     *\n     * @var int\n     */\n    public $index = 0;\n\n    /**\n     * Counter for window offset\n     *\n     * @var int\n     */\n    public $offset = 0;\n\n    /**\n     * Start logging template\n     *\n     * @param \\Smarty_Internal_Template $template template\n     * @param null                      $mode     true: display   false: fetch  null: subtemplate\n     */\n    public function start_template(Smarty_Internal_Template $template, $mode = null)\n    {\n        if (isset($mode) && !$template->_isSubTpl()) {\n            $this->index ++;\n            $this->offset ++;\n            $this->template_data[ $this->index ] = null;\n        }\n        $key = $this->get_key($template);\n        $this->template_data[ $this->index ][ $key ][ 'start_template_time' ] = microtime(true);\n    }\n\n    /**\n     * End logging of cache time\n     *\n     * @param \\Smarty_Internal_Template $template cached template\n     */\n    public function end_template(Smarty_Internal_Template $template)\n    {\n        $key = $this->get_key($template);\n        $this->template_data[ $this->index ][ $key ][ 'total_time' ] +=\n            microtime(true) - $this->template_data[ $this->index ][ $key ][ 'start_template_time' ];\n        //$this->template_data[$this->index][$key]['properties'] = $template->properties;\n    }\n\n    /**\n     * Start logging of compile time\n     *\n     * @param \\Smarty_Internal_Template $template\n     */\n    public function start_compile(Smarty_Internal_Template $template)\n    {\n        static $_is_stringy = array('string' => true, 'eval' => true);\n        if (!empty($template->compiler->trace_uid)) {\n            $key = $template->compiler->trace_uid;\n            if (!isset($this->template_data[ $this->index ][ $key ])) {\n                if (isset($_is_stringy[ $template->source->type ])) {\n                    $this->template_data[ $this->index ][ $key ][ 'name' ] =\n                        '\\'' . substr($template->source->name, 0, 25) . '...\\'';\n                } else {\n                    $this->template_data[ $this->index ][ $key ][ 'name' ] = $template->source->filepath;\n                }\n                $this->template_data[ $this->index ][ $key ][ 'compile_time' ] = 0;\n                $this->template_data[ $this->index ][ $key ][ 'render_time' ] = 0;\n                $this->template_data[ $this->index ][ $key ][ 'cache_time' ] = 0;\n            }\n        } else {\n            if (isset($this->ignore_uid[ $template->source->uid ])) {\n                return;\n            }\n            $key = $this->get_key($template);\n        }\n        $this->template_data[ $this->index ][ $key ][ 'start_time' ] = microtime(true);\n    }\n\n    /**\n     * End logging of compile time\n     *\n     * @param \\Smarty_Internal_Template $template\n     */\n    public function end_compile(Smarty_Internal_Template $template)\n    {\n        if (!empty($template->compiler->trace_uid)) {\n            $key = $template->compiler->trace_uid;\n        } else {\n            if (isset($this->ignore_uid[ $template->source->uid ])) {\n                return;\n            }\n\n            $key = $this->get_key($template);\n        }\n        $this->template_data[ $this->index ][ $key ][ 'compile_time' ] +=\n            microtime(true) - $this->template_data[ $this->index ][ $key ][ 'start_time' ];\n    }\n\n    /**\n     * Start logging of render time\n     *\n     * @param \\Smarty_Internal_Template $template\n     */\n    public function start_render(Smarty_Internal_Template $template)\n    {\n        $key = $this->get_key($template);\n        $this->template_data[ $this->index ][ $key ][ 'start_time' ] = microtime(true);\n    }\n\n    /**\n     * End logging of compile time\n     *\n     * @param \\Smarty_Internal_Template $template\n     */\n    public function end_render(Smarty_Internal_Template $template)\n    {\n        $key = $this->get_key($template);\n        $this->template_data[ $this->index ][ $key ][ 'render_time' ] +=\n            microtime(true) - $this->template_data[ $this->index ][ $key ][ 'start_time' ];\n    }\n\n    /**\n     * Start logging of cache time\n     *\n     * @param \\Smarty_Internal_Template $template cached template\n     */\n    public function start_cache(Smarty_Internal_Template $template)\n    {\n        $key = $this->get_key($template);\n        $this->template_data[ $this->index ][ $key ][ 'start_time' ] = microtime(true);\n    }\n\n    /**\n     * End logging of cache time\n     *\n     * @param \\Smarty_Internal_Template $template cached template\n     */\n    public function end_cache(Smarty_Internal_Template $template)\n    {\n        $key = $this->get_key($template);\n        $this->template_data[ $this->index ][ $key ][ 'cache_time' ] +=\n            microtime(true) - $this->template_data[ $this->index ][ $key ][ 'start_time' ];\n    }\n\n    /**\n     * Register template object\n     *\n     * @param \\Smarty_Internal_Template $template cached template\n     */\n    public function register_template(Smarty_Internal_Template $template)\n    {\n    }\n\n    /**\n     * Register data object\n     *\n     * @param \\Smarty_Data $data data object\n     */\n    public static function register_data(Smarty_Data $data)\n    {\n    }\n\n    /**\n     * Opens a window for the Smarty Debugging Console and display the data\n     *\n     * @param Smarty_Internal_Template|Smarty $obj object to debug\n     * @param bool                            $full\n     *\n     * @throws \\Exception\n     * @throws \\SmartyException\n     */\n    public function display_debug($obj, $full = false)\n    {\n        if (!$full) {\n            $this->offset ++;\n            $savedIndex = $this->index;\n            $this->index = 9999;\n        }\n        $smarty = $obj->_getSmartyObj();\n        // create fresh instance of smarty for displaying the debug console\n        // to avoid problems if the application did overload the Smarty class\n        $debObj = new Smarty();\n        // copy the working dirs from application\n        $debObj->setCompileDir($smarty->getCompileDir());\n        // init properties by hand as user may have edited the original Smarty class\n        $debObj->setPluginsDir(is_dir(__DIR__ . '/../plugins') ? __DIR__ . '/../plugins' : $smarty->getPluginsDir());\n        $debObj->force_compile = false;\n        $debObj->compile_check = Smarty::COMPILECHECK_ON;\n        $debObj->left_delimiter = '{';\n        $debObj->right_delimiter = '}';\n        $debObj->security_policy = null;\n        $debObj->debugging = false;\n        $debObj->debugging_ctrl = 'NONE';\n        $debObj->error_reporting = E_ALL & ~E_NOTICE;\n        $debObj->debug_tpl = isset($smarty->debug_tpl) ? $smarty->debug_tpl : 'file:' . __DIR__ . '/../debug.tpl';\n        $debObj->registered_plugins = array();\n        $debObj->registered_resources = array();\n        $debObj->registered_filters = array();\n        $debObj->autoload_filters = array();\n        $debObj->default_modifiers = array();\n        $debObj->escape_html = true;\n        $debObj->caching = Smarty::CACHING_OFF;\n        $debObj->compile_id = null;\n        $debObj->cache_id = null;\n        // prepare information of assigned variables\n        $ptr = $this->get_debug_vars($obj);\n        $_assigned_vars = $ptr->tpl_vars;\n        ksort($_assigned_vars);\n        $_config_vars = $ptr->config_vars;\n        ksort($_config_vars);\n        $debugging = $smarty->debugging;\n\n        $_template = new Smarty_Internal_Template($debObj->debug_tpl, $debObj);\n        if ($obj->_isTplObj()) {\n            $_template->assign('template_name', $obj->source->type . ':' . $obj->source->name);\n        }\n        if ($obj->_objType === 1 || $full) {\n            $_template->assign('template_data', $this->template_data[ $this->index ]);\n        } else {\n            $_template->assign('template_data', null);\n        }\n        $_template->assign('assigned_vars', $_assigned_vars);\n        $_template->assign('config_vars', $_config_vars);\n        $_template->assign('execution_time', microtime(true) - $smarty->start_time);\n        $_template->assign('display_mode', $debugging === 2 || !$full);\n        $_template->assign('offset', $this->offset * 50);\n        echo $_template->fetch();\n        if (isset($full)) {\n            $this->index --;\n        }\n        if (!$full) {\n            $this->index = $savedIndex;\n        }\n    }\n\n    /**\n     * Recursively gets variables from all template/data scopes\n     *\n     * @param  Smarty_Internal_Template|Smarty_Data $obj object to debug\n     *\n     * @return StdClass\n     */\n    public function get_debug_vars($obj)\n    {\n        $config_vars = array();\n        foreach ($obj->config_vars as $key => $var) {\n            $config_vars[ $key ][ 'value' ] = $var;\n            if ($obj->_isTplObj()) {\n                $config_vars[ $key ][ 'scope' ] = $obj->source->type . ':' . $obj->source->name;\n            } elseif ($obj->_isDataObj()) {\n                $tpl_vars[ $key ][ 'scope' ] = $obj->dataObjectName;\n            } else {\n                $config_vars[ $key ][ 'scope' ] = 'Smarty object';\n            }\n        }\n        $tpl_vars = array();\n        foreach ($obj->tpl_vars as $key => $var) {\n            foreach ($var as $varkey => $varvalue) {\n                if ($varkey === 'value') {\n                    $tpl_vars[ $key ][ $varkey ] = $varvalue;\n                } else {\n                    if ($varkey === 'nocache') {\n                        if ($varvalue === true) {\n                            $tpl_vars[ $key ][ $varkey ] = $varvalue;\n                        }\n                    } else {\n                        if ($varkey !== 'scope' || $varvalue !== 0) {\n                            $tpl_vars[ $key ][ 'attributes' ][ $varkey ] = $varvalue;\n                        }\n                    }\n                }\n            }\n            if ($obj->_isTplObj()) {\n                $tpl_vars[ $key ][ 'scope' ] = $obj->source->type . ':' . $obj->source->name;\n            } elseif ($obj->_isDataObj()) {\n                $tpl_vars[ $key ][ 'scope' ] = $obj->dataObjectName;\n            } else {\n                $tpl_vars[ $key ][ 'scope' ] = 'Smarty object';\n            }\n        }\n\n        if (isset($obj->parent)) {\n            $parent = $this->get_debug_vars($obj->parent);\n            foreach ($parent->tpl_vars as $name => $pvar) {\n                if (isset($tpl_vars[ $name ]) && $tpl_vars[ $name ][ 'value' ] === $pvar[ 'value' ]) {\n                    $tpl_vars[ $name ][ 'scope' ] = $pvar[ 'scope' ];\n                }\n            }\n            $tpl_vars = array_merge($parent->tpl_vars, $tpl_vars);\n\n            foreach ($parent->config_vars as $name => $pvar) {\n                if (isset($config_vars[ $name ]) && $config_vars[ $name ][ 'value' ] === $pvar[ 'value' ]) {\n                    $config_vars[ $name ][ 'scope' ] = $pvar[ 'scope' ];\n                }\n            }\n            $config_vars = array_merge($parent->config_vars, $config_vars);\n        } else {\n            foreach (Smarty::$global_tpl_vars as $key => $var) {\n                if (!array_key_exists($key, $tpl_vars)) {\n                    foreach ($var as $varkey => $varvalue) {\n                        if ($varkey === 'value') {\n                            $tpl_vars[ $key ][ $varkey ] = $varvalue;\n                        } else {\n                            if ($varkey === 'nocache') {\n                                if ($varvalue === true) {\n                                    $tpl_vars[ $key ][ $varkey ] = $varvalue;\n                                }\n                            } else {\n                                if ($varkey !== 'scope' || $varvalue !== 0) {\n                                    $tpl_vars[ $key ][ 'attributes' ][ $varkey ] = $varvalue;\n                                }\n                            }\n                        }\n                    }\n                    $tpl_vars[ $key ][ 'scope' ] = 'Global';\n                }\n            }\n        }\n\n        return (object) array('tpl_vars' => $tpl_vars, 'config_vars' => $config_vars);\n    }\n\n    /**\n     * Return key into $template_data for template\n     *\n     * @param \\Smarty_Internal_Template $template template object\n     *\n     * @return string key into $template_data\n     */\n    private function get_key(Smarty_Internal_Template $template)\n    {\n        static $_is_stringy = array('string' => true, 'eval' => true);\n        // calculate Uid if not already done\n        if ($template->source->uid === '') {\n            $template->source->filepath;\n        }\n        $key = $template->source->uid;\n        if (isset($this->template_data[ $this->index ][ $key ])) {\n            return $key;\n        } else {\n            if (isset($_is_stringy[ $template->source->type ])) {\n                $this->template_data[ $this->index ][ $key ][ 'name' ] =\n                    '\\'' . substr($template->source->name, 0, 25) . '...\\'';\n            } else {\n                $this->template_data[ $this->index ][ $key ][ 'name' ] = $template->source->filepath;\n            }\n            $this->template_data[ $this->index ][ $key ][ 'compile_time' ] = 0;\n            $this->template_data[ $this->index ][ $key ][ 'render_time' ] = 0;\n            $this->template_data[ $this->index ][ $key ][ 'cache_time' ] = 0;\n            $this->template_data[ $this->index ][ $key ][ 'total_time' ] = 0;\n\n            return $key;\n        }\n    }\n\n    /**\n     * Ignore template\n     *\n     * @param \\Smarty_Internal_Template $template\n     */\n    public function ignore(Smarty_Internal_Template $template)\n    {\n        // calculate Uid if not already done\n        if ($template->source->uid === '') {\n            $template->source->filepath;\n        }\n        $this->ignore_uid[ $template->source->uid ] = true;\n    }\n\n    /**\n     * handle 'URL' debugging mode\n     *\n     * @param Smarty $smarty\n     */\n    public function debugUrl(Smarty $smarty)\n    {\n        if (isset($_SERVER[ 'QUERY_STRING' ])) {\n            $_query_string = $_SERVER[ 'QUERY_STRING' ];\n        } else {\n            $_query_string = '';\n        }\n        if (false !== strpos($_query_string, $smarty->smarty_debug_id)) {\n            if (false !== strpos($_query_string, $smarty->smarty_debug_id . '=on')) {\n                // enable debugging for this browser session\n                setcookie('SMARTY_DEBUG', true);\n                $smarty->debugging = true;\n            } elseif (false !== strpos($_query_string, $smarty->smarty_debug_id . '=off')) {\n                // disable debugging for this browser session\n                setcookie('SMARTY_DEBUG', false);\n                $smarty->debugging = false;\n            } else {\n                // enable debugging for this page\n                $smarty->debugging = true;\n            }\n        } else {\n            if (isset($_COOKIE[ 'SMARTY_DEBUG' ])) {\n                $smarty->debugging = true;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_errorhandler.php",
    "content": "<?php\n\n/**\n * Smarty error handler\n *\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n *\n * @deprecated\nSmarty does no longer use @filemtime()\n */\nclass Smarty_Internal_ErrorHandler\n{\n    /**\n     * contains directories outside of SMARTY_DIR that are to be muted by muteExpectedErrors()\n     */\n    public static $mutedDirectories = array();\n    /**\n     * error handler returned by set_error_handler() in self::muteExpectedErrors()\n     */\n    private static $previousErrorHandler = null;\n\n    /**\n     * Enable error handler to mute expected messages\n     *\n     * @return boolean\n     */\n    public static function muteExpectedErrors()\n    {\n        /*\n            error muting is done because some people implemented custom error_handlers using\n            http://php.net/set_error_handler and for some reason did not understand the following paragraph:\n\n                It is important to remember that the standard PHP error handler is completely bypassed for the\n                error types specified by error_types unless the callback function returns FALSE.\n                error_reporting() settings will have no effect and your error handler will be called regardless -\n                however you are still able to read the current value of error_reporting and act appropriately.\n                Of particular note is that this value will be 0 if the statement that caused the error was\n                prepended by the @ error-control operator.\n\n            Smarty deliberately uses @filemtime() over file_exists() and filemtime() in some places. Reasons include\n                - @filemtime() is almost twice as fast as using an additional file_exists()\n                - between file_exists() and filemtime() a possible race condition is opened,\n                  which does not exist using the simple @filemtime() approach.\n        */\n        $error_handler = array('Smarty_Internal_ErrorHandler', 'mutingErrorHandler');\n        $previous = set_error_handler($error_handler);\n        // avoid dead loops\n        if ($previous !== $error_handler) {\n            self::$previousErrorHandler = $previous;\n        }\n    }\n\n    /**\n     * Error Handler to mute expected messages\n     *\n     * @link http://php.net/set_error_handler\n     *\n     * @param  integer $errno Error level\n     * @param          $errstr\n     * @param          $errfile\n     * @param          $errline\n     * @param          $errcontext\n     *\n     * @return bool\n     */\n    public static function mutingErrorHandler($errno, $errstr, $errfile, $errline, $errcontext)\n    {\n        $_is_muted_directory = false;\n        // add the SMARTY_DIR to the list of muted directories\n        if (!isset(self::$mutedDirectories[ SMARTY_DIR ])) {\n            $smarty_dir = realpath(SMARTY_DIR);\n            if ($smarty_dir !== false) {\n                self::$mutedDirectories[ SMARTY_DIR ] =\n                    array('file' => $smarty_dir, 'length' => strlen($smarty_dir),);\n            }\n        }\n        // walk the muted directories and test against $errfile\n        foreach (self::$mutedDirectories as $key => &$dir) {\n            if (!$dir) {\n                // resolve directory and length for speedy comparisons\n                $file = realpath($key);\n                if ($file === false) {\n                    // this directory does not exist, remove and skip it\n                    unset(self::$mutedDirectories[ $key ]);\n                    continue;\n                }\n                $dir = array('file' => $file, 'length' => strlen($file),);\n            }\n            if (!strncmp($errfile, $dir[ 'file' ], $dir[ 'length' ])) {\n                $_is_muted_directory = true;\n                break;\n            }\n        }\n        // pass to next error handler if this error did not occur inside SMARTY_DIR\n        // or the error was within smarty but masked to be ignored\n        if (!$_is_muted_directory || ($errno && $errno & error_reporting())) {\n            if (self::$previousErrorHandler) {\n                return call_user_func(self::$previousErrorHandler,\n                                      $errno,\n                                      $errstr,\n                                      $errfile,\n                                      $errline,\n                                      $errcontext);\n            } else {\n                return false;\n            }\n        }\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_extension_handler.php",
    "content": "<?php\n\n/**\n * Smarty Extension handler\n *\n * Load extensions dynamically\n *\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n *\n * Runtime extensions\n * @property Smarty_Internal_Runtime_CacheModify       $_cacheModify\n * @property Smarty_Internal_Runtime_CacheResourceFile $_cacheResourceFile\n * @property Smarty_Internal_Runtime_Capture           $_capture\n * @property Smarty_Internal_Runtime_CodeFrame         $_codeFrame\n * @property Smarty_Internal_Runtime_FilterHandler     $_filterHandler\n * @property Smarty_Internal_Runtime_Foreach           $_foreach\n * @property Smarty_Internal_Runtime_GetIncludePath    $_getIncludePath\n * @property Smarty_Internal_Runtime_Make_Nocache      $_make_nocache\n * @property Smarty_Internal_Runtime_UpdateCache       $_updateCache\n * @property Smarty_Internal_Runtime_UpdateScope       $_updateScope\n * @property Smarty_Internal_Runtime_TplFunction       $_tplFunction\n * @property Smarty_Internal_Runtime_WriteFile         $_writeFile\n *\n * Method extensions\n * @property Smarty_Internal_Method_GetTemplateVars    $getTemplateVars\n * @property Smarty_Internal_Method_Append             $append\n * @property Smarty_Internal_Method_AppendByRef    $appendByRef\n * @property Smarty_Internal_Method_AssignGlobal   $assignGlobal\n * @property Smarty_Internal_Method_AssignByRef    $assignByRef\n * @property Smarty_Internal_Method_LoadFilter     $loadFilter\n * @property Smarty_Internal_Method_LoadPlugin     $loadPlugin\n * @property Smarty_Internal_Method_RegisterFilter $registerFilter\n * @property Smarty_Internal_Method_RegisterObject $registerObject\n * @property Smarty_Internal_Method_RegisterPlugin $registerPlugin\n * @property mixed|\\Smarty_Template_Cached         configLoad\n */\nclass Smarty_Internal_Extension_Handler\n{\n\n    public $objType = null;\n\n    /**\n     * Cache for property information from generic getter/setter\n     * Preloaded with names which should not use with generic getter/setter\n     *\n     * @var array\n     */\n    private $_property_info     = array('AutoloadFilters' => 0, 'DefaultModifiers' => 0, 'ConfigVars' => 0,\n                                        'DebugTemplate'   => 0, 'RegisteredObject' => 0, 'StreamVariable' => 0,\n                                        'TemplateVars'    => 0, 'Literals' => 'Literals',);#\n\n    private $resolvedProperties = array();\n\n    /**\n     * Call external Method\n     *\n     * @param \\Smarty_Internal_Data $data\n     * @param string                $name external method names\n     * @param array                 $args argument array\n     *\n     * @return mixed\n     * @throws SmartyException\n     */\n    public function _callExternalMethod(Smarty_Internal_Data $data, $name, $args)\n    {\n        /* @var Smarty $data ->smarty */\n        $smarty = isset($data->smarty) ? $data->smarty : $data;\n        if (!isset($smarty->ext->$name)) {\n            if (preg_match('/^((set|get)|(.*?))([A-Z].*)$/', $name, $match)) {\n                $basename = $this->upperCase($match[4]);\n                if (!isset($smarty->ext->$basename) && isset($this->_property_info[ $basename ]) &&\n                    is_string($this->_property_info[ $basename ])) {\n                    $class = 'Smarty_Internal_Method_' . $this->_property_info[ $basename ];\n                    if (class_exists($class)) {\n                        $classObj = new $class();\n                        $methodes = get_class_methods($classObj);\n                        foreach ($methodes as $method) {\n                            $smarty->ext->$method = $classObj;\n                        }\n                    }\n                }\n                if (!empty($match[2]) && !isset($smarty->ext->$name)) {\n                    $class = 'Smarty_Internal_Method_' . $this->upperCase($name);\n                    if (!class_exists($class)) {\n                        $objType = $data->_objType;\n                        $propertyType = false;\n                        if (!isset($this->resolvedProperties[ $match[0] ][ $objType ])) {\n                            $property = isset($this->resolvedProperties['property'][ $basename ]) ?\n                                $this->resolvedProperties['property'][ $basename ] :\n                                $property = $this->resolvedProperties['property'][ $basename ] = strtolower(join('_',\n                                                                                                                 preg_split('/([A-Z][^A-Z]*)/',\n                                                                                                                            $basename,\n                                                                                                                            -1,\n                                                                                                                            PREG_SPLIT_NO_EMPTY |\n                                                                                                                            PREG_SPLIT_DELIM_CAPTURE)));\n\n                            if ($property !== false) {\n                                if (property_exists($data, $property)) {\n                                    $propertyType = $this->resolvedProperties[ $match[0] ][ $objType ] = 1;\n                                } else if (property_exists($smarty, $property)) {\n                                    $propertyType = $this->resolvedProperties[ $match[0] ][ $objType ] = 2;\n                                } else {\n                                    $this->resolvedProperties['property'][ $basename ] = $property = false;\n                                }\n                            }\n                        } else {\n                            $propertyType = $this->resolvedProperties[ $match[0] ][ $objType ];\n                            $property = $this->resolvedProperties['property'][ $basename ];\n                        }\n                        if ($propertyType) {\n                            $obj = $propertyType === 1 ? $data : $smarty;\n                            if ($match[2] === 'get') {\n                                return $obj->$property;\n                            } else if ($match[2] === 'set') {\n                                return $obj->$property = $args[0];\n                            }\n                        }\n                    }\n                }\n            }\n        }\n        $callback = array($smarty->ext->$name, $name);\n        array_unshift($args, $data);\n        if (isset($callback) && $callback[0]->objMap | $data->_objType) {\n            return call_user_func_array($callback, $args);\n        }\n        return call_user_func_array(array(new Smarty_Internal_Undefined(), $name), $args);\n    }\n\n    /**\n     * Make first character of name parts upper case\n     *\n     * @param string $name\n     *\n     * @return string\n     */\n    public function upperCase($name)\n    {\n        $_name = explode('_', $name);\n        $_name = array_map('ucfirst', $_name);\n        return implode('_', $_name);\n    }\n\n    /**\n     * get extension object\n     *\n     * @param string $property_name property name\n     *\n     * @return mixed|Smarty_Template_Cached\n     * @throws SmartyException\n     */\n    public function __get($property_name)\n    {\n        // object properties of runtime template extensions will start with '_'\n        if ($property_name[0] === '_') {\n            $class = 'Smarty_Internal_Runtime' . $this->upperCase($property_name);\n        } else {\n            $class = 'Smarty_Internal_Method_' . $this->upperCase($property_name);\n        }\n        if (!class_exists($class)) {\n            return $this->$property_name = new Smarty_Internal_Undefined($class);\n        }\n        return $this->$property_name = new $class();\n    }\n\n    /**\n     * set extension property\n     *\n     * @param string $property_name property name\n     * @param mixed  $value         value\n     *\n     * @throws SmartyException\n     */\n    public function __set($property_name, $value)\n    {\n        $this->$property_name = $value;\n    }\n\n    /**\n     * Call error handler for undefined method\n     *\n     * @param string $name unknown method-name\n     * @param array  $args argument array\n     *\n     * @return mixed\n     * @throws SmartyException\n     */\n    public function __call($name, $args)\n    {\n        return call_user_func_array(array(new Smarty_Internal_Undefined(), $name), array($this));\n    }\n\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_addautoloadfilters.php",
    "content": "<?php\n\n/**\n * Smarty Method AddAutoloadFilters\n *\n * Smarty::addAutoloadFilters() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_AddAutoloadFilters extends Smarty_Internal_Method_SetAutoloadFilters\n{\n    /**\n     * Add autoload filters\n     *\n     * @api Smarty::setAutoloadFilters()\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  array                                                          $filters filters to load automatically\n     * @param  string                                                         $type    \"pre\", \"output\", … specify the\n     *                                                                                 filter type to set. Defaults to\n     *                                                                                 none treating $filters' keys as\n     *                                                                                 the appropriate types\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws \\SmartyException\n     */\n    public function addAutoloadFilters(Smarty_Internal_TemplateBase $obj, $filters, $type = null)\n    {\n        $smarty = $obj->_getSmartyObj();\n        if ($type !== null) {\n            $this->_checkFilterType($type);\n            if (!empty($smarty->autoload_filters[ $type ])) {\n                $smarty->autoload_filters[ $type ] = array_merge($smarty->autoload_filters[ $type ], (array) $filters);\n            } else {\n                $smarty->autoload_filters[ $type ] = (array) $filters;\n            }\n        } else {\n            foreach ((array) $filters as $type => $value) {\n                $this->_checkFilterType($type);\n                if (!empty($smarty->autoload_filters[ $type ])) {\n                    $smarty->autoload_filters[ $type ] =\n                        array_merge($smarty->autoload_filters[ $type ], (array) $value);\n                } else {\n                    $smarty->autoload_filters[ $type ] = (array) $value;\n                }\n            }\n        }\n        return $obj;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_adddefaultmodifiers.php",
    "content": "<?php\n\n/**\n * Smarty Method AddDefaultModifiers\n *\n * Smarty::addDefaultModifiers() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_AddDefaultModifiers\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Add default modifiers\n     *\n     * @api Smarty::addDefaultModifiers()\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  array|string                                                   $modifiers modifier or list of modifiers\n     *                                                                                   to add\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     */\n    public function addDefaultModifiers(Smarty_Internal_TemplateBase $obj, $modifiers)\n    {\n        $smarty = $obj->_getSmartyObj();\n        if (is_array($modifiers)) {\n            $smarty->default_modifiers = array_merge($smarty->default_modifiers, $modifiers);\n        } else {\n            $smarty->default_modifiers[] = $modifiers;\n        }\n        return $obj;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_append.php",
    "content": "<?php\n\n/**\n * Smarty Method Append\n *\n * Smarty::append() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_Append\n{\n    /**\n     * Valid for all objects\n     *\n     * @var int\n     */\n    public $objMap = 7;\n\n    /**\n     * appends values to template variables\n     *\n     * @api  Smarty::append()\n     * @link http://www.smarty.net/docs/en/api.append.tpl\n     *\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $data\n     * @param  array|string                                           $tpl_var the template variable name(s)\n     * @param  mixed                                                  $value   the value to append\n     * @param  bool                                                   $merge   flag if array elements shall be merged\n     * @param  bool                                                   $nocache if true any output of this variable will\n     *                                                                         be not cached\n     *\n     * @return \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty\n     */\n    public function append(Smarty_Internal_Data $data, $tpl_var, $value = null, $merge = false, $nocache = false)\n    {\n        if (is_array($tpl_var)) {\n            // $tpl_var is an array, ignore $value\n            foreach ($tpl_var as $_key => $_val) {\n                if ($_key !== '') {\n                    $this->append($data, $_key, $_val, $merge, $nocache);\n                }\n            }\n        } else {\n            if ($tpl_var !== '' && isset($value)) {\n                if (!isset($data->tpl_vars[ $tpl_var ])) {\n                    $tpl_var_inst = $data->ext->getTemplateVars->_getVariable($data, $tpl_var, null, true, false);\n                    if ($tpl_var_inst instanceof Smarty_Undefined_Variable) {\n                        $data->tpl_vars[ $tpl_var ] = new Smarty_Variable(null, $nocache);\n                    } else {\n                        $data->tpl_vars[ $tpl_var ] = clone $tpl_var_inst;\n                    }\n                }\n                if (!(is_array($data->tpl_vars[ $tpl_var ]->value) ||\n                      $data->tpl_vars[ $tpl_var ]->value instanceof ArrayAccess)\n                ) {\n                    settype($data->tpl_vars[ $tpl_var ]->value, 'array');\n                }\n                if ($merge && is_array($value)) {\n                    foreach ($value as $_mkey => $_mval) {\n                        $data->tpl_vars[ $tpl_var ]->value[ $_mkey ] = $_mval;\n                    }\n                } else {\n                    $data->tpl_vars[ $tpl_var ]->value[] = $value;\n                }\n            }\n            if ($data->_isTplObj() && $data->scope) {\n                $data->ext->_updateScope->_updateScope($data, $tpl_var);\n            }\n        }\n        return $data;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_appendbyref.php",
    "content": "<?php\n\n/**\n * Smarty Method AppendByRef\n *\n * Smarty::appendByRef() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_AppendByRef\n{\n\n    /**\n     * appends values to template variables by reference\n     *\n     * @api  Smarty::appendByRef()\n     * @link http://www.smarty.net/docs/en/api.append.by.ref.tpl\n     *\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $data\n     * @param  string                                                 $tpl_var the template variable name\n     * @param  mixed                                                  &$value  the referenced value to append\n     * @param  bool                                                   $merge   flag if array elements shall be merged\n     *\n     * @return \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty\n     */\n    public static function appendByRef(Smarty_Internal_Data $data, $tpl_var, &$value, $merge = false)\n    {\n        if ($tpl_var !== '' && isset($value)) {\n            if (!isset($data->tpl_vars[ $tpl_var ])) {\n                $data->tpl_vars[ $tpl_var ] = new Smarty_Variable();\n            }\n            if (!is_array($data->tpl_vars[ $tpl_var ]->value)) {\n                settype($data->tpl_vars[ $tpl_var ]->value, 'array');\n            }\n            if ($merge && is_array($value)) {\n                foreach ($value as $_key => $_val) {\n                    $data->tpl_vars[ $tpl_var ]->value[ $_key ] = &$value[ $_key ];\n                }\n            } else {\n                $data->tpl_vars[ $tpl_var ]->value[] = &$value;\n            }\n            if ($data->_isTplObj() && $data->scope) {\n                $data->ext->_updateScope->_updateScope($data, $tpl_var);\n            }\n        }\n        return $data;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_assignbyref.php",
    "content": "<?php\n\n/**\n * Smarty Method AssignByRef\n *\n * Smarty::assignByRef() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_AssignByRef\n{\n\n    /**\n     * assigns values to template variables by reference\n     *\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $data\n     * @param string                                                  $tpl_var the template variable name\n     * @param                                                         $value\n     * @param  boolean                                                $nocache if true any output of this variable will be not cached\n     *\n     * @return \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty\n     */\n    public function assignByRef(Smarty_Internal_Data $data, $tpl_var, &$value, $nocache)\n    {\n        if ($tpl_var !== '') {\n            $data->tpl_vars[ $tpl_var ] = new Smarty_Variable(null, $nocache);\n            $data->tpl_vars[ $tpl_var ]->value = &$value;\n            if ($data->_isTplObj() && $data->scope) {\n                $data->ext->_updateScope->_updateScope($data, $tpl_var);\n            }\n        }\n        return $data;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_assignglobal.php",
    "content": "<?php\n\n/**\n * Smarty Method AssignGlobal\n *\n * Smarty::assignGlobal() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_AssignGlobal\n{\n    /**\n     * Valid for all objects\n     *\n     * @var int\n     */\n    public $objMap = 7;\n\n    /**\n     * assigns a global Smarty variable\n     *\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $data\n     * @param  string                                                 $varName the global variable name\n     * @param  mixed                                                  $value   the value to assign\n     * @param  boolean                                                $nocache if true any output of this variable will be not cached\n     *\n     * @return \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty\n     */\n    public function assignGlobal(Smarty_Internal_Data $data, $varName, $value = null, $nocache = false)\n    {\n        if ($varName !== '') {\n            Smarty::$global_tpl_vars[ $varName ] = new Smarty_Variable($value, $nocache);\n            $ptr = $data;\n            while ($ptr->_isTplObj()) {\n                $ptr->tpl_vars[ $varName ] = clone Smarty::$global_tpl_vars[ $varName ];\n                $ptr = $ptr->parent;\n            }\n        }\n        return $data;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_clearallassign.php",
    "content": "<?php\n\n/**\n * Smarty Method ClearAllAssign\n *\n * Smarty::clearAllAssign() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_ClearAllAssign\n{\n    /**\n     * Valid for all objects\n     *\n     * @var int\n     */\n    public $objMap = 7;\n\n    /**\n     * clear all the assigned template variables.\n     *\n     * @api  Smarty::clearAllAssign()\n     * @link http://www.smarty.net/docs/en/api.clear.all.assign.tpl\n     *\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $data\n     *\n     * @return \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty\n     */\n    public function clearAllAssign(Smarty_Internal_Data $data)\n    {\n        $data->tpl_vars = array();\n\n        return $data;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_clearallcache.php",
    "content": "<?php\n\n/**\n * Smarty Method ClearAllCache\n *\n * Smarty::clearAllCache() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_ClearAllCache\n{\n    /**\n     * Valid for Smarty object\n     *\n     * @var int\n     */\n    public $objMap = 1;\n\n    /**\n     * Empty cache folder\n     *\n     * @api  Smarty::clearAllCache()\n     * @link http://www.smarty.net/docs/en/api.clear.all.cache.tpl\n     *\n     * @param \\Smarty  $smarty\n     * @param  integer $exp_time expiration time\n     * @param  string  $type     resource type\n     *\n     * @return int number of cache files deleted\n     * @throws \\SmartyException\n     */\n    public function clearAllCache(Smarty $smarty, $exp_time = null, $type = null)\n    {\n        $smarty->_clearTemplateCache();\n        // load cache resource and call clearAll\n        $_cache_resource = Smarty_CacheResource::load($smarty, $type);\n        return $_cache_resource->clearAll($smarty, $exp_time);\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_clearassign.php",
    "content": "<?php\n\n/**\n * Smarty Method ClearAssign\n *\n * Smarty::clearAssign() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_ClearAssign\n{\n    /**\n     * Valid for all objects\n     *\n     * @var int\n     */\n    public $objMap = 7;\n\n    /**\n     * clear the given assigned template variable(s).\n     *\n     * @api  Smarty::clearAssign()\n     * @link http://www.smarty.net/docs/en/api.clear.assign.tpl\n     *\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $data\n     * @param  string|array                                           $tpl_var the template variable(s) to clear\n     *\n     * @return \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty\n     */\n    public function clearAssign(Smarty_Internal_Data $data, $tpl_var)\n    {\n        if (is_array($tpl_var)) {\n            foreach ($tpl_var as $curr_var) {\n                unset($data->tpl_vars[ $curr_var ]);\n            }\n        } else {\n            unset($data->tpl_vars[ $tpl_var ]);\n        }\n\n        return $data;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_clearcache.php",
    "content": "<?php\n\n/**\n * Smarty Method ClearCache\n *\n * Smarty::clearCache() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_ClearCache\n{\n    /**\n     * Valid for Smarty object\n     *\n     * @var int\n     */\n    public $objMap = 1;\n\n    /**\n     * Empty cache for a specific template\n     *\n     * @api  Smarty::clearCache()\n     * @link http://www.smarty.net/docs/en/api.clear.cache.tpl\n     *\n     * @param \\Smarty  $smarty\n     * @param  string  $template_name template name\n     * @param  string  $cache_id      cache id\n     * @param  string  $compile_id    compile id\n     * @param  integer $exp_time      expiration time\n     * @param  string  $type          resource type\n     *\n     * @return int number of cache files deleted\n     * @throws \\SmartyException\n     */\n    public function clearCache(Smarty $smarty, $template_name, $cache_id = null, $compile_id = null, $exp_time = null,\n                               $type = null)\n    {\n        $smarty->_clearTemplateCache();\n        // load cache resource and call clear\n        $_cache_resource = Smarty_CacheResource::load($smarty, $type);\n        return $_cache_resource->clear($smarty, $template_name, $cache_id, $compile_id, $exp_time);\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_clearcompiledtemplate.php",
    "content": "<?php\n\n/**\n * Smarty Method ClearCompiledTemplate\n *\n * Smarty::clearCompiledTemplate() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_ClearCompiledTemplate\n{\n    /**\n     * Valid for Smarty object\n     *\n     * @var int\n     */\n    public $objMap = 1;\n\n    /**\n     * Delete compiled template file\n     *\n     * @api  Smarty::clearCompiledTemplate()\n     * @link http://www.smarty.net/docs/en/api.clear.compiled.template.tpl\n     *\n     * @param \\Smarty  $smarty\n     * @param  string  $resource_name template name\n     * @param  string  $compile_id    compile id\n     * @param  integer $exp_time      expiration time\n     *\n     * @return int number of template files deleted\n     * @throws \\SmartyException\n     */\n    public function clearCompiledTemplate(Smarty $smarty, $resource_name = null, $compile_id = null, $exp_time = null)\n    {\n        // clear template objects cache\n        $smarty->_clearTemplateCache();\n        $_compile_dir = $smarty->getCompileDir();\n        if ($_compile_dir === '/') { //We should never want to delete this!\n            return 0;\n        }\n        $_compile_id = isset($compile_id) ? preg_replace('![^\\w]+!', '_', $compile_id) : null;\n        $_dir_sep = $smarty->use_sub_dirs ? DIRECTORY_SEPARATOR : '^';\n        if (isset($resource_name)) {\n            $_save_stat = $smarty->caching;\n            $smarty->caching = Smarty::CACHING_OFF;\n            /* @var Smarty_Internal_Template $tpl */\n            $tpl = $smarty->createTemplate($resource_name);\n            $smarty->caching = $_save_stat;\n            if (!$tpl->source->handler->uncompiled && !$tpl->source->handler->recompiled && $tpl->source->exists) {\n                $_resource_part_1 = basename(str_replace('^', DIRECTORY_SEPARATOR, $tpl->compiled->filepath));\n                $_resource_part_1_length = strlen($_resource_part_1);\n            } else {\n                return 0;\n            }\n            $_resource_part_2 = str_replace('.php', '.cache.php', $_resource_part_1);\n            $_resource_part_2_length = strlen($_resource_part_2);\n        }\n        $_dir = $_compile_dir;\n        if ($smarty->use_sub_dirs && isset($_compile_id)) {\n            $_dir .= $_compile_id . $_dir_sep;\n        }\n        if (isset($_compile_id)) {\n            $_compile_id_part = $_compile_dir . $_compile_id . $_dir_sep;\n            $_compile_id_part_length = strlen($_compile_id_part);\n        }\n        $_count = 0;\n        try {\n            $_compileDirs = new RecursiveDirectoryIterator($_dir);\n            // NOTE: UnexpectedValueException thrown for PHP >= 5.3\n        }\n        catch (Exception $e) {\n            return 0;\n        }\n        $_compile = new RecursiveIteratorIterator($_compileDirs, RecursiveIteratorIterator::CHILD_FIRST);\n        foreach ($_compile as $_file) {\n            if (substr(basename($_file->getPathname()), 0, 1) === '.') {\n                continue;\n            }\n            $_filepath = (string)$_file;\n            if ($_file->isDir()) {\n                if (!$_compile->isDot()) {\n                    // delete folder if empty\n                    @rmdir($_file->getPathname());\n                }\n            } else {\n                // delete only php files\n                if (substr($_filepath, -4) !== '.php') {\n                    continue;\n                }\n                $unlink = false;\n                if ((!isset($_compile_id) || (isset($_filepath[ $_compile_id_part_length ]) && $a =\n                                !strncmp($_filepath, $_compile_id_part, $_compile_id_part_length))) &&\n                    (!isset($resource_name) || (isset($_filepath[ $_resource_part_1_length ]) &&\n                                                substr_compare($_filepath,\n                                                               $_resource_part_1,\n                                                               -$_resource_part_1_length,\n                                                               $_resource_part_1_length) ===\n                                                0) || (isset($_filepath[ $_resource_part_2_length ]) &&\n                                                       substr_compare($_filepath,\n                                                                      $_resource_part_2,\n                                                                      -$_resource_part_2_length,\n                                                                      $_resource_part_2_length) === 0))\n                ) {\n                    if (isset($exp_time)) {\n                        if (is_file($_filepath) && time() - filemtime($_filepath) >= $exp_time) {\n                            $unlink = true;\n                        }\n                    } else {\n                        $unlink = true;\n                    }\n                }\n                if ($unlink && is_file($_filepath) && @unlink($_filepath)) {\n                    $_count++;\n                    if (function_exists('opcache_invalidate')\n                        && (!function_exists('ini_get') || strlen(ini_get('opcache.restrict_api')) < 1)\n                    ) {\n                        opcache_invalidate($_filepath, true);\n                    } else if (function_exists('apc_delete_file')) {\n                        apc_delete_file($_filepath);\n                    }\n                }\n            }\n        }\n        return $_count;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_clearconfig.php",
    "content": "<?php\n\n/**\n * Smarty Method ClearConfig\n *\n * Smarty::clearConfig() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_ClearConfig\n{\n    /**\n     * Valid for all objects\n     *\n     * @var int\n     */\n    public $objMap = 7;\n\n    /**\n     * clear a single or all config variables\n     *\n     * @api  Smarty::clearConfig()\n     * @link http://www.smarty.net/docs/en/api.clear.config.tpl\n     *\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $data\n     * @param  string|null                                            $name variable name or null\n     *\n     * @return \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty\n     */\n    public function clearConfig(Smarty_Internal_Data $data, $name = null)\n    {\n        if (isset($name)) {\n            unset($data->config_vars[ $name ]);\n        } else {\n            $data->config_vars = array();\n        }\n        return $data;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_compileallconfig.php",
    "content": "<?php\n\n/**\n * Smarty Method CompileAllConfig\n *\n * Smarty::compileAllConfig() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_CompileAllConfig extends Smarty_Internal_Method_CompileAllTemplates\n{\n\n    /**\n     * Compile all config files\n     *\n     * @api  Smarty::compileAllConfig()\n     *\n     * @param \\Smarty $smarty        passed smarty object\n     * @param  string $extension     file extension\n     * @param  bool   $force_compile force all to recompile\n     * @param  int    $time_limit\n     * @param  int    $max_errors\n     *\n     * @return int number of template files recompiled\n     */\n    public function compileAllConfig(Smarty $smarty, $extension = '.conf', $force_compile = false, $time_limit = 0,\n                                     $max_errors = null)\n    {\n        return $this->compileAll($smarty, $extension, $force_compile, $time_limit, $max_errors, true);\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_compilealltemplates.php",
    "content": "<?php\n/**\n * Smarty Method CompileAllTemplates\n *\n * Smarty::compileAllTemplates() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_CompileAllTemplates\n{\n    /**\n     * Valid for Smarty object\n     *\n     * @var int\n     */\n    public $objMap = 1;\n\n    /**\n     * Compile all template files\n     *\n     * @api  Smarty::compileAllTemplates()\n     *\n     * @param \\Smarty $smarty        passed smarty object\n     * @param  string $extension     file extension\n     * @param  bool   $force_compile force all to recompile\n     * @param  int    $time_limit\n     * @param  int    $max_errors\n     *\n     * @return integer number of template files recompiled\n     */\n    public function compileAllTemplates(Smarty $smarty,\n                                        $extension = '.tpl',\n                                        $force_compile = false,\n                                        $time_limit = 0,\n                                        $max_errors = null)\n    {\n        return $this->compileAll($smarty, $extension, $force_compile, $time_limit, $max_errors);\n    }\n\n    /**\n     * Compile all template or config files\n     *\n     * @param \\Smarty $smarty\n     * @param  string $extension     template file name extension\n     * @param  bool   $force_compile force all to recompile\n     * @param  int    $time_limit    set maximum execution time\n     * @param  int    $max_errors    set maximum allowed errors\n     * @param bool    $isConfig      flag true if called for config files\n     *\n     * @return int number of template files compiled\n     */\n    protected function compileAll(Smarty $smarty,\n                                  $extension,\n                                  $force_compile,\n                                  $time_limit,\n                                  $max_errors,\n                                  $isConfig = false)\n    {\n        // switch off time limit\n        if (function_exists('set_time_limit')) {\n            @set_time_limit($time_limit);\n        }\n        $_count = 0;\n        $_error_count = 0;\n        $sourceDir = $isConfig ? $smarty->getConfigDir() : $smarty->getTemplateDir();\n        // loop over array of source directories\n        foreach ($sourceDir as $_dir) {\n            $_dir_1 = new RecursiveDirectoryIterator($_dir, defined('FilesystemIterator::FOLLOW_SYMLINKS') ?\n                FilesystemIterator::FOLLOW_SYMLINKS : 0);\n            $_dir_2 = new RecursiveIteratorIterator($_dir_1);\n            foreach ($_dir_2 as $_fileinfo) {\n                $_file = $_fileinfo->getFilename();\n                if (substr(basename($_fileinfo->getPathname()), 0, 1) === '.' || strpos($_file, '.svn') !== false) {\n                    continue;\n                }\n                if (!substr_compare($_file, $extension, -strlen($extension)) === 0) {\n                    continue;\n                }\n                if ($_fileinfo->getPath() !== substr($_dir, 0, -1)) {\n                    $_file = substr($_fileinfo->getPath(), strlen($_dir)) . DIRECTORY_SEPARATOR . $_file;\n                }\n                echo \"\\n<br>\", $_dir, '---', $_file;\n                flush();\n                $_start_time = microtime(true);\n                $_smarty = clone $smarty;\n                //\n                $_smarty->_cache = array();\n                $_smarty->ext = new Smarty_Internal_Extension_Handler();\n                $_smarty->ext->objType = $_smarty->_objType;\n                $_smarty->force_compile = $force_compile;\n                try {\n                    /* @var Smarty_Internal_Template $_tpl */\n                    $_tpl = new $smarty->template_class($_file, $_smarty);\n                    $_tpl->caching = Smarty::CACHING_OFF;\n                    $_tpl->source =\n                        $isConfig ? Smarty_Template_Config::load($_tpl) : Smarty_Template_Source::load($_tpl);\n                    if ($_tpl->mustCompile()) {\n                        $_tpl->compileTemplateSource();\n                        $_count++;\n                        echo ' compiled in  ', microtime(true) - $_start_time, ' seconds';\n                        flush();\n                    } else {\n                        echo ' is up to date';\n                        flush();\n                    }\n                }\n                catch (Exception $e) {\n                    echo \"\\n<br>        ------>Error: \", $e->getMessage(), \"<br><br>\\n\";\n                    $_error_count++;\n                }\n                // free memory\n                unset($_tpl);\n                $_smarty->_clearTemplateCache();\n                if ($max_errors !== null && $_error_count === $max_errors) {\n                    echo \"\\n<br><br>too many errors\\n\";\n                    exit();\n                }\n            }\n        }\n        echo \"\\n<br>\";\n        return $_count;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_configload.php",
    "content": "<?php\n\n/**\n * Smarty Method ConfigLoad\n *\n * Smarty::configLoad() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_ConfigLoad\n{\n    /**\n     * Valid for all objects\n     *\n     * @var int\n     */\n    public $objMap = 7;\n\n    /**\n     * load a config file, optionally load just selected sections\n     *\n     * @api  Smarty::configLoad()\n     * @link http://www.smarty.net/docs/en/api.config.load.tpl\n     *\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $data\n     * @param  string                                                 $config_file filename\n     * @param  mixed                                                  $sections    array of section names, single\n     *                                                                             section or null\n     *\n     * @return \\Smarty|\\Smarty_Internal_Data|\\Smarty_Internal_Template\n     * @throws \\Exception\n     */\n    public function configLoad(Smarty_Internal_Data $data, $config_file, $sections = null)\n    {\n        $this->_loadConfigFile($data, $config_file, $sections, null);\n        return $data;\n    }\n\n    /**\n     * load a config file, optionally load just selected sections\n     *\n     * @api  Smarty::configLoad()\n     * @link http://www.smarty.net/docs/en/api.config.load.tpl\n     *\n     * @param \\Smarty|\\Smarty_Internal_Data|\\Smarty_Internal_Template $data\n     * @param  string                                                 $config_file filename\n     * @param  mixed                                                  $sections    array of section names, single\n     *                                                                             section or null\n     * @param int                                                     $scope       scope into which config variables\n     *                                                                             shall be loaded\n     *\n     * @return \\Smarty|\\Smarty_Internal_Data|\\Smarty_Internal_Template\n     * @throws \\Exception\n     */\n    public function _loadConfigFile(Smarty_Internal_Data $data, $config_file, $sections = null, $scope = 0)\n    {\n        /* @var \\Smarty $smarty */\n        $smarty = $data->_getSmartyObj();\n        /* @var \\Smarty_Internal_Template $confObj */\n        $confObj = new Smarty_Internal_Template($config_file, $smarty, $data, null, null, null, null, true);\n        $confObj->caching = Smarty::CACHING_OFF;\n        $confObj->source->config_sections = $sections;\n        $confObj->source->scope = $scope;\n        $confObj->compiled = Smarty_Template_Compiled::load($confObj);\n        $confObj->compiled->render($confObj);\n        if ($data->_isTplObj()) {\n            $data->compiled->file_dependency[ $confObj->source->uid ] =\n                array($confObj->source->filepath, $confObj->source->getTimeStamp(), $confObj->source->type);\n        }\n    }\n\n    /**\n     * load config variables into template object\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     * @param  array                    $new_config_vars\n     *\n     */\n    public function _loadConfigVars(Smarty_Internal_Template $tpl, $new_config_vars)\n    {\n        $this->_assignConfigVars($tpl->parent->config_vars, $tpl, $new_config_vars);\n        $tagScope = $tpl->source->scope;\n        if ($tagScope >= 0) {\n            if ($tagScope === Smarty::SCOPE_LOCAL) {\n                $this->_updateVarStack($tpl, $new_config_vars);\n                $tagScope = 0;\n                if (!$tpl->scope) {\n                    return;\n                }\n            }\n            if ($tpl->parent->_isTplObj() && ($tagScope || $tpl->parent->scope)) {\n                $mergedScope = $tagScope | $tpl->scope;\n                if ($mergedScope) {\n                    // update scopes\n                    /* @var \\Smarty_Internal_Template|\\Smarty|\\Smarty_Internal_Data $ptr */\n                    foreach ($tpl->smarty->ext->_updateScope->_getAffectedScopes($tpl->parent, $mergedScope) as $ptr) {\n                        $this->_assignConfigVars($ptr->config_vars, $tpl, $new_config_vars);\n                        if ($tagScope && $ptr->_isTplObj() && isset($tpl->_cache[ 'varStack' ])) {\n                            $this->_updateVarStack($tpl, $new_config_vars);\n                        }\n                    }\n                }\n            }\n        }\n    }\n\n    /**\n     * Assign all config variables in given scope\n     *\n     * @param array                     $config_vars     config variables in scope\n     * @param \\Smarty_Internal_Template $tpl\n     * @param  array                    $new_config_vars loaded config variables\n     */\n    public function _assignConfigVars(&$config_vars, Smarty_Internal_Template $tpl, $new_config_vars)\n    {\n        // copy global config vars\n        foreach ($new_config_vars[ 'vars' ] as $variable => $value) {\n            if ($tpl->smarty->config_overwrite || !isset($config_vars[ $variable ])) {\n                $config_vars[ $variable ] = $value;\n            } else {\n                $config_vars[ $variable ] = array_merge((array) $config_vars[ $variable ], (array) $value);\n            }\n        }\n        // scan sections\n        $sections = $tpl->source->config_sections;\n        if (!empty($sections)) {\n            foreach ((array) $sections as $tpl_section) {\n                if (isset($new_config_vars[ 'sections' ][ $tpl_section ])) {\n                    foreach ($new_config_vars[ 'sections' ][ $tpl_section ][ 'vars' ] as $variable => $value) {\n                        if ($tpl->smarty->config_overwrite || !isset($config_vars[ $variable ])) {\n                            $config_vars[ $variable ] = $value;\n                        } else {\n                            $config_vars[ $variable ] = array_merge((array) $config_vars[ $variable ], (array) $value);\n                        }\n                    }\n                }\n            }\n        }\n    }\n\n    /**\n     * Update config variables in template local variable stack\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     * @param array                     $config_vars\n     */\n    public function _updateVarStack(Smarty_Internal_Template $tpl, $config_vars)\n    {\n        $i = 0;\n        while (isset($tpl->_cache[ 'varStack' ][ $i ])) {\n            $this->_assignConfigVars($tpl->_cache[ 'varStack' ][ $i ][ 'config' ], $tpl, $config_vars);\n            $i ++;\n        }\n    }\n\n    /**\n     * gets  a config variable value\n     *\n     * @param \\Smarty|\\Smarty_Internal_Data|\\Smarty_Internal_Template $data\n     * @param string                                                  $varName the name of the config variable\n     * @param bool                                                    $errorEnable\n     *\n     * @return null|string  the value of the config variable\n     */\n    public function _getConfigVariable(Smarty_Internal_Data $data, $varName, $errorEnable = true)\n    {\n        $_ptr = $data;\n        while ($_ptr !== null) {\n            if (isset($_ptr->config_vars[ $varName ])) {\n                // found it, return it\n                return $_ptr->config_vars[ $varName ];\n            }\n            // not found, try at parent\n            $_ptr = $_ptr->parent;\n        }\n        if ($data->smarty->error_unassigned && $errorEnable) {\n            // force a notice\n            $x = $$varName;\n        }\n        return null;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_createdata.php",
    "content": "<?php\n\n/**\n * Smarty Method CreateData\n *\n * Smarty::createData() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_CreateData\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * creates a data object\n     *\n     * @api  Smarty::createData()\n     * @link http://www.smarty.net/docs/en/api.create.data.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty      $obj\n     * @param \\Smarty_Internal_Template|\\Smarty_Internal_Data|\\Smarty_Data|\\Smarty $parent next higher level of Smarty\n     *                                                                                     variables\n     * @param string                                                               $name   optional data block name\n     *\n     * @returns Smarty_Data data object\n     */\n    public function createData(Smarty_Internal_TemplateBase $obj, Smarty_Internal_Data $parent = null, $name = null)\n    {\n        /* @var Smarty $smarty */\n        $smarty = $obj->_getSmartyObj();\n        $dataObj = new Smarty_Data($parent, $smarty, $name);\n        if ($smarty->debugging) {\n            Smarty_Internal_Debug::register_data($dataObj);\n        }\n        return $dataObj;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_getautoloadfilters.php",
    "content": "<?php\n\n/**\n * Smarty Method GetAutoloadFilters\n *\n * Smarty::getAutoloadFilters() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_GetAutoloadFilters extends Smarty_Internal_Method_SetAutoloadFilters\n{\n    /**\n     * Get autoload filters\n     *\n     * @api Smarty::getAutoloadFilters()\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $type type of filter to get auto loads\n     *                                                                              for. Defaults to all autoload\n     *                                                                              filters\n     *\n     * @return array array( 'type1' => array( 'filter1', 'filter2', … ) ) or array( 'filter1', 'filter2', …) if $type\n     *                was specified\n     * @throws \\SmartyException\n     */\n    public function getAutoloadFilters(Smarty_Internal_TemplateBase $obj, $type = null)\n    {\n        $smarty = $obj->_getSmartyObj();\n        if ($type !== null) {\n            $this->_checkFilterType($type);\n            return isset($smarty->autoload_filters[ $type ]) ? $smarty->autoload_filters[ $type ] : array();\n        }\n        return $smarty->autoload_filters;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_getconfigvariable.php",
    "content": "<?php\n\n/**\n * Smarty Method GetConfigVariable\n *\n * Smarty::getConfigVariable() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_GetConfigVariable\n{\n    /**\n     * Valid for all objects\n     *\n     * @var int\n     */\n    public $objMap = 7;\n\n    /**\n     * gets  a config variable value\n     *\n     * @param \\Smarty|\\Smarty_Internal_Data|\\Smarty_Internal_Template $data\n     * @param string                                                  $varName the name of the config variable\n     * @param bool                                                    $errorEnable\n     *\n     * @return null|string  the value of the config variable\n     */\n    public function getConfigVariable(Smarty_Internal_Data $data, $varName = null, $errorEnable = true)\n    {\n        return $data->ext->configLoad->_getConfigVariable($data, $varName, $errorEnable);\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_getconfigvars.php",
    "content": "<?php\n\n/**\n * Smarty Method GetConfigVars\n *\n * Smarty::getConfigVars() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_GetConfigVars\n{\n    /**\n     * Valid for all objects\n     *\n     * @var int\n     */\n    public $objMap = 7;\n\n    /**\n     * Returns a single or all config variables\n     *\n     * @api  Smarty::getConfigVars()\n     * @link http://www.smarty.net/docs/en/api.get.config.vars.tpl\n     *\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $data\n     * @param  string                                                 $varname        variable name or null\n     * @param  bool                                                   $search_parents include parent templates?\n     *\n     * @return mixed variable value or or array of variables\n     */\n    public function getConfigVars(Smarty_Internal_Data $data, $varname = null, $search_parents = true)\n    {\n        $_ptr = $data;\n        $var_array = array();\n        while ($_ptr !== null) {\n            if (isset($varname)) {\n                if (isset($_ptr->config_vars[ $varname ])) {\n                    return $_ptr->config_vars[ $varname ];\n                }\n            } else {\n                $var_array = array_merge($_ptr->config_vars, $var_array);\n            }\n            // not found, try at parent\n            if ($search_parents) {\n                $_ptr = $_ptr->parent;\n            } else {\n                $_ptr = null;\n            }\n        }\n        if (isset($varname)) {\n            return '';\n        } else {\n            return $var_array;\n        }\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_getdebugtemplate.php",
    "content": "<?php\n\n/**\n * Smarty Method GetDebugTemplate\n *\n * Smarty::getDebugTemplate() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_GetDebugTemplate\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * return name of debugging template\n     *\n     * @api Smarty::getDebugTemplate()\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     *\n     * @return string\n     */\n    public function getDebugTemplate(Smarty_Internal_TemplateBase $obj)\n    {\n        $smarty = $obj->_getSmartyObj();\n        return $smarty->debug_tpl;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_getdefaultmodifiers.php",
    "content": "<?php\n\n/**\n * Smarty Method GetDefaultModifiers\n *\n * Smarty::getDefaultModifiers() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_GetDefaultModifiers\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Get default modifiers\n     *\n     * @api Smarty::getDefaultModifiers()\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     *\n     * @return array list of default modifiers\n     */\n    public function getDefaultModifiers(Smarty_Internal_TemplateBase $obj)\n    {\n        $smarty = $obj->_getSmartyObj();\n        return $smarty->default_modifiers;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_getglobal.php",
    "content": "<?php\n\n/**\n * Smarty Method GetGlobal\n *\n * Smarty::getGlobal() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_GetGlobal\n{\n    /**\n     * Valid for all objects\n     *\n     * @var int\n     */\n    public $objMap = 7;\n\n    /**\n     * Returns a single or all global  variables\n     *\n     * @api  Smarty::getGlobal()\n     *\n     * @param \\Smarty_Internal_Data $data\n     * @param  string              $varName variable name or null\n     *\n     * @return string|array variable value or or array of variables\n     */\n    public function getGlobal(Smarty_Internal_Data $data, $varName = null)\n    {\n        if (isset($varName)) {\n            if (isset(Smarty::$global_tpl_vars[ $varName ])) {\n                return Smarty::$global_tpl_vars[ $varName ]->value;\n            } else {\n                return '';\n            }\n        } else {\n            $_result = array();\n            foreach (Smarty::$global_tpl_vars AS $key => $var) {\n                $_result[ $key ] = $var->value;\n            }\n            return $_result;\n        }\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_getregisteredobject.php",
    "content": "<?php\n\n/**\n * Smarty Method GetRegisteredObject\n *\n * Smarty::getRegisteredObject() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_GetRegisteredObject\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * return a reference to a registered object\n     *\n     * @api  Smarty::getRegisteredObject()\n     * @link http://www.smarty.net/docs/en/api.get.registered.object.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $object_name object name\n     *\n     * @return object\n     * @throws \\SmartyException if no such object is found\n     */\n    public function getRegisteredObject(Smarty_Internal_TemplateBase $obj, $object_name)\n    {\n        $smarty = $obj->_getSmartyObj();\n        if (!isset($smarty->registered_objects[ $object_name ])) {\n            throw new SmartyException(\"'$object_name' is not a registered object\");\n        }\n        if (!is_object($smarty->registered_objects[ $object_name ][ 0 ])) {\n            throw new SmartyException(\"registered '$object_name' is not an object\");\n        }\n        return $smarty->registered_objects[ $object_name ][ 0 ];\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_getstreamvariable.php",
    "content": "<?php\n\n/**\n * Smarty Method GetStreamVariable\n *\n * Smarty::getStreamVariable() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_GetStreamVariable\n{\n    /**\n     * Valid for all objects\n     *\n     * @var int\n     */\n    public $objMap = 7;\n\n    /**\n     * gets  a stream variable\n     *\n     * @api Smarty::getStreamVariable()\n     *\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $data\n     * @param  string                                                 $variable the stream of the variable\n     *\n     * @return mixed\n     * @throws \\SmartyException\n     */\n    public function getStreamVariable(Smarty_Internal_Data $data, $variable)\n    {\n        $_result = '';\n        $fp = fopen($variable, 'r+');\n        if ($fp) {\n            while (!feof($fp) && ($current_line = fgets($fp)) !== false) {\n                $_result .= $current_line;\n            }\n            fclose($fp);\n\n            return $_result;\n        }\n        $smarty = isset($data->smarty) ? $data->smarty : $data;\n        if ($smarty->error_unassigned) {\n            throw new SmartyException('Undefined stream variable \"' . $variable . '\"');\n        } else {\n            return null;\n        }\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_gettags.php",
    "content": "<?php\n\n/**\n * Smarty Method GetTags\n *\n * Smarty::getTags() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_GetTags\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Return array of tag/attributes of all tags used by an template\n     *\n     * @api  Smarty::getTags()\n     * @link http://www.smarty.net/docs/en/api.get.tags.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param null|string|Smarty_Internal_Template                            $template\n     *\n     * @return array of tag/attributes\n     * @throws \\Exception\n     * @throws \\SmartyException\n     */\n    public function getTags(Smarty_Internal_TemplateBase $obj, $template = null)\n    {\n        /* @var Smarty $smarty */\n        $smarty = $obj->_getSmartyObj();\n        if ($obj->_isTplObj() && !isset($template)) {\n            $tpl = clone $obj;\n        } elseif (isset($template) && $template->_isTplObj()) {\n            $tpl = clone $template;\n        } elseif (isset($template) && is_string($template)) {\n            /* @var Smarty_Internal_Template $tpl */\n            $tpl = new $smarty->template_class($template, $smarty);\n            // checks if template exists\n            if (!$tpl->source->exists) {\n                throw new SmartyException(\"Unable to load template {$tpl->source->type} '{$tpl->source->name}'\");\n            }\n        }\n        if (isset($tpl)) {\n            $tpl->smarty = clone $tpl->smarty;\n            $tpl->smarty->_cache[ 'get_used_tags' ] = true;\n            $tpl->_cache[ 'used_tags' ] = array();\n            $tpl->smarty->merge_compiled_includes = false;\n            $tpl->smarty->disableSecurity();\n            $tpl->caching = Smarty::CACHING_OFF;\n            $tpl->loadCompiler();\n            $tpl->compiler->compileTemplate($tpl);\n            return $tpl->_cache[ 'used_tags' ];\n        }\n        throw new SmartyException('Missing template specification');\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_gettemplatevars.php",
    "content": "<?php\n\n/**\n * Smarty Method GetTemplateVars\n *\n * Smarty::getTemplateVars() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_GetTemplateVars\n{\n    /**\n     * Valid for all objects\n     *\n     * @var int\n     */\n    public $objMap = 7;\n\n    /**\n     * Returns a single or all template variables\n     *\n     * @api  Smarty::getTemplateVars()\n     * @link http://www.smarty.net/docs/en/api.get.template.vars.tpl\n     *\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $data\n     * @param  string                                                 $varName       variable name or null\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $_ptr          optional pointer to data object\n     * @param  bool                                                   $searchParents include parent templates?\n     *\n     * @return mixed variable value or or array of variables\n     */\n    public function getTemplateVars(Smarty_Internal_Data $data, $varName = null, Smarty_Internal_Data $_ptr = null,\n                                    $searchParents = true)\n    {\n        if (isset($varName)) {\n            $_var = $this->_getVariable($data, $varName, $_ptr, $searchParents, false);\n            if (is_object($_var)) {\n                return $_var->value;\n            } else {\n                return null;\n            }\n        } else {\n            $_result = array();\n            if ($_ptr === null) {\n                $_ptr = $data;\n            }\n            while ($_ptr !== null) {\n                foreach ($_ptr->tpl_vars AS $key => $var) {\n                    if (!array_key_exists($key, $_result)) {\n                        $_result[ $key ] = $var->value;\n                    }\n                }\n                // not found, try at parent\n                if ($searchParents) {\n                    $_ptr = $_ptr->parent;\n                } else {\n                    $_ptr = null;\n                }\n            }\n            if ($searchParents && isset(Smarty::$global_tpl_vars)) {\n                foreach (Smarty::$global_tpl_vars AS $key => $var) {\n                    if (!array_key_exists($key, $_result)) {\n                        $_result[ $key ] = $var->value;\n                    }\n                }\n            }\n            return $_result;\n        }\n    }\n\n    /**\n     * gets the object of a Smarty variable\n     *\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $data\n     * @param string                                                  $varName       the name of the Smarty variable\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $_ptr          optional pointer to data object\n     * @param bool                                                    $searchParents search also in parent data\n     * @param bool                                                    $errorEnable\n     *\n     * @return \\Smarty_Variable\n     */\n    public function _getVariable(Smarty_Internal_Data $data, $varName, Smarty_Internal_Data $_ptr = null,\n                                 $searchParents = true, $errorEnable = true)\n    {\n        if ($_ptr === null) {\n            $_ptr = $data;\n        }\n        while ($_ptr !== null) {\n            if (isset($_ptr->tpl_vars[ $varName ])) {\n                // found it, return it\n                return $_ptr->tpl_vars[ $varName ];\n            }\n            // not found, try at parent\n            if ($searchParents) {\n                $_ptr = $_ptr->parent;\n            } else {\n                $_ptr = null;\n            }\n        }\n        if (isset(Smarty::$global_tpl_vars[ $varName ])) {\n            // found it, return it\n            return Smarty::$global_tpl_vars[ $varName ];\n        }\n        /* @var \\Smarty $smarty */\n        $smarty = isset($data->smarty) ? $data->smarty : $data;\n        if ($smarty->error_unassigned && $errorEnable) {\n            // force a notice\n            $x = $$varName;\n        }\n\n        return new Smarty_Undefined_Variable;\n    }\n\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_literals.php",
    "content": "<?php\n\n/**\n * Smarty Method GetLiterals\n *\n * Smarty::getLiterals() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_Literals\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Get literals\n     *\n     * @api Smarty::getLiterals()\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     *\n     * @return array list of literals\n     */\n    public function getLiterals(Smarty_Internal_TemplateBase $obj)\n    {\n        $smarty = $obj->_getSmartyObj();\n        return (array)$smarty->literals;\n    }\n\n    /**\n     * Add literals\n     *\n     * @api Smarty::addLiterals()\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  array|string                                                   $literals  literal or list of literals\n     *                                                                                   to add\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws \\SmartyException\n     */\n    public function addLiterals(Smarty_Internal_TemplateBase $obj, $literals = null)\n    {\n        if (isset($literals)) {\n            $this->set($obj->_getSmartyObj(), (array)$literals);\n        }\n        return $obj;\n    }\n\n    /**\n     * Set literals\n     *\n     * @api Smarty::setLiterals()\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  array|string                                                   $literals  literal or list of literals\n     *                                                                                   to set\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws \\SmartyException\n     */\n    public function setLiterals(Smarty_Internal_TemplateBase $obj, $literals = null)\n    {\n        $smarty = $obj->_getSmartyObj();\n        $smarty->literals = array();\n        if (!empty($literals)) {\n            $this->set($smarty, (array)$literals);\n        }\n        return $obj;\n    }\n\n    /**\n     * common setter for literals for easier handling of duplicates the\n     * Smarty::$literals array gets filled with identical key values\n     *\n     * @param \\Smarty $smarty\n     * @param  array  $literals\n     *\n     * @throws \\SmartyException\n     */\n    private function set(Smarty $smarty, $literals)\n    {\n        $literals = array_combine($literals, $literals);\n        $error = isset($literals[ $smarty->left_delimiter ]) ? array($smarty->left_delimiter) : array();\n        $error = isset($literals[ $smarty->right_delimiter ]) ? $error[] = $smarty->right_delimiter : $error;\n        if (!empty($error)) {\n            throw new SmartyException('User defined literal(s) \"' . $error .\n                                      '\" may not be identical with left or right delimiter');\n        }\n        $smarty->literals = array_merge((array)$smarty->literals, (array)$literals);\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_loadfilter.php",
    "content": "<?php\n\n/**\n * Smarty Method LoadFilter\n *\n * Smarty::loadFilter() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_LoadFilter\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Valid filter types\n     *\n     * @var array\n     */\n    private $filterTypes = array('pre' => true, 'post' => true, 'output' => true, 'variable' => true);\n\n    /**\n     * load a filter of specified type and name\n     *\n     * @api  Smarty::loadFilter()\n     *\n     * @link http://www.smarty.net/docs/en/api.load.filter.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $type filter type\n     * @param  string                                                         $name filter name\n     *\n     * @return bool\n     * @throws SmartyException if filter could not be loaded\n     */\n    public function loadFilter(Smarty_Internal_TemplateBase $obj, $type, $name)\n    {\n        $smarty = $obj->_getSmartyObj();\n        $this->_checkFilterType($type);\n        $_plugin = \"smarty_{$type}filter_{$name}\";\n        $_filter_name = $_plugin;\n        if (is_callable($_plugin)) {\n            $smarty->registered_filters[ $type ][ $_filter_name ] = $_plugin;\n            return true;\n        }\n        if ($smarty->loadPlugin($_plugin)) {\n            if (class_exists($_plugin, false)) {\n                $_plugin = array($_plugin, 'execute');\n            }\n            if (is_callable($_plugin)) {\n                $smarty->registered_filters[ $type ][ $_filter_name ] = $_plugin;\n                return true;\n            }\n        }\n        throw new SmartyException(\"{$type}filter '{$name}' not found or callable\");\n    }\n\n    /**\n     * Check if filter type is valid\n     *\n     * @param string $type\n     *\n     * @throws \\SmartyException\n     */\n    public function _checkFilterType($type)\n    {\n        if (!isset($this->filterTypes[ $type ])) {\n            throw new SmartyException(\"Illegal filter type '{$type}'\");\n        }\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_loadplugin.php",
    "content": "<?php\n\n/**\n * Smarty Extension Loadplugin\n *\n * $smarty->loadPlugin() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_LoadPlugin\n{\n    /**\n     * Cache of searched plugin files\n     *\n     * @var array\n     */\n    public $plugin_files = array();\n\n    /**\n     * Takes unknown classes and loads plugin files for them\n     * class name format: Smarty_PluginType_PluginName\n     * plugin filename format: plugintype.pluginname.php\n     *\n     * @param \\Smarty $smarty\n     * @param  string $plugin_name class plugin name to load\n     * @param  bool   $check       check if already loaded\n     *\n     * @return bool|string\n     * @throws \\SmartyException\n     */\n    public function loadPlugin(Smarty $smarty, $plugin_name, $check)\n    {\n        // if function or class exists, exit silently (already loaded)\n        if ($check && (is_callable($plugin_name) || class_exists($plugin_name, false))) {\n            return true;\n        }\n        if (!preg_match('#^smarty_((internal)|([^_]+))_(.+)$#i', $plugin_name, $match)) {\n            throw new SmartyException(\"plugin {$plugin_name} is not a valid name format\");\n        }\n        if (!empty($match[ 2 ])) {\n            $file = SMARTY_SYSPLUGINS_DIR . strtolower($plugin_name) . '.php';\n            if (isset($this->plugin_files[ $file ])) {\n                if ($this->plugin_files[ $file ] !== false) {\n                    return $this->plugin_files[ $file ];\n                } else {\n                    return false;\n                }\n            } else {\n                if (is_file($file)) {\n                    $this->plugin_files[ $file ] = $file;\n                    require_once($file);\n                    return $file;\n                } else {\n                    $this->plugin_files[ $file ] = false;\n                    return false;\n                }\n            }\n        }\n        // plugin filename is expected to be: [type].[name].php\n        $_plugin_filename = \"{$match[1]}.{$match[4]}.php\";\n        $_lower_filename = strtolower($_plugin_filename);\n        if (isset($this->plugin_files)) {\n            if (isset($this->plugin_files[ 'plugins_dir' ][ $_lower_filename ])) {\n                if (!$smarty->use_include_path || $this->plugin_files[ 'plugins_dir' ][ $_lower_filename ] !== false) {\n                    return $this->plugin_files[ 'plugins_dir' ][ $_lower_filename ];\n                }\n            }\n            if (!$smarty->use_include_path || $smarty->ext->_getIncludePath->isNewIncludePath($smarty)) {\n                unset($this->plugin_files[ 'include_path' ]);\n            } else {\n                if (isset($this->plugin_files[ 'include_path' ][ $_lower_filename ])) {\n                    return $this->plugin_files[ 'include_path' ][ $_lower_filename ];\n                }\n            }\n        }\n        $_file_names = array($_plugin_filename);\n        if ($_lower_filename !== $_plugin_filename) {\n            $_file_names[] = $_lower_filename;\n        }\n        $_p_dirs = $smarty->getPluginsDir();\n        if (!isset($this->plugin_files[ 'plugins_dir' ][ $_lower_filename ])) {\n            // loop through plugin dirs and find the plugin\n            foreach ($_p_dirs as $_plugin_dir) {\n                foreach ($_file_names as $name) {\n                    $file = $_plugin_dir . $name;\n                    if (is_file($file)) {\n                        $this->plugin_files[ 'plugins_dir' ][ $_lower_filename ] = $file;\n                        require_once($file);\n                        return $file;\n                    }\n                    $this->plugin_files[ 'plugins_dir' ][ $_lower_filename ] = false;\n                }\n            }\n        }\n        if ($smarty->use_include_path) {\n            foreach ($_file_names as $_file_name) {\n                // try PHP include_path\n                $file = $smarty->ext->_getIncludePath->getIncludePath($_p_dirs, $_file_name, $smarty);\n                $this->plugin_files[ 'include_path' ][ $_lower_filename ] = $file;\n                if ($file !== false) {\n                    require_once($file);\n                    return $file;\n                }\n            }\n        }\n        // no plugin loaded\n        return false;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_mustcompile.php",
    "content": "<?php\n\n/**\n * Smarty Method MustCompile\n *\n * Smarty_Internal_Template::mustCompile() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_MustCompile\n{\n    /**\n     * Valid for template object\n     *\n     * @var int\n     */\n    public $objMap = 2;\n\n    /**\n     * Returns if the current template must be compiled by the Smarty compiler\n     * It does compare the timestamps of template source and the compiled templates and checks the force compile\n     * configuration\n     *\n     * @param \\Smarty_Internal_Template $_template\n     *\n     * @return bool\n     * @throws \\SmartyException\n     */\n    public function mustCompile(Smarty_Internal_Template $_template)\n    {\n        if (!$_template->source->exists) {\n            if ($_template->_isSubTpl()) {\n                $parent_resource = \" in '$_template->parent->template_resource}'\";\n            } else {\n                $parent_resource = '';\n            }\n            throw new SmartyException(\"Unable to load template {$_template->source->type} '{$_template->source->name}'{$parent_resource}\");\n        }\n        if ($_template->mustCompile === null) {\n            $_template->mustCompile = (!$_template->source->handler->uncompiled &&\n                                       ($_template->smarty->force_compile || $_template->source->handler->recompiled ||\n                                        !$_template->compiled->exists || ($_template->compile_check &&\n                                                                          $_template->compiled->getTimeStamp() <\n                                                                          $_template->source->getTimeStamp())));\n        }\n\n        return $_template->mustCompile;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_registercacheresource.php",
    "content": "<?php\n\n/**\n * Smarty Method RegisterCacheResource\n *\n * Smarty::registerCacheResource() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_RegisterCacheResource\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Registers a resource to fetch a template\n     *\n     * @api  Smarty::registerCacheResource()\n     * @link http://www.smarty.net/docs/en/api.register.cacheresource.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $name name of resource type\n     * @param \\Smarty_CacheResource                                           $resource_handler\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     */\n    public function registerCacheResource(Smarty_Internal_TemplateBase $obj, $name,\n                                          Smarty_CacheResource $resource_handler)\n    {\n        $smarty = $obj->_getSmartyObj();\n        $smarty->registered_cache_resources[ $name ] = $resource_handler;\n        return $obj;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_registerclass.php",
    "content": "<?php\n\n/**\n * Smarty Method RegisterClass\n *\n * Smarty::registerClass() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_RegisterClass\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Registers static classes to be used in templates\n     *\n     * @api  Smarty::registerClass()\n     * @link http://www.smarty.net/docs/en/api.register.class.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $class_name\n     * @param  string                                                         $class_impl the referenced PHP class to\n     *                                                                                    register\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws \\SmartyException\n     */\n    public function registerClass(Smarty_Internal_TemplateBase $obj, $class_name, $class_impl)\n    {\n        $smarty = $obj->_getSmartyObj();\n        // test if exists\n        if (!class_exists($class_impl)) {\n            throw new SmartyException(\"Undefined class '$class_impl' in register template class\");\n        }\n        // register the class\n        $smarty->registered_classes[ $class_name ] = $class_impl;\n        return $obj;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_registerdefaultconfighandler.php",
    "content": "<?php\n\n/**\n * Smarty Method RegisterDefaultConfigHandler\n *\n * Smarty::registerDefaultConfigHandler() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_RegisterDefaultConfigHandler\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Register config default handler\n     *\n     * @api  Smarty::registerDefaultConfigHandler()\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  callable                                                       $callback class/method name\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws SmartyException              if $callback is not callable\n     */\n    public function registerDefaultConfigHandler(Smarty_Internal_TemplateBase $obj, $callback)\n    {\n        $smarty = $obj->_getSmartyObj();\n        if (is_callable($callback)) {\n            $smarty->default_config_handler_func = $callback;\n        } else {\n            throw new SmartyException('Default config handler not callable');\n        }\n        return $obj;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_registerdefaultpluginhandler.php",
    "content": "<?php\n\n/**\n * Smarty Method RegisterDefaultPluginHandler\n *\n * Smarty::registerDefaultPluginHandler() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_RegisterDefaultPluginHandler\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Registers a default plugin handler\n     *\n     * @api  Smarty::registerDefaultPluginHandler()\n     * @link http://www.smarty.net/docs/en/api.register.default.plugin.handler.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  callable                                                       $callback class/method name\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws SmartyException              if $callback is not callable\n     */\n    public function registerDefaultPluginHandler(Smarty_Internal_TemplateBase $obj, $callback)\n    {\n        $smarty = $obj->_getSmartyObj();\n        if (is_callable($callback)) {\n            $smarty->default_plugin_handler_func = $callback;\n        } else {\n            throw new SmartyException(\"Default plugin handler '$callback' not callable\");\n        }\n        return $obj;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_registerdefaulttemplatehandler.php",
    "content": "<?php\n\n/**\n * Smarty Method RegisterDefaultTemplateHandler\n *\n * Smarty::registerDefaultTemplateHandler() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_RegisterDefaultTemplateHandler\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Register template default handler\n     *\n     * @api  Smarty::registerDefaultTemplateHandler()\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  callable                                                       $callback class/method name\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws SmartyException              if $callback is not callable\n     */\n    public function registerDefaultTemplateHandler(Smarty_Internal_TemplateBase $obj, $callback)\n    {\n        $smarty = $obj->_getSmartyObj();\n        if (is_callable($callback)) {\n            $smarty->default_template_handler_func = $callback;\n        } else {\n            throw new SmartyException('Default template handler not callable');\n        }\n        return $obj;\n    }\n\n    /**\n     * get default content from template or config resource handler\n     *\n     * @param Smarty_Template_Source $source\n     *\n     * @throws \\SmartyException\n     */\n    public static function _getDefaultTemplate(Smarty_Template_Source $source)\n    {\n        if ($source->isConfig) {\n            $default_handler = $source->smarty->default_config_handler_func;\n        } else {\n            $default_handler = $source->smarty->default_template_handler_func;\n        }\n        $_content = $_timestamp = null;\n        $_return = call_user_func_array($default_handler,\n                                        array($source->type, $source->name, &$_content, &$_timestamp, $source->smarty));\n        if (is_string($_return)) {\n            $source->exists = is_file($_return);\n            if ($source->exists) {\n                $source->timestamp = filemtime($_return);\n            } else {\n                throw new SmartyException('Default handler: Unable to load ' .\n                                          ($source->isConfig ? 'config' : 'template') .\n                                          \" default file '{$_return}' for '{$source->type}:{$source->name}'\");\n            }\n            $source->name = $source->filepath = $_return;\n            $source->uid = sha1($source->filepath);\n        } elseif ($_return === true) {\n            $source->content = $_content;\n            $source->exists = true;\n            $source->uid = $source->name = sha1($_content);\n            $source->handler = Smarty_Resource::load($source->smarty, 'eval');\n        } else {\n            $source->exists = false;\n            throw new SmartyException('Default handler: No ' . ($source->isConfig ? 'config' : 'template') .\n                                      \" default content for '{$source->type}:{$source->name}'\");\n        }\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_registerfilter.php",
    "content": "<?php\n\n/**\n * Smarty Method RegisterFilter\n *\n * Smarty::registerFilter() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_RegisterFilter\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Valid filter types\n     *\n     * @var array\n     */\n    private $filterTypes = array('pre' => true, 'post' => true, 'output' => true, 'variable' => true);\n\n    /**\n     * Registers a filter function\n     *\n     * @api  Smarty::registerFilter()\n     *\n     * @link http://www.smarty.net/docs/en/api.register.filter.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $type filter type\n     * @param  callback                                                       $callback\n     * @param  string|null                                                    $name optional filter name\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws \\SmartyException\n     */\n    public function registerFilter(Smarty_Internal_TemplateBase $obj, $type, $callback, $name = null)\n    {\n        $smarty = $obj->_getSmartyObj();\n        $this->_checkFilterType($type);\n        $name = isset($name) ? $name : $this->_getFilterName($callback);\n        if (!is_callable($callback)) {\n            throw new SmartyException(\"{$type}filter '{$name}' not callable\");\n        }\n        $smarty->registered_filters[ $type ][ $name ] = $callback;\n        return $obj;\n    }\n\n    /**\n     * Return internal filter name\n     *\n     * @param  callback $function_name\n     *\n     * @return string   internal filter name\n     */\n    public function _getFilterName($function_name)\n    {\n        if (is_array($function_name)) {\n            $_class_name = (is_object($function_name[ 0 ]) ? get_class($function_name[ 0 ]) : $function_name[ 0 ]);\n\n            return $_class_name . '_' . $function_name[ 1 ];\n        } elseif (is_string($function_name)) {\n            return $function_name;\n        } else {\n            return 'closure';\n        }\n    }\n\n    /**\n     * Check if filter type is valid\n     *\n     * @param string $type\n     *\n     * @throws \\SmartyException\n     */\n    public function _checkFilterType($type)\n    {\n        if (!isset($this->filterTypes[ $type ])) {\n            throw new SmartyException(\"Illegal filter type '{$type}'\");\n        }\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_registerobject.php",
    "content": "<?php\n\n/**\n * Smarty Method RegisterObject\n *\n * Smarty::registerObject() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_RegisterObject\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Registers object to be used in templates\n     *\n     * @api  Smarty::registerObject()\n     * @link http://www.smarty.net/docs/en/api.register.object.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $object_name\n     * @param  object                                                         $object                     the\n     *                                                                                                    referenced\n     *                                                                                                    PHP object to\n     *                                                                                                    register\n     * @param  array                                                          $allowed_methods_properties list of\n     *                                                                                                    allowed\n     *                                                                                                    methods\n     *                                                                                                    (empty = all)\n     * @param  bool                                                           $format                     smarty\n     *                                                                                                    argument\n     *                                                                                                    format, else\n     *                                                                                                    traditional\n     * @param  array                                                          $block_methods              list of\n     *                                                                                                    block-methods\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws \\SmartyException\n     */\n    public function registerObject(Smarty_Internal_TemplateBase $obj, $object_name, $object,\n                                   $allowed_methods_properties = array(), $format = true, $block_methods = array())\n    {\n        $smarty = $obj->_getSmartyObj();\n        // test if allowed methods callable\n        if (!empty($allowed_methods_properties)) {\n            foreach ((array) $allowed_methods_properties as $method) {\n                if (!is_callable(array($object, $method)) && !property_exists($object, $method)) {\n                    throw new SmartyException(\"Undefined method or property '$method' in registered object\");\n                }\n            }\n        }\n        // test if block methods callable\n        if (!empty($block_methods)) {\n            foreach ((array) $block_methods as $method) {\n                if (!is_callable(array($object, $method))) {\n                    throw new SmartyException(\"Undefined method '$method' in registered object\");\n                }\n            }\n        }\n        // register the object\n        $smarty->registered_objects[ $object_name ] =\n            array($object, (array) $allowed_methods_properties, (boolean) $format, (array) $block_methods);\n        return $obj;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_registerplugin.php",
    "content": "<?php\n\n/**\n * Smarty Method RegisterPlugin\n *\n * Smarty::registerPlugin() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_RegisterPlugin\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Registers plugin to be used in templates\n     *\n     * @api  Smarty::registerPlugin()\n     * @link http://www.smarty.net/docs/en/api.register.plugin.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $type       plugin type\n     * @param  string                                                         $name       name of template tag\n     * @param  callback                                                       $callback   PHP callback to register\n     * @param  bool                                                           $cacheable  if true (default) this\n     *                                                                                    function is cache able\n     * @param  mixed                                                          $cache_attr caching attributes if any\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws SmartyException              when the plugin tag is invalid\n     */\n    public function registerPlugin(Smarty_Internal_TemplateBase $obj, $type, $name, $callback, $cacheable = true,\n                                   $cache_attr = null)\n    {\n        $smarty = $obj->_getSmartyObj();\n        if (isset($smarty->registered_plugins[ $type ][ $name ])) {\n            throw new SmartyException(\"Plugin tag '{$name}' already registered\");\n        } elseif (!is_callable($callback)) {\n            throw new SmartyException(\"Plugin '{$name}' not callable\");\n        } else {\n            $smarty->registered_plugins[ $type ][ $name ] = array($callback, (bool) $cacheable, (array) $cache_attr);\n        }\n        return $obj;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_registerresource.php",
    "content": "<?php\n\n/**\n * Smarty Method RegisterResource\n *\n * Smarty::registerResource() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_RegisterResource\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Registers a resource to fetch a template\n     *\n     * @api  Smarty::registerResource()\n     * @link http://www.smarty.net/docs/en/api.register.resource.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $name             name of resource type\n     * @param  Smarty_Resource|array                                          $resource_handler or instance of\n     *                                                                                          Smarty_Resource, or\n     *                                                                                          array of callbacks to\n     *                                                                                          handle resource\n     *                                                                                          (deprecated)\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     */\n    public function registerResource(Smarty_Internal_TemplateBase $obj, $name, $resource_handler)\n    {\n        $smarty = $obj->_getSmartyObj();\n        $smarty->registered_resources[ $name ] =\n            $resource_handler instanceof Smarty_Resource ? $resource_handler : array($resource_handler, false);\n        return $obj;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_setautoloadfilters.php",
    "content": "<?php\n\n/**\n * Smarty Method SetAutoloadFilters\n *\n * Smarty::setAutoloadFilters() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_SetAutoloadFilters\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Valid filter types\n     *\n     * @var array\n     */\n    private $filterTypes = array('pre' => true, 'post' => true, 'output' => true, 'variable' => true);\n\n    /**\n     * Set autoload filters\n     *\n     * @api Smarty::setAutoloadFilters()\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  array                                                          $filters filters to load automatically\n     * @param  string                                                         $type    \"pre\", \"output\", … specify the\n     *                                                                                 filter type to set. Defaults to\n     *                                                                                 none treating $filters' keys as\n     *                                                                                 the appropriate types\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws \\SmartyException\n     */\n    public function setAutoloadFilters(Smarty_Internal_TemplateBase $obj, $filters, $type = null)\n    {\n        $smarty = $obj->_getSmartyObj();\n        if ($type !== null) {\n            $this->_checkFilterType($type);\n            $smarty->autoload_filters[ $type ] = (array) $filters;\n        } else {\n            foreach ((array) $filters as $type => $value) {\n                $this->_checkFilterType($type);\n            }\n            $smarty->autoload_filters = (array) $filters;\n        }\n        return $obj;\n    }\n\n    /**\n     * Check if filter type is valid\n     *\n     * @param string $type\n     *\n     * @throws \\SmartyException\n     */\n    public function _checkFilterType($type)\n    {\n        if (!isset($this->filterTypes[ $type ])) {\n            throw new SmartyException(\"Illegal filter type '{$type}'\");\n        }\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_setdebugtemplate.php",
    "content": "<?php\n\n/**\n * Smarty Method SetDebugTemplate\n *\n * Smarty::setDebugTemplate() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_SetDebugTemplate\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * set the debug template\n     *\n     * @api Smarty::setDebugTemplate()\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $tpl_name\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws SmartyException if file is not readable\n     */\n    public function setDebugTemplate(Smarty_Internal_TemplateBase $obj, $tpl_name)\n    {\n        $smarty = $obj->_getSmartyObj();\n        if (!is_readable($tpl_name)) {\n            throw new SmartyException(\"Unknown file '{$tpl_name}'\");\n        }\n        $smarty->debug_tpl = $tpl_name;\n        return $obj;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_setdefaultmodifiers.php",
    "content": "<?php\n\n/**\n * Smarty Method SetDefaultModifiers\n *\n * Smarty::setDefaultModifiers() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_SetDefaultModifiers\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Set default modifiers\n     *\n     * @api Smarty::setDefaultModifiers()\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  array|string                                                   $modifiers modifier or list of modifiers\n     *                                                                                   to set\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     */\n    public function setDefaultModifiers(Smarty_Internal_TemplateBase $obj, $modifiers)\n    {\n        $smarty = $obj->_getSmartyObj();\n        $smarty->default_modifiers = (array) $modifiers;\n        return $obj;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_unloadfilter.php",
    "content": "<?php\n\n/**\n * Smarty Method UnloadFilter\n *\n * Smarty::unloadFilter() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_UnloadFilter extends Smarty_Internal_Method_LoadFilter\n{\n    /**\n     * load a filter of specified type and name\n     *\n     * @api  Smarty::unloadFilter()\n     *\n     * @link http://www.smarty.net/docs/en/api.unload.filter.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $type filter type\n     * @param  string                                                         $name filter name\n     *\n     * @return Smarty_Internal_TemplateBase\n     * @throws \\SmartyException\n     */\n    public function unloadFilter(Smarty_Internal_TemplateBase $obj, $type, $name)\n    {\n        $smarty = $obj->_getSmartyObj();\n        $this->_checkFilterType($type);\n        if (isset($smarty->registered_filters[ $type ])) {\n            $_filter_name = \"smarty_{$type}filter_{$name}\";\n            if (isset($smarty->registered_filters[ $type ][ $_filter_name ])) {\n                unset ($smarty->registered_filters[ $type ][ $_filter_name ]);\n                if (empty($smarty->registered_filters[ $type ])) {\n                    unset($smarty->registered_filters[ $type ]);\n                }\n            }\n        }\n        return $obj;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_unregistercacheresource.php",
    "content": "<?php\n\n/**\n * Smarty Method UnregisterCacheResource\n *\n * Smarty::unregisterCacheResource() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_UnregisterCacheResource\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Registers a resource to fetch a template\n     *\n     * @api      Smarty::unregisterCacheResource()\n     * @link     http://www.smarty.net/docs/en/api.unregister.cacheresource.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param                                                                 $name\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     */\n    public function unregisterCacheResource(Smarty_Internal_TemplateBase $obj, $name)\n    {\n        $smarty = $obj->_getSmartyObj();\n        if (isset($smarty->registered_cache_resources[ $name ])) {\n            unset($smarty->registered_cache_resources[ $name ]);\n        }\n        return $obj;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_unregisterfilter.php",
    "content": "<?php\n\n/**\n * Smarty Method UnregisterFilter\n *\n * Smarty::unregisterFilter() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_UnregisterFilter extends Smarty_Internal_Method_RegisterFilter\n{\n    /**\n     * Unregisters a filter function\n     *\n     * @api  Smarty::unregisterFilter()\n     *\n     * @link http://www.smarty.net/docs/en/api.unregister.filter.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $type filter type\n     * @param  callback|string                                                $callback\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws \\SmartyException\n     */\n    public function unregisterFilter(Smarty_Internal_TemplateBase $obj, $type, $callback)\n    {\n        $smarty = $obj->_getSmartyObj();\n        $this->_checkFilterType($type);\n        if (isset($smarty->registered_filters[ $type ])) {\n            $name = is_string($callback) ? $callback : $this->_getFilterName($callback);\n            if (isset($smarty->registered_filters[ $type ][ $name ])) {\n                unset($smarty->registered_filters[ $type ][ $name ]);\n                if (empty($smarty->registered_filters[ $type ])) {\n                    unset($smarty->registered_filters[ $type ]);\n                }\n            }\n        }\n        return $obj;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_unregisterobject.php",
    "content": "<?php\n\n/**\n * Smarty Method UnregisterObject\n *\n * Smarty::unregisterObject() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_UnregisterObject\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Registers plugin to be used in templates\n     *\n     * @api  Smarty::unregisterObject()\n     * @link http://www.smarty.net/docs/en/api.unregister.object.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $object_name name of object\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     */\n    public function unregisterObject(Smarty_Internal_TemplateBase $obj, $object_name)\n    {\n        $smarty = $obj->_getSmartyObj();\n        if (isset($smarty->registered_objects[ $object_name ])) {\n            unset($smarty->registered_objects[ $object_name ]);\n        }\n        return $obj;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_unregisterplugin.php",
    "content": "<?php\n\n/**\n * Smarty Method UnregisterPlugin\n *\n * Smarty::unregisterPlugin() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_UnregisterPlugin\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Registers plugin to be used in templates\n     *\n     * @api  Smarty::unregisterPlugin()\n     * @link http://www.smarty.net/docs/en/api.unregister.plugin.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $type plugin type\n     * @param  string                                                         $name name of template tag\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     */\n    public function unregisterPlugin(Smarty_Internal_TemplateBase $obj, $type, $name)\n    {\n        $smarty = $obj->_getSmartyObj();\n        if (isset($smarty->registered_plugins[ $type ][ $name ])) {\n            unset($smarty->registered_plugins[ $type ][ $name ]);\n        }\n        return $obj;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_method_unregisterresource.php",
    "content": "<?php\n\n/**\n * Smarty Method UnregisterResource\n *\n * Smarty::unregisterResource() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_UnregisterResource\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Registers a resource to fetch a template\n     *\n     * @api  Smarty::unregisterResource()\n     * @link http://www.smarty.net/docs/en/api.unregister.resource.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $type name of resource type\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     */\n    public function unregisterResource(Smarty_Internal_TemplateBase $obj, $type)\n    {\n        $smarty = $obj->_getSmartyObj();\n        if (isset($smarty->registered_resources[ $type ])) {\n            unset($smarty->registered_resources[ $type ]);\n        }\n        return $obj;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_nocache_insert.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Nocache Insert\n * Compiles the {insert} tag into the cache file\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Insert Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Nocache_Insert\n{\n    /**\n     * Compiles code for the {insert} tag into cache file\n     *\n     * @param  string                   $_function insert function name\n     * @param  array                    $_attr     array with parameter\n     * @param  Smarty_Internal_Template $_template template object\n     * @param  string                   $_script   script name to load or 'null'\n     * @param  string                   $_assign   optional variable name\n     *\n     * @return string                   compiled code\n     */\n    public static function compile($_function, $_attr, $_template, $_script, $_assign = null)\n    {\n        $_output = '<?php ';\n        if ($_script !== 'null') {\n            // script which must be included\n            // code for script file loading\n            $_output .= \"require_once '{$_script}';\";\n        }\n        // call insert\n        if (isset($_assign)) {\n            $_output .= \"\\$_smarty_tpl->assign('{$_assign}' , {$_function} (\" . var_export($_attr, true) .\n                        ',\\$_smarty_tpl), true);?>';\n        } else {\n            $_output .= \"echo {$_function}(\" . var_export($_attr, true) . ',$_smarty_tpl);?>';\n        }\n        $_tpl = $_template;\n        while ($_tpl->_isSubTpl()) {\n            $_tpl = $_tpl->parent;\n        }\n\n        return \"/*%%SmartyNocache:{$_tpl->compiled->nocache_hash}%%*/{$_output}/*/%%SmartyNocache:{$_tpl->compiled->nocache_hash}%%*/\";\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_parsetree.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Templateparser Parsetree\n * These are classes to build parsetree in the template parser\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Thue Kristensen\n * @author     Uwe Tews\n */\n\n/**\n * @package    Smarty\n * @subpackage Compiler\n * @ignore\n */\nabstract class Smarty_Internal_ParseTree\n{\n\n    /**\n     * Buffer content\n     *\n     * @var mixed\n     */\n    public $data;\n\n    /**\n     * Subtree array\n     *\n     * @var array\n     */\n    public $subtrees = array();\n\n    /**\n     * Return buffer\n     *\n     * @param \\Smarty_Internal_Templateparser $parser\n     *\n     * @return string buffer content\n     */\n    abstract public function to_smarty_php(Smarty_Internal_Templateparser $parser);\n\n    /**\n     * Template data object destructor\n     */\n    public function __destruct()\n    {\n        $this->data = null;\n        $this->subtrees = null;\n    }\n\n}\n\n\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_parsetree_code.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Templateparser Parse Tree\n * These are classes to build parse trees in the template parser\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Thue Kristensen\n * @author     Uwe Tews\n */\n\n/**\n * Code fragment inside a tag .\n *\n * @package    Smarty\n * @subpackage Compiler\n * @ignore\n */\nclass Smarty_Internal_ParseTree_Code extends Smarty_Internal_ParseTree\n{\n    /**\n     * Create parse tree buffer for code fragment\n     *\n     * @param string $data content\n     */\n    public function __construct($data)\n    {\n        $this->data = $data;\n    }\n\n    /**\n     * Return buffer content in parentheses\n     *\n     * @param \\Smarty_Internal_Templateparser $parser\n     *\n     * @return string content\n     */\n    public function to_smarty_php(Smarty_Internal_Templateparser $parser)\n    {\n        return sprintf('(%s)', $this->data);\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_parsetree_dq.php",
    "content": "<?php\n\n/**\n * Double quoted string inside a tag.\n *\n * @package    Smarty\n * @subpackage Compiler\n * @ignore\n */\n\n/**\n * Double quoted string inside a tag.\n *\n * @package    Smarty\n * @subpackage Compiler\n * @ignore\n */\nclass Smarty_Internal_ParseTree_Dq extends Smarty_Internal_ParseTree\n{\n    /**\n     * Create parse tree buffer for double quoted string subtrees\n     *\n     * @param object                    $parser  parser object\n     * @param Smarty_Internal_ParseTree $subtree parse tree buffer\n     */\n    public function __construct($parser, Smarty_Internal_ParseTree $subtree)\n    {\n        $this->subtrees[] = $subtree;\n        if ($subtree instanceof Smarty_Internal_ParseTree_Tag) {\n            $parser->block_nesting_level = count($parser->compiler->_tag_stack);\n        }\n    }\n\n    /**\n     * Append buffer to subtree\n     *\n     * @param \\Smarty_Internal_Templateparser $parser\n     * @param Smarty_Internal_ParseTree       $subtree parse tree buffer\n     */\n    public function append_subtree(Smarty_Internal_Templateparser $parser, Smarty_Internal_ParseTree $subtree)\n    {\n        $last_subtree = count($this->subtrees) - 1;\n        if ($last_subtree >= 0 && $this->subtrees[ $last_subtree ] instanceof Smarty_Internal_ParseTree_Tag &&\n            $this->subtrees[ $last_subtree ]->saved_block_nesting < $parser->block_nesting_level\n        ) {\n            if ($subtree instanceof Smarty_Internal_ParseTree_Code) {\n                $this->subtrees[ $last_subtree ]->data =\n                    $parser->compiler->appendCode($this->subtrees[ $last_subtree ]->data,\n                                                  '<?php echo ' . $subtree->data . ';?>');\n            } elseif ($subtree instanceof Smarty_Internal_ParseTree_DqContent) {\n                $this->subtrees[ $last_subtree ]->data =\n                    $parser->compiler->appendCode($this->subtrees[ $last_subtree ]->data,\n                                                  '<?php echo \"' . $subtree->data . '\";?>');\n            } else {\n                $this->subtrees[ $last_subtree ]->data =\n                    $parser->compiler->appendCode($this->subtrees[ $last_subtree ]->data, $subtree->data);\n            }\n        } else {\n            $this->subtrees[] = $subtree;\n        }\n        if ($subtree instanceof Smarty_Internal_ParseTree_Tag) {\n            $parser->block_nesting_level = count($parser->compiler->_tag_stack);\n        }\n    }\n\n    /**\n     * Merge subtree buffer content together\n     *\n     * @param \\Smarty_Internal_Templateparser $parser\n     *\n     * @return string compiled template code\n     */\n    public function to_smarty_php(Smarty_Internal_Templateparser $parser)\n    {\n        $code = '';\n        foreach ($this->subtrees as $subtree) {\n            if ($code !== '') {\n                $code .= '.';\n            }\n            if ($subtree instanceof Smarty_Internal_ParseTree_Tag) {\n                $more_php = $subtree->assign_to_var($parser);\n            } else {\n                $more_php = $subtree->to_smarty_php($parser);\n            }\n\n            $code .= $more_php;\n\n            if (!$subtree instanceof Smarty_Internal_ParseTree_DqContent) {\n                $parser->compiler->has_variable_string = true;\n            }\n        }\n\n        return $code;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_parsetree_dqcontent.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Templateparser Parse Tree\n * These are classes to build parse tree  in the template parser\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Thue Kristensen\n * @author     Uwe Tews\n */\n\n/**\n * Raw chars as part of a double quoted string.\n *\n * @package    Smarty\n * @subpackage Compiler\n * @ignore\n */\nclass Smarty_Internal_ParseTree_DqContent extends Smarty_Internal_ParseTree\n{\n    /**\n     * Create parse tree buffer with string content\n     *\n     * @param string $data string section\n     */\n    public function __construct($data)\n    {\n        $this->data = $data;\n    }\n\n    /**\n     * Return content as double quoted string\n     *\n     * @param \\Smarty_Internal_Templateparser $parser\n     *\n     * @return string doubled quoted string\n     */\n    public function to_smarty_php(Smarty_Internal_Templateparser $parser)\n    {\n        return '\"' . $this->data . '\"';\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_parsetree_tag.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Templateparser Parse Tree\n * These are classes to build parse tree in the template parser\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Thue Kristensen\n * @author     Uwe Tews\n */\n\n/**\n * A complete smarty tag.\n *\n * @package    Smarty\n * @subpackage Compiler\n * @ignore\n */\nclass Smarty_Internal_ParseTree_Tag extends Smarty_Internal_ParseTree\n{\n\n    /**\n     * Saved block nesting level\n     *\n     * @var int\n     */\n    public $saved_block_nesting;\n\n    /**\n     * Create parse tree buffer for Smarty tag\n     *\n     * @param \\Smarty_Internal_Templateparser $parser parser object\n     * @param string                          $data   content\n     */\n    public function __construct(Smarty_Internal_Templateparser $parser, $data)\n    {\n        $this->data = $data;\n        $this->saved_block_nesting = $parser->block_nesting_level;\n    }\n\n    /**\n     * Return buffer content\n     *\n     * @param \\Smarty_Internal_Templateparser $parser\n     *\n     * @return string content\n     */\n    public function to_smarty_php(Smarty_Internal_Templateparser $parser)\n    {\n        return $this->data;\n    }\n\n    /**\n     * Return complied code that loads the evaluated output of buffer content into a temporary variable\n     *\n     * @param \\Smarty_Internal_Templateparser $parser\n     *\n     * @return string template code\n     */\n    public function assign_to_var(Smarty_Internal_Templateparser $parser)\n    {\n        $var = $parser->compiler->getNewPrefixVariable();\n        $tmp = $parser->compiler->appendCode('<?php ob_start();?>', $this->data);\n        $tmp = $parser->compiler->appendCode($tmp, \"<?php {$var}=ob_get_clean();?>\");\n        $parser->compiler->prefix_code[] = sprintf('%s', $tmp);\n\n        return $var;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_parsetree_template.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Templateparser Parse Tree\n * These are classes to build parse tree in the template parser\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Thue Kristensen\n * @author     Uwe Tews\n */\n\n/**\n * Template element\n *\n * @package    Smarty\n * @subpackage Compiler\n * @ignore\n */\nclass Smarty_Internal_ParseTree_Template extends Smarty_Internal_ParseTree\n{\n\n    /**\n     * Array of template elements\n     *\n     * @var array\n     */\n    public $subtrees = Array();\n\n    /**\n     * Create root of parse tree for template elements\n     *\n     */\n    public function __construct()\n    {\n    }\n\n    /**\n     * Append buffer to subtree\n     *\n     * @param \\Smarty_Internal_Templateparser $parser\n     * @param Smarty_Internal_ParseTree       $subtree\n     */\n    public function append_subtree(Smarty_Internal_Templateparser $parser, Smarty_Internal_ParseTree $subtree)\n    {\n        if (!empty($subtree->subtrees)) {\n            $this->subtrees = array_merge($this->subtrees, $subtree->subtrees);\n        } else {\n            if ($subtree->data !== '') {\n                $this->subtrees[] = $subtree;\n            }\n        }\n    }\n\n    /**\n     * Append array to subtree\n     *\n     * @param \\Smarty_Internal_Templateparser $parser\n     * @param \\Smarty_Internal_ParseTree[]    $array\n     */\n    public function append_array(Smarty_Internal_Templateparser $parser, $array = array())\n    {\n        if (!empty($array)) {\n            $this->subtrees = array_merge($this->subtrees, (array) $array);\n        }\n    }\n\n    /**\n     * Prepend array to subtree\n     *\n     * @param \\Smarty_Internal_Templateparser $parser\n     * @param \\Smarty_Internal_ParseTree[]    $array\n     */\n    public function prepend_array(Smarty_Internal_Templateparser $parser, $array = array())\n    {\n        if (!empty($array)) {\n            $this->subtrees = array_merge((array) $array, $this->subtrees);\n        }\n    }\n\n    /**\n     * Sanitize and merge subtree buffers together\n     *\n     * @param \\Smarty_Internal_Templateparser $parser\n     *\n     * @return string template code content\n     */\n    public function to_smarty_php(Smarty_Internal_Templateparser $parser)\n    {\n        $code = '';\n        for ($key = 0, $cnt = count($this->subtrees); $key < $cnt; $key ++) {\n            if ($this->subtrees[ $key ] instanceof Smarty_Internal_ParseTree_Text) {\n                $subtree = $this->subtrees[ $key ]->to_smarty_php($parser);\n                while ($key + 1 < $cnt && ($this->subtrees[ $key + 1 ] instanceof Smarty_Internal_ParseTree_Text ||\n                                           $this->subtrees[ $key + 1 ]->data === '')) {\n                    $key ++;\n                    if ($this->subtrees[ $key ]->data === '') {\n                        continue;\n                    }\n                    $subtree .= $this->subtrees[ $key ]->to_smarty_php($parser);\n                }\n                if ($subtree === '') {\n                    continue;\n                }\n                $code .= preg_replace('/((<%)|(%>)|(<\\?php)|(<\\?)|(\\?>)|(<\\/?script))/', \"<?php echo '\\$1'; ?>\\n\",\n                                      $subtree);\n                continue;\n            }\n            if ($this->subtrees[ $key ] instanceof Smarty_Internal_ParseTree_Tag) {\n                $subtree = $this->subtrees[ $key ]->to_smarty_php($parser);\n                while ($key + 1 < $cnt && ($this->subtrees[ $key + 1 ] instanceof Smarty_Internal_ParseTree_Tag ||\n                                           $this->subtrees[ $key + 1 ]->data === '')) {\n                    $key ++;\n                    if ($this->subtrees[ $key ]->data === '') {\n                        continue;\n                    }\n                    $subtree = $parser->compiler->appendCode($subtree, $this->subtrees[ $key ]->to_smarty_php($parser));\n                }\n                if ($subtree === '') {\n                    continue;\n                }\n                $code .= $subtree;\n                continue;\n            }\n            $code .= $this->subtrees[ $key ]->to_smarty_php($parser);\n        }\n        return $code;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_parsetree_text.php",
    "content": "<?php\n\n/**\n * Smarty Internal Plugin Templateparser Parse Tree\n * These are classes to build parse tree in the template parser\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Thue Kristensen\n * @author     Uwe Tews\n *             *\n *             template text\n * @package    Smarty\n * @subpackage Compiler\n * @ignore\n */\nclass Smarty_Internal_ParseTree_Text extends Smarty_Internal_ParseTree\n{\n    /**\n     * Create template text buffer\n     *\n     * @param string $data text\n     */\n    public function __construct($data)\n    {\n        $this->data = $data;\n    }\n\n    /**\n     * Return buffer content\n     *\n     * @param \\Smarty_Internal_Templateparser $parser\n     *\n     * @return string text\n     */\n    public function to_smarty_php(Smarty_Internal_Templateparser $parser)\n    {\n        return $this->data;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_resource_eval.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Resource Eval\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Uwe Tews\n * @author     Rodney Rehm\n */\n\n/**\n * Smarty Internal Plugin Resource Eval\n * Implements the strings as resource for Smarty template\n * {@internal unlike string-resources the compiled state of eval-resources is NOT saved for subsequent access}}\n *\n * @package    Smarty\n * @subpackage TemplateResources\n */\nclass Smarty_Internal_Resource_Eval extends Smarty_Resource_Recompiled\n{\n    /**\n     * populate Source Object with meta data from Resource\n     *\n     * @param  Smarty_Template_Source   $source    source object\n     * @param  Smarty_Internal_Template $_template template object\n     *\n     * @return void\n     */\n    public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)\n    {\n        $source->uid = $source->filepath = sha1($source->name);\n        $source->timestamp = $source->exists = true;\n    }\n\n    /**\n     * Load template's source from $resource_name into current template object\n     *\n     * @uses decode() to decode base64 and urlencoded template_resources\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return string                 template source\n     */\n    public function getContent(Smarty_Template_Source $source)\n    {\n        return $this->decode($source->name);\n    }\n\n    /**\n     * decode base64 and urlencode\n     *\n     * @param  string $string template_resource to decode\n     *\n     * @return string decoded template_resource\n     */\n    protected function decode($string)\n    {\n        // decode if specified\n        if (($pos = strpos($string, ':')) !== false) {\n            if (!strncmp($string, 'base64', 6)) {\n                return base64_decode(substr($string, 7));\n            } elseif (!strncmp($string, 'urlencode', 9)) {\n                return urldecode(substr($string, 10));\n            }\n        }\n\n        return $string;\n    }\n\n    /**\n     * modify resource_name according to resource handlers specifications\n     *\n     * @param  Smarty  $smarty        Smarty instance\n     * @param  string  $resource_name resource_name to make unique\n     * @param  boolean $isConfig      flag for config resource\n     *\n     * @return string unique resource name\n     */\n    public function buildUniqueResourceName(Smarty $smarty, $resource_name, $isConfig = false)\n    {\n        return get_class($this) . '#' . $this->decode($resource_name);\n    }\n\n    /**\n     * Determine basename for compiled filename\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return string                 resource's basename\n     */\n    public function getBasename(Smarty_Template_Source $source)\n    {\n        return '';\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_resource_extends.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Resource Extends\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Uwe Tews\n * @author     Rodney Rehm\n */\n\n/**\n * Smarty Internal Plugin Resource Extends\n * Implements the file system as resource for Smarty which {extend}s a chain of template files templates\n *\n * @package    Smarty\n * @subpackage TemplateResources\n */\nclass Smarty_Internal_Resource_Extends extends Smarty_Resource\n{\n    /**\n     * mbstring.overload flag\n     *\n     * @var int\n     */\n    public $mbstring_overload = 0;\n\n    /**\n     * populate Source Object with meta data from Resource\n     *\n     * @param Smarty_Template_Source   $source    source object\n     * @param Smarty_Internal_Template $_template template object\n     *\n     * @throws SmartyException\n     */\n    public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)\n    {\n        $uid = '';\n        $sources = array();\n        $components = explode('|', $source->name);\n        $smarty = &$source->smarty;\n        $exists = true;\n        foreach ($components as $component) {\n            /* @var \\Smarty_Template_Source $_s */\n            $_s = Smarty_Template_Source::load(null, $smarty, $component);\n            if ($_s->type === 'php') {\n                throw new SmartyException(\"Resource type {$_s->type} cannot be used with the extends resource type\");\n            }\n            $sources[ $_s->uid ] = $_s;\n            $uid .= $_s->filepath;\n            if ($_template) {\n                $exists = $exists && $_s->exists;\n            }\n        }\n        $source->components = $sources;\n        $source->filepath = $_s->filepath;\n        $source->uid = sha1($uid . $source->smarty->_joined_template_dir);\n        $source->exists = $exists;\n        if ($_template) {\n            $source->timestamp = $_s->timestamp;\n        }\n    }\n\n    /**\n     * populate Source Object with timestamp and exists from Resource\n     *\n     * @param Smarty_Template_Source $source source object\n     */\n    public function populateTimestamp(Smarty_Template_Source $source)\n    {\n        $source->exists = true;\n        /* @var \\Smarty_Template_Source $_s */\n        foreach ($source->components as $_s) {\n            $source->exists = $source->exists && $_s->exists;\n        }\n        $source->timestamp = $source->exists ? $_s->getTimeStamp() : false;\n    }\n\n    /**\n     * Load template's source from files into current template object\n     *\n     * @param Smarty_Template_Source $source source object\n     *\n     * @return string template source\n     * @throws SmartyException if source cannot be loaded\n     */\n    public function getContent(Smarty_Template_Source $source)\n    {\n        if (!$source->exists) {\n            throw new SmartyException(\"Unable to load template '{$source->type}:{$source->name}'\");\n        }\n\n        $_components = array_reverse($source->components);\n\n        $_content = '';\n        /* @var \\Smarty_Template_Source $_s */\n        foreach ($_components as $_s) {\n            // read content\n            $_content .= $_s->getContent();\n        }\n        return $_content;\n    }\n\n    /**\n     * Determine basename for compiled filename\n     *\n     * @param Smarty_Template_Source $source source object\n     *\n     * @return string resource's basename\n     */\n    public function getBasename(Smarty_Template_Source $source)\n    {\n        return str_replace(':', '.', basename($source->filepath));\n    }\n\n    /*\n      * Disable timestamp checks for extends resource.\n      * The individual source components will be checked.\n      *\n      * @return bool\n      */\n    /**\n     * @return bool\n     */\n    public function checkTimestamps()\n    {\n        return false;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_resource_file.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Resource File\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Uwe Tews\n * @author     Rodney Rehm\n */\n\n/**\n * Smarty Internal Plugin Resource File\n * Implements the file system as resource for Smarty templates\n *\n * @package    Smarty\n * @subpackage TemplateResources\n */\nclass Smarty_Internal_Resource_File extends Smarty_Resource\n{\n    /**\n     * build template filepath by traversing the template_dir array\n     *\n     * @param Smarty_Template_Source    $source    source object\n     * @param  Smarty_Internal_Template $_template template object\n     *\n     * @return string fully qualified filepath\n     * @throws SmartyException\n     */\n    protected function buildFilepath(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)\n    {\n        $file = $source->name;\n        // absolute file ?\n        if ($file[ 0 ] === '/' || $file[ 1 ] === ':') {\n            $file = $source->smarty->_realpath($file, true);\n            return is_file($file) ? $file : false;\n        }\n        // go relative to a given template?\n        if ($file[ 0 ] === '.' && $_template && $_template->_isSubTpl() &&\n            preg_match('#^[.]{1,2}[\\\\\\/]#', $file)\n        ) {\n            if ($_template->parent->source->type !== 'file' && $_template->parent->source->type !== 'extends' &&\n                !isset($_template->parent->_cache[ 'allow_relative_path' ])\n            ) {\n                throw new SmartyException(\"Template '{$file}' cannot be relative to template of resource type '{$_template->parent->source->type}'\");\n            }\n            // normalize path\n            $path = $source->smarty->_realpath(dirname($_template->parent->source->filepath) . DIRECTORY_SEPARATOR . $file);\n            // files relative to a template only get one shot\n            return is_file($path) ? $path : false;\n        }\n        // normalize DIRECTORY_SEPARATOR\n        if (strpos($file, DIRECTORY_SEPARATOR === '/' ? '\\\\' : '/') !== false) {\n            $file = str_replace(DIRECTORY_SEPARATOR === '/' ? '\\\\' : '/', DIRECTORY_SEPARATOR, $file);\n        }\n\n        $_directories = $source->smarty->getTemplateDir(null, $source->isConfig);\n        // template_dir index?\n        if ($file[ 0 ] === '[' && preg_match('#^\\[([^\\]]+)\\](.+)$#', $file, $fileMatch)) {\n            $file = $fileMatch[ 2 ];\n            $_indices = explode(',', $fileMatch[ 1 ]);\n            $_index_dirs = array();\n            foreach ($_indices as $index) {\n                $index = trim($index);\n                // try string indexes\n                if (isset($_directories[ $index ])) {\n                    $_index_dirs[] = $_directories[ $index ];\n                } elseif (is_numeric($index)) {\n                    // try numeric index\n                    $index = (int) $index;\n                    if (isset($_directories[ $index ])) {\n                        $_index_dirs[] = $_directories[ $index ];\n                    } else {\n                        // try at location index\n                        $keys = array_keys($_directories);\n                        if (isset($_directories[ $keys[ $index ] ])) {\n                            $_index_dirs[] = $_directories[ $keys[ $index ] ];\n                        }\n                    }\n                }\n            }\n            if (empty($_index_dirs)) {\n                // index not found\n                return false;\n            } else {\n                $_directories = $_index_dirs;\n            }\n        }\n\n        // relative file name?\n        foreach ($_directories as $_directory) {\n            $path = $_directory . $file;\n            if (is_file($path)) {\n                return (strpos($path, '.' . DIRECTORY_SEPARATOR) !== false) ? $source->smarty->_realpath($path) : $path;\n            }\n        }\n        if (!isset($_index_dirs)) {\n            // Could be relative to cwd\n            $path = $source->smarty->_realpath($file, true);\n            if (is_file($path)) {\n                return $path;\n            }\n        }\n        // Use include path ?\n        if ($source->smarty->use_include_path) {\n            return $source->smarty->ext->_getIncludePath->getIncludePath($_directories, $file, $source->smarty);\n        }\n        return false;\n    }\n\n    /**\n     * populate Source Object with meta data from Resource\n     *\n     * @param Smarty_Template_Source   $source    source object\n     * @param Smarty_Internal_Template $_template template object\n     *\n     * @throws \\SmartyException\n     */\n    public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)\n    {\n        $source->filepath = $this->buildFilepath($source, $_template);\n\n        if ($source->filepath !== false) {\n            if (isset($source->smarty->security_policy) && is_object($source->smarty->security_policy)) {\n                $source->smarty->security_policy->isTrustedResourceDir($source->filepath, $source->isConfig);\n            }\n            $source->exists = true;\n            $source->uid = sha1($source->filepath . ($source->isConfig ? $source->smarty->_joined_config_dir :\n                                    $source->smarty->_joined_template_dir));\n            $source->timestamp = filemtime($source->filepath);\n        } else {\n            $source->timestamp = $source->exists = false;\n        }\n    }\n\n    /**\n     * populate Source Object with timestamp and exists from Resource\n     *\n     * @param Smarty_Template_Source $source source object\n     */\n    public function populateTimestamp(Smarty_Template_Source $source)\n    {\n        if (!$source->exists) {\n            $source->timestamp = $source->exists = is_file($source->filepath);\n        }\n        if ($source->exists) {\n            $source->timestamp = filemtime($source->filepath);\n        }\n    }\n\n    /**\n     * Load template's source from file into current template object\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return string                 template source\n     * @throws SmartyException        if source cannot be loaded\n     */\n    public function getContent(Smarty_Template_Source $source)\n    {\n        if ($source->exists) {\n            return file_get_contents($source->filepath);\n        }\n        throw new SmartyException('Unable to read ' . ($source->isConfig ? 'config' : 'template') .\n                                  \" {$source->type} '{$source->name}'\");\n    }\n\n    /**\n     * Determine basename for compiled filename\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return string                 resource's basename\n     */\n    public function getBasename(Smarty_Template_Source $source)\n    {\n        return basename($source->filepath);\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_resource_php.php",
    "content": "<?php\n\n/**\n * Smarty Internal Plugin Resource PHP\n * Implements the file system as resource for PHP templates\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Uwe Tews\n * @author     Rodney Rehm\n */\nclass Smarty_Internal_Resource_Php extends Smarty_Internal_Resource_File\n{\n    /**\n     * Flag that it's an uncompiled resource\n     *\n     * @var bool\n     */\n    public $uncompiled = true;\n\n    /**\n     * Resource does implement populateCompiledFilepath() method\n     *\n     * @var bool\n     */\n    public $hasCompiledHandler = true;\n\n    /**\n     * container for short_open_tag directive's value before executing PHP templates\n     *\n     * @var string\n     */\n    protected $short_open_tag;\n\n    /**\n     * Create a new PHP Resource\n     */\n    public function __construct()\n    {\n        $this->short_open_tag = function_exists('ini_get') ? ini_get('short_open_tag') : 1;\n    }\n\n    /**\n     * Load template's source from file into current template object\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return string                 template source\n     * @throws SmartyException        if source cannot be loaded\n     */\n    public function getContent(Smarty_Template_Source $source)\n    {\n        if ($source->exists) {\n            return '';\n        }\n        throw new SmartyException(\"Unable to read template {$source->type} '{$source->name}'\");\n    }\n\n    /**\n     * populate compiled object with compiled filepath\n     *\n     * @param Smarty_Template_Compiled $compiled  compiled object\n     * @param Smarty_Internal_Template $_template template object (is ignored)\n     */\n    public function populateCompiledFilepath(Smarty_Template_Compiled $compiled, Smarty_Internal_Template $_template)\n    {\n        $compiled->filepath = $_template->source->filepath;\n        $compiled->timestamp = $_template->source->timestamp;\n        $compiled->exists = $_template->source->exists;\n        $compiled->file_dependency[ $_template->source->uid ] =\n            array($compiled->filepath,\n                  $compiled->timestamp,\n                  $_template->source->type,);\n    }\n\n    /**\n     * Render and output the template (without using the compiler)\n     *\n     * @param  Smarty_Template_Source   $source    source object\n     * @param  Smarty_Internal_Template $_template template object\n     *\n     * @return void\n     * @throws SmartyException          if template cannot be loaded or allow_php_templates is disabled\n     */\n    public function renderUncompiled(Smarty_Template_Source $source, Smarty_Internal_Template $_template)\n    {\n        if (!$source->smarty->allow_php_templates) {\n            throw new SmartyException('PHP templates are disabled');\n        }\n        if (!$source->exists) {\n            throw new SmartyException(\"Unable to load template '{$source->type}:{$source->name}'\" .\n                                      ($_template->_isSubTpl() ? \" in '{$_template->parent->template_resource}'\" : ''));\n        }\n\n        // prepare variables\n        extract($_template->getTemplateVars());\n\n        // include PHP template with short open tags enabled\n        if (function_exists('ini_set')) {\n            ini_set('short_open_tag', '1');\n        }\n        /** @var Smarty_Internal_Template $_smarty_template\n         * used in included file\n         */\n        $_smarty_template = $_template;\n        include($source->filepath);\n        if (function_exists('ini_set')) {\n            ini_set('short_open_tag', $this->short_open_tag);\n        }\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_resource_registered.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Resource Registered\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Uwe Tews\n * @author     Rodney Rehm\n */\n\n/**\n * Smarty Internal Plugin Resource Registered\n * Implements the registered resource for Smarty template\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @deprecated\n */\nclass Smarty_Internal_Resource_Registered extends Smarty_Resource\n{\n    /**\n     * populate Source Object with meta data from Resource\n     *\n     * @param  Smarty_Template_Source   $source    source object\n     * @param  Smarty_Internal_Template $_template template object\n     *\n     * @return void\n     */\n    public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)\n    {\n        $source->filepath = $source->type . ':' . $source->name;\n        $source->uid = sha1($source->filepath . $source->smarty->_joined_template_dir);\n        $source->timestamp = $this->getTemplateTimestamp($source);\n        $source->exists = !!$source->timestamp;\n    }\n\n    /**\n     * populate Source Object with timestamp and exists from Resource\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return void\n     */\n    public function populateTimestamp(Smarty_Template_Source $source)\n    {\n        $source->timestamp = $this->getTemplateTimestamp($source);\n        $source->exists = !!$source->timestamp;\n    }\n\n    /**\n     * Get timestamp (epoch) the template source was modified\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return integer|boolean        timestamp (epoch) the template was modified, false if resources has no timestamp\n     */\n    public function getTemplateTimestamp(Smarty_Template_Source $source)\n    {\n        // return timestamp\n        $time_stamp = false;\n        call_user_func_array($source->smarty->registered_resources[ $source->type ][ 0 ][ 1 ],\n                             array($source->name, &$time_stamp, $source->smarty));\n\n        return is_numeric($time_stamp) ? (int) $time_stamp : $time_stamp;\n    }\n\n    /**\n     * Load template's source by invoking the registered callback into current template object\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return string                 template source\n     * @throws SmartyException        if source cannot be loaded\n     */\n    public function getContent(Smarty_Template_Source $source)\n    {\n        // return template string\n        $content = null;\n        $t = call_user_func_array($source->smarty->registered_resources[ $source->type ][ 0 ][ 0 ],\n                                  array($source->name, &$content, $source->smarty));\n        if (is_bool($t) && !$t) {\n            throw new SmartyException(\"Unable to read template {$source->type} '{$source->name}'\");\n        }\n\n        return $content;\n    }\n\n    /**\n     * Determine basename for compiled filename\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return string                 resource's basename\n     */\n    public function getBasename(Smarty_Template_Source $source)\n    {\n        return basename($source->name);\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_resource_stream.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Resource Stream\n * Implements the streams as resource for Smarty template\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Uwe Tews\n * @author     Rodney Rehm\n */\n\n/**\n * Smarty Internal Plugin Resource Stream\n * Implements the streams as resource for Smarty template\n *\n * @link       http://php.net/streams\n * @package    Smarty\n * @subpackage TemplateResources\n */\nclass Smarty_Internal_Resource_Stream extends Smarty_Resource_Recompiled\n{\n    /**\n     * populate Source Object with meta data from Resource\n     *\n     * @param Smarty_Template_Source   $source    source object\n     * @param Smarty_Internal_Template $_template template object\n     *\n     * @return void\n     * @throws \\SmartyException\n     */\n    public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)\n    {\n        if (strpos($source->resource, '://') !== false) {\n            $source->filepath = $source->resource;\n        } else {\n            $source->filepath = str_replace(':', '://', $source->resource);\n        }\n        $source->uid = false;\n        $source->content = $this->getContent($source);\n        $source->timestamp = $source->exists = !!$source->content;\n    }\n\n    /**\n     * Load template's source from stream into current template object\n     *\n     * @param Smarty_Template_Source $source source object\n     *\n     * @return string template source\n     * @throws SmartyException if source cannot be loaded\n     */\n    public function getContent(Smarty_Template_Source $source)\n    {\n        $t = '';\n        // the availability of the stream has already been checked in Smarty_Resource::fetch()\n        $fp = fopen($source->filepath, 'r+');\n        if ($fp) {\n            while (!feof($fp) && ($current_line = fgets($fp)) !== false) {\n                $t .= $current_line;\n            }\n            fclose($fp);\n\n            return $t;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * modify resource_name according to resource handlers specifications\n     *\n     * @param Smarty   $smarty        Smarty instance\n     * @param string   $resource_name resource_name to make unique\n     * @param  boolean $isConfig      flag for config resource\n     *\n     * @return string unique resource name\n     */\n    public function buildUniqueResourceName(Smarty $smarty, $resource_name, $isConfig = false)\n    {\n        return get_class($this) . '#' . $resource_name;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_resource_string.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Resource String\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Uwe Tews\n * @author     Rodney Rehm\n */\n\n/**\n * Smarty Internal Plugin Resource String\n * Implements the strings as resource for Smarty template\n * {@internal unlike eval-resources the compiled state of string-resources is saved for subsequent access}}\n *\n * @package    Smarty\n * @subpackage TemplateResources\n */\nclass Smarty_Internal_Resource_String extends Smarty_Resource\n{\n    /**\n     * populate Source Object with meta data from Resource\n     *\n     * @param  Smarty_Template_Source   $source    source object\n     * @param  Smarty_Internal_Template $_template template object\n     *\n     * @return void\n     */\n    public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)\n    {\n        $source->uid = $source->filepath = sha1($source->name . $source->smarty->_joined_template_dir);\n        $source->timestamp = $source->exists = true;\n    }\n\n    /**\n     * Load template's source from $resource_name into current template object\n     *\n     * @uses decode() to decode base64 and urlencoded template_resources\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return string                 template source\n     */\n    public function getContent(Smarty_Template_Source $source)\n    {\n        return $this->decode($source->name);\n    }\n\n    /**\n     * decode base64 and urlencode\n     *\n     * @param  string $string template_resource to decode\n     *\n     * @return string decoded template_resource\n     */\n    protected function decode($string)\n    {\n        // decode if specified\n        if (($pos = strpos($string, ':')) !== false) {\n            if (!strncmp($string, 'base64', 6)) {\n                return base64_decode(substr($string, 7));\n            } elseif (!strncmp($string, 'urlencode', 9)) {\n                return urldecode(substr($string, 10));\n            }\n        }\n\n        return $string;\n    }\n\n    /**\n     * modify resource_name according to resource handlers specifications\n     *\n     * @param  Smarty  $smarty        Smarty instance\n     * @param  string  $resource_name resource_name to make unique\n     * @param  boolean $isConfig      flag for config resource\n     *\n     * @return string unique resource name\n     */\n    public function buildUniqueResourceName(Smarty $smarty, $resource_name, $isConfig = false)\n    {\n        return get_class($this) . '#' . $this->decode($resource_name);\n    }\n\n    /**\n     * Determine basename for compiled filename\n     * Always returns an empty string.\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return string                 resource's basename\n     */\n    public function getBasename(Smarty_Template_Source $source)\n    {\n        return '';\n    }\n\n    /*\n        * Disable timestamp checks for string resource.\n        *\n        * @return bool\n        */\n    /**\n     * @return bool\n     */\n    public function checkTimestamps()\n    {\n        return false;\n    }\n}\n\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_runtime_cachemodify.php",
    "content": "<?php\n\n/**\n * Inline Runtime Methods render, setSourceByUid, setupSubTemplate\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n *\n **/\nclass Smarty_Internal_Runtime_CacheModify\n{\n    /**\n     * check client side cache\n     *\n     * @param \\Smarty_Template_Cached   $cached\n     * @param \\Smarty_Internal_Template $_template\n     * @param  string                   $content\n     *\n     * @throws \\Exception\n     * @throws \\SmartyException\n     */\n    public function cacheModifiedCheck(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template, $content)\n    {\n        $_isCached = $_template->isCached() && !$_template->compiled->has_nocache_code;\n        $_last_modified_date =\n            @substr($_SERVER[ 'HTTP_IF_MODIFIED_SINCE' ], 0, strpos($_SERVER[ 'HTTP_IF_MODIFIED_SINCE' ], 'GMT') + 3);\n        if ($_isCached && $cached->timestamp <= strtotime($_last_modified_date)) {\n            switch (PHP_SAPI) {\n                case 'cgi': // php-cgi < 5.3\n                case 'cgi-fcgi': // php-cgi >= 5.3\n                case 'fpm-fcgi': // php-fpm >= 5.3.3\n                    header('Status: 304 Not Modified');\n                    break;\n\n                case 'cli':\n                    if ( /* ^phpunit */\n                    !empty($_SERVER[ 'SMARTY_PHPUNIT_DISABLE_HEADERS' ]) /* phpunit$ */\n                    ) {\n                        $_SERVER[ 'SMARTY_PHPUNIT_HEADERS' ][] = '304 Not Modified';\n                    }\n                    break;\n\n                default:\n                    if ( /* ^phpunit */\n                    !empty($_SERVER[ 'SMARTY_PHPUNIT_DISABLE_HEADERS' ]) /* phpunit$ */\n                    ) {\n                        $_SERVER[ 'SMARTY_PHPUNIT_HEADERS' ][] = '304 Not Modified';\n                    } else {\n                        header($_SERVER[ 'SERVER_PROTOCOL' ] . ' 304 Not Modified');\n                    }\n                    break;\n            }\n        } else {\n            switch (PHP_SAPI) {\n                case 'cli':\n                    if ( /* ^phpunit */\n                    !empty($_SERVER[ 'SMARTY_PHPUNIT_DISABLE_HEADERS' ]) /* phpunit$ */\n                    ) {\n                        $_SERVER[ 'SMARTY_PHPUNIT_HEADERS' ][] =\n                            'Last-Modified: ' . gmdate('D, d M Y H:i:s', $cached->timestamp) . ' GMT';\n                    }\n                    break;\n                default:\n                    header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $cached->timestamp) . ' GMT');\n                    break;\n            }\n            echo $content;\n        }\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_runtime_cacheresourcefile.php",
    "content": "<?php\n/**\n * Smarty cache resource file clear method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\n/**\n * Smarty Internal Runtime Cache Resource File Class\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n */\nclass Smarty_Internal_Runtime_CacheResourceFile\n{\n    /**\n     * Empty cache for a specific template\n     *\n     * @param Smarty  $smarty\n     * @param string  $resource_name template name\n     * @param string  $cache_id      cache id\n     * @param string  $compile_id    compile id\n     * @param integer $exp_time      expiration time (number of seconds, not timestamp)\n     *\n     * @return integer number of cache files deleted\n     */\n    public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)\n    {\n        $_cache_id = isset($cache_id) ? preg_replace('![^\\w\\|]+!', '_', $cache_id) : null;\n        $_compile_id = isset($compile_id) ? preg_replace('![^\\w]+!', '_', $compile_id) : null;\n        $_dir_sep = $smarty->use_sub_dirs ? '/' : '^';\n        $_compile_id_offset = $smarty->use_sub_dirs ? 3 : 0;\n        $_dir = $smarty->getCacheDir();\n        if ($_dir === '/') { //We should never want to delete this!\n            return 0;\n        }\n        $_dir_length = strlen($_dir);\n        if (isset($_cache_id)) {\n            $_cache_id_parts = explode('|', $_cache_id);\n            $_cache_id_parts_count = count($_cache_id_parts);\n            if ($smarty->use_sub_dirs) {\n                foreach ($_cache_id_parts as $id_part) {\n                    $_dir .= $id_part . DIRECTORY_SEPARATOR;\n                }\n            }\n        }\n        if (isset($resource_name)) {\n            $_save_stat = $smarty->caching;\n            $smarty->caching = Smarty::CACHING_LIFETIME_CURRENT;\n            $tpl = new $smarty->template_class($resource_name, $smarty);\n            $smarty->caching = $_save_stat;\n            // remove from template cache\n            $tpl->source; // have the template registered before unset()\n            if ($tpl->source->exists) {\n                $_resourcename_parts = basename(str_replace('^', '/', $tpl->cached->filepath));\n            } else {\n                return 0;\n            }\n        }\n        $_count = 0;\n        $_time = time();\n        if (file_exists($_dir)) {\n            $_cacheDirs = new RecursiveDirectoryIterator($_dir);\n            $_cache = new RecursiveIteratorIterator($_cacheDirs, RecursiveIteratorIterator::CHILD_FIRST);\n            foreach ($_cache as $_file) {\n                if (substr(basename($_file->getPathname()), 0, 1) === '.') {\n                    continue;\n                }\n                $_filepath = (string)$_file;\n                // directory ?\n                if ($_file->isDir()) {\n                    if (!$_cache->isDot()) {\n                        // delete folder if empty\n                        @rmdir($_file->getPathname());\n                    }\n                } else {\n                    // delete only php files\n                    if (substr($_filepath, -4) !== '.php') {\n                        continue;\n                    }\n                    $_parts = explode($_dir_sep, str_replace('\\\\', '/', substr($_filepath, $_dir_length)));\n                    $_parts_count = count($_parts);\n                    // check name\n                    if (isset($resource_name)) {\n                        if ($_parts[ $_parts_count - 1 ] !== $_resourcename_parts) {\n                            continue;\n                        }\n                    }\n                    // check compile id\n                    if (isset($_compile_id) && (!isset($_parts[ $_parts_count - 2 - $_compile_id_offset ]) ||\n                                                $_parts[ $_parts_count - 2 - $_compile_id_offset ] !== $_compile_id)\n                    ) {\n                        continue;\n                    }\n                    // check cache id\n                    if (isset($_cache_id)) {\n                        // count of cache id parts\n                        $_parts_count = (isset($_compile_id)) ? $_parts_count - 2 - $_compile_id_offset :\n                            $_parts_count - 1 - $_compile_id_offset;\n                        if ($_parts_count < $_cache_id_parts_count) {\n                            continue;\n                        }\n                        for ($i = 0; $i < $_cache_id_parts_count; $i++) {\n                            if ($_parts[ $i ] !== $_cache_id_parts[ $i ]) {\n                                continue 2;\n                            }\n                        }\n                    }\n                    if (is_file($_filepath)) {\n                        // expired ?\n                        if (isset($exp_time)) {\n                            if ($exp_time < 0) {\n                                preg_match('#\\'cache_lifetime\\' =>\\s*(\\d*)#', file_get_contents($_filepath), $match);\n                                if ($_time < (filemtime($_filepath) + $match[ 1 ])) {\n                                    continue;\n                                }\n                            } else {\n                                if ($_time - filemtime($_filepath) < $exp_time) {\n                                    continue;\n                                }\n                            }\n                        }\n                        $_count += @unlink($_filepath) ? 1 : 0;\n                        if (function_exists('opcache_invalidate')\n                            && (!function_exists('ini_get') || strlen(ini_get(\"opcache.restrict_api\")) < 1)\n                        ) {\n                            opcache_invalidate($_filepath, true);\n                        } else if (function_exists('apc_delete_file')) {\n                            apc_delete_file($_filepath);\n                        }\n                    }\n                }\n            }\n        }\n        return $_count;\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_runtime_capture.php",
    "content": "<?php\n\n/**\n * Runtime Extension Capture\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Runtime_Capture\n{\n    /**\n     * Flag that this instance  will not be cached\n     *\n     * @var bool\n     */\n    public $isPrivateExtension = true;\n\n    /**\n     * Stack of capture parameter\n     *\n     * @var array\n     */\n    private $captureStack = array();\n\n    /**\n     * Current open capture sections\n     *\n     * @var int\n     */\n    private $captureCount = 0;\n\n    /**\n     * Count stack\n     *\n     * @var int[]\n     */\n    private $countStack = array();\n\n    /**\n     * Named buffer\n     *\n     * @var string[]\n     */\n    private $namedBuffer = array();\n\n    /**\n     * Flag if callbacks are registered\n     *\n     * @var bool\n     */\n    private $isRegistered = false;\n\n    /**\n     * Open capture section\n     *\n     * @param \\Smarty_Internal_Template $_template\n     * @param string                    $buffer capture name\n     * @param string                    $assign variable name\n     * @param string                    $append variable name\n     */\n    public function open(Smarty_Internal_Template $_template, $buffer, $assign, $append)\n    {\n        if (!$this->isRegistered) {\n            $this->register($_template);\n        }\n        $this->captureStack[] = array($buffer,\n                                      $assign,\n                                      $append);\n        $this->captureCount ++;\n        ob_start();\n    }\n\n    /**\n     * Register callbacks in template class\n     *\n     * @param \\Smarty_Internal_Template $_template\n     */\n    private function register(Smarty_Internal_Template $_template)\n    {\n        $_template->startRenderCallbacks[] = array($this,\n                                                   'startRender');\n        $_template->endRenderCallbacks[] = array($this,\n                                                 'endRender');\n        $this->startRender($_template);\n        $this->isRegistered = true;\n    }\n\n    /**\n     * Start render callback\n     *\n     * @param \\Smarty_Internal_Template $_template\n     */\n    public function startRender(Smarty_Internal_Template $_template)\n    {\n        $this->countStack[] = $this->captureCount;\n        $this->captureCount = 0;\n    }\n\n    /**\n     * Close capture section\n     *\n     * @param \\Smarty_Internal_Template $_template\n     *\n     * @throws \\SmartyException\n     */\n    public function close(Smarty_Internal_Template $_template)\n    {\n        if ($this->captureCount) {\n            list($buffer, $assign, $append) = array_pop($this->captureStack);\n            $this->captureCount --;\n            if (isset($assign)) {\n                $_template->assign($assign, ob_get_contents());\n            }\n            if (isset($append)) {\n                $_template->append($append, ob_get_contents());\n            }\n            $this->namedBuffer[ $buffer ] = ob_get_clean();\n        } else {\n            $this->error($_template);\n        }\n    }\n\n    /**\n     * Error exception on not matching {capture}{/capture}\n     *\n     * @param \\Smarty_Internal_Template $_template\n     *\n     * @throws \\SmartyException\n     */\n    public function error(Smarty_Internal_Template $_template)\n    {\n        throw new SmartyException(\"Not matching {capture}{/capture} in '{$_template->template_resource}'\");\n    }\n\n    /**\n     * Return content of named capture buffer by key or as array\n     *\n     * @param \\Smarty_Internal_Template $_template\n     * @param   string|null             $name\n     *\n     * @return string|string[]|null\n     */\n    public function getBuffer(Smarty_Internal_Template $_template, $name = null)\n    {\n        if (isset($name)) {\n            return isset($this->namedBuffer[ $name ]) ? $this->namedBuffer[ $name ] : null;\n        } else {\n            return $this->namedBuffer;\n        }\n    }\n\n    /**\n     * End render callback\n     *\n     * @param \\Smarty_Internal_Template $_template\n     *\n     * @throws \\SmartyException\n     */\n    public function endRender(Smarty_Internal_Template $_template)\n    {\n        if ($this->captureCount) {\n            $this->error($_template);\n        } else {\n            $this->captureCount = array_pop($this->countStack);\n        }\n    }\n\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_runtime_codeframe.php",
    "content": "<?php\n/**\n * Smarty Internal Extension\n * This file contains the Smarty template extension to create a code frame\n *\n * @package    Smarty\n * @subpackage Template\n * @author     Uwe Tews\n */\n\n/**\n * Class Smarty_Internal_Extension_CodeFrame\n * Create code frame for compiled and cached templates\n */\nclass Smarty_Internal_Runtime_CodeFrame\n{\n    /**\n     * Create code frame for compiled and cached templates\n     *\n     * @param Smarty_Internal_Template              $_template\n     * @param string                                $content   optional template content\n     * @param string                                $functions compiled template function and block code\n     * @param bool                                  $cache     flag for cache file\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler\n     *\n     * @return string\n     */\n    public function create(Smarty_Internal_Template $_template, $content = '', $functions = '', $cache = false,\n                           Smarty_Internal_TemplateCompilerBase $compiler = null)\n    {\n        // build property code\n        $properties[ 'version' ] = Smarty::SMARTY_VERSION;\n        $properties[ 'unifunc' ] = 'content_' . str_replace(array('.', ','), '_', uniqid('', true));\n        if (!$cache) {\n            $properties[ 'has_nocache_code' ] = $_template->compiled->has_nocache_code;\n            $properties[ 'file_dependency' ] = $_template->compiled->file_dependency;\n            $properties[ 'includes' ] = $_template->compiled->includes;\n         } else {\n            $properties[ 'has_nocache_code' ] = $_template->cached->has_nocache_code;\n            $properties[ 'file_dependency' ] = $_template->cached->file_dependency;\n            $properties[ 'cache_lifetime' ] = $_template->cache_lifetime;\n        }\n        $output = \"<?php\\n\";\n        $output .= \"/* Smarty version {$properties[ 'version' ]}, created on \" . strftime(\"%Y-%m-%d %H:%M:%S\") .\n                   \"\\n  from '\" . str_replace('*/','* /',$_template->source->filepath) . \"' */\\n\\n\";\n        $output .= \"/* @var Smarty_Internal_Template \\$_smarty_tpl */\\n\";\n        $dec = \"\\$_smarty_tpl->_decodeProperties(\\$_smarty_tpl, \" . var_export($properties, true) . ',' .\n               ($cache ? 'true' : 'false') . ')';\n        $output .= \"if ({$dec}) {\\n\";\n        $output .= \"function {$properties['unifunc']} (Smarty_Internal_Template \\$_smarty_tpl) {\\n\";\n        if (!$cache && !empty($compiler->tpl_function)) {\n            $output .= '$_smarty_tpl->smarty->ext->_tplFunction->registerTplFunctions($_smarty_tpl, ';\n            $output .= var_export($compiler->tpl_function, true);\n            $output .= \");\\n\";\n        }\n        if ($cache && isset($_template->smarty->ext->_tplFunction)) {\n            $output .= \"\\$_smarty_tpl->smarty->ext->_tplFunction->registerTplFunctions(\\$_smarty_tpl, \" .\n                       var_export($_template->smarty->ext->_tplFunction->getTplFunction($_template), true) . \");\\n\";\n\n        }\n        // include code for plugins\n        if (!$cache) {\n            if (!empty($_template->compiled->required_plugins[ 'compiled' ])) {\n                foreach ($_template->compiled->required_plugins[ 'compiled' ] as $tmp) {\n                    foreach ($tmp as $data) {\n                        $file = addslashes($data[ 'file' ]);\n                        if (is_array($data[ 'function' ])) {\n                            $output .= \"if (!is_callable(array('{$data['function'][0]}','{$data['function'][1]}'))) require_once '{$file}';\\n\";\n                        } else {\n                            $output .= \"if (!is_callable('{$data['function']}')) require_once '{$file}';\\n\";\n                        }\n                    }\n                }\n            }\n            if ($_template->caching && !empty($_template->compiled->required_plugins[ 'nocache' ])) {\n                $_template->compiled->has_nocache_code = true;\n                $output .= \"echo '/*%%SmartyNocache:{$_template->compiled->nocache_hash}%%*/<?php \\$_smarty = \\$_smarty_tpl->smarty; \";\n                foreach ($_template->compiled->required_plugins[ 'nocache' ] as $tmp) {\n                    foreach ($tmp as $data) {\n                        $file = addslashes($data[ 'file' ]);\n                        if (is_array($data[ 'function' ])) {\n                            $output .= addslashes(\"if (!is_callable(array('{$data['function'][0]}','{$data['function'][1]}'))) require_once '{$file}';\\n\");\n                        } else {\n                            $output .= addslashes(\"if (!is_callable('{$data['function']}')) require_once '{$file}';\\n\");\n                        }\n                    }\n                }\n                $output .= \"?>/*/%%SmartyNocache:{$_template->compiled->nocache_hash}%%*/';\\n\";\n            }\n        }\n        $output .= \"?>\";\n        $output .= $content;\n        $output .= \"<?php }\\n?>\";\n        $output .= $functions;\n        $output .= \"<?php }\\n\";\n        // remove unneeded PHP tags\n        return preg_replace(array('/\\s*\\?>[\\n]?<\\?php\\s*/', '/\\?>\\s*$/'), array(\"\\n\", ''), $output);\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_runtime_filterhandler.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Filter Handler\n * Smarty filter handler class\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\n\n/**\n * Class for filter processing\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n */\nclass Smarty_Internal_Runtime_FilterHandler\n{\n    /**\n     * Run filters over content\n     * The filters will be lazy loaded if required\n     * class name format: Smarty_FilterType_FilterName\n     * plugin filename format: filtertype.filtername.php\n     * Smarty2 filter plugins could be used\n     *\n     * @param  string                   $type     the type of filter ('pre','post','output') which shall run\n     * @param  string                   $content  the content which shall be processed by the filters\n     * @param  Smarty_Internal_Template $template template object\n     *\n     * @throws SmartyException\n     * @return string                   the filtered content\n     */\n    public function runFilter($type, $content, Smarty_Internal_Template $template)\n    {\n        // loop over autoload filters of specified type\n        if (!empty($template->smarty->autoload_filters[ $type ])) {\n            foreach ((array) $template->smarty->autoload_filters[ $type ] as $name) {\n                $plugin_name = \"Smarty_{$type}filter_{$name}\";\n                if (function_exists($plugin_name)) {\n                    $callback = $plugin_name;\n                } elseif (class_exists($plugin_name, false) && is_callable(array($plugin_name, 'execute'))) {\n                    $callback = array($plugin_name, 'execute');\n                } elseif ($template->smarty->loadPlugin($plugin_name, false)) {\n                    if (function_exists($plugin_name)) {\n                        // use loaded Smarty2 style plugin\n                        $callback = $plugin_name;\n                    } elseif (class_exists($plugin_name, false) && is_callable(array($plugin_name, 'execute'))) {\n                        // loaded class of filter plugin\n                        $callback = array($plugin_name, 'execute');\n                    } else {\n                        throw new SmartyException(\"Auto load {$type}-filter plugin method '{$plugin_name}::execute' not callable\");\n                    }\n                } else {\n                    // nothing found, throw exception\n                    throw new SmartyException(\"Unable to auto load {$type}-filter plugin '{$plugin_name}'\");\n                }\n                $content = call_user_func($callback, $content, $template);\n            }\n        }\n        // loop over registered filters of specified type\n        if (!empty($template->smarty->registered_filters[ $type ])) {\n            foreach ($template->smarty->registered_filters[ $type ] as $key => $name) {\n                $content = call_user_func($template->smarty->registered_filters[ $type ][ $key ], $content, $template);\n            }\n        }\n        // return filtered output\n        return $content;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_runtime_foreach.php",
    "content": "<?php\n\n/**\n * Foreach Runtime Methods count(), init(), restore()\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n *\n */\nclass Smarty_Internal_Runtime_Foreach\n{\n\n    /**\n     * Stack of saved variables\n     *\n     * @var array\n     */\n    private $stack = array();\n\n    /**\n     * Init foreach loop\n     *  - save item and key variables, named foreach property data if defined\n     *  - init item and key variables, named foreach property data if required\n     *  - count total if required\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     * @param mixed                     $from       values to loop over\n     * @param string                    $item       variable name\n     * @param bool                      $needTotal  flag if we need to count values\n     * @param null|string               $key        variable name\n     * @param null|string               $name       of named foreach\n     * @param array                     $properties of named foreach\n     *\n     * @return mixed $from\n     */\n    public function init(Smarty_Internal_Template $tpl, $from, $item, $needTotal = false, $key = null, $name = null,\n                         $properties = array())\n    {\n        $saveVars = array();\n        $total = null;\n        if (!is_array($from)) {\n            if (is_object($from)) {\n                $total = $this->count($from);\n            } else {\n                settype($from, 'array');\n            }\n        }\n        if (!isset($total)) {\n            $total = empty($from) ? 0 : (($needTotal || isset($properties[ 'total' ])) ? count($from) : 1);\n        }\n        if (isset($tpl->tpl_vars[ $item ])) {\n            $saveVars[ 'item' ] = array($item,\n                                        $tpl->tpl_vars[ $item ]);\n        }\n        $tpl->tpl_vars[ $item ] = new Smarty_Variable(null, $tpl->isRenderingCache);\n        if ($total === 0) {\n            $from = null;\n        } else {\n            if ($key) {\n                if (isset($tpl->tpl_vars[ $key ])) {\n                    $saveVars[ 'key' ] = array($key,\n                                               $tpl->tpl_vars[ $key ]);\n                }\n                $tpl->tpl_vars[ $key ] = new Smarty_Variable(null, $tpl->isRenderingCache);\n            }\n        }\n        if ($needTotal) {\n            $tpl->tpl_vars[ $item ]->total = $total;\n        }\n        if ($name) {\n            $namedVar = \"__smarty_foreach_{$name}\";\n            if (isset($tpl->tpl_vars[ $namedVar ])) {\n                $saveVars[ 'named' ] = array($namedVar,\n                                             $tpl->tpl_vars[ $namedVar ]);\n            }\n            $namedProp = array();\n            if (isset($properties[ 'total' ])) {\n                $namedProp[ 'total' ] = $total;\n            }\n            if (isset($properties[ 'iteration' ])) {\n                $namedProp[ 'iteration' ] = 0;\n            }\n            if (isset($properties[ 'index' ])) {\n                $namedProp[ 'index' ] = - 1;\n            }\n            if (isset($properties[ 'show' ])) {\n                $namedProp[ 'show' ] = ($total > 0);\n            }\n            $tpl->tpl_vars[ $namedVar ] = new Smarty_Variable($namedProp);\n        }\n        $this->stack[] = $saveVars;\n        return $from;\n    }\n\n    /**\n     *\n     * [util function] counts an array, arrayAccess/traversable or PDOStatement object\n     *\n     * @param  mixed $value\n     *\n     * @return int   the count for arrays and objects that implement countable, 1 for other objects that don't, and 0\n     *               for empty elements\n     */\n    public function count($value)\n    {\n        if ($value instanceof IteratorAggregate) {\n            // Note: getIterator() returns a Traversable, not an Iterator\n            // thus rewind() and valid() methods may not be present\n            return iterator_count($value->getIterator());\n        } elseif ($value instanceof Iterator) {\n            return $value instanceof Generator ? 1 : iterator_count($value);\n        } elseif ($value instanceof Countable) {\n            return count($value);\n        } elseif ($value instanceof PDOStatement) {\n            return $value->rowCount();\n        } elseif ($value instanceof Traversable) {\n            return iterator_count($value);\n        }\n        return count((array) $value);\n    }\n\n    /**\n     * Restore saved variables\n     *\n     * will be called by {break n} or {continue n} for the required number of levels\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     * @param int                       $levels number of levels\n     */\n    public function restore(Smarty_Internal_Template $tpl, $levels = 1)\n    {\n        while ($levels) {\n            $saveVars = array_pop($this->stack);\n            if (!empty($saveVars)) {\n                if (isset($saveVars[ 'item' ])) {\n                    $item = &$saveVars[ 'item' ];\n                    $tpl->tpl_vars[ $item[ 0 ] ]->value = $item[ 1 ]->value;\n                }\n                if (isset($saveVars[ 'key' ])) {\n                    $tpl->tpl_vars[ $saveVars[ 'key' ][ 0 ] ] = $saveVars[ 'key' ][ 1 ];\n                }\n                if (isset($saveVars[ 'named' ])) {\n                    $tpl->tpl_vars[ $saveVars[ 'named' ][ 0 ] ] = $saveVars[ 'named' ][ 1 ];\n                }\n            }\n            $levels --;\n        }\n    }\n\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_runtime_getincludepath.php",
    "content": "<?php\n/**\n * Smarty read include path plugin\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Monte Ohrt\n */\n\n/**\n * Smarty Internal Read Include Path Class\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n */\nclass Smarty_Internal_Runtime_GetIncludePath\n{\n    /**\n     * include path cache\n     *\n     * @var string\n     */\n    public $_include_path = '';\n    /**\n     * include path directory cache\n     *\n     * @var array\n     */\n    public $_include_dirs = array();\n    /**\n     * include path directory cache\n     *\n     * @var array\n     */\n    public $_user_dirs = array();\n    /**\n     * stream cache\n     *\n     * @var string[][]\n     */\n    public $isFile = array();\n    /**\n     * stream cache\n     *\n     * @var string[]\n     */\n    public $isPath = array();\n    /**\n     * stream cache\n     *\n     * @var int[]\n     */\n    public $number = array();\n    /**\n     * status cache\n     *\n     * @var bool\n     */\n    public $_has_stream_include = null;\n    /**\n     * Number for array index\n     *\n     * @var int\n     */\n    public $counter = 0;\n\n    /**\n     * Check if include path was updated\n     *\n     * @param \\Smarty $smarty\n     *\n     * @return bool\n     */\n    public function isNewIncludePath(Smarty $smarty)\n    {\n        $_i_path = get_include_path();\n        if ($this->_include_path !== $_i_path) {\n            $this->_include_dirs = array();\n            $this->_include_path = $_i_path;\n            $_dirs = (array)explode(PATH_SEPARATOR, $_i_path);\n            foreach ($_dirs as $_path) {\n                if (is_dir($_path)) {\n                    $this->_include_dirs[] = $smarty->_realpath($_path . DIRECTORY_SEPARATOR, true);\n                }\n            }\n            return true;\n        }\n        return false;\n    }\n\n    /**\n     * return array with include path directories\n     *\n     * @param \\Smarty $smarty\n     *\n     * @return array\n     */\n    public function getIncludePathDirs(Smarty $smarty)\n    {\n        $this->isNewIncludePath($smarty);\n        return $this->_include_dirs;\n    }\n\n    /**\n     * Return full file path from PHP include_path\n     *\n     * @param  string[] $dirs\n     * @param  string   $file\n     * @param \\Smarty   $smarty\n     *\n     * @return bool|string full filepath or false\n     *\n     */\n    public function getIncludePath($dirs, $file, Smarty $smarty)\n    {\n        //if (!(isset($this->_has_stream_include) ? $this->_has_stream_include : $this->_has_stream_include = false)) {\n        if (!(isset($this->_has_stream_include) ? $this->_has_stream_include :\n            $this->_has_stream_include = function_exists('stream_resolve_include_path'))\n        ) {\n            $this->isNewIncludePath($smarty);\n        }\n        // try PHP include_path\n        foreach ($dirs as $dir) {\n            $dir_n = isset($this->number[ $dir ]) ? $this->number[ $dir ] : $this->number[ $dir ] = $this->counter++;\n            if (isset($this->isFile[ $dir_n ][ $file ])) {\n                if ($this->isFile[ $dir_n ][ $file ]) {\n                    return $this->isFile[ $dir_n ][ $file ];\n                } else {\n                    continue;\n                }\n            }\n            if (isset($this->_user_dirs[ $dir_n ])) {\n                if (false === $this->_user_dirs[ $dir_n ]) {\n                    continue;\n                } else {\n                    $dir = $this->_user_dirs[ $dir_n ];\n                }\n            } else {\n                if ($dir[ 0 ] === '/' || $dir[ 1 ] === ':') {\n                    $dir = str_ireplace(getcwd(), '.', $dir);\n                    if ($dir[ 0 ] === '/' || $dir[ 1 ] === ':') {\n                        $this->_user_dirs[ $dir_n ] = false;\n                        continue;\n                    }\n                }\n                $dir = substr($dir, 2);\n                $this->_user_dirs[ $dir_n ] = $dir;\n            }\n            if ($this->_has_stream_include) {\n                $path = stream_resolve_include_path($dir . (isset($file) ? $file : ''));\n                if ($path) {\n                    return $this->isFile[ $dir_n ][ $file ] = $path;\n                }\n            } else {\n                foreach ($this->_include_dirs as $key => $_i_path) {\n                    $path = isset($this->isPath[ $key ][ $dir_n ]) ? $this->isPath[ $key ][ $dir_n ] :\n                        $this->isPath[ $key ][ $dir_n ] = is_dir($_dir_path = $_i_path . $dir) ? $_dir_path : false;\n                    if ($path === false) {\n                        continue;\n                    }\n                    if (isset($file)) {\n                        $_file = $this->isFile[ $dir_n ][ $file ] = (is_file($path . $file)) ? $path . $file : false;\n                        if ($_file) {\n                            return $_file;\n                        }\n                    } else {\n                        // no file was given return directory path\n                        return $path;\n                    }\n                }\n            }\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_runtime_inheritance.php",
    "content": "<?php\n\n/**\n * Inheritance Runtime Methods processBlock, endChild, init\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n *\n **/\nclass Smarty_Internal_Runtime_Inheritance\n{\n\n    /**\n     * State machine\n     * - 0 idle next extends will create a new inheritance tree\n     * - 1 processing child template\n     * - 2 wait for next inheritance template\n     * - 3 assume parent template, if child will loaded goto state 1\n     *     a call to a sub template resets the state to 0\n     *\n     * @var int\n     */\n    public $state = 0;\n\n    /**\n     * Array of root child {block} objects\n     *\n     * @var Smarty_Internal_Block[]\n     */\n    public $childRoot = array();\n\n    /**\n     * inheritance template nesting level\n     *\n     * @var int\n     */\n    public $inheritanceLevel = 0;\n\n    /**\n     * inheritance template index\n     *\n     * @var int\n     */\n    public $tplIndex = -1;\n\n    /**\n     * Array of template source objects\n     * - key template index\n     *\n     * @var Smarty_Template_Source[]\n     */\n    public $sources = array();\n\n    /**\n     * Stack of source objects while executing block code\n     *\n     * @var Smarty_Template_Source[]\n     */\n    public $sourceStack = array();\n\n    /**\n     * Initialize inheritance\n     *\n     * @param \\Smarty_Internal_Template $tpl        template object of caller\n     * @param bool                      $initChild  if true init for child template\n     * @param array                     $blockNames outer level block name\n     *\n     */\n    public function init(Smarty_Internal_Template $tpl, $initChild, $blockNames = array())\n    {\n        // if called while executing parent template it must be a sub-template with new inheritance root\n        if ($initChild && $this->state === 3 && (strpos($tpl->template_resource, 'extendsall') === false)) {\n            $tpl->inheritance = new Smarty_Internal_Runtime_Inheritance();\n            $tpl->inheritance->init($tpl, $initChild, $blockNames);\n            return;\n        }\n        $this->tplIndex++;\n        $this->sources[ $this->tplIndex ] = $tpl->source;\n\n        // start of child sub template(s)\n        if ($initChild) {\n            $this->state = 1;\n            if (!$this->inheritanceLevel) {\n                //grab any output of child templates\n                ob_start();\n            }\n            $this->inheritanceLevel++;\n            //           $tpl->startRenderCallbacks[ 'inheritance' ] = array($this, 'subTemplateStart');\n            //           $tpl->endRenderCallbacks[ 'inheritance' ] = array($this, 'subTemplateEnd');\n        }\n        // if state was waiting for parent change state to parent\n        if ($this->state === 2) {\n            $this->state = 3;\n        }\n    }\n\n    /**\n     * End of child template(s)\n     * - if outer level is reached flush output buffer and switch to wait for parent template state\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     * @param null|string               $template optional name of inheritance parent template\n     * @param null|string               $uid      uid of inline template\n     * @param null|string               $func     function call name of inline template\n     *\n     * @throws \\Exception\n     * @throws \\SmartyException\n     */\n    public function endChild(Smarty_Internal_Template $tpl, $template = null, $uid = null, $func = null)\n    {\n        $this->inheritanceLevel--;\n        if (!$this->inheritanceLevel) {\n            ob_end_clean();\n            $this->state = 2;\n        }\n        if (isset($template) && (($tpl->parent->_isTplObj() && $tpl->parent->source->type !== 'extends') ||\n                                 $tpl->smarty->extends_recursion)) {\n            $tpl->_subTemplateRender($template,\n                                     $tpl->cache_id,\n                                     $tpl->compile_id,\n                                     $tpl->caching ? 9999 : 0,\n                                     $tpl->cache_lifetime,\n                                     array(),\n                                     2,\n                                     false,\n                                     $uid,\n                                     $func);\n        }\n    }\n\n    /**\n     * Smarty_Internal_Block constructor.\n     * - if outer level {block} of child template ($state === 1) save it as child root block\n     * - otherwise process inheritance and render\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     * @param                           $className\n     * @param string                    $name\n     * @param int|null                  $tplIndex index of outer level {block} if nested\n     *\n     * @throws \\SmartyException\n     */\n    public function instanceBlock(Smarty_Internal_Template $tpl, $className, $name, $tplIndex = null)\n    {\n        $block = new $className($name, isset($tplIndex) ? $tplIndex : $this->tplIndex);\n        if (isset($this->childRoot[ $name ])) {\n            $block->child = $this->childRoot[ $name ];\n        }\n        if ($this->state === 1) {\n            $this->childRoot[ $name ] = $block;\n            return;\n        }\n        // make sure we got child block of child template of current block\n        while ($block->child && $block->tplIndex <= $block->child->tplIndex) {\n            $block->child = $block->child->child;\n        }\n        $this->process($tpl, $block);\n    }\n\n    /**\n     * Goto child block or render this\n     *\n     * @param \\Smarty_Internal_Template   $tpl\n     * @param \\Smarty_Internal_Block      $block\n     * @param \\Smarty_Internal_Block|null $parent\n     *\n     * @throws \\SmartyException\n     */\n    public function process(Smarty_Internal_Template $tpl,\n                            Smarty_Internal_Block $block,\n                            Smarty_Internal_Block $parent = null)\n    {\n        if ($block->hide && !isset($block->child)) {\n            return;\n        }\n        if (isset($block->child) && $block->child->hide && !isset($block->child->child)) {\n            $block->child = null;\n        }\n        $block->parent = $parent;\n        if ($block->append && !$block->prepend && isset($parent)) {\n            $this->callParent($tpl, $block);\n        }\n        if ($block->callsChild || !isset($block->child) || ($block->child->hide && !isset($block->child->child))) {\n            $this->callBlock($block, $tpl);\n        } else {\n            $this->process($tpl, $block->child, $block);\n        }\n        if ($block->prepend && isset($parent)) {\n            $this->callParent($tpl, $block);\n            if ($block->append) {\n                if ($block->callsChild || !isset($block->child) ||\n                    ($block->child->hide && !isset($block->child->child))\n                ) {\n                    $this->callBlock($block, $tpl);\n                } else {\n                    $this->process($tpl, $block->child, $block);\n                }\n            }\n        }\n        $block->parent = null;\n    }\n\n    /**\n     * Render child on $smarty.block.child\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     * @param \\Smarty_Internal_Block    $block\n     * @param boolean                   $returnContent flag if content shall be returned\n     *\n     * @return null|string null or block content dependent on $returnContent\n     * @throws \\SmartyException\n     */\n    public function callChild(Smarty_Internal_Template $tpl, Smarty_Internal_Block $block, $returnContent = false)\n    {\n        if ($returnContent) {\n            ob_start();\n        }\n        if (isset($block->child)) {\n            $this->process($tpl, $block->child, $block);\n        }\n        if ($returnContent) {\n            return ob_get_clean();\n        }\n        return;\n    }\n\n    /**\n     * Render parent block on $smarty.block.parent or {block append/prepend}\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     * @param \\Smarty_Internal_Block    $block\n     * @param null|string               $name\n     * @param boolean                   $returnContent flag if content shall be returned\n     *\n     * @return null|string  null or block content dependent on $returnContent\n     * @throws \\SmartyException\n     */\n    public function callParent(Smarty_Internal_Template $tpl,\n                               Smarty_Internal_Block $block,\n                               $name = null,\n                               $returnContent = false)\n    {\n        if ($returnContent) {\n            ob_start();\n        }\n        if (isset($name)) {\n            $block = $block->parent;\n            while (isset($block)) {\n                if (isset($block->subBlocks[ $name ])) {\n                } else {\n                    $block = $block->parent;\n                }\n            }\n            return;\n        } else if (isset($block->parent)) {\n            $this->callBlock($block->parent, $tpl);\n        } else {\n            throw new SmartyException(\"inheritance: illegal '\\$smarty.block.parent' or {block append/prepend} used in parent template '{$tpl->inheritance->sources[$block->tplIndex]->filepath}' block '{$block->name}'\");\n        }\n        if ($returnContent) {\n            return ob_get_clean();\n        }\n        return;\n    }\n\n    /**\n     * redender block\n     *\n     * @param \\Smarty_Internal_Block    $block\n     * @param \\Smarty_Internal_Template $tpl\n     */\n    public function callBlock(Smarty_Internal_Block $block, Smarty_Internal_Template $tpl)\n    {\n        $this->sourceStack[] = $tpl->source;\n        $tpl->source = $this->sources[ $block->tplIndex ];\n        $block->callBlock($tpl);\n        $tpl->source = array_pop($this->sourceStack);\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_runtime_make_nocache.php",
    "content": "<?php\n\n/**\n * {make_nocache} Runtime Methods save(), store()\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n *\n */\nclass Smarty_Internal_Runtime_Make_Nocache\n{\n\n    /**\n     * Save current variable value while rendering compiled template and inject nocache code to\n     * assign variable value in cahed template\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     * @param string                    $var variable name\n     *\n     * @throws \\SmartyException\n     */\n    public function save(Smarty_Internal_Template $tpl, $var)\n    {\n        if (isset($tpl->tpl_vars[ $var ])) {\n            $export =\n                preg_replace('/^Smarty_Variable::__set_state[(]|[)]$/', '', var_export($tpl->tpl_vars[ $var ], true));\n            if (preg_match('/(\\w+)::__set_state/', $export, $match)) {\n                throw new SmartyException(\"{make_nocache \\${$var}} in template '{$tpl->source->name}': variable does contain object '{$match[1]}' not implementing method '__set_state'\");\n            }\n            echo \"/*%%SmartyNocache:{$tpl->compiled->nocache_hash}%%*/<?php \" .\n                 addcslashes(\"\\$_smarty_tpl->smarty->ext->_make_nocache->store(\\$_smarty_tpl, '{$var}', \", '\\\\') .\n                 $export . \");?>\\n/*/%%SmartyNocache:{$tpl->compiled->nocache_hash}%%*/\";\n        }\n    }\n\n    /**\n     * Store variable value saved while rendering compiled template in cached template context\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     * @param  string                   $var variable name\n     * @param  array                    $properties\n     */\n    public function store(Smarty_Internal_Template $tpl, $var, $properties)\n    {\n        // do not overwrite existing nocache variables\n        if (!isset($tpl->tpl_vars[ $var ]) || !$tpl->tpl_vars[ $var ]->nocache) {\n            $newVar = new Smarty_Variable();\n            unset($properties[ 'nocache' ]);\n            foreach ($properties as $k => $v) {\n                $newVar->$k = $v;\n            }\n            $tpl->tpl_vars[ $var ] = $newVar;\n        }\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_runtime_tplfunction.php",
    "content": "<?php\n\n/**\n * TplFunction Runtime Methods callTemplateFunction\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n *\n **/\nclass Smarty_Internal_Runtime_TplFunction\n{\n    /**\n     * Call template function\n     *\n     * @param \\Smarty_Internal_Template $tpl     template object\n     * @param string                    $name    template function name\n     * @param array                     $params  parameter array\n     * @param bool                      $nocache true if called nocache\n     *\n     * @throws \\SmartyException\n     */\n    public function callTemplateFunction(Smarty_Internal_Template $tpl, $name, $params, $nocache)\n    {\n        $funcParam = isset($tpl->tplFunctions[ $name ]) ? $tpl->tplFunctions[ $name ] :\n            (isset($tpl->smarty->tplFunctions[ $name ]) ? $tpl->smarty->tplFunctions[ $name ] : null);\n        if (isset($funcParam)) {\n            if (!$tpl->caching || ($tpl->caching && $nocache)) {\n                $function = $funcParam[ 'call_name' ];\n            } else {\n                if (isset($funcParam[ 'call_name_caching' ])) {\n                    $function = $funcParam[ 'call_name_caching' ];\n                } else {\n                    $function = $funcParam[ 'call_name' ];\n                }\n            }\n            if (function_exists($function)) {\n                $this->saveTemplateVariables($tpl, $name);\n                $function ($tpl, $params);\n                $this->restoreTemplateVariables($tpl, $name);\n                return;\n            }\n            // try to load template function dynamically\n            if ($this->addTplFuncToCache($tpl, $name, $function)) {\n                $this->saveTemplateVariables($tpl, $name);\n                $function ($tpl, $params);\n                $this->restoreTemplateVariables($tpl, $name);\n                return;\n            }\n        }\n        throw new SmartyException(\"Unable to find template function '{$name}'\");\n    }\n\n    /**\n     * Register template functions defined by template\n     *\n     * @param \\Smarty|\\Smarty_Internal_Template|\\Smarty_Internal_TemplateBase $obj\n     * @param  array                                                          $tplFunctions source information array of template functions defined in template\n     * @param bool                                                            $override     if true replace existing functions with same name\n     */\n    public function registerTplFunctions(Smarty_Internal_TemplateBase $obj, $tplFunctions, $override = true)\n    {\n        $obj->tplFunctions =\n            $override ? array_merge($obj->tplFunctions, $tplFunctions) : array_merge($tplFunctions, $obj->tplFunctions);\n        // make sure that the template functions are known in parent templates\n        if ($obj->_isSubTpl()) {\n            $obj->smarty->ext->_tplFunction->registerTplFunctions($obj->parent, $tplFunctions, false);\n        } else {\n            $obj->smarty->tplFunctions = $override ? array_merge($obj->smarty->tplFunctions, $tplFunctions) :\n                array_merge($tplFunctions, $obj->smarty->tplFunctions);\n        }\n    }\n\n    /**\n     * Return source parameter array for single or all template functions\n     *\n     * @param \\Smarty_Internal_Template $tpl  template object\n     * @param null|string               $name template function name\n     *\n     * @return array|bool|mixed\n     */\n    public function getTplFunction(Smarty_Internal_Template $tpl, $name = null)\n    {\n        if (isset($name)) {\n            return isset($tpl->tplFunctions[ $name ]) ? $tpl->tplFunctions[ $name ] :\n                (isset($tpl->smarty->tplFunctions[ $name ]) ? $tpl->smarty->tplFunctions[ $name ] : false);\n        } else {\n            return empty($tpl->tplFunctions) ? $tpl->smarty->tplFunctions : $tpl->tplFunctions;\n        }\n    }\n\n    /**\n     *\n     * Add template function to cache file for nocache calls\n     *\n     * @param Smarty_Internal_Template $tpl\n     * @param string                   $_name     template function name\n     * @param string                   $_function PHP function name\n     *\n     * @return bool\n     */\n    public function addTplFuncToCache(Smarty_Internal_Template $tpl, $_name, $_function)\n    {\n        $funcParam = $tpl->tplFunctions[ $_name ];\n        if (is_file($funcParam[ 'compiled_filepath' ])) {\n            // read compiled file\n            $code = file_get_contents($funcParam[ 'compiled_filepath' ]);\n            // grab template function\n            if (preg_match(\"/\\/\\* {$_function} \\*\\/([\\S\\s]*?)\\/\\*\\/ {$_function} \\*\\//\", $code, $match)) {\n                // grab source info from file dependency\n                preg_match(\"/\\s*'{$funcParam['uid']}'([\\S\\s]*?)\\),/\", $code, $match1);\n                unset($code);\n                // make PHP function known\n                eval($match[ 0 ]);\n                if (function_exists($_function)) {\n                    // search cache file template\n                    $tplPtr = $tpl;\n                    while (!isset($tplPtr->cached) && isset($tplPtr->parent)) {\n                        $tplPtr = $tplPtr->parent;\n                    }\n                    // add template function code to cache file\n                    if (isset($tplPtr->cached)) {\n                        /* @var Smarty_Template_Cached $cache */\n                        $cache = $tplPtr->cached;\n                        $content = $cache->read($tplPtr);\n                        if ($content) {\n                            // check if we must update file dependency\n                            if (!preg_match(\"/'{$funcParam['uid']}'(.*?)'nocache_hash'/\", $content, $match2)) {\n                                $content = preg_replace(\"/('file_dependency'(.*?)\\()/\", \"\\\\1{$match1[0]}\", $content);\n                            }\n                            $tplPtr->smarty->ext->_updateCache->write($cache, $tplPtr,\n                                                                      preg_replace('/\\s*\\?>\\s*$/', \"\\n\", $content) .\n                                                                      \"\\n\" . preg_replace(array('/^\\s*<\\?php\\s+/',\n                                                                                                '/\\s*\\?>\\s*$/',), \"\\n\",\n                                                                                          $match[ 0 ]));\n                        }\n                    }\n                    return true;\n                }\n            }\n        }\n        return false;\n    }\n\n    /**\n     * Save current template variables on stack\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     * @param  string                   $name stack name\n     */\n    public function saveTemplateVariables(Smarty_Internal_Template $tpl, $name)\n    {\n        $tpl->_cache[ 'varStack' ][] =\n            array('tpl' => $tpl->tpl_vars, 'config' => $tpl->config_vars, 'name' => \"_tplFunction_{$name}\");\n    }\n\n    /**\n     * Restore saved variables into template objects\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     * @param  string                   $name stack name\n     */\n    public function restoreTemplateVariables(Smarty_Internal_Template $tpl, $name)\n    {\n        if (isset($tpl->_cache[ 'varStack' ])) {\n            $vars = array_pop($tpl->_cache[ 'varStack' ]);\n            $tpl->tpl_vars = $vars[ 'tpl' ];\n            $tpl->config_vars = $vars[ 'config' ];\n        }\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_runtime_updatecache.php",
    "content": "<?php\n\n/**\n * Inline Runtime Methods render, setSourceByUid, setupSubTemplate\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n *\n **/\nclass Smarty_Internal_Runtime_UpdateCache\n{\n    /**\n     * check client side cache\n     *\n     * @param \\Smarty_Template_Cached  $cached\n     * @param Smarty_Internal_Template $_template\n     * @param  string                  $content\n     */\n    public function cacheModifiedCheck(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template, $content)\n    {\n    }\n\n    /**\n     * Sanitize content and write it to cache resource\n     *\n     * @param \\Smarty_Template_Cached  $cached\n     * @param Smarty_Internal_Template $_template\n     * @param bool                     $no_output_filter\n     *\n     * @throws \\SmartyException\n     */\n    public function removeNoCacheHash(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template,\n                                      $no_output_filter)\n    {\n        $content = ob_get_clean();\n        unset($cached->hashes[ $_template->compiled->nocache_hash ]);\n        if (!empty($cached->hashes)) {\n            $hash_array = array();\n            foreach ($cached->hashes as $hash => $foo) {\n                $hash_array[] = \"/{$hash}/\";\n            }\n            $content = preg_replace($hash_array, $_template->compiled->nocache_hash, $content);\n        }\n        $_template->cached->has_nocache_code = false;\n        // get text between non-cached items\n        $cache_split =\n            preg_split(\"!/\\*%%SmartyNocache:{$_template->compiled->nocache_hash}%%\\*\\/(.+?)/\\*/%%SmartyNocache:{$_template->compiled->nocache_hash}%%\\*/!s\",\n                       $content);\n        // get non-cached items\n        preg_match_all(\"!/\\*%%SmartyNocache:{$_template->compiled->nocache_hash}%%\\*\\/(.+?)/\\*/%%SmartyNocache:{$_template->compiled->nocache_hash}%%\\*/!s\",\n                       $content, $cache_parts);\n        $content = '';\n        // loop over items, stitch back together\n        foreach ($cache_split as $curr_idx => $curr_split) {\n            // escape PHP tags in template content\n            $content .= preg_replace('/(<%|%>|<\\?php|<\\?|\\?>|<script\\s+language\\s*=\\s*[\\\"\\']?\\s*php\\s*[\\\"\\']?\\s*>)/',\n                                     \"<?php echo '\\$1'; ?>\\n\", $curr_split);\n            if (isset($cache_parts[ 0 ][ $curr_idx ])) {\n                $_template->cached->has_nocache_code = true;\n                $content .= $cache_parts[ 1 ][ $curr_idx ];\n            }\n        }\n        if (!$no_output_filter && !$_template->cached->has_nocache_code &&\n            (isset($_template->smarty->autoload_filters[ 'output' ]) ||\n             isset($_template->smarty->registered_filters[ 'output' ]))\n        ) {\n            $content = $_template->smarty->ext->_filterHandler->runFilter('output', $content, $_template);\n        }\n        // write cache file content\n        $this->writeCachedContent($cached, $_template, $content);\n    }\n\n    /**\n     * Cache was invalid , so render from compiled and write to cache\n     *\n     * @param \\Smarty_Template_Cached   $cached\n     * @param \\Smarty_Internal_Template $_template\n     * @param                           $no_output_filter\n     *\n     * @throws \\Exception\n     */\n    public function updateCache(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template, $no_output_filter)\n    {\n        ob_start();\n        if (!isset($_template->compiled)) {\n            $_template->loadCompiled();\n        }\n        $_template->compiled->render($_template);\n        if ($_template->smarty->debugging) {\n            $_template->smarty->_debug->start_cache($_template);\n        }\n        $this->removeNoCacheHash($cached, $_template, $no_output_filter);\n        $compile_check = (int)$_template->compile_check;\n        $_template->compile_check = Smarty::COMPILECHECK_OFF;\n        if ($_template->_isSubTpl()) {\n            $_template->compiled->unifunc = $_template->parent->compiled->unifunc;\n        }\n        if (!$_template->cached->processed) {\n            $_template->cached->process($_template, true);\n        }\n        $_template->compile_check = $compile_check;\n        $cached->getRenderedTemplateCode($_template);\n        if ($_template->smarty->debugging) {\n            $_template->smarty->_debug->end_cache($_template);\n        }\n    }\n\n    /**\n     * Writes the content to cache resource\n     *\n     * @param \\Smarty_Template_Cached  $cached\n     * @param Smarty_Internal_Template $_template\n     * @param string                   $content\n     *\n     * @return bool\n     */\n    public function writeCachedContent(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template, $content)\n    {\n        if ($_template->source->handler->recompiled || !$_template->caching\n        ) {\n            // don't write cache file\n            return false;\n        }\n        $content = $_template->smarty->ext->_codeFrame->create($_template, $content, '', true);\n        return $this->write($cached, $_template, $content);\n    }\n\n    /**\n     * Write this cache object to handler\n     *\n     * @param \\Smarty_Template_Cached  $cached\n     * @param Smarty_Internal_Template $_template template object\n     * @param string                   $content   content to cache\n     *\n     * @return bool success\n     */\n    public function write(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template, $content)\n    {\n        if (!$_template->source->handler->recompiled) {\n            if ($cached->handler->writeCachedContent($_template, $content)) {\n                $cached->content = null;\n                $cached->timestamp = time();\n                $cached->exists = true;\n                $cached->valid = true;\n                $cached->cache_lifetime = $_template->cache_lifetime;\n                $cached->processed = false;\n                if ($_template->smarty->cache_locking) {\n                    $cached->handler->releaseLock($_template->smarty, $cached);\n                }\n\n                return true;\n            }\n            $cached->content = null;\n            $cached->timestamp = false;\n            $cached->exists = false;\n            $cached->valid = false;\n            $cached->processed = false;\n        }\n\n        return false;\n    }\n\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_runtime_updatescope.php",
    "content": "<?php\n\n/**\n * Runtime Extension updateScope\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n *\n **/\nclass Smarty_Internal_Runtime_UpdateScope\n{\n\n    /**\n     * Update new assigned template or config variable in other effected scopes\n     *\n     * @param Smarty_Internal_Template $tpl     data object\n     * @param string|null              $varName variable name\n     * @param int                      $tagScope   tag scope to which bubble up variable value\n     *\n     */\n    public function _updateScope(Smarty_Internal_Template $tpl, $varName, $tagScope = 0)\n    {\n        if ($tagScope) {\n            $this->_updateVarStack($tpl, $varName);\n            $tagScope = $tagScope & ~Smarty::SCOPE_LOCAL;\n            if (!$tpl->scope && !$tagScope) return;\n        }\n        $mergedScope = $tagScope | $tpl->scope;\n        if ($mergedScope) {\n            if ($mergedScope & Smarty::SCOPE_GLOBAL && $varName) {\n                Smarty::$global_tpl_vars[ $varName ] = $tpl->tpl_vars[ $varName ];\n            }\n            // update scopes\n            foreach ($this->_getAffectedScopes($tpl, $mergedScope) as $ptr) {\n                $this->_updateVariableInOtherScope($ptr->tpl_vars, $tpl, $varName);\n                if($tagScope && $ptr->_isTplObj() && isset($tpl->_cache[ 'varStack' ])) {\n                    $this->_updateVarStack($ptr, $varName);              }\n            }\n        }\n    }\n\n    /**\n     * Get array of objects which needs to be updated  by given scope value\n     *\n     * @param Smarty_Internal_Template $tpl\n     * @param int                      $mergedScope merged tag and template scope to which bubble up variable value\n     *\n     * @return array\n     */\n    public function _getAffectedScopes(Smarty_Internal_Template $tpl, $mergedScope)\n    {\n        $_stack = array();\n        $ptr = $tpl->parent;\n        if ($mergedScope && isset($ptr) && $ptr->_isTplObj()) {\n            $_stack[] = $ptr;\n            $mergedScope = $mergedScope & ~Smarty::SCOPE_PARENT;\n            if (!$mergedScope) {\n                // only parent was set, we are done\n                return $_stack;\n            }\n            $ptr = $ptr->parent;\n        }\n        while (isset($ptr) && $ptr->_isTplObj()) {\n                $_stack[] = $ptr;\n             $ptr = $ptr->parent;\n        }\n        if ($mergedScope & Smarty::SCOPE_SMARTY) {\n            if (isset($tpl->smarty)) {\n                $_stack[] = $tpl->smarty;\n            }\n        } elseif ($mergedScope & Smarty::SCOPE_ROOT) {\n            while (isset($ptr)) {\n                if (!$ptr->_isTplObj()) {\n                    $_stack[] = $ptr;\n                    break;\n                }\n                $ptr = $ptr->parent;\n            }\n        }\n        return $_stack;\n    }\n\n    /**\n     * Update variable in other scope\n     *\n     * @param array     $tpl_vars template variable array\n     * @param \\Smarty_Internal_Template $from\n     * @param string               $varName variable name\n     */\n    public function _updateVariableInOtherScope(&$tpl_vars, Smarty_Internal_Template $from, $varName)\n    {\n        if (!isset($tpl_vars[ $varName ])) {\n            $tpl_vars[ $varName ] = clone $from->tpl_vars[ $varName ];\n        } else {\n            $tpl_vars[ $varName ] = clone $tpl_vars[ $varName ];\n            $tpl_vars[ $varName ]->value = $from->tpl_vars[ $varName ]->value;\n        }\n    }\n\n    /**\n     * Update variable in template local variable stack\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     * @param string|null               $varName variable name or null for config variables\n     */\n    public function _updateVarStack(Smarty_Internal_Template $tpl, $varName)\n    {\n        $i = 0;\n        while (isset($tpl->_cache[ 'varStack' ][ $i ])) {\n            $this->_updateVariableInOtherScope($tpl->_cache[ 'varStack' ][ $i ][ 'tpl' ], $tpl, $varName);\n            $i ++;\n        }\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_runtime_writefile.php",
    "content": "<?php\n/**\n * Smarty write file plugin\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Monte Ohrt\n */\n/**\n * Smarty Internal Write File Class\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n */\nclass Smarty_Internal_Runtime_WriteFile\n{\n    /**\n     * Writes file in a safe way to disk\n     *\n     * @param  string $_filepath complete filepath\n     * @param  string $_contents file content\n     * @param  Smarty $smarty    smarty instance\n     *\n     * @throws SmartyException\n     * @return boolean true\n     */\n    public function writeFile($_filepath, $_contents, Smarty $smarty)\n    {\n        $_error_reporting = error_reporting();\n        error_reporting($_error_reporting & ~E_NOTICE & ~E_WARNING);\n        $_file_perms = property_exists($smarty, '_file_perms') ? $smarty->_file_perms : 0644;\n        $_dir_perms =\n            property_exists($smarty, '_dir_perms') ? (isset($smarty->_dir_perms) ? $smarty->_dir_perms : 0777) : 0771;\n        if ($_file_perms !== null) {\n            $old_umask = umask(0);\n        }\n        $_dirpath = dirname($_filepath);\n        // if subdirs, create dir structure\n        if ($_dirpath !== '.') {\n            $i = 0;\n            // loop if concurrency problem occurs\n            // see https://bugs.php.net/bug.php?id=35326\n            while (!is_dir($_dirpath)) {\n                if (@mkdir($_dirpath, $_dir_perms, true)) {\n                    break;\n                }\n                clearstatcache();\n                if (++$i === 3) {\n                    error_reporting($_error_reporting);\n                    throw new SmartyException(\"unable to create directory {$_dirpath}\");\n                }\n                sleep(1);\n            }\n        }\n        // write to tmp file, then move to overt file lock race condition\n        $_tmp_file = $_dirpath . DIRECTORY_SEPARATOR . str_replace(array('.', ','), '_', uniqid('wrt', true));\n        if (!file_put_contents($_tmp_file, $_contents)) {\n            error_reporting($_error_reporting);\n            throw new SmartyException(\"unable to write file {$_tmp_file}\");\n        }\n        /*\n         * Windows' rename() fails if the destination exists,\n         * Linux' rename() properly handles the overwrite.\n         * Simply unlink()ing a file might cause other processes\n         * currently reading that file to fail, but linux' rename()\n         * seems to be smart enough to handle that for us.\n         */\n        if (Smarty::$_IS_WINDOWS) {\n            // remove original file\n            if (is_file($_filepath)) {\n                @unlink($_filepath);\n            }\n            // rename tmp file\n            $success = @rename($_tmp_file, $_filepath);\n        } else {\n            // rename tmp file\n            $success = @rename($_tmp_file, $_filepath);\n            if (!$success) {\n                // remove original file\n                if (is_file($_filepath)) {\n                    @unlink($_filepath);\n                }\n                // rename tmp file\n                $success = @rename($_tmp_file, $_filepath);\n            }\n        }\n        if (!$success) {\n            error_reporting($_error_reporting);\n            throw new SmartyException(\"unable to write file {$_filepath}\");\n        }\n        if ($_file_perms !== null) {\n            // set file permissions\n            chmod($_filepath, $_file_perms);\n            umask($old_umask);\n        }\n        error_reporting($_error_reporting);\n        return true;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_smartytemplatecompiler.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Smarty Template Compiler Base\n * This file contains the basic classes and methods for compiling Smarty templates with lexer/parser\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Class SmartyTemplateCompiler\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCompilerBase\n{\n    /**\n     * Lexer class name\n     *\n     * @var string\n     */\n    public $lexer_class;\n\n    /**\n     * Parser class name\n     *\n     * @var string\n     */\n    public $parser_class;\n\n    /**\n     * array of vars which can be compiled in local scope\n     *\n     * @var array\n     */\n    public $local_var = array();\n\n    /**\n     * array of callbacks called when the normal compile process of template is finished\n     *\n     * @var array\n     */\n    public $postCompileCallbacks = array();\n\n    /**\n     * prefix code\n     *\n     * @var string\n     */\n    public $prefixCompiledCode = '';\n\n    /**\n     * postfix code\n     *\n     * @var string\n     */\n    public $postfixCompiledCode = '';\n\n    /**\n     * Initialize compiler\n     *\n     * @param string $lexer_class  class name\n     * @param string $parser_class class name\n     * @param Smarty $smarty       global instance\n     */\n    public function __construct($lexer_class, $parser_class, Smarty $smarty)\n    {\n        parent::__construct($smarty);\n        // get required plugins\n        $this->lexer_class = $lexer_class;\n        $this->parser_class = $parser_class;\n    }\n\n    /**\n     * method to compile a Smarty template\n     *\n     * @param  mixed $_content template source\n     * @param bool   $isTemplateSource\n     *\n     * @return bool true if compiling succeeded, false if it failed\n     * @throws \\SmartyCompilerException\n     */\n    protected function doCompile($_content, $isTemplateSource = false)\n    {\n        /* here is where the compiling takes place. Smarty\n          tags in the templates are replaces with PHP code,\n          then written to compiled files. */\n        // init the lexer/parser to compile the template\n        $this->parser =\n            new $this->parser_class(new $this->lexer_class(str_replace(array(\"\\r\\n\",\n                                                                             \"\\r\"), \"\\n\", $_content), $this),\n                                    $this);\n        if ($isTemplateSource && $this->template->caching) {\n            $this->parser->insertPhpCode(\"<?php\\n\\$_smarty_tpl->compiled->nocache_hash = '{$this->nocache_hash}';\\n?>\\n\");\n        }\n        if (function_exists('mb_internal_encoding')\n            && function_exists('ini_get')\n            && ((int) ini_get('mbstring.func_overload')) & 2\n        ) {\n            $mbEncoding = mb_internal_encoding();\n            mb_internal_encoding('ASCII');\n        } else {\n            $mbEncoding = null;\n        }\n\n        if ($this->smarty->_parserdebug) {\n            $this->parser->PrintTrace();\n            $this->parser->lex->PrintTrace();\n        }\n        // get tokens from lexer and parse them\n        while ($this->parser->lex->yylex()) {\n            if ($this->smarty->_parserdebug) {\n                echo \"<pre>Line {$this->parser->lex->line} Parsing  {$this->parser->yyTokenName[$this->parser->lex->token]} Token \" .\n                     htmlentities($this->parser->lex->value) . \"</pre>\";\n            }\n            $this->parser->doParse($this->parser->lex->token, $this->parser->lex->value);\n        }\n\n        // finish parsing process\n        $this->parser->doParse(0, 0);\n        if ($mbEncoding) {\n            mb_internal_encoding($mbEncoding);\n        }\n        // check for unclosed tags\n        if (count($this->_tag_stack) > 0) {\n            // get stacked info\n            list($openTag, $_data) = array_pop($this->_tag_stack);\n            $this->trigger_template_error(\"unclosed {$this->smarty->left_delimiter}\" . $openTag .\n                                          \"{$this->smarty->right_delimiter} tag\");\n        }\n        // call post compile callbacks\n        foreach ($this->postCompileCallbacks as $cb) {\n            $parameter = $cb;\n            $parameter[ 0 ] = $this;\n            call_user_func_array($cb[ 0 ], $parameter);\n        }\n        // return compiled code\n        return $this->prefixCompiledCode . $this->parser->retvalue . $this->postfixCompiledCode;\n    }\n\n    /**\n     * Register a post compile callback\n     * - when the callback is called after template compiling the compiler object will be inserted as first parameter\n     *\n     * @param callback $callback\n     * @param array    $parameter optional parameter array\n     * @param string   $key       optional key for callback\n     * @param bool     $replace   if true replace existing keyed callback\n     *\n     */\n    public function registerPostCompileCallback($callback, $parameter = array(), $key = null, $replace = false)\n    {\n        array_unshift($parameter, $callback);\n        if (isset($key)) {\n            if ($replace || !isset($this->postCompileCallbacks[ $key ])) {\n                $this->postCompileCallbacks[ $key ] = $parameter;\n            }\n        } else {\n            $this->postCompileCallbacks[] = $parameter;\n        }\n    }\n\n    /**\n     * Remove a post compile callback\n     *\n     * @param string $key callback key\n     */\n    public function unregisterPostCompileCallback($key)\n    {\n        unset($this->postCompileCallbacks[ $key ]);\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_template.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Template\n * This file contains the Smarty template engine\n *\n * @package    Smarty\n * @subpackage Template\n * @author     Uwe Tews\n */\n\n/**\n * Main class with template data structures and methods\n *\n * @package    Smarty\n * @subpackage Template\n *\n * @property Smarty_Template_Compiled             $compiled\n * @property Smarty_Template_Cached               $cached\n * @property Smarty_Internal_TemplateCompilerBase $compiler\n * @property mixed|\\Smarty_Template_Cached        registered_plugins\n *\n * The following methods will be dynamically loaded by the extension handler when they are called.\n * They are located in a corresponding Smarty_Internal_Method_xxxx class\n *\n * @method bool mustCompile()\n */\nclass Smarty_Internal_Template extends Smarty_Internal_TemplateBase\n{\n    /**\n     * This object type (Smarty = 1, template = 2, data = 4)\n     *\n     * @var int\n     */\n    public $_objType = 2;\n\n    /**\n     * Global smarty instance\n     *\n     * @var Smarty\n     */\n    public $smarty = null;\n\n    /**\n     * Source instance\n     *\n     * @var Smarty_Template_Source|Smarty_Template_Config\n     */\n    public $source = null;\n\n    /**\n     * Inheritance runtime extension\n     *\n     * @var Smarty_Internal_Runtime_Inheritance\n     */\n    public $inheritance = null;\n\n    /**\n     * Template resource\n     *\n     * @var string\n     */\n    public $template_resource = null;\n\n    /**\n     * flag if compiled template is invalid and must be (re)compiled\n     *\n     * @var bool\n     */\n    public $mustCompile = null;\n\n    /**\n     * Template Id\n     *\n     * @var null|string\n     */\n    public $templateId = null;\n\n    /**\n     * Scope in which variables shall be assigned\n     *\n     * @var int\n     */\n    public $scope = 0;\n\n    /**\n     * Flag which is set while rending a cache file\n     *\n     * @var bool\n     */\n    public $isRenderingCache = false;\n\n    /**\n     * Callbacks called before rendering template\n     *\n     * @var callback[]\n     */\n    public $startRenderCallbacks = array();\n\n    /**\n     * Callbacks called after rendering template\n     *\n     * @var callback[]\n     */\n    public $endRenderCallbacks = array();\n\n    /**\n     * Template object cache\n     *\n     * @var Smarty_Internal_Template[]\n     */\n    public static $tplObjCache = array();\n\n    /**\n     * Template object cache for Smarty::isCached() === true\n     *\n     * @var Smarty_Internal_Template[]\n     */\n    public static $isCacheTplObj = array();\n\n    /**\n     * Sub template Info Cache\n     * - index name\n     * - value use count\n     *\n     * @var int[]\n     */\n    public static $subTplInfo = array();\n\n    /**\n     * Create template data object\n     * Some of the global Smarty settings copied to template scope\n     * It load the required template resources and caching plugins\n     *\n     * @param string                                                       $template_resource template resource string\n     * @param Smarty                                                       $smarty            Smarty instance\n     * @param null|\\Smarty_Internal_Template|\\Smarty|\\Smarty_Internal_Data $_parent           back pointer to parent object\n     *                                                                                        with variables or null\n     * @param mixed                                                        $_cache_id         cache   id or null\n     * @param mixed                                                        $_compile_id       compile id or null\n     * @param bool|int|null                                                $_caching          use caching?\n     * @param int|null                                                     $_cache_lifetime   cache life-time in seconds\n     * @param bool                                                         $_isConfig\n     *\n     * @throws \\SmartyException\n     */\n    public function __construct($template_resource, Smarty $smarty, Smarty_Internal_Data $_parent = null,\n                                $_cache_id = null, $_compile_id = null, $_caching = null, $_cache_lifetime = null,\n                                $_isConfig = false)\n    {\n        $this->smarty = $smarty;\n        // Smarty parameter\n        $this->cache_id = $_cache_id === null ? $this->smarty->cache_id : $_cache_id;\n        $this->compile_id = $_compile_id === null ? $this->smarty->compile_id : $_compile_id;\n        $this->caching = (int)($_caching === null ? $this->smarty->caching : $_caching);\n        $this->cache_lifetime = $_cache_lifetime === null ? $this->smarty->cache_lifetime : $_cache_lifetime;\n        $this->compile_check = (int)$smarty->compile_check;\n        $this->parent = $_parent;\n        // Template resource\n        $this->template_resource = $template_resource;\n        $this->source = $_isConfig ? Smarty_Template_Config::load($this) : Smarty_Template_Source::load($this);\n        parent::__construct();\n        if ($smarty->security_policy && method_exists($smarty->security_policy, 'registerCallBacks')) {\n            $smarty->security_policy->registerCallBacks($this);\n        }\n    }\n\n    /**\n     * render template\n     *\n     * @param  bool      $no_output_filter if true do not run output filter\n     * @param  null|bool $display          true: display, false: fetch null: sub-template\n     *\n     * @return string\n     * @throws \\Exception\n     * @throws \\SmartyException\n     */\n    public function render($no_output_filter = true, $display = null)\n    {\n        if ($this->smarty->debugging) {\n            if (!isset($this->smarty->_debug)) {\n                $this->smarty->_debug = new Smarty_Internal_Debug();\n            }\n            $this->smarty->_debug->start_template($this, $display);\n        }\n        // checks if template exists\n        if (!$this->source->exists) {\n            throw new SmartyException(\"Unable to load template '{$this->source->type}:{$this->source->name}'\" .\n                                      ($this->_isSubTpl() ? \" in '{$this->parent->template_resource}'\" : ''));\n        }\n        // disable caching for evaluated code\n        if ($this->source->handler->recompiled) {\n            $this->caching = Smarty::CACHING_OFF;\n        }\n        // read from cache or render\n        if ($this->caching === Smarty::CACHING_LIFETIME_CURRENT || $this->caching === Smarty::CACHING_LIFETIME_SAVED) {\n            if (!isset($this->cached) || $this->cached->cache_id !== $this->cache_id ||\n                $this->cached->compile_id !== $this->compile_id\n            ) {\n                $this->loadCached(true);\n            }\n            $this->cached->render($this, $no_output_filter);\n        } else {\n            if (!isset($this->compiled) || $this->compiled->compile_id !== $this->compile_id) {\n                $this->loadCompiled(true);\n            }\n            $this->compiled->render($this);\n        }\n\n        // display or fetch\n        if ($display) {\n            if ($this->caching && $this->smarty->cache_modified_check) {\n                $this->smarty->ext->_cacheModify->cacheModifiedCheck($this->cached, $this,\n                                                                     isset($content) ? $content : ob_get_clean());\n            } else {\n                if ((!$this->caching || $this->cached->has_nocache_code || $this->source->handler->recompiled) &&\n                    !$no_output_filter && (isset($this->smarty->autoload_filters[ 'output' ]) ||\n                                           isset($this->smarty->registered_filters[ 'output' ]))\n                ) {\n                    echo $this->smarty->ext->_filterHandler->runFilter('output', ob_get_clean(), $this);\n                } else {\n                    echo ob_get_clean();\n                }\n            }\n            if ($this->smarty->debugging) {\n                $this->smarty->_debug->end_template($this);\n                // debug output\n                $this->smarty->_debug->display_debug($this, true);\n            }\n            return '';\n        } else {\n            if ($this->smarty->debugging) {\n                $this->smarty->_debug->end_template($this);\n                if ($this->smarty->debugging === 2 && $display === false) {\n                    $this->smarty->_debug->display_debug($this, true);\n                }\n            }\n            if ($this->_isSubTpl()) {\n                foreach ($this->compiled->required_plugins as $code => $tmp1) {\n                    foreach ($tmp1 as $name => $tmp) {\n                        foreach ($tmp as $type => $data) {\n                            $this->parent->compiled->required_plugins[ $code ][ $name ][ $type ] = $data;\n                        }\n                    }\n                }\n            }\n            if (!$no_output_filter &&\n                (!$this->caching || $this->cached->has_nocache_code || $this->source->handler->recompiled) &&\n                (isset($this->smarty->autoload_filters[ 'output' ]) ||\n                 isset($this->smarty->registered_filters[ 'output' ]))\n            ) {\n                return $this->smarty->ext->_filterHandler->runFilter('output', ob_get_clean(), $this);\n            }\n            // return cache content\n            return null;\n        }\n    }\n\n    /**\n     * Runtime function to render sub-template\n     *\n     * @param string  $template       template name\n     * @param mixed   $cache_id       cache id\n     * @param mixed   $compile_id     compile id\n     * @param integer $caching        cache mode\n     * @param integer $cache_lifetime life time of cache data\n     * @param array   $data           passed parameter template variables\n     * @param int     $scope          scope in which {include} should execute\n     * @param bool    $forceTplCache  cache template object\n     * @param string  $uid            file dependency uid\n     * @param string  $content_func   function name\n     *\n     * @throws \\Exception\n     * @throws \\SmartyException\n     */\n    public function _subTemplateRender($template, $cache_id, $compile_id, $caching, $cache_lifetime, $data, $scope,\n                                       $forceTplCache, $uid = null, $content_func = null)\n    {\n        $tpl = clone $this;\n        $tpl->parent = $this;\n        $smarty = &$this->smarty;\n        $_templateId = $smarty->_getTemplateId($template, $cache_id, $compile_id, $caching, $tpl);\n        // recursive call ?\n        if (isset($tpl->templateId) ? $tpl->templateId : $tpl->_getTemplateId() !== $_templateId) {\n            // already in template cache?\n            if (isset(self::$tplObjCache[ $_templateId ])) {\n                // copy data from cached object\n                $cachedTpl = &self::$tplObjCache[ $_templateId ];\n                $tpl->templateId = $cachedTpl->templateId;\n                $tpl->template_resource = $cachedTpl->template_resource;\n                $tpl->cache_id = $cachedTpl->cache_id;\n                $tpl->compile_id = $cachedTpl->compile_id;\n                $tpl->source = $cachedTpl->source;\n                if (isset($cachedTpl->compiled)) {\n                    $tpl->compiled = $cachedTpl->compiled;\n                } else {\n                    unset($tpl->compiled);\n                }\n                if ($caching !== 9999 && isset($cachedTpl->cached)) {\n                    $tpl->cached = $cachedTpl->cached;\n                } else {\n                    unset($tpl->cached);\n                }\n            } else {\n                $tpl->templateId = $_templateId;\n                $tpl->template_resource = $template;\n                $tpl->cache_id = $cache_id;\n                $tpl->compile_id = $compile_id;\n                if (isset($uid)) {\n                    // for inline templates we can get all resource information from file dependency\n                    list($filepath, $timestamp, $type) = $tpl->compiled->file_dependency[ $uid ];\n                    $tpl->source = new Smarty_Template_Source($smarty, $filepath, $type, $filepath);\n                    $tpl->source->filepath = $filepath;\n                    $tpl->source->timestamp = $timestamp;\n                    $tpl->source->exists = true;\n                    $tpl->source->uid = $uid;\n                } else {\n                    $tpl->source = Smarty_Template_Source::load($tpl);\n                    unset($tpl->compiled);\n                }\n                if ($caching !== 9999) {\n                    unset($tpl->cached);\n                }\n            }\n        } else {\n            // on recursive calls force caching\n            $forceTplCache = true;\n        }\n        $tpl->caching = $caching;\n        $tpl->cache_lifetime = $cache_lifetime;\n        // set template scope\n        $tpl->scope = $scope;\n        if (!isset(self::$tplObjCache[ $tpl->templateId ]) && !$tpl->source->handler->recompiled) {\n            // check if template object should be cached\n            if ($forceTplCache || (isset(self::$subTplInfo[ $tpl->template_resource ]) &&\n                                   self::$subTplInfo[ $tpl->template_resource ] > 1) ||\n                ($tpl->_isSubTpl() &&  isset(self::$tplObjCache[ $tpl->parent->templateId ]))\n            ) {\n                self::$tplObjCache[ $tpl->templateId ] = $tpl;\n            }\n        }\n\n        if (!empty($data)) {\n            // set up variable values\n            foreach ($data as $_key => $_val) {\n                $tpl->tpl_vars[ $_key ] = new Smarty_Variable($_val, $this->isRenderingCache);\n            }\n        }\n        if ($tpl->caching === 9999) {\n            if (!isset($tpl->compiled)) {\n                $this->loadCompiled(true);\n            }\n            if ($tpl->compiled->has_nocache_code) {\n                $this->cached->hashes[ $tpl->compiled->nocache_hash ] = true;\n            }\n        }\n        $tpl->_cache = array();\n        if (isset($uid)) {\n            if ($smarty->debugging) {\n                if (!isset($smarty->_debug)) {\n                    $smarty->_debug = new Smarty_Internal_Debug();\n                }\n                $smarty->_debug->start_template($tpl);\n                $smarty->_debug->start_render($tpl);\n            }\n            $tpl->compiled->getRenderedTemplateCode($tpl, $content_func);\n            if ($smarty->debugging) {\n                $smarty->_debug->end_template($tpl);\n                $smarty->_debug->end_render($tpl);\n            }\n        } else {\n            if (isset($tpl->compiled)) {\n                $tpl->compiled->render($tpl);\n            } else {\n                $tpl->render();\n            }\n        }\n    }\n\n    /**\n     * Get called sub-templates and save call count\n     *\n     */\n    public function _subTemplateRegister()\n    {\n        foreach ($this->compiled->includes as $name => $count) {\n            if (isset(self::$subTplInfo[ $name ])) {\n                self::$subTplInfo[ $name ] += $count;\n            } else {\n                self::$subTplInfo[ $name ] = $count;\n            }\n        }\n    }\n\n    /**\n     * Check if this is a sub template\n     *\n     * @return bool true is sub template\n     */\n    public function _isSubTpl()\n    {\n        return isset($this->parent) && $this->parent->_isTplObj();\n    }\n\n    /**\n     * Assign variable in scope\n     *\n     * @param string $varName variable name\n     * @param mixed  $value   value\n     * @param bool   $nocache nocache flag\n     * @param int    $scope   scope into which variable shall be assigned\n     *\n     */\n    public function _assignInScope($varName, $value, $nocache = false, $scope = 0)\n    {\n        if (isset($this->tpl_vars[ $varName ])) {\n            $this->tpl_vars[ $varName ] = clone $this->tpl_vars[ $varName ];\n            $this->tpl_vars[ $varName ]->value = $value;\n            if ($nocache || $this->isRenderingCache) {\n                $this->tpl_vars[ $varName ]->nocache = true;\n            }\n        } else {\n            $this->tpl_vars[ $varName ] = new Smarty_Variable($value, $nocache || $this->isRenderingCache);\n        }\n        if ($scope >= 0) {\n            if ($scope > 0 || $this->scope > 0) {\n                $this->smarty->ext->_updateScope->_updateScope($this, $varName, $scope);\n            }\n        }\n    }\n\n    /**\n     * This function is executed automatically when a compiled or cached template file is included\n     * - Decode saved properties from compiled template and cache files\n     * - Check if compiled or cache file is valid\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     * @param  array                    $properties special template properties\n     * @param  bool                     $cache      flag if called from cache file\n     *\n     * @return bool flag if compiled or cache file is valid\n     * @throws \\SmartyException\n     */\n    public function _decodeProperties(Smarty_Internal_Template $tpl, $properties, $cache = false)\n    {\n        // on cache resources other than file check version stored in cache code\n        if (!isset($properties[ 'version' ]) || Smarty::SMARTY_VERSION !== $properties[ 'version' ]) {\n            if ($cache) {\n                $tpl->smarty->clearAllCache();\n            } else {\n                $tpl->smarty->clearCompiledTemplate();\n            }\n            return false;\n        }\n        $is_valid = true;\n        if (!empty($properties[ 'file_dependency' ]) &&\n                  ((!$cache && $tpl->compile_check) || $tpl->compile_check === Smarty::COMPILECHECK_ON)\n        ) {\n            // check file dependencies at compiled code\n            foreach ($properties[ 'file_dependency' ] as $_file_to_check) {\n                if ($_file_to_check[ 2 ] === 'file' || $_file_to_check[ 2 ] === 'php') {\n                    if ($tpl->source->filepath === $_file_to_check[ 0 ]) {\n                        // do not recheck current template\n                        continue;\n                        //$mtime = $tpl->source->getTimeStamp();\n                    } else {\n                        // file and php types can be checked without loading the respective resource handlers\n                        $mtime = is_file($_file_to_check[ 0 ]) ? filemtime($_file_to_check[ 0 ]) : false;\n                    }\n                } else {\n                    $handler = Smarty_Resource::load($tpl->smarty, $_file_to_check[ 2 ]);\n                    if ($handler->checkTimestamps()) {\n                        $source = Smarty_Template_Source::load($tpl, $tpl->smarty, $_file_to_check[ 0 ]);\n                        $mtime = $source->getTimeStamp();\n                    } else {\n                        continue;\n                    }\n                }\n                if ($mtime === false || $mtime > $_file_to_check[ 1 ]) {\n                    $is_valid = false;\n                    break;\n                }\n            }\n        }\n        if ($cache) {\n            // CACHING_LIFETIME_SAVED cache expiry has to be validated here since otherwise we'd define the unifunc\n            if ($tpl->caching === Smarty::CACHING_LIFETIME_SAVED && $properties[ 'cache_lifetime' ] >= 0 &&\n                (time() > ($tpl->cached->timestamp + $properties[ 'cache_lifetime' ]))\n            ) {\n                $is_valid = false;\n            }\n            $tpl->cached->cache_lifetime = $properties[ 'cache_lifetime' ];\n            $tpl->cached->valid = $is_valid;\n            $resource = $tpl->cached;\n        } else {\n            $tpl->mustCompile = !$is_valid;\n            $resource = $tpl->compiled;\n            $resource->includes = isset($properties[ 'includes' ]) ? $properties[ 'includes' ] : array();\n        }\n        if ($is_valid) {\n            $resource->unifunc = $properties[ 'unifunc' ];\n            $resource->has_nocache_code = $properties[ 'has_nocache_code' ];\n            //            $tpl->compiled->nocache_hash = $properties['nocache_hash'];\n            $resource->file_dependency = $properties[ 'file_dependency' ];\n        }\n        return $is_valid && !function_exists($properties[ 'unifunc' ]);\n    }\n\n    /**\n     * Compiles the template\n     * If the template is not evaluated the compiled template is saved on disk\n     */\n    public function compileTemplateSource()\n    {\n        return $this->compiled->compileTemplateSource($this);\n    }\n\n    /**\n     * Writes the content to cache resource\n     *\n     * @param string $content\n     *\n     * @return bool\n     */\n    public function writeCachedContent($content)\n    {\n        return $this->smarty->ext->_updateCache->writeCachedContent($this->cached, $this, $content);\n    }\n\n    /**\n     * Get unique template id\n     *\n     * @return string\n     * @throws \\SmartyException\n     */\n    public function _getTemplateId()\n    {\n        return isset($this->templateId) ? $this->templateId : $this->templateId =\n            $this->smarty->_getTemplateId($this->template_resource, $this->cache_id, $this->compile_id);\n    }\n\n    /**\n     * runtime error not matching capture tags\n     */\n    public function capture_error()\n    {\n        throw new SmartyException(\"Not matching {capture} open/close in '{$this->template_resource}'\");\n    }\n\n    /**\n     * Load compiled object\n     *\n     * @param bool $force force new compiled object\n     */\n    public function loadCompiled($force = false)\n    {\n        if ($force || !isset($this->compiled)) {\n            $this->compiled = Smarty_Template_Compiled::load($this);\n        }\n    }\n\n    /**\n     * Load cached object\n     *\n     * @param bool $force force new cached object\n     */\n    public function loadCached($force = false)\n    {\n        if ($force || !isset($this->cached)) {\n            $this->cached = Smarty_Template_Cached::load($this);\n        }\n    }\n\n    /**\n     * Load inheritance object\n     *\n     */\n    public function _loadInheritance()\n    {\n        if (!isset($this->inheritance)) {\n            $this->inheritance = new Smarty_Internal_Runtime_Inheritance();\n        }\n    }\n\n    /**\n     * Unload inheritance object\n     *\n     */\n    public function _cleanUp()\n    {\n        $this->startRenderCallbacks = array();\n        $this->endRenderCallbacks = array();\n        $this->inheritance = null;\n    }\n\n    /**\n     * Load compiler object\n     *\n     * @throws \\SmartyException\n     */\n    public function loadCompiler()\n    {\n        if (!class_exists($this->source->compiler_class,false)) {\n            $this->smarty->loadPlugin($this->source->compiler_class);\n        }\n        $this->compiler =\n            new $this->source->compiler_class($this->source->template_lexer_class, $this->source->template_parser_class,\n                                              $this->smarty);\n    }\n\n    /**\n     * Handle unknown class methods\n     *\n     * @param string $name unknown method-name\n     * @param array  $args argument array\n     *\n     * @return mixed\n     * @throws SmartyException\n     */\n    public function __call($name, $args)\n    {\n        // method of Smarty object?\n        if (method_exists($this->smarty, $name)) {\n            return call_user_func_array(array($this->smarty, $name), $args);\n        }\n        // parent\n        return parent::__call($name, $args);\n    }\n\n    /**\n     * set Smarty property in template context\n     *\n     * @param string $property_name property name\n     * @param mixed  $value         value\n     *\n     * @throws SmartyException\n     */\n    public function __set($property_name, $value)\n    {\n        switch ($property_name) {\n            case 'compiled':\n            case 'cached':\n            case 'compiler':\n                $this->$property_name = $value;\n                return;\n            default:\n                // Smarty property ?\n                if (property_exists($this->smarty, $property_name)) {\n                    $this->smarty->$property_name = $value;\n                    return;\n                }\n        }\n        throw new SmartyException(\"invalid template property '$property_name'.\");\n    }\n\n    /**\n     * get Smarty property in template context\n     *\n     * @param string $property_name property name\n     *\n     * @return mixed|Smarty_Template_Cached\n     * @throws SmartyException\n     */\n    public function __get($property_name)\n    {\n        switch ($property_name) {\n            case 'compiled':\n                $this->loadCompiled();\n                return $this->compiled;\n\n            case 'cached':\n                $this->loadCached();\n                return $this->cached;\n\n            case 'compiler':\n                $this->loadCompiler();\n                return $this->compiler;\n            default:\n                // Smarty property ?\n                if (property_exists($this->smarty, $property_name)) {\n                    return $this->smarty->$property_name;\n                }\n        }\n        throw new SmartyException(\"template property '$property_name' does not exist.\");\n    }\n\n    /**\n     * Template data object destructor\n     */\n    public function __destruct()\n    {\n        if ($this->smarty->cache_locking && isset($this->cached) && $this->cached->is_locked) {\n            $this->cached->handler->releaseLock($this->smarty, $this->cached);\n        }\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_templatebase.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Smarty Template  Base\n * This file contains the basic shared methods for template handling\n *\n * @package    Smarty\n * @subpackage Template\n * @author     Uwe Tews\n */\n\n/**\n * Class with shared smarty/template methods\n *\n * @package      Smarty\n * @subpackage   Template\n *\n * @property int $_objType\n *\n * The following methods will be dynamically loaded by the extension handler when they are called.\n * They are located in a corresponding Smarty_Internal_Method_xxxx class\n *\n * @method Smarty_Internal_TemplateBase addAutoloadFilters(mixed $filters, string $type = null)\n * @method Smarty_Internal_TemplateBase addDefaultModifier(mixed $modifiers)\n * @method Smarty_Internal_TemplateBase addLiterals(mixed $literals)\n * @method Smarty_Internal_TemplateBase createData(Smarty_Internal_Data $parent = null, string $name = null)\n * @method array getAutoloadFilters(string $type = null)\n * @method string getDebugTemplate()\n * @method array getDefaultModifier()\n * @method array getLiterals()\n * @method array getTags(mixed $template = null)\n * @method object getRegisteredObject(string $object_name)\n * @method Smarty_Internal_TemplateBase registerCacheResource(string $name, Smarty_CacheResource $resource_handler)\n * @method Smarty_Internal_TemplateBase registerClass(string $class_name, string $class_impl)\n * @method Smarty_Internal_TemplateBase registerDefaultConfigHandler(callback $callback)\n * @method Smarty_Internal_TemplateBase registerDefaultPluginHandler(callback $callback)\n * @method Smarty_Internal_TemplateBase registerDefaultTemplateHandler(callback $callback)\n * @method Smarty_Internal_TemplateBase registerResource(string $name, mixed $resource_handler)\n * @method Smarty_Internal_TemplateBase setAutoloadFilters(mixed $filters, string $type = null)\n * @method Smarty_Internal_TemplateBase setDebugTemplate(string $tpl_name)\n * @method Smarty_Internal_TemplateBase setDefaultModifiers(mixed $modifiers)\n * @method Smarty_Internal_TemplateBase setLiterals(mixed $literals)\n * @method Smarty_Internal_TemplateBase unloadFilter(string $type, string $name)\n * @method Smarty_Internal_TemplateBase unregisterCacheResource(string $name)\n * @method Smarty_Internal_TemplateBase unregisterObject(string $object_name)\n * @method Smarty_Internal_TemplateBase unregisterPlugin(string $type, string $name)\n * @method Smarty_Internal_TemplateBase unregisterFilter(string $type, mixed $callback)\n * @method Smarty_Internal_TemplateBase unregisterResource(string $name)\n */\nabstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data\n{\n    /**\n     * Set this if you want different sets of cache files for the same\n     * templates.\n     *\n     * @var string\n     */\n    public $cache_id = null;\n\n    /**\n     * Set this if you want different sets of compiled files for the same\n     * templates.\n     *\n     * @var string\n     */\n    public $compile_id = null;\n\n    /**\n     * caching enabled\n     *\n     * @var int\n     */\n    public $caching = Smarty::CACHING_OFF;\n\n    /**\n     * check template for modifications?\n     *\n     * @var int\n     */\n    public $compile_check = Smarty::COMPILECHECK_ON;\n\n    /**\n     * cache lifetime in seconds\n     *\n     * @var integer\n     */\n    public $cache_lifetime = 3600;\n\n    /**\n     * Array of source information for known template functions\n     *\n     * @var array\n     */\n    public $tplFunctions = array();\n\n    /**\n     * universal cache\n     *\n     * @var array()\n     */\n    public $_cache = array();\n\n    /**\n     * fetches a rendered Smarty template\n     *\n     * @param  string $template   the resource handle of the template file or template object\n     * @param  mixed  $cache_id   cache id to be used with this template\n     * @param  mixed  $compile_id compile id to be used with this template\n     * @param  object $parent     next higher level of Smarty variables\n     *\n     * @throws Exception\n     * @throws SmartyException\n     * @return string rendered template output\n     */\n    public function fetch($template = null, $cache_id = null, $compile_id = null, $parent = null)\n    {\n        $result = $this->_execute($template, $cache_id, $compile_id, $parent, 0);\n        return $result === null ? ob_get_clean() : $result;\n    }\n\n    /**\n     * displays a Smarty template\n     *\n     * @param string $template   the resource handle of the template file or template object\n     * @param mixed  $cache_id   cache id to be used with this template\n     * @param mixed  $compile_id compile id to be used with this template\n     * @param object $parent     next higher level of Smarty variables\n     *\n     * @throws \\Exception\n     * @throws \\SmartyException\n     */\n    public function display($template = null, $cache_id = null, $compile_id = null, $parent = null)\n    {\n        // display template\n        $this->_execute($template, $cache_id, $compile_id, $parent, 1);\n    }\n\n    /**\n     * test if cache is valid\n     *\n     * @api  Smarty::isCached()\n     * @link http://www.smarty.net/docs/en/api.is.cached.tpl\n     *\n     * @param  null|string|\\Smarty_Internal_Template $template   the resource handle of the template file or template object\n     * @param  mixed                                 $cache_id   cache id to be used with this template\n     * @param  mixed                                 $compile_id compile id to be used with this template\n     * @param  object                                $parent     next higher level of Smarty variables\n     *\n     * @return bool cache status\n     * @throws \\Exception\n     * @throws \\SmartyException\n     */\n    public function isCached($template = null, $cache_id = null, $compile_id = null, $parent = null)\n    {\n        return $this->_execute($template, $cache_id, $compile_id, $parent, 2);\n    }\n\n    /**\n     * fetches a rendered Smarty template\n     *\n     * @param  string $template   the resource handle of the template file or template object\n     * @param  mixed  $cache_id   cache id to be used with this template\n     * @param  mixed  $compile_id compile id to be used with this template\n     * @param  object $parent     next higher level of Smarty variables\n     * @param  string $function   function type 0 = fetch,  1 = display, 2 = isCache\n     *\n     * @return mixed\n     * @throws \\Exception\n     * @throws \\SmartyException\n     */\n    private function _execute($template, $cache_id, $compile_id, $parent, $function)\n    {\n        $smarty = $this->_getSmartyObj();\n        $saveVars = true;\n        if ($template === null) {\n            if (!$this->_isTplObj()) {\n                throw new SmartyException($function . '():Missing \\'$template\\' parameter');\n            } else {\n                $template = $this;\n            }\n        } elseif (is_object($template)) {\n            /* @var Smarty_Internal_Template $template */\n            if (!isset($template->_objType) || !$template->_isTplObj()) {\n                throw new SmartyException($function . '():Template object expected');\n            }\n        } else {\n            // get template object\n            $saveVars = false;\n\n            $template = $smarty->createTemplate($template, $cache_id, $compile_id, $parent ? $parent : $this, false);\n            if ($this->_objType === 1) {\n                // set caching in template object\n                $template->caching = $this->caching;\n            }\n        }\n        // make sure we have integer values\n        $template->caching = (int)$template->caching;\n        // fetch template content\n        $level = ob_get_level();\n        try {\n            $_smarty_old_error_level =\n                isset($smarty->error_reporting) ? error_reporting($smarty->error_reporting) : null;\n            if ($this->_objType === 2) {\n                /* @var Smarty_Internal_Template $this */\n                $template->tplFunctions = $this->tplFunctions;\n                $template->inheritance = $this->inheritance;\n            }\n            /* @var Smarty_Internal_Template $parent */\n            if (isset($parent->_objType) && ($parent->_objType === 2) && !empty($parent->tplFunctions)) {\n                $template->tplFunctions = array_merge($parent->tplFunctions, $template->tplFunctions);\n            }\n            if ($function === 2) {\n                if ($template->caching) {\n                    // return cache status of template\n                    if (!isset($template->cached)) {\n                        $template->loadCached();\n                    }\n                    $result = $template->cached->isCached($template);\n                    Smarty_Internal_Template::$isCacheTplObj[ $template->_getTemplateId() ] = $template;\n                } else {\n                    return false;\n                }\n            } else {\n                if ($saveVars) {\n                    $savedTplVars = $template->tpl_vars;\n                    $savedConfigVars = $template->config_vars;\n                }\n                ob_start();\n                $template->_mergeVars();\n                if (!empty(Smarty::$global_tpl_vars)) {\n                    $template->tpl_vars = array_merge(Smarty::$global_tpl_vars, $template->tpl_vars);\n                }\n                $result = $template->render(false, $function);\n                $template->_cleanUp();\n                if ($saveVars) {\n                    $template->tpl_vars = $savedTplVars;\n                    $template->config_vars = $savedConfigVars;\n                } else {\n                    if (!$function && !isset(Smarty_Internal_Template::$tplObjCache[ $template->templateId ])) {\n                        $template->parent = null;\n                        $template->tpl_vars = $template->config_vars = array();\n                        Smarty_Internal_Template::$tplObjCache[ $template->templateId ] = $template;\n                    }\n                }\n            }\n            if (isset($_smarty_old_error_level)) {\n                error_reporting($_smarty_old_error_level);\n            }\n            return $result;\n        }\n        catch (Exception $e) {\n            while (ob_get_level() > $level) {\n                ob_end_clean();\n            }\n            if (isset($_smarty_old_error_level)) {\n                error_reporting($_smarty_old_error_level);\n            }\n            throw $e;\n        }\n    }\n\n    /**\n     * Registers plugin to be used in templates\n     *\n     * @api  Smarty::registerPlugin()\n     * @link http://www.smarty.net/docs/en/api.register.plugin.tpl\n     *\n     * @param  string   $type       plugin type\n     * @param  string   $name       name of template tag\n     * @param  callback $callback   PHP callback to register\n     * @param  bool     $cacheable  if true (default) this function is cache able\n     * @param  mixed    $cache_attr caching attributes if any\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws SmartyException              when the plugin tag is invalid\n     */\n    public function registerPlugin($type, $name, $callback, $cacheable = true, $cache_attr = null)\n    {\n        return $this->ext->registerPlugin->registerPlugin($this, $type, $name, $callback, $cacheable, $cache_attr);\n    }\n\n    /**\n     * load a filter of specified type and name\n     *\n     * @api  Smarty::loadFilter()\n     * @link http://www.smarty.net/docs/en/api.load.filter.tpl\n     *\n     * @param  string $type filter type\n     * @param  string $name filter name\n     *\n     * @return bool\n     * @throws SmartyException if filter could not be loaded\n     */\n    public function loadFilter($type, $name)\n    {\n        return $this->ext->loadFilter->loadFilter($this, $type, $name);\n    }\n\n    /**\n     * Registers a filter function\n     *\n     * @api  Smarty::registerFilter()\n     * @link http://www.smarty.net/docs/en/api.register.filter.tpl\n     *\n     * @param  string      $type filter type\n     * @param  callback    $callback\n     * @param  string|null $name optional filter name\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws \\SmartyException\n     */\n    public function registerFilter($type, $callback, $name = null)\n    {\n        return $this->ext->registerFilter->registerFilter($this, $type, $callback, $name);\n    }\n\n    /**\n     * Registers object to be used in templates\n     *\n     * @api  Smarty::registerObject()\n     * @link http://www.smarty.net/docs/en/api.register.object.tpl\n     *\n     * @param  string $object_name\n     * @param  object $object                     the referenced PHP object to register\n     * @param  array  $allowed_methods_properties list of allowed methods (empty = all)\n     * @param  bool   $format                     smarty argument format, else traditional\n     * @param  array  $block_methods              list of block-methods\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws \\SmartyException\n     */\n    public function registerObject($object_name, $object, $allowed_methods_properties = array(), $format = true,\n                                   $block_methods = array())\n    {\n        return $this->ext->registerObject->registerObject($this, $object_name, $object, $allowed_methods_properties,\n                                                          $format, $block_methods);\n    }\n\n    /**\n     * @param int $compile_check\n     */\n    public function setCompileCheck($compile_check)\n    {\n        $this->compile_check = (int)$compile_check;\n    }\n\n    /**\n     * @param int $caching\n     */\n    public function setCaching($caching)\n    {\n        $this->caching = (int)$caching;\n    }\n\n    /**\n     * @param int $cache_lifetime\n     */\n    public function setCacheLifetime($cache_lifetime)\n    {\n        $this->cache_lifetime = $cache_lifetime;\n    }\n\n    /**\n     * @param string $compile_id\n     */\n    public function setCompileId($compile_id)\n    {\n        $this->compile_id = $compile_id;\n    }\n\n    /**\n     * @param string $cache_id\n     */\n    public function setCacheId($cache_id)\n    {\n        $this->cache_id = $cache_id;\n    }\n\n}\n\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_templatecompilerbase.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Smarty Template Compiler Base\n * This file contains the basic classes and methods for compiling Smarty templates with lexer/parser\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Main abstract compiler class\n *\n * @package    Smarty\n * @subpackage Compiler\n *\n * @property Smarty_Internal_SmartyTemplateCompiler $prefixCompiledCode  = ''\n * @property Smarty_Internal_SmartyTemplateCompiler $postfixCompiledCode = ''\n * @method registerPostCompileCallback($callback, $parameter = array(), $key = null, $replace = false)\n * @method unregisterPostCompileCallback($key)\n */\nabstract class Smarty_Internal_TemplateCompilerBase\n{\n    /**\n     * compile tag objects cache\n     *\n     * @var array\n     */\n    static $_tag_objects = array();\n    /**\n     * counter for prefix variable number\n     *\n     * @var int\n     */\n    public static $prefixVariableNumber = 0;\n    /**\n     * Smarty object\n     *\n     * @var Smarty\n     */\n    public $smarty = null;\n    /**\n     * Parser object\n     *\n     * @var Smarty_Internal_Templateparser\n     */\n    public $parser = null;\n    /**\n     * hash for nocache sections\n     *\n     * @var mixed\n     */\n    public $nocache_hash = null;\n    /**\n     * suppress generation of nocache code\n     *\n     * @var bool\n     */\n    public $suppressNocacheProcessing = false;\n    /**\n     * tag stack\n     *\n     * @var array\n     */\n    public $_tag_stack = array();\n    /**\n     * tag stack count\n     *\n     * @var array\n     */\n    public $_tag_stack_count = array();\n    /**\n     * current template\n     *\n     * @var Smarty_Internal_Template\n     */\n    public $template = null;\n    /**\n     * merged included sub template data\n     *\n     * @var array\n     */\n    public $mergedSubTemplatesData = array();\n    /**\n     * merged sub template code\n     *\n     * @var array\n     */\n    public $mergedSubTemplatesCode = array();\n    /**\n     * collected template properties during compilation\n     *\n     * @var array\n     */\n    public $templateProperties = array();\n    /**\n     * source line offset for error messages\n     *\n     * @var int\n     */\n    public $trace_line_offset = 0;\n    /**\n     * trace uid\n     *\n     * @var string\n     */\n    public $trace_uid = '';\n    /**\n     * trace file path\n     *\n     * @var string\n     */\n    public $trace_filepath = '';\n    /**\n     * stack for tracing file and line of nested {block} tags\n     *\n     * @var array\n     */\n    public $trace_stack = array();\n    /**\n     * plugins loaded by default plugin handler\n     *\n     * @var array\n     */\n    public $default_handler_plugins = array();\n    /**\n     * saved preprocessed modifier list\n     *\n     * @var mixed\n     */\n    public $default_modifier_list = null;\n    /**\n     * force compilation of complete template as nocache\n     *\n     * @var boolean\n     */\n    public $forceNocache = false;\n    /**\n     * flag if compiled template file shall we written\n     *\n     * @var bool\n     */\n    public $write_compiled_code = true;\n    /**\n     * Template functions\n     *\n     * @var array\n     */\n    public $tpl_function = array();\n    /**\n     * called sub functions from template function\n     *\n     * @var array\n     */\n    public $called_functions = array();\n    /**\n     * compiled template or block function code\n     *\n     * @var string\n     */\n    public $blockOrFunctionCode = '';\n    /**\n     * php_handling setting either from Smarty or security\n     *\n     * @var int\n     */\n    public $php_handling = 0;\n    /**\n     * flags for used modifier plugins\n     *\n     * @var array\n     */\n    public $modifier_plugins = array();\n    /**\n     * type of already compiled modifier\n     *\n     * @var array\n     */\n    public $known_modifier_type = array();\n    /**\n     * parent compiler object for merged subtemplates and template functions\n     *\n     * @var Smarty_Internal_TemplateCompilerBase\n     */\n    public $parent_compiler = null;\n    /**\n     * Flag true when compiling nocache section\n     *\n     * @var bool\n     */\n    public $nocache = false;\n    /**\n     * Flag true when tag is compiled as nocache\n     *\n     * @var bool\n     */\n    public $tag_nocache = false;\n    /**\n     * Compiled tag prefix code\n     *\n     * @var array\n     */\n    public $prefix_code = array();\n    /**\n     * used prefix variables by current compiled tag\n     *\n     * @var array\n     */\n    public $usedPrefixVariables = array();\n    /**\n     * Prefix code  stack\n     *\n     * @var array\n     */\n    public $prefixCodeStack = array();\n    /**\n     * Tag has compiled code\n     *\n     * @var bool\n     */\n    public $has_code = false;\n    /**\n     * A variable string was compiled\n     *\n     * @var bool\n     */\n    public $has_variable_string = false;\n\n    /**\n     * Stack for {setfilter} {/setfilter}\n     *\n     * @var array\n     */\n    public $variable_filter_stack = array();\n    /**\n     * variable filters for {setfilter} {/setfilter}\n     *\n     * @var array\n     */\n    public $variable_filters = array();\n    /**\n     * Nesting count of looping tags like {foreach}, {for}, {section}, {while}\n     *\n     * @var int\n     */\n    public $loopNesting = 0;\n    /**\n     * Strip preg pattern\n     *\n     * @var string\n     */\n    public $stripRegEx = '![\\t ]*[\\r\\n]+[\\t ]*!';\n    /**\n     * plugin search order\n     *\n     * @var array\n     */\n    public $plugin_search_order = array('function',\n                                        'block',\n                                        'compiler',\n                                        'class');\n    /**\n     * General storage area for tag compiler plugins\n     *\n     * @var array\n     */\n    public $_cache = array();\n    /**\n     * Lexer preg pattern for left delimiter\n     *\n     * @var string\n     */\n    private $ldelPreg = '[{]';\n    /**\n     * Lexer preg pattern for right delimiter\n     *\n     * @var string\n     */\n    private $rdelPreg = '[}]';\n    /**\n     * Length of right delimiter\n     *\n     * @var int\n     */\n    private $rdelLength = 0;\n    /**\n     * Length of left delimiter\n     *\n     * @var int\n     */\n    private $ldelLength = 0;\n    /**\n     * Lexer preg pattern for user literals\n     *\n     * @var string\n     */\n    private $literalPreg = '';\n\n    /**\n     * Initialize compiler\n     *\n     * @param Smarty $smarty global instance\n     */\n    public function __construct(Smarty $smarty)\n    {\n        $this->smarty = $smarty;\n        $this->nocache_hash = str_replace(array('.',\n                                                ','),\n                                          '_',\n                                          uniqid(rand(), true));\n    }\n\n    /**\n     * Method to compile a Smarty template\n     *\n     * @param  Smarty_Internal_Template                 $template template object to compile\n     * @param  bool                                     $nocache  true is shall be compiled in nocache mode\n     * @param null|Smarty_Internal_TemplateCompilerBase $parent_compiler\n     *\n     * @return bool true if compiling succeeded, false if it failed\n     * @throws \\Exception\n     */\n    public function compileTemplate(Smarty_Internal_Template $template,\n                                    $nocache = null,\n                                    Smarty_Internal_TemplateCompilerBase $parent_compiler = null)\n    {\n        // get code frame of compiled template\n        $_compiled_code = $template->smarty->ext->_codeFrame->create($template,\n                                                                     $this->compileTemplateSource($template,\n                                                                                                  $nocache,\n                                                                                                  $parent_compiler),\n                                                                     $this->postFilter($this->blockOrFunctionCode) .\n                                                                     join('', $this->mergedSubTemplatesCode),\n                                                                     false,\n                                                                     $this);\n        return $_compiled_code;\n    }\n\n    /**\n     * Compile template source and run optional post filter\n     *\n     * @param \\Smarty_Internal_Template             $template\n     * @param null|bool                             $nocache flag if template must be compiled in nocache mode\n     * @param \\Smarty_Internal_TemplateCompilerBase $parent_compiler\n     *\n     * @return string\n     * @throws \\Exception\n     */\n    public function compileTemplateSource(Smarty_Internal_Template $template,\n                                          $nocache = null,\n                                          Smarty_Internal_TemplateCompilerBase $parent_compiler = null)\n    {\n        try {\n            // save template object in compiler class\n            $this->template = $template;\n            if (property_exists($this->template->smarty, 'plugin_search_order')) {\n                $this->plugin_search_order = $this->template->smarty->plugin_search_order;\n            }\n            if ($this->smarty->debugging) {\n                if (!isset($this->smarty->_debug)) {\n                    $this->smarty->_debug = new Smarty_Internal_Debug();\n                }\n                $this->smarty->_debug->start_compile($this->template);\n            }\n            if (isset($this->template->smarty->security_policy)) {\n                $this->php_handling = $this->template->smarty->security_policy->php_handling;\n            } else {\n                $this->php_handling = $this->template->smarty->php_handling;\n            }\n            $this->parent_compiler = $parent_compiler ? $parent_compiler : $this;\n            $nocache = isset($nocache) ? $nocache : false;\n            if (empty($template->compiled->nocache_hash)) {\n                $template->compiled->nocache_hash = $this->nocache_hash;\n            } else {\n                $this->nocache_hash = $template->compiled->nocache_hash;\n            }\n            // flag for nocache sections\n            $this->nocache = $nocache;\n            $this->tag_nocache = false;\n            // reset has nocache code flag\n            $this->template->compiled->has_nocache_code = false;\n            $this->has_variable_string = false;\n            $this->prefix_code = array();\n            // add file dependency\n            if ($this->smarty->merge_compiled_includes || $this->template->source->handler->checkTimestamps()) {\n                $this->parent_compiler->template->compiled->file_dependency[ $this->template->source->uid ] =\n                    array($this->template->source->filepath,\n                          $this->template->source->getTimeStamp(),\n                          $this->template->source->type,);\n            }\n            $this->smarty->_current_file = $this->template->source->filepath;\n            // get template source\n            if (!empty($this->template->source->components)) {\n                // we have array of inheritance templates by extends: resource\n                // generate corresponding source code sequence\n                $_content =\n                    Smarty_Internal_Compile_Extends::extendsSourceArrayCode($this->template->source->components);\n            } else {\n                // get template source\n                $_content = $this->template->source->getContent();\n            }\n            $_compiled_code = $this->postFilter($this->doCompile($this->preFilter($_content), true));\n        }\n        catch (Exception $e) {\n            if ($this->smarty->debugging) {\n                $this->smarty->_debug->end_compile($this->template);\n            }\n            $this->_tag_stack = array();\n            // free memory\n            $this->parent_compiler = null;\n            $this->template = null;\n            $this->parser = null;\n            throw $e;\n        }\n        if ($this->smarty->debugging) {\n            $this->smarty->_debug->end_compile($this->template);\n        }\n        $this->parent_compiler = null;\n        $this->parser = null;\n        return $_compiled_code;\n    }\n\n    /**\n     * Optionally process compiled code by post filter\n     *\n     * @param string $code compiled code\n     *\n     * @return string\n     * @throws \\SmartyException\n     */\n    public function postFilter($code)\n    {\n        // run post filter if on code\n        if (!empty($code) &&\n            (isset($this->smarty->autoload_filters[ 'post' ]) || isset($this->smarty->registered_filters[ 'post' ]))\n        ) {\n            return $this->smarty->ext->_filterHandler->runFilter('post', $code, $this->template);\n        } else {\n            return $code;\n        }\n    }\n\n    /**\n     * Run optional prefilter\n     *\n     * @param string $_content template source\n     *\n     * @return string\n     * @throws \\SmartyException\n     */\n    public function preFilter($_content)\n    {\n        // run pre filter if required\n        if ($_content !== '' &&\n            ((isset($this->smarty->autoload_filters[ 'pre' ]) || isset($this->smarty->registered_filters[ 'pre' ])))\n        ) {\n            return $this->smarty->ext->_filterHandler->runFilter('pre', $_content, $this->template);\n        } else {\n            return $_content;\n        }\n    }\n\n    /**\n     * Compile Tag\n     * This is a call back from the lexer/parser\n     *\n     * Save current prefix code\n     * Compile tag\n     * Merge tag prefix code with saved one\n     * (required nested tags in attributes)\n     *\n     * @param  string $tag       tag name\n     * @param  array  $args      array with tag attributes\n     * @param  array  $parameter array with compilation parameter\n     *\n     * @throws SmartyCompilerException\n     * @throws SmartyException\n     * @return string compiled code\n     */\n    public function compileTag($tag, $args, $parameter = array())\n    {\n        $this->prefixCodeStack[] = $this->prefix_code;\n        $this->prefix_code = array();\n        $result = $this->compileTag2($tag, $args, $parameter);\n        $this->prefix_code = array_merge($this->prefix_code, array_pop($this->prefixCodeStack));\n        return $result;\n    }\n\n    /**\n     * compile variable\n     *\n     * @param string $variable\n     *\n     * @return string\n     */\n    public function compileVariable($variable)\n    {\n        if (!strpos($variable, '(')) {\n            // not a variable variable\n            $var = trim($variable, '\\'');\n            $this->tag_nocache = $this->tag_nocache |\n                                 $this->template->ext->getTemplateVars->_getVariable($this->template,\n                                                                                     $var,\n                                                                                     null,\n                                                                                     true,\n                                                                                     false)->nocache;\n            // todo $this->template->compiled->properties['variables'][$var] = $this->tag_nocache | $this->nocache;\n        }\n        return '$_smarty_tpl->tpl_vars[' . $variable . ']->value';\n    }\n\n    /**\n     * compile config variable\n     *\n     * @param string $variable\n     *\n     * @return string\n     */\n    public function compileConfigVariable($variable)\n    {\n        // return '$_smarty_tpl->config_vars[' . $variable . ']';\n        return '$_smarty_tpl->smarty->ext->configLoad->_getConfigVariable($_smarty_tpl, ' . $variable . ')';\n    }\n\n    /**\n     * compile PHP function call\n     *\n     * @param string       $name\n     * @param        array $parameter\n     *\n     * @return string\n     * @throws \\SmartyCompilerException\n     */\n    public function compilePHPFunctionCall($name, $parameter)\n    {\n        if (!$this->smarty->security_policy || $this->smarty->security_policy->isTrustedPhpFunction($name, $this)) {\n            if (strcasecmp($name, 'isset') === 0 || strcasecmp($name, 'empty') === 0 ||\n                strcasecmp($name, 'array') === 0 || is_callable($name)\n            ) {\n                $func_name = strtolower($name);\n                $par = implode(',', $parameter);\n                $parHasFuction = strpos($par, '(') !== false;\n                if ($func_name === 'isset') {\n                    if (count($parameter) === 0) {\n                        $this->trigger_template_error('Illegal number of parameter in \"isset()\"');\n                    }\n                    if ($parHasFuction) {\n                        $pa = array();\n                        foreach ($parameter as $p) {\n                            $pa[] = (strpos($p, '(') === false) ? ('isset(' . $p . ')') : ('(' . $p . ' !== null )');\n                        }\n                        return '(' . implode(' && ', $pa) . ')';\n                    } else {\n                        $isset_par = str_replace(\"')->value\", \"',null,true,false)->value\", $par);\n                    }\n                    return $name . '(' . $isset_par . ')';\n                } else if (in_array($func_name,\n                                    array('empty',\n                                          'reset',\n                                          'current',\n                                          'end',\n                                          'prev',\n                                          'next'))) {\n                    if (count($parameter) !== 1) {\n                        $this->trigger_template_error(\"Illegal number of parameter in '{$func_name()}'\");\n                    }\n                    if ($func_name === 'empty') {\n                        if ($parHasFuction && version_compare(PHP_VERSION, '5.5.0', '<')) {\n                            return '(' . $parameter[ 0 ] . ' === false )';\n                        } else {\n                            return $func_name . '(' .\n                                   str_replace(\"')->value\", \"',null,true,false)->value\", $parameter[ 0 ]) . ')';\n                        }\n                    } else {\n                        return $func_name . '(' . $parameter[ 0 ] . ')';\n                    }\n                } else {\n                    return $name . '(' . implode(',', $parameter) . ')';\n                }\n            } else {\n                $this->trigger_template_error(\"unknown function '{$name}'\");\n            }\n        }\n    }\n\n    /**\n     * This method is called from parser to process a text content section\n     * - remove text from inheritance child templates as they may generate output\n     * - strip text if strip is enabled\n     *\n     * @param string $text\n     *\n     * @return null|\\Smarty_Internal_ParseTree_Text\n     */\n    public function processText($text)\n    {\n        if ((string)$text !== '') {\n            $store = array();\n            $_store = 0;\n            if ($this->parser->strip) {\n                if (strpos($text, '<') !== false) {\n                    // capture html elements not to be messed with\n                    $_offset = 0;\n                    if (preg_match_all('#(<script[^>]*>.*?</script[^>]*>)|(<textarea[^>]*>.*?</textarea[^>]*>)|(<pre[^>]*>.*?</pre[^>]*>)#is',\n                                       $text,\n                                       $matches,\n                                       PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) {\n                        foreach ($matches as $match) {\n                            $store[] = $match[ 0 ][ 0 ];\n                            $_length = strlen($match[ 0 ][ 0 ]);\n                            $replace = '@!@SMARTY:' . $_store . ':SMARTY@!@';\n                            $text = substr_replace($text, $replace, $match[ 0 ][ 1 ] - $_offset, $_length);\n                            $_offset += $_length - strlen($replace);\n                            ++$_store;\n                        }\n                    }\n                    $expressions = array(// replace multiple spaces between tags by a single space\n                                         '#(:SMARTY@!@|>)[\\040\\011]+(?=@!@SMARTY:|<)#s'                            => '\\1 \\2',\n                                         // remove newline between tags\n                                         '#(:SMARTY@!@|>)[\\040\\011]*[\\n]\\s*(?=@!@SMARTY:|<)#s'                     => '\\1\\2',\n                                         // remove multiple spaces between attributes (but not in attribute values!)\n                                         '#(([a-z0-9]\\s*=\\s*(\"[^\"]*?\")|(\\'[^\\']*?\\'))|<[a-z0-9_]+)\\s+([a-z/>])#is' => '\\1 \\5',\n                                         '#>[\\040\\011]+$#Ss'                                                       => '> ',\n                                         '#>[\\040\\011]*[\\n]\\s*$#Ss'                                                => '>',\n                                         $this->stripRegEx                                                         => '',);\n                    $text = preg_replace(array_keys($expressions), array_values($expressions), $text);\n                    $_offset = 0;\n                    if (preg_match_all('#@!@SMARTY:([0-9]+):SMARTY@!@#is',\n                                       $text,\n                                       $matches,\n                                       PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) {\n                        foreach ($matches as $match) {\n                            $_length = strlen($match[ 0 ][ 0 ]);\n                            $replace = $store[ $match[ 1 ][ 0 ] ];\n                            $text = substr_replace($text, $replace, $match[ 0 ][ 1 ] + $_offset, $_length);\n                            $_offset += strlen($replace) - $_length;\n                            ++$_store;\n                        }\n                    }\n                } else {\n                    $text = preg_replace($this->stripRegEx, '', $text);\n                }\n            }\n            return new Smarty_Internal_ParseTree_Text($text);\n        }\n        return null;\n    }\n\n    /**\n     * lazy loads internal compile plugin for tag and calls the compile method\n     * compile objects cached for reuse.\n     * class name format:  Smarty_Internal_Compile_TagName\n     * plugin filename format: Smarty_Internal_TagName.php\n     *\n     * @param  string $tag    tag name\n     * @param  array  $args   list of tag attributes\n     * @param  mixed  $param1 optional parameter\n     * @param  mixed  $param2 optional parameter\n     * @param  mixed  $param3 optional parameter\n     *\n     * @return bool|string compiled code or false\n     * @throws \\SmartyCompilerException\n     */\n    public function callTagCompiler($tag, $args, $param1 = null, $param2 = null, $param3 = null)\n    {\n        /* @var Smarty_Internal_CompileBase $tagCompiler */\n        $tagCompiler = $this->getTagCompiler($tag);\n        // compile this tag\n        return $tagCompiler === false ? false : $tagCompiler->compile($args, $this, $param1, $param2, $param3);\n    }\n\n    /**\n     * lazy loads internal compile plugin for tag compile objects cached for reuse.\n     *\n     * class name format:  Smarty_Internal_Compile_TagName\n     * plugin filename format: Smarty_Internal_TagName.php\n     *\n     * @param  string $tag tag name\n     *\n     * @return bool|\\Smarty_Internal_CompileBase tag compiler object or false if not found\n     * @throws \\SmartyCompilerException\n     */\n    public function getTagCompiler($tag)\n    {\n        // re-use object if already exists\n        if (!isset(self::$_tag_objects[ $tag ])) {\n            // lazy load internal compiler plugin\n            $_tag = explode('_', $tag);\n            $_tag = array_map('ucfirst', $_tag);\n            $class_name = 'Smarty_Internal_Compile_' . implode('_', $_tag);\n            if (class_exists($class_name) &&\n                (!isset($this->smarty->security_policy) || $this->smarty->security_policy->isTrustedTag($tag, $this))\n            ) {\n                self::$_tag_objects[ $tag ] = new $class_name;\n            } else {\n                self::$_tag_objects[ $tag ] = false;\n            }\n        }\n        return self::$_tag_objects[ $tag ];\n    }\n\n    /**\n     * Check for plugins and return function name\n     *\n     * @param         $plugin_name\n     * @param  string $plugin_type type of plugin\n     *\n     * @return string call name of function\n     * @throws \\SmartyException\n     */\n    public function getPlugin($plugin_name, $plugin_type)\n    {\n        $function = null;\n        if ($this->template->caching && ($this->nocache || $this->tag_nocache)) {\n            if (isset($this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ])) {\n                $function =\n                    $this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ][ 'function' ];\n            } else if (isset($this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ])) {\n                $this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ] =\n                    $this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ];\n                $function =\n                    $this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ][ 'function' ];\n            }\n        } else {\n            if (isset($this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ])) {\n                $function =\n                    $this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ][ 'function' ];\n            } else if (isset($this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ])) {\n                $this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ] =\n                    $this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ];\n                $function =\n                    $this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ][ 'function' ];\n            }\n        }\n        if (isset($function)) {\n            if ($plugin_type === 'modifier') {\n                $this->modifier_plugins[ $plugin_name ] = true;\n            }\n            return $function;\n        }\n        // loop through plugin dirs and find the plugin\n        $function = 'smarty_' . $plugin_type . '_' . $plugin_name;\n        $file = $this->smarty->loadPlugin($function, false);\n        if (is_string($file)) {\n            if ($this->template->caching && ($this->nocache || $this->tag_nocache)) {\n                $this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ][ 'file' ] =\n                    $file;\n                $this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ][ 'function' ] =\n                    $function;\n            } else {\n                $this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ][ 'file' ] =\n                    $file;\n                $this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ][ 'function' ] =\n                    $function;\n            }\n            if ($plugin_type === 'modifier') {\n                $this->modifier_plugins[ $plugin_name ] = true;\n            }\n            return $function;\n        }\n        if (is_callable($function)) {\n            // plugin function is defined in the script\n            return $function;\n        }\n        return false;\n    }\n\n    /**\n     * Check for plugins by default plugin handler\n     *\n     * @param  string $tag         name of tag\n     * @param  string $plugin_type type of plugin\n     *\n     * @return bool true if found\n     * @throws \\SmartyCompilerException\n     */\n    public function getPluginFromDefaultHandler($tag, $plugin_type)\n    {\n        $callback = null;\n        $script = null;\n        $cacheable = true;\n        $result = call_user_func_array($this->smarty->default_plugin_handler_func,\n                                       array($tag,\n                                             $plugin_type,\n                                             $this->template,\n                                             &$callback,\n                                             &$script,\n                                             &$cacheable,));\n        if ($result) {\n            $this->tag_nocache = $this->tag_nocache || !$cacheable;\n            if ($script !== null) {\n                if (is_file($script)) {\n                    if ($this->template->caching && ($this->nocache || $this->tag_nocache)) {\n                        $this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $tag ][ $plugin_type ][ 'file' ] =\n                            $script;\n                        $this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $tag ][ $plugin_type ][ 'function' ] =\n                            $callback;\n                    } else {\n                        $this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $tag ][ $plugin_type ][ 'file' ] =\n                            $script;\n                        $this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $tag ][ $plugin_type ][ 'function' ] =\n                            $callback;\n                    }\n                    require_once $script;\n                } else {\n                    $this->trigger_template_error(\"Default plugin handler: Returned script file '{$script}' for '{$tag}' not found\");\n                }\n            }\n            if (is_callable($callback)) {\n                $this->default_handler_plugins[ $plugin_type ][ $tag ] = array($callback,\n                                                                               true,\n                                                                               array());\n                return true;\n            } else {\n                $this->trigger_template_error(\"Default plugin handler: Returned callback for '{$tag}' not callable\");\n            }\n        }\n        return false;\n    }\n\n    /**\n     * Append code segments and remove unneeded ?> <?php transitions\n     *\n     * @param string $left\n     * @param string $right\n     *\n     * @return string\n     */\n    public function appendCode($left, $right)\n    {\n        if (preg_match('/\\s*\\?>\\s?$/D', $left) && preg_match('/^<\\?php\\s+/', $right)) {\n            $left = preg_replace('/\\s*\\?>\\s?$/D', \"\\n\", $left);\n            $left .= preg_replace('/^<\\?php\\s+/', '', $right);\n        } else {\n            $left .= $right;\n        }\n        return $left;\n    }\n\n    /**\n     * Inject inline code for nocache template sections\n     * This method gets the content of each template element from the parser.\n     * If the content is compiled code and it should be not cached the code is injected\n     * into the rendered output.\n     *\n     * @param  string  $content content of template element\n     * @param  boolean $is_code true if content is compiled code\n     *\n     * @return string  content\n     */\n    public function processNocacheCode($content, $is_code)\n    {\n        // If the template is not evaluated and we have a nocache section and or a nocache tag\n        if ($is_code && !empty($content)) {\n            // generate replacement code\n            if ((!($this->template->source->handler->recompiled) || $this->forceNocache) && $this->template->caching &&\n                !$this->suppressNocacheProcessing && ($this->nocache || $this->tag_nocache)\n            ) {\n                $this->template->compiled->has_nocache_code = true;\n                $_output = addcslashes($content, '\\'\\\\');\n                $_output = str_replace('^#^', '\\'', $_output);\n                $_output = \"<?php echo '/*%%SmartyNocache:{$this->nocache_hash}%%*/{$_output}/*/%%SmartyNocache:{$this->nocache_hash}%%*/';?>\\n\";\n                // make sure we include modifier plugins for nocache code\n                foreach ($this->modifier_plugins as $plugin_name => $dummy) {\n                    if (isset($this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ 'modifier' ])) {\n                        $this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $plugin_name ][ 'modifier' ] =\n                            $this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ 'modifier' ];\n                    }\n                }\n            } else {\n                $_output = $content;\n            }\n        } else {\n            $_output = $content;\n        }\n        $this->modifier_plugins = array();\n        $this->suppressNocacheProcessing = false;\n        $this->tag_nocache = false;\n        return $_output;\n    }\n\n    /**\n     * Get Id\n     *\n     * @param string $input\n     *\n     * @return bool|string\n     */\n    public function getId($input)\n    {\n        if (preg_match('~^([\\'\"]*)([0-9]*[a-zA-Z_]\\w*)\\1$~', $input, $match)) {\n            return $match[ 2 ];\n        }\n        return false;\n    }\n\n    /**\n     * Get variable name from string\n     *\n     * @param string $input\n     *\n     * @return bool|string\n     */\n    public function getVariableName($input)\n    {\n        if (preg_match('~^[$]_smarty_tpl->tpl_vars\\[[\\'\"]*([0-9]*[a-zA-Z_]\\w*)[\\'\"]*\\]->value$~', $input, $match)) {\n            return $match[ 1 ];\n        }\n        return false;\n    }\n\n    /**\n     * Set nocache flag in variable or create new variable\n     *\n     * @param string $varName\n     */\n    public function setNocacheInVariable($varName)\n    {\n        // create nocache var to make it know for further compiling\n        if ($_var = $this->getId($varName)) {\n            if (isset($this->template->tpl_vars[ $_var ])) {\n                $this->template->tpl_vars[ $_var ] = clone $this->template->tpl_vars[ $_var ];\n                $this->template->tpl_vars[ $_var ]->nocache = true;\n            } else {\n                $this->template->tpl_vars[ $_var ] = new Smarty_Variable(null, true);\n            }\n        }\n    }\n\n    /**\n     * @param array $_attr tag attributes\n     * @param array $validScopes\n     *\n     * @return int|string\n     * @throws \\SmartyCompilerException\n     */\n    public function convertScope($_attr, $validScopes)\n    {\n        $_scope = 0;\n        if (isset($_attr[ 'scope' ])) {\n            $_scopeName = trim($_attr[ 'scope' ], '\\'\"');\n            if (is_numeric($_scopeName) && in_array($_scopeName, $validScopes)) {\n                $_scope = $_scopeName;\n            } else if (is_string($_scopeName)) {\n                $_scopeName = trim($_scopeName, '\\'\"');\n                $_scope = isset($validScopes[ $_scopeName ]) ? $validScopes[ $_scopeName ] : false;\n            } else {\n                $_scope = false;\n            }\n            if ($_scope === false) {\n                $err = var_export($_scopeName, true);\n                $this->trigger_template_error(\"illegal value '{$err}' for \\\"scope\\\" attribute\", null, true);\n            }\n        }\n        return $_scope;\n    }\n\n    /**\n     * Generate nocache code string\n     *\n     * @param string $code PHP code\n     *\n     * @return string\n     */\n    public function makeNocacheCode($code)\n    {\n        return \"echo '/*%%SmartyNocache:{$this->nocache_hash}%%*/<?php \" .\n               str_replace('^#^', '\\'', addcslashes($code, '\\'\\\\')) .\n               \"?>/*/%%SmartyNocache:{$this->nocache_hash}%%*/';\\n\";\n    }\n\n    /**\n     * display compiler error messages without dying\n     * If parameter $args is empty it is a parser detected syntax error.\n     * In this case the parser is called to obtain information about expected tokens.\n     * If parameter $args contains a string this is used as error message\n     *\n     * @param  string   $args    individual error message or null\n     * @param  string   $line    line-number\n     * @param null|bool $tagline if true the line number of last tag\n     *\n     * @throws \\SmartyCompilerException when an unexpected token is found\n     */\n    public function trigger_template_error($args = null, $line = null, $tagline = null)\n    {\n        $lex = $this->parser->lex;\n        if ($tagline === true) {\n            // get line number of Tag\n            $line = $lex->taglineno;\n        } else if (!isset($line)) {\n            // get template source line which has error\n            $line = $lex->line;\n        } else {\n            $line = (int)$line;\n        }\n        if (in_array($this->template->source->type,\n                     array('eval',\n                           'string'))) {\n            $templateName = $this->template->source->type . ':' . trim(preg_replace('![\\t\\r\\n]+!',\n                                                                                    ' ',\n                                                                                    strlen($lex->data) > 40 ?\n                                                                                        substr($lex->data, 0, 40) .\n                                                                                        '...' : $lex->data));\n        } else {\n            $templateName = $this->template->source->type . ':' . $this->template->source->filepath;\n        }\n        //        $line += $this->trace_line_offset;\n        $match = preg_split(\"/\\n/\", $lex->data);\n        $error_text =\n            'Syntax error in template \"' . (empty($this->trace_filepath) ? $templateName : $this->trace_filepath) .\n            '\"  on line ' . ($line + $this->trace_line_offset) . ' \"' .\n            trim(preg_replace('![\\t\\r\\n]+!', ' ', $match[ $line - 1 ])) . '\" ';\n        if (isset($args)) {\n            // individual error message\n            $error_text .= $args;\n        } else {\n            $expect = array();\n            // expected token from parser\n            $error_text .= ' - Unexpected \"' . $lex->value . '\"';\n            if (count($this->parser->yy_get_expected_tokens($this->parser->yymajor)) <= 4) {\n                foreach ($this->parser->yy_get_expected_tokens($this->parser->yymajor) as $token) {\n                    $exp_token = $this->parser->yyTokenName[ $token ];\n                    if (isset($lex->smarty_token_names[ $exp_token ])) {\n                        // token type from lexer\n                        $expect[] = '\"' . $lex->smarty_token_names[ $exp_token ] . '\"';\n                    } else {\n                        // otherwise internal token name\n                        $expect[] = $this->parser->yyTokenName[ $token ];\n                    }\n                }\n                $error_text .= ', expected one of: ' . implode(' , ', $expect);\n            }\n        }\n        if ($this->smarty->_parserdebug) {\n            $this->parser->errorRunDown();\n            echo ob_get_clean();\n            flush();\n        }\n        $e = new SmartyCompilerException($error_text);\n        $e->line = $line;\n        $e->source = trim(preg_replace('![\\t\\r\\n]+!', ' ', $match[ $line - 1 ]));\n        $e->desc = $args;\n        $e->template = $this->template->source->filepath;\n        throw $e;\n    }\n\n    /**\n     * Return var_export() value with all white spaces removed\n     *\n     * @param  mixed $value\n     *\n     * @return string\n     */\n    public function getVarExport($value)\n    {\n        return preg_replace('/\\s/', '', var_export($value, true));\n    }\n\n    /**\n     *  enter double quoted string\n     *  - save tag stack count\n     */\n    public function enterDoubleQuote()\n    {\n        array_push($this->_tag_stack_count, $this->getTagStackCount());\n    }\n\n    /**\n     * Return tag stack count\n     *\n     * @return int\n     */\n    public function getTagStackCount()\n    {\n        return count($this->_tag_stack);\n    }\n\n    /**\n     * @param $lexerPreg\n     *\n     * @return mixed\n     */\n    public function replaceDelimiter($lexerPreg)\n    {\n        return str_replace(array('SMARTYldel', 'SMARTYliteral', 'SMARTYrdel', 'SMARTYautoliteral', 'SMARTYal'),\n                           array($this->ldelPreg, $this->literalPreg, $this->rdelPreg,\n                                 $this->smarty->getAutoLiteral() ? '{1,}' : '{9}',\n                                 $this->smarty->getAutoLiteral() ? '' : '\\\\s*'),\n                           $lexerPreg);\n    }\n\n    /**\n     * Build lexer regular expressions for left and right delimiter and user defined literals\n     */\n    public function initDelimiterPreg()\n    {\n        $ldel = $this->smarty->getLeftDelimiter();\n        $this->ldelLength = strlen($ldel);\n        $this->ldelPreg = '';\n        foreach (str_split($ldel, 1) as $chr) {\n            $this->ldelPreg .= '[' . ($chr === '\\\\' ? '\\\\' : '') . $chr . ']';\n        }\n        $rdel = $this->smarty->getRightDelimiter();\n        $this->rdelLength = strlen($rdel);\n        $this->rdelPreg = '';\n        foreach (str_split($rdel, 1) as $chr) {\n            $this->rdelPreg .= '[' . ($chr === '\\\\' ? '\\\\' : '') . $chr . ']';\n        }\n        $literals = $this->smarty->getLiterals();\n        if (!empty($literals)) {\n            foreach ($literals as $key => $literal) {\n                $literalPreg = '';\n                foreach (str_split($literal, 1) as $chr) {\n                    $literalPreg .= '[' . ($chr === '\\\\' ? '\\\\' : '') . $chr . ']';\n                }\n                $literals[ $key ] = $literalPreg;\n            }\n            $this->literalPreg = '|' . implode('|', $literals);\n        } else {\n            $this->literalPreg = '';\n        }\n    }\n\n    /**\n     *  leave double quoted string\n     *  - throw exception if block in string was not closed\n     *\n     * @throws \\SmartyCompilerException\n     */\n    public function leaveDoubleQuote()\n    {\n        if (array_pop($this->_tag_stack_count) !== $this->getTagStackCount()) {\n            $tag = $this->getOpenBlockTag();\n            $this->trigger_template_error(\"unclosed '{{$tag}}' in doubled quoted string\",\n                                          null,\n                                          true);\n        }\n    }\n\n    /**\n     * Get left delimiter preg\n     *\n     * @return string\n     */\n    public function getLdelPreg()\n    {\n        return $this->ldelPreg;\n    }\n\n    /**\n     * Get right delimiter preg\n     *\n     * @return string\n     */\n    public function getRdelPreg()\n    {\n        return $this->rdelPreg;\n    }\n\n    /**\n     * Get length of left delimiter\n     *\n     * @return int\n     */\n    public function getLdelLength()\n    {\n        return $this->ldelLength;\n    }\n\n    /**\n     * Get length of right delimiter\n     *\n     * @return int\n     */\n    public function getRdelLength()\n    {\n        return $this->rdelLength;\n    }\n\n    /**\n     * Get name of current open block tag\n     *\n     * @return string|boolean\n     */\n    public function getOpenBlockTag()\n    {\n        $tagCount = $this->getTagStackCount();\n        if ($tagCount) {\n            return $this->_tag_stack[ $tagCount - 1 ][ 0 ];\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * Check if $value contains variable elements\n     *\n     * @param mixed $value\n     *\n     * @return bool|int\n     */\n    public function isVariable($value)\n    {\n        if (is_string($value)) {\n            return preg_match('/[$(]/', $value);\n        }\n        if (is_bool($value) || is_numeric($value)) {\n            return false;\n        }\n        if (is_array($value)) {\n            foreach ($value as $k => $v) {\n                if ($this->isVariable($k) || $this->isVariable($v)) {\n                    return true;\n                }\n            }\n            return false;\n        }\n        return false;\n    }\n\n    /**\n     * Get new prefix variable name\n     *\n     * @return string\n     */\n    public function getNewPrefixVariable()\n    {\n        ++self::$prefixVariableNumber;\n        return $this->getPrefixVariable();\n    }\n\n    /**\n     * Get current prefix variable name\n     *\n     * @return string\n     */\n    public function getPrefixVariable()\n    {\n        return '$_prefixVariable' . self::$prefixVariableNumber;\n    }\n\n    /**\n     * append  code to prefix buffer\n     *\n     * @param string $code\n     */\n    public function appendPrefixCode($code)\n    {\n        $this->prefix_code[] = $code;\n    }\n\n    /**\n     * get prefix code string\n     *\n     * @return string\n     */\n    public function getPrefixCode()\n    {\n        $code = '';\n        $prefixArray = array_merge($this->prefix_code, array_pop($this->prefixCodeStack));\n        $this->prefixCodeStack[] = array();\n        foreach ($prefixArray as $c) {\n            $code = $this->appendCode($code, $c);\n        }\n        $this->prefix_code = array();\n        return $code;\n    }\n\n    /**\n     * method to compile a Smarty template\n     *\n     * @param mixed $_content template source\n     * @param bool  $isTemplateSource\n     *\n     * @return bool true if compiling succeeded, false if it failed\n     */\n    abstract protected function doCompile($_content, $isTemplateSource = false);\n\n    /**\n     * Compile Tag\n     *\n     * @param  string $tag       tag name\n     * @param  array  $args      array with tag attributes\n     * @param  array  $parameter array with compilation parameter\n     *\n     * @throws SmartyCompilerException\n     * @throws SmartyException\n     * @return string compiled code\n     */\n    private function compileTag2($tag, $args, $parameter)\n    {\n        $plugin_type = '';\n        // $args contains the attributes parsed and compiled by the lexer/parser\n        // assume that tag does compile into code, but creates no HTML output\n        $this->has_code = true;\n        // log tag/attributes\n        if (isset($this->smarty->_cache[ 'get_used_tags' ])) {\n            $this->template->_cache[ 'used_tags' ][] = array($tag,\n                                                             $args);\n        }\n        // check nocache option flag\n        foreach ($args as $arg) {\n            if (!is_array($arg)) {\n                if ($arg === \"'nocache'\" || $arg === 'nocache') {\n                    $this->tag_nocache = true;\n                }\n            } else {\n                foreach ($arg as $k => $v) {\n                    if (($k === \"'nocache'\" || $k === 'nocache') && (trim($v, \"'\\\" \") === 'true')) {\n                        $this->tag_nocache = true;\n                    }\n                }\n            }\n        }\n        // compile the smarty tag (required compile classes to compile the tag are auto loaded)\n        if (($_output = $this->callTagCompiler($tag, $args, $parameter)) === false) {\n            if (isset($this->parent_compiler->tpl_function[ $tag ]) ||\n                (isset ($this->template->smarty->ext->_tplFunction) &&\n                 $this->template->smarty->ext->_tplFunction->getTplFunction($this->template, $tag) !== false)\n            ) {\n                // template defined by {template} tag\n                $args[ '_attr' ][ 'name' ] = \"'{$tag}'\";\n                $_output = $this->callTagCompiler('call', $args, $parameter);\n            }\n        }\n        if ($_output !== false) {\n            if ($_output !== true) {\n                // did we get compiled code\n                if ($this->has_code) {\n                    // return compiled code\n                    return $_output;\n                }\n            }\n            // tag did not produce compiled code\n            return null;\n        } else {\n            // map_named attributes\n            if (isset($args[ '_attr' ])) {\n                foreach ($args[ '_attr' ] as $key => $attribute) {\n                    if (is_array($attribute)) {\n                        $args = array_merge($args, $attribute);\n                    }\n                }\n            }\n            // not an internal compiler tag\n            if (strlen($tag) < 6 || substr($tag, -5) !== 'close') {\n                // check if tag is a registered object\n                if (isset($this->smarty->registered_objects[ $tag ]) && isset($parameter[ 'object_method' ])) {\n                    $method = $parameter[ 'object_method' ];\n                    if (!in_array($method, $this->smarty->registered_objects[ $tag ][ 3 ]) &&\n                        (empty($this->smarty->registered_objects[ $tag ][ 1 ]) ||\n                         in_array($method, $this->smarty->registered_objects[ $tag ][ 1 ]))\n                    ) {\n                        return $this->callTagCompiler('private_object_function', $args, $parameter, $tag, $method);\n                    } else if (in_array($method, $this->smarty->registered_objects[ $tag ][ 3 ])) {\n                        return $this->callTagCompiler('private_object_block_function',\n                                                      $args,\n                                                      $parameter,\n                                                      $tag,\n                                                      $method);\n                    } else {\n                        // throw exception\n                        $this->trigger_template_error('not allowed method \"' . $method . '\" in registered object \"' .\n                                                      $tag . '\"',\n                                                      null,\n                                                      true);\n                    }\n                }\n                // check if tag is registered\n                foreach (array(Smarty::PLUGIN_COMPILER,\n                               Smarty::PLUGIN_FUNCTION,\n                               Smarty::PLUGIN_BLOCK,) as $plugin_type) {\n                    if (isset($this->smarty->registered_plugins[ $plugin_type ][ $tag ])) {\n                        // if compiler function plugin call it now\n                        if ($plugin_type === Smarty::PLUGIN_COMPILER) {\n                            $new_args = array();\n                            foreach ($args as $key => $mixed) {\n                                if (is_array($mixed)) {\n                                    $new_args = array_merge($new_args, $mixed);\n                                } else {\n                                    $new_args[ $key ] = $mixed;\n                                }\n                            }\n                            if (!$this->smarty->registered_plugins[ $plugin_type ][ $tag ][ 1 ]) {\n                                $this->tag_nocache = true;\n                            }\n                            return call_user_func_array($this->smarty->registered_plugins[ $plugin_type ][ $tag ][ 0 ],\n                                                        array($new_args,\n                                                              $this));\n                        }\n                        // compile registered function or block function\n                        if ($plugin_type === Smarty::PLUGIN_FUNCTION || $plugin_type === Smarty::PLUGIN_BLOCK) {\n                            return $this->callTagCompiler('private_registered_' . $plugin_type,\n                                                          $args,\n                                                          $parameter,\n                                                          $tag);\n                        }\n                    }\n                }\n                // check plugins from plugins folder\n                foreach ($this->plugin_search_order as $plugin_type) {\n                    if ($plugin_type === Smarty::PLUGIN_COMPILER &&\n                        $this->smarty->loadPlugin('smarty_compiler_' . $tag) &&\n                        (!isset($this->smarty->security_policy) ||\n                         $this->smarty->security_policy->isTrustedTag($tag, $this))\n                    ) {\n                        $plugin = 'smarty_compiler_' . $tag;\n                        if (is_callable($plugin)) {\n                            // convert arguments format for old compiler plugins\n                            $new_args = array();\n                            foreach ($args as $key => $mixed) {\n                                if (is_array($mixed)) {\n                                    $new_args = array_merge($new_args, $mixed);\n                                } else {\n                                    $new_args[ $key ] = $mixed;\n                                }\n                            }\n                            return $plugin($new_args, $this->smarty);\n                        }\n                        if (class_exists($plugin, false)) {\n                            $plugin_object = new $plugin;\n                            if (method_exists($plugin_object, 'compile')) {\n                                return $plugin_object->compile($args, $this);\n                            }\n                        }\n                        throw new SmartyException(\"Plugin '{$tag}' not callable\");\n                    } else {\n                        if ($function = $this->getPlugin($tag, $plugin_type)) {\n                            if (!isset($this->smarty->security_policy) ||\n                                $this->smarty->security_policy->isTrustedTag($tag, $this)\n                            ) {\n                                return $this->callTagCompiler('private_' . $plugin_type . '_plugin',\n                                                              $args,\n                                                              $parameter,\n                                                              $tag,\n                                                              $function);\n                            }\n                        }\n                    }\n                }\n                if (is_callable($this->smarty->default_plugin_handler_func)) {\n                    $found = false;\n                    // look for already resolved tags\n                    foreach ($this->plugin_search_order as $plugin_type) {\n                        if (isset($this->default_handler_plugins[ $plugin_type ][ $tag ])) {\n                            $found = true;\n                            break;\n                        }\n                    }\n                    if (!$found) {\n                        // call default handler\n                        foreach ($this->plugin_search_order as $plugin_type) {\n                            if ($this->getPluginFromDefaultHandler($tag, $plugin_type)) {\n                                $found = true;\n                                break;\n                            }\n                        }\n                    }\n                    if ($found) {\n                        // if compiler function plugin call it now\n                        if ($plugin_type === Smarty::PLUGIN_COMPILER) {\n                            $new_args = array();\n                            foreach ($args as $key => $mixed) {\n                                if (is_array($mixed)) {\n                                    $new_args = array_merge($new_args, $mixed);\n                                } else {\n                                    $new_args[ $key ] = $mixed;\n                                }\n                            }\n                            return call_user_func_array($this->default_handler_plugins[ $plugin_type ][ $tag ][ 0 ],\n                                                        array($new_args,\n                                                              $this));\n                        } else {\n                            return $this->callTagCompiler('private_registered_' . $plugin_type,\n                                                          $args,\n                                                          $parameter,\n                                                          $tag);\n                        }\n                    }\n                }\n            } else {\n                // compile closing tag of block function\n                $base_tag = substr($tag, 0, -5);\n                // check if closing tag is a registered object\n                if (isset($this->smarty->registered_objects[ $base_tag ]) && isset($parameter[ 'object_method' ])) {\n                    $method = $parameter[ 'object_method' ];\n                    if (in_array($method, $this->smarty->registered_objects[ $base_tag ][ 3 ])) {\n                        return $this->callTagCompiler('private_object_block_function',\n                                                      $args,\n                                                      $parameter,\n                                                      $tag,\n                                                      $method);\n                    } else {\n                        // throw exception\n                        $this->trigger_template_error('not allowed closing tag method \"' . $method .\n                                                      '\" in registered object \"' . $base_tag . '\"',\n                                                      null,\n                                                      true);\n                    }\n                }\n                // registered block tag ?\n                if (isset($this->smarty->registered_plugins[ Smarty::PLUGIN_BLOCK ][ $base_tag ]) ||\n                    isset($this->default_handler_plugins[ Smarty::PLUGIN_BLOCK ][ $base_tag ])\n                ) {\n                    return $this->callTagCompiler('private_registered_block', $args, $parameter, $tag);\n                }\n                // registered function tag ?\n                if (isset($this->smarty->registered_plugins[ Smarty::PLUGIN_FUNCTION ][ $tag ])) {\n                    return $this->callTagCompiler('private_registered_function', $args, $parameter, $tag);\n                }\n                // block plugin?\n                if ($function = $this->getPlugin($base_tag, Smarty::PLUGIN_BLOCK)) {\n                    return $this->callTagCompiler('private_block_plugin', $args, $parameter, $tag, $function);\n                }\n                // function plugin?\n                if ($function = $this->getPlugin($tag, Smarty::PLUGIN_FUNCTION)) {\n                    if (!isset($this->smarty->security_policy) ||\n                        $this->smarty->security_policy->isTrustedTag($tag, $this)\n                    ) {\n                        return $this->callTagCompiler('private_function_plugin', $args, $parameter, $tag, $function);\n                    }\n                }\n                // registered compiler plugin ?\n                if (isset($this->smarty->registered_plugins[ Smarty::PLUGIN_COMPILER ][ $tag ])) {\n                    // if compiler function plugin call it now\n                    $args = array();\n                    if (!$this->smarty->registered_plugins[ Smarty::PLUGIN_COMPILER ][ $tag ][ 1 ]) {\n                        $this->tag_nocache = true;\n                    }\n                    return call_user_func_array($this->smarty->registered_plugins[ Smarty::PLUGIN_COMPILER ][ $tag ][ 0 ],\n                                                array($args,\n                                                      $this));\n                }\n                if ($this->smarty->loadPlugin('smarty_compiler_' . $tag)) {\n                    $plugin = 'smarty_compiler_' . $tag;\n                    if (is_callable($plugin)) {\n                        return $plugin($args, $this->smarty);\n                    }\n                    if (class_exists($plugin, false)) {\n                        $plugin_object = new $plugin;\n                        if (method_exists($plugin_object, 'compile')) {\n                            return $plugin_object->compile($args, $this);\n                        }\n                    }\n                    throw new SmartyException(\"Plugin '{$tag}' not callable\");\n                }\n            }\n            $this->trigger_template_error(\"unknown tag '{$tag}'\", null, true);\n        }\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_templatelexer.php",
    "content": "<?php\n/*\n * This file is part of Smarty.\n *\n * (c) 2015 Uwe Tews\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\n/**\n * Smarty_Internal_Templatelexer\n * This is the template file lexer.\n * It is generated from the smarty_internal_templatelexer.plex file\n *\n *\n * @author Uwe Tews <uwe.tews@googlemail.com>\n */\nclass Smarty_Internal_Templatelexer\n{\n    const TEXT               = 1;\n    const TAG                = 2;\n    const TAGBODY            = 3;\n    const LITERAL            = 4;\n    const DOUBLEQUOTEDSTRING = 5;\n    /**\n     * Source\n     *\n     * @var string\n     */\n    public $data;\n    /**\n     * Source length\n     *\n     * @var int\n     */\n    public $dataLength = null;\n    /**\n     * byte counter\n     *\n     * @var int\n     */\n    public $counter;\n    /**\n     * token number\n     *\n     * @var int\n     */\n    public $token;\n    /**\n     * token value\n     *\n     * @var string\n     */\n    public $value;\n    /**\n     * current line\n     *\n     * @var int\n     */\n    public $line;\n    /**\n     * tag start line\n     *\n     * @var\n     */\n    public $taglineno;\n    /**\n     * php code type\n     *\n     * @var string\n     */\n    public $phpType = '';\n    /**\n     * state number\n     *\n     * @var int\n     */\n    public $state = 1;\n    /**\n     * Smarty object\n     *\n     * @var Smarty\n     */\n    public $smarty = null;\n    /**\n     * compiler object\n     *\n     * @var Smarty_Internal_TemplateCompilerBase\n     */\n    public $compiler = null;\n    /**\n     * trace file\n     *\n     * @var resource\n     */\n    public $yyTraceFILE;\n    /**\n     * trace prompt\n     *\n     * @var string\n     */\n    public $yyTracePrompt;\n    /**\n     * XML flag true while processing xml\n     *\n     * @var bool\n     */\n    public $is_xml = false;\n    /**\n     * state names\n     *\n     * @var array\n     */\n    public $state_name = array(1 => 'TEXT', 2 => 'TAG', 3 => 'TAGBODY', 4 => 'LITERAL', 5 => 'DOUBLEQUOTEDSTRING',);\n    /**\n     * token names\n     *\n     * @var array\n     */\n    public $smarty_token_names = array(        // Text for parser error messages\n                                               'NOT'         => '(!,not)',\n                                               'OPENP'       => '(',\n                                               'CLOSEP'      => ')',\n                                               'OPENB'       => '[',\n                                               'CLOSEB'      => ']',\n                                               'PTR'         => '->',\n                                               'APTR'        => '=>',\n                                               'EQUAL'       => '=',\n                                               'NUMBER'      => 'number',\n                                               'UNIMATH'     => '+\" , \"-',\n                                               'MATH'        => '*\" , \"/\" , \"%',\n                                               'INCDEC'      => '++\" , \"--',\n                                               'SPACE'       => ' ',\n                                               'DOLLAR'      => '$',\n                                               'SEMICOLON'   => ';',\n                                               'COLON'       => ':',\n                                               'DOUBLECOLON' => '::',\n                                               'AT'          => '@',\n                                               'HATCH'       => '#',\n                                               'QUOTE'       => '\"',\n                                               'BACKTICK'    => '`',\n                                               'VERT'        => '\"|\" modifier',\n                                               'DOT'         => '.',\n                                               'COMMA'       => '\",\"',\n                                               'QMARK'       => '\"?\"',\n                                               'ID'          => 'id, name',\n                                               'TEXT'        => 'text',\n                                               'LDELSLASH'   => '{/..} closing tag',\n                                               'LDEL'        => '{...} Smarty tag',\n                                               'COMMENT'     => 'comment',\n                                               'AS'          => 'as',\n                                               'TO'          => 'to',\n                                               'PHP'         => '\"<?php\", \"<%\", \"{php}\" tag',\n                                               'LOGOP'       => '\"<\", \"==\" ... logical operator',\n                                               'TLOGOP'      => '\"lt\", \"eq\" ... logical operator; \"is div by\" ... if condition',\n                                               'SCOND'       => '\"is even\" ... if condition',\n    );\n    /**\n     * literal tag nesting level\n     *\n     * @var int\n     */\n    private $literal_cnt = 0;\n    /**\n     * preg token pattern for state TEXT\n     *\n     * @var string\n     */\n    private $yy_global_pattern1 = null;\n    /**\n     * preg token pattern for state TAG\n     *\n     * @var string\n     */\n    private $yy_global_pattern2 = null;\n    /**\n     * preg token pattern for state TAGBODY\n     *\n     * @var string\n     */\n    private $yy_global_pattern3 = null;\n    /**\n     * preg token pattern for state LITERAL\n     *\n     * @var string\n     */\n    private $yy_global_pattern4 = null;\n    /**\n     * preg token pattern for state DOUBLEQUOTEDSTRING\n     *\n     * @var null\n     */\n    private $yy_global_pattern5 = null;\n    private $_yy_state          = 1;\n    private $_yy_stack          = array();\n\n    /**\n     * constructor\n     *\n     * @param   string                             $source template source\n     * @param Smarty_Internal_TemplateCompilerBase $compiler\n     */\n    function __construct($source, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        $this->data = $source;\n        $this->dataLength = strlen($this->data);\n        $this->counter = 0;\n        if (preg_match('/^\\xEF\\xBB\\xBF/i', $this->data, $match)) {\n            $this->counter += strlen($match[ 0 ]);\n        }\n        $this->line = 1;\n        $this->smarty = $compiler->template->smarty;\n        $this->compiler = $compiler;\n        $this->compiler->initDelimiterPreg();\n        $this->smarty_token_names[ 'LDEL' ] = $this->smarty->getLeftDelimiter();\n        $this->smarty_token_names[ 'RDEL' ] = $this->smarty->getRightDelimiter();\n    }\n\n    /**\n     * open lexer/parser trace file\n     *\n     */\n    public function PrintTrace()\n    {\n        $this->yyTraceFILE = fopen('php://output', 'w');\n        $this->yyTracePrompt = '<br>';\n    }\n\n    /**\n     * replace placeholders with runtime preg  code\n     *\n     * @param string $preg\n     *\n     * @return string\n     */\n    public function replace($preg)\n    {\n        return $this->compiler->replaceDelimiter($preg);\n    }\n\n    /**\n     * check if current value is an autoliteral left delimiter\n     *\n     * @return bool\n     */\n    public function isAutoLiteral()\n    {\n        return $this->smarty->getAutoLiteral() && isset($this->value[ $this->compiler->getLdelLength() ]) ?\n            strpos(\" \\n\\t\\r\", $this->value[ $this->compiler->getLdelLength() ]) !== false : false;\n    } // end function\n\n    public function yylex()\n    {\n        return $this->{'yylex' . $this->_yy_state}();\n    }\n\n    public function yypushstate($state)\n    {\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE,\n                    \"%sState push %s\\n\",\n                    $this->yyTracePrompt,\n                    isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] :\n                        $this->_yy_state);\n        }\n        array_push($this->_yy_stack, $this->_yy_state);\n        $this->_yy_state = $state;\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE,\n                    \"%snew State %s\\n\",\n                    $this->yyTracePrompt,\n                    isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] :\n                        $this->_yy_state);\n        }\n    }\n\n    public function yypopstate()\n    {\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE,\n                    \"%sState pop %s\\n\",\n                    $this->yyTracePrompt,\n                    isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] :\n                        $this->_yy_state);\n        }\n        $this->_yy_state = array_pop($this->_yy_stack);\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE,\n                    \"%snew State %s\\n\",\n                    $this->yyTracePrompt,\n                    isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] :\n                        $this->_yy_state);\n        }\n    }\n\n    public function yybegin($state)\n    {\n        $this->_yy_state = $state;\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE,\n                    \"%sState set %s\\n\",\n                    $this->yyTracePrompt,\n                    isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] :\n                        $this->_yy_state);\n        }\n    }\n\n    public function yylex1()\n    {\n        if (!isset($this->yy_global_pattern1)) {\n            $this->yy_global_pattern1 =\n                $this->replace(\"/\\G([{][}])|\\G((SMARTYldel)SMARTYal[*])|\\G((SMARTYldel)SMARTYalphp([ ].*?)?SMARTYrdel|(SMARTYldel)SMARTYal[\\/]phpSMARTYrdel)|\\G((SMARTYldel)SMARTYautoliteral\\\\s+SMARTYliteral)|\\G((SMARTYldel)SMARTYalliteral\\\\s*SMARTYrdel)|\\G((SMARTYldel)SMARTYal[\\/]literal\\\\s*SMARTYrdel)|\\G((SMARTYldel)SMARTYal)|\\G([<][?]((php\\\\s+|=)|\\\\s+)|[<][%]|[<][?]xml\\\\s+|[<]script\\\\s+language\\\\s*=\\\\s*[\\\"']?\\\\s*php\\\\s*[\\\"']?\\\\s*[>]|[?][>]|[%][>])|\\G((.*?)(?=((SMARTYldel)SMARTYal|[<][?]((php\\\\s+|=)|\\\\s+)|[<][%]|[<][?]xml\\\\s+|[<]script\\\\s+language\\\\s*=\\\\s*[\\\"']?\\\\s*php\\\\s*[\\\"']?\\\\s*[>]|[?][>]|[%][>]SMARTYliteral))|[\\s\\S]+)/isS\");\n        }\n        if (!isset($this->dataLength)) {\n            $this->dataLength = strlen($this->data);\n        }\n        if ($this->counter >= $this->dataLength) {\n            return false; // end of input\n        }\n        do {\n            if (preg_match($this->yy_global_pattern1, $this->data, $yymatches, 0, $this->counter)) {\n                if (!isset($yymatches[ 0 ][ 1 ])) {\n                    $yymatches = preg_grep(\"/(.|\\s)+/\", $yymatches);\n                } else {\n                    $yymatches = array_filter($yymatches);\n                }\n                if (empty($yymatches)) {\n                    throw new Exception('Error: lexing failed because a rule matched' .\n                                        ' an empty string.  Input \"' . substr($this->data,\n                                                                              $this->counter,\n                                                                              5) . '... state TEXT');\n                }\n                next($yymatches); // skip global match\n                $this->token = key($yymatches); // token number\n                $this->value = current($yymatches); // token value\n                $r = $this->{'yy_r1_' . $this->token}();\n                if ($r === null) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    // accept this token\n                    return true;\n                } else if ($r === true) {\n                    // we have changed state\n                    // process this token in the new state\n                    return $this->yylex();\n                } else if ($r === false) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    if ($this->counter >= $this->dataLength) {\n                        return false; // end of input\n                    }\n                    // skip this token\n                    continue;\n                }\n            } else {\n                throw new Exception('Unexpected input at line' . $this->line .\n                                    ': ' . $this->data[ $this->counter ]);\n            }\n            break;\n        } while (true);\n    }\n\n    function yy_r1_1()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_TEXT;\n    }\n\n    function yy_r1_2()\n    {\n        preg_match(\"/[*]{$this->compiler->getRdelPreg()}[\\n]?/\",\n                   $this->data,\n                   $match,\n                   PREG_OFFSET_CAPTURE,\n                   $this->counter);\n        if (isset($match[ 0 ][ 1 ])) {\n            $to = $match[ 0 ][ 1 ] + strlen($match[ 0 ][ 0 ]);\n        } else {\n            $this->compiler->trigger_template_error(\"missing or misspelled comment closing tag '{$this->smarty->getRightDelimiter()}'\");\n        }\n        $this->value = substr($this->data, $this->counter, $to - $this->counter);\n        return false;\n    }\n\n    function yy_r1_4()\n    {\n        $this->compiler->getTagCompiler('private_php')->parsePhp($this);\n    }\n\n    function yy_r1_8()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_TEXT;\n    }\n\n    function yy_r1_10()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_LITERALSTART;\n        $this->yypushstate(self::LITERAL);\n    }\n\n    function yy_r1_12()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_LITERALEND;\n        $this->yypushstate(self::LITERAL);\n    } // end function\n\n    function yy_r1_14()\n    {\n        $this->yypushstate(self::TAG);\n        return true;\n    }\n\n    function yy_r1_16()\n    {\n        $this->compiler->getTagCompiler('private_php')->parsePhp($this);\n    }\n\n    function yy_r1_19()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_TEXT;\n    }\n\n    public function yylex2()\n    {\n        if (!isset($this->yy_global_pattern2)) {\n            $this->yy_global_pattern2 =\n                $this->replace(\"/\\G((SMARTYldel)SMARTYal(if|elseif|else if|while)\\\\s+)|\\G((SMARTYldel)SMARTYalfor\\\\s+)|\\G((SMARTYldel)SMARTYalforeach(?![^\\s]))|\\G((SMARTYldel)SMARTYalsetfilter\\\\s+)|\\G((SMARTYldel)SMARTYalmake_nocache\\\\s+)|\\G((SMARTYldel)SMARTYal[0-9]*[a-zA-Z_]\\\\w*(\\\\s+nocache)?\\\\s*SMARTYrdel)|\\G((SMARTYldel)SMARTYal[\\/](?:(?!block)[0-9]*[a-zA-Z_]\\\\w*)\\\\s*SMARTYrdel)|\\G((SMARTYldel)SMARTYal[$][0-9]*[a-zA-Z_]\\\\w*(\\\\s+nocache)?\\\\s*SMARTYrdel)|\\G((SMARTYldel)SMARTYal[\\/])|\\G((SMARTYldel)SMARTYal)/isS\");\n        }\n        if (!isset($this->dataLength)) {\n            $this->dataLength = strlen($this->data);\n        }\n        if ($this->counter >= $this->dataLength) {\n            return false; // end of input\n        }\n        do {\n            if (preg_match($this->yy_global_pattern2, $this->data, $yymatches, 0, $this->counter)) {\n                if (!isset($yymatches[ 0 ][ 1 ])) {\n                    $yymatches = preg_grep(\"/(.|\\s)+/\", $yymatches);\n                } else {\n                    $yymatches = array_filter($yymatches);\n                }\n                if (empty($yymatches)) {\n                    throw new Exception('Error: lexing failed because a rule matched' .\n                                        ' an empty string.  Input \"' . substr($this->data,\n                                                                              $this->counter,\n                                                                              5) . '... state TAG');\n                }\n                next($yymatches); // skip global match\n                $this->token = key($yymatches); // token number\n                $this->value = current($yymatches); // token value\n                $r = $this->{'yy_r2_' . $this->token}();\n                if ($r === null) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    // accept this token\n                    return true;\n                } else if ($r === true) {\n                    // we have changed state\n                    // process this token in the new state\n                    return $this->yylex();\n                } else if ($r === false) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    if ($this->counter >= $this->dataLength) {\n                        return false; // end of input\n                    }\n                    // skip this token\n                    continue;\n                }\n            } else {\n                throw new Exception('Unexpected input at line' . $this->line .\n                                    ': ' . $this->data[ $this->counter ]);\n            }\n            break;\n        } while (true);\n    }\n\n    function yy_r2_1()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_LDELIF;\n        $this->yybegin(self::TAGBODY);\n        $this->taglineno = $this->line;\n    }\n\n    function yy_r2_4()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_LDELFOR;\n        $this->yybegin(self::TAGBODY);\n        $this->taglineno = $this->line;\n    }\n\n    function yy_r2_6()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH;\n        $this->yybegin(self::TAGBODY);\n        $this->taglineno = $this->line;\n    }\n\n    function yy_r2_8()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_LDELSETFILTER;\n        $this->yybegin(self::TAGBODY);\n        $this->taglineno = $this->line;\n    }\n\n    function yy_r2_10()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_LDELMAKENOCACHE;\n        $this->yybegin(self::TAGBODY);\n        $this->taglineno = $this->line;\n    }\n\n    function yy_r2_12()\n    {\n        $this->yypopstate();\n        $this->token = Smarty_Internal_Templateparser::TP_SIMPLETAG;\n        $this->taglineno = $this->line;\n    }\n\n    function yy_r2_15()\n    {\n        $this->yypopstate();\n        $this->token = Smarty_Internal_Templateparser::TP_CLOSETAG;\n        $this->taglineno = $this->line;\n    }\n\n    function yy_r2_17()\n    {\n        if ($this->_yy_stack[ count($this->_yy_stack) - 1 ] === self::TEXT) {\n            $this->yypopstate();\n            $this->token = Smarty_Internal_Templateparser::TP_SIMPELOUTPUT;\n            $this->taglineno = $this->line;\n        } else {\n            $this->value = $this->smarty->getLeftDelimiter();\n            $this->token = Smarty_Internal_Templateparser::TP_LDEL;\n            $this->yybegin(self::TAGBODY);\n            $this->taglineno = $this->line;\n        }\n    } // end function\n\n    function yy_r2_20()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;\n        $this->yybegin(self::TAGBODY);\n        $this->taglineno = $this->line;\n    }\n\n    function yy_r2_22()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_LDEL;\n        $this->yybegin(self::TAGBODY);\n        $this->taglineno = $this->line;\n    }\n\n    public function yylex3()\n    {\n        if (!isset($this->yy_global_pattern3)) {\n            $this->yy_global_pattern3 =\n                $this->replace(\"/\\G(\\\\s*SMARTYrdel)|\\G((SMARTYldel)SMARTYal)|\\G([\\\"])|\\G('[^'\\\\\\\\]*(?:\\\\\\\\.[^'\\\\\\\\]*)*')|\\G([$][0-9]*[a-zA-Z_]\\\\w*)|\\G([$])|\\G(\\\\s+is\\\\s+in\\\\s+)|\\G(\\\\s+as\\\\s+)|\\G(\\\\s+to\\\\s+)|\\G(\\\\s+step\\\\s+)|\\G(\\\\s+instanceof\\\\s+)|\\G(\\\\s*([!=][=]{1,2}|[<][=>]?|[>][=]?|[&|]{2})\\\\s*)|\\G(\\\\s+(eq|ne|neq|gt|ge|gte|lt|le|lte|mod|and|or|xor)\\\\s+)|\\G(\\\\s+is\\\\s+(not\\\\s+)?(odd|even|div)\\\\s+by\\\\s+)|\\G(\\\\s+is\\\\s+(not\\\\s+)?(odd|even))|\\G([!]\\\\s*|not\\\\s+)|\\G([(](int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)[)]\\\\s*)|\\G(\\\\s*[(]\\\\s*)|\\G(\\\\s*[)])|\\G(\\\\[\\\\s*)|\\G(\\\\s*\\\\])|\\G(\\\\s*[-][>]\\\\s*)|\\G(\\\\s*[=][>]\\\\s*)|\\G(\\\\s*[=]\\\\s*)|\\G(([+]|[-]){2})|\\G(\\\\s*([+]|[-])\\\\s*)|\\G(\\\\s*([*]{1,2}|[%\\/^&]|[<>]{2})\\\\s*)|\\G([@])|\\G([#])|\\G(\\\\s+[0-9]*[a-zA-Z_][a-zA-Z0-9_\\-:]*\\\\s*[=]\\\\s*)|\\G(([0-9]*[a-zA-Z_]\\\\w*)?(\\\\\\\\[0-9]*[a-zA-Z_]\\\\w*)+)|\\G([0-9]*[a-zA-Z_]\\\\w*)|\\G(\\\\d+)|\\G([`])|\\G([|][@]?)|\\G([.])|\\G(\\\\s*[,]\\\\s*)|\\G(\\\\s*[;]\\\\s*)|\\G([:]{2})|\\G(\\\\s*[:]\\\\s*)|\\G(\\\\s*[?]\\\\s*)|\\G(0[xX][0-9a-fA-F]+)|\\G(\\\\s+)|\\G([\\S\\s])/isS\");\n        }\n        if (!isset($this->dataLength)) {\n            $this->dataLength = strlen($this->data);\n        }\n        if ($this->counter >= $this->dataLength) {\n            return false; // end of input\n        }\n        do {\n            if (preg_match($this->yy_global_pattern3, $this->data, $yymatches, 0, $this->counter)) {\n                if (!isset($yymatches[ 0 ][ 1 ])) {\n                    $yymatches = preg_grep(\"/(.|\\s)+/\", $yymatches);\n                } else {\n                    $yymatches = array_filter($yymatches);\n                }\n                if (empty($yymatches)) {\n                    throw new Exception('Error: lexing failed because a rule matched' .\n                                        ' an empty string.  Input \"' . substr($this->data,\n                                                                              $this->counter,\n                                                                              5) . '... state TAGBODY');\n                }\n                next($yymatches); // skip global match\n                $this->token = key($yymatches); // token number\n                $this->value = current($yymatches); // token value\n                $r = $this->{'yy_r3_' . $this->token}();\n                if ($r === null) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    // accept this token\n                    return true;\n                } else if ($r === true) {\n                    // we have changed state\n                    // process this token in the new state\n                    return $this->yylex();\n                } else if ($r === false) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    if ($this->counter >= $this->dataLength) {\n                        return false; // end of input\n                    }\n                    // skip this token\n                    continue;\n                }\n            } else {\n                throw new Exception('Unexpected input at line' . $this->line .\n                                    ': ' . $this->data[ $this->counter ]);\n            }\n            break;\n        } while (true);\n    }\n\n    function yy_r3_1()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_RDEL;\n        $this->yypopstate();\n    }\n\n    function yy_r3_2()\n    {\n        $this->yypushstate(self::TAG);\n        return true;\n    }\n\n    function yy_r3_4()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_QUOTE;\n        $this->yypushstate(self::DOUBLEQUOTEDSTRING);\n        $this->compiler->enterDoubleQuote();\n    }\n\n    function yy_r3_5()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_SINGLEQUOTESTRING;\n    }\n\n    function yy_r3_6()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_DOLLARID;\n    }\n\n    function yy_r3_7()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_DOLLAR;\n    }\n\n    function yy_r3_8()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_ISIN;\n    }\n\n    function yy_r3_9()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_AS;\n    }\n\n    function yy_r3_10()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_TO;\n    }\n\n    function yy_r3_11()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_STEP;\n    }\n\n    function yy_r3_12()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_INSTANCEOF;\n    }\n\n    function yy_r3_13()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_LOGOP;\n    }\n\n    function yy_r3_15()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_SLOGOP;\n    }\n\n    function yy_r3_17()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_TLOGOP;\n    }\n\n    function yy_r3_20()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_SINGLECOND;\n    }\n\n    function yy_r3_23()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_NOT;\n    }\n\n    function yy_r3_24()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_TYPECAST;\n    }\n\n    function yy_r3_28()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_OPENP;\n    }\n\n    function yy_r3_29()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_CLOSEP;\n    }\n\n    function yy_r3_30()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_OPENB;\n    }\n\n    function yy_r3_31()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_CLOSEB;\n    }\n\n    function yy_r3_32()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_PTR;\n    }\n\n    function yy_r3_33()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_APTR;\n    }\n\n    function yy_r3_34()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_EQUAL;\n    }\n\n    function yy_r3_35()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_INCDEC;\n    }\n\n    function yy_r3_37()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_UNIMATH;\n    }\n\n    function yy_r3_39()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_MATH;\n    }\n\n    function yy_r3_41()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_AT;\n    }\n\n    function yy_r3_42()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_HATCH;\n    }\n\n    function yy_r3_43()\n    {\n        // resolve conflicts with shorttag and right_delimiter starting with '='\n        if (substr($this->data, $this->counter + strlen($this->value) - 1, $this->compiler->getRdelLength()) ===\n            $this->smarty->getRightDelimiter()) {\n            preg_match('/\\s+/', $this->value, $match);\n            $this->value = $match[ 0 ];\n            $this->token = Smarty_Internal_Templateparser::TP_SPACE;\n        } else {\n            $this->token = Smarty_Internal_Templateparser::TP_ATTR;\n        }\n    }\n\n    function yy_r3_44()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_NAMESPACE;\n    }\n\n    function yy_r3_47()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_ID;\n    }\n\n    function yy_r3_48()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_INTEGER;\n    }\n\n    function yy_r3_49()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_BACKTICK;\n        $this->yypopstate();\n    }\n\n    function yy_r3_50()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_VERT;\n    }\n\n    function yy_r3_51()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_DOT;\n    }\n\n    function yy_r3_52()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_COMMA;\n    }\n\n    function yy_r3_53()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_SEMICOLON;\n    }\n\n    function yy_r3_54()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_DOUBLECOLON;\n    }\n\n    function yy_r3_55()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_COLON;\n    }\n\n    function yy_r3_56()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_QMARK;\n    }\n\n    function yy_r3_57()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_HEX;\n    }\n\n    function yy_r3_58()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_SPACE;\n    } // end function\n\n    function yy_r3_59()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_TEXT;\n    }\n\n    public function yylex4()\n    {\n        if (!isset($this->yy_global_pattern4)) {\n            $this->yy_global_pattern4 =\n                $this->replace(\"/\\G((SMARTYldel)SMARTYalliteral\\\\s*SMARTYrdel)|\\G((SMARTYldel)SMARTYal[\\/]literal\\\\s*SMARTYrdel)|\\G((.*?)(?=(SMARTYldel)SMARTYal[\\/]?literalSMARTYrdel))/isS\");\n        }\n        if (!isset($this->dataLength)) {\n            $this->dataLength = strlen($this->data);\n        }\n        if ($this->counter >= $this->dataLength) {\n            return false; // end of input\n        }\n        do {\n            if (preg_match($this->yy_global_pattern4, $this->data, $yymatches, 0, $this->counter)) {\n                if (!isset($yymatches[ 0 ][ 1 ])) {\n                    $yymatches = preg_grep(\"/(.|\\s)+/\", $yymatches);\n                } else {\n                    $yymatches = array_filter($yymatches);\n                }\n                if (empty($yymatches)) {\n                    throw new Exception('Error: lexing failed because a rule matched' .\n                                        ' an empty string.  Input \"' . substr($this->data,\n                                                                              $this->counter,\n                                                                              5) . '... state LITERAL');\n                }\n                next($yymatches); // skip global match\n                $this->token = key($yymatches); // token number\n                $this->value = current($yymatches); // token value\n                $r = $this->{'yy_r4_' . $this->token}();\n                if ($r === null) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    // accept this token\n                    return true;\n                } else if ($r === true) {\n                    // we have changed state\n                    // process this token in the new state\n                    return $this->yylex();\n                } else if ($r === false) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    if ($this->counter >= $this->dataLength) {\n                        return false; // end of input\n                    }\n                    // skip this token\n                    continue;\n                }\n            } else {\n                throw new Exception('Unexpected input at line' . $this->line .\n                                    ': ' . $this->data[ $this->counter ]);\n            }\n            break;\n        } while (true);\n    }\n\n    function yy_r4_1()\n    {\n        $this->literal_cnt++;\n        $this->token = Smarty_Internal_Templateparser::TP_LITERAL;\n    }\n\n    function yy_r4_3()\n    {\n        if ($this->literal_cnt) {\n            $this->literal_cnt--;\n            $this->token = Smarty_Internal_Templateparser::TP_LITERAL;\n        } else {\n            $this->token = Smarty_Internal_Templateparser::TP_LITERALEND;\n            $this->yypopstate();\n        }\n    }\n\n    function yy_r4_5()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_LITERAL;\n    } // end function\n\n    public function yylex5()\n    {\n        if (!isset($this->yy_global_pattern5)) {\n            $this->yy_global_pattern5 =\n                $this->replace(\"/\\G((SMARTYldel)SMARTYautoliteral\\\\s+SMARTYliteral)|\\G((SMARTYldel)SMARTYalliteral\\\\s*SMARTYrdel)|\\G((SMARTYldel)SMARTYal[\\/]literal\\\\s*SMARTYrdel)|\\G((SMARTYldel)SMARTYal[\\/])|\\G((SMARTYldel)SMARTYal[0-9]*[a-zA-Z_]\\\\w*)|\\G((SMARTYldel)SMARTYal)|\\G([\\\"])|\\G([`][$])|\\G([$][0-9]*[a-zA-Z_]\\\\w*)|\\G([$])|\\G(([^\\\"\\\\\\\\]*?)((?:\\\\\\\\.[^\\\"\\\\\\\\]*?)*?)(?=((SMARTYldel)SMARTYal|\\\\$|`\\\\$|\\\"SMARTYliteral)))/isS\");\n        }\n        if (!isset($this->dataLength)) {\n            $this->dataLength = strlen($this->data);\n        }\n        if ($this->counter >= $this->dataLength) {\n            return false; // end of input\n        }\n        do {\n            if (preg_match($this->yy_global_pattern5, $this->data, $yymatches, 0, $this->counter)) {\n                if (!isset($yymatches[ 0 ][ 1 ])) {\n                    $yymatches = preg_grep(\"/(.|\\s)+/\", $yymatches);\n                } else {\n                    $yymatches = array_filter($yymatches);\n                }\n                if (empty($yymatches)) {\n                    throw new Exception('Error: lexing failed because a rule matched' .\n                                        ' an empty string.  Input \"' . substr($this->data,\n                                                                              $this->counter,\n                                                                              5) . '... state DOUBLEQUOTEDSTRING');\n                }\n                next($yymatches); // skip global match\n                $this->token = key($yymatches); // token number\n                $this->value = current($yymatches); // token value\n                $r = $this->{'yy_r5_' . $this->token}();\n                if ($r === null) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    // accept this token\n                    return true;\n                } else if ($r === true) {\n                    // we have changed state\n                    // process this token in the new state\n                    return $this->yylex();\n                } else if ($r === false) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    if ($this->counter >= $this->dataLength) {\n                        return false; // end of input\n                    }\n                    // skip this token\n                    continue;\n                }\n            } else {\n                throw new Exception('Unexpected input at line' . $this->line .\n                                    ': ' . $this->data[ $this->counter ]);\n            }\n            break;\n        } while (true);\n    }\n\n    function yy_r5_1()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_TEXT;\n    }\n\n    function yy_r5_3()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_TEXT;\n    }\n\n    function yy_r5_5()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_TEXT;\n    }\n\n    function yy_r5_7()\n    {\n        $this->yypushstate(self::TAG);\n        return true;\n    }\n\n    function yy_r5_9()\n    {\n        $this->yypushstate(self::TAG);\n        return true;\n    }\n\n    function yy_r5_11()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_LDEL;\n        $this->taglineno = $this->line;\n        $this->yypushstate(self::TAGBODY);\n    }\n\n    function yy_r5_13()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_QUOTE;\n        $this->yypopstate();\n    }\n\n    function yy_r5_14()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_BACKTICK;\n        $this->value = substr($this->value, 0, -1);\n        $this->yypushstate(self::TAGBODY);\n        $this->taglineno = $this->line;\n    }\n\n    function yy_r5_15()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_DOLLARID;\n    }\n\n    function yy_r5_16()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_TEXT;\n    }\n\n    function yy_r5_17()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_TEXT;\n    }\n}\n\n     "
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_templateparser.php",
    "content": "<?php\n\nclass TP_yyStackEntry\n{\n    public $stateno;       /* The state-number */\n    public $major;         /* The major token value.  This is the code\n                     ** number for the token at this stack level */\n    public $minor; /* The user-supplied minor token value.  This\n                     ** is the value of the token  */\n}\n\n#line 11 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n/**\n * Smarty Template Parser Class\n *\n * This is the template parser.\n * It is generated from the smarty_internal_templateparser.y file\n *\n * @author Uwe Tews <uwe.tews@googlemail.com>\n */\nclass Smarty_Internal_Templateparser\n{\n    #line 23 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    const Err1                 = 'Security error: Call to private object member not allowed';\n    const Err2                 = 'Security error: Call to dynamic object member not allowed';\n    const Err3                 = 'PHP in template not allowed. Use SmartyBC to enable it';\n    const TP_VERT              = 1;\n    const TP_COLON             = 2;\n    const TP_UNIMATH           = 3;\n    const TP_PHP               = 4;\n    const TP_TEXT              = 5;\n    const TP_STRIPON           = 6;\n    const TP_STRIPOFF          = 7;\n    const TP_LITERALSTART      = 8;\n    const TP_LITERALEND        = 9;\n    const TP_LITERAL           = 10;\n    const TP_SIMPELOUTPUT      = 11;\n    const TP_SIMPLETAG         = 12;\n    const TP_LDEL              = 13;\n    const TP_RDEL              = 14;\n    const TP_DOLLARID          = 15;\n    const TP_EQUAL             = 16;\n    const TP_ID                = 17;\n    const TP_PTR               = 18;\n    const TP_LDELMAKENOCACHE   = 19;\n    const TP_LDELIF            = 20;\n    const TP_LDELFOR           = 21;\n    const TP_SEMICOLON         = 22;\n    const TP_INCDEC            = 23;\n    const TP_TO                = 24;\n    const TP_STEP              = 25;\n    const TP_LDELFOREACH       = 26;\n    const TP_SPACE             = 27;\n    const TP_AS                = 28;\n    const TP_APTR              = 29;\n    const TP_LDELSETFILTER     = 30;\n    const TP_CLOSETAG          = 31;\n    const TP_LDELSLASH         = 32;\n    const TP_ATTR              = 33;\n    const TP_INTEGER           = 34;\n    const TP_COMMA             = 35;\n    const TP_OPENP             = 36;\n    const TP_CLOSEP            = 37;\n    const TP_MATH              = 38;\n    const TP_ISIN              = 39;\n    const TP_QMARK             = 40;\n    const TP_NOT               = 41;\n    const TP_TYPECAST          = 42;\n    const TP_HEX               = 43;\n    const TP_DOT               = 44;\n    const TP_INSTANCEOF        = 45;\n    const TP_SINGLEQUOTESTRING = 46;\n    const TP_DOUBLECOLON       = 47;\n    const TP_NAMESPACE         = 48;\n    const TP_AT                = 49;\n    const TP_HATCH             = 50;\n    const TP_OPENB             = 51;\n    const TP_CLOSEB            = 52;\n    const TP_DOLLAR            = 53;\n    const TP_LOGOP             = 54;\n    const TP_SLOGOP            = 55;\n    const TP_TLOGOP            = 56;\n    const TP_SINGLECOND        = 57;\n    const TP_QUOTE             = 58;\n    const TP_BACKTICK          = 59;\n    const YY_NO_ACTION         = 509;\n    const YY_ACCEPT_ACTION     = 508;\n    const YY_ERROR_ACTION      = 507;\n    const YY_SZ_ACTTAB         = 1956;\n    const YY_SHIFT_USE_DFLT    = -13;\n    const YY_SHIFT_MAX         = 227;\n    const YY_REDUCE_USE_DFLT   = -75;\n    const YY_REDUCE_MAX        = 176;\n    const YYNOCODE             = 107;\n    const YYSTACKDEPTH         = 500;\n    const YYNSTATE             = 322;\n    const YYNRULE              = 185;\n    const YYERRORSYMBOL        = 60;\n    const YYERRSYMDT           = 'yy0';\n    const YYFALLBACK           = 0;\n    static public $yy_action        = array(\n        41, 15, 301, 113, 209, 252, 254, 12, 274, 275,\n        1, 251, 124, 95, 183, 165, 211, 10, 79, 141,\n        14, 204, 248, 107, 6, 316, 17, 212, 250, 215,\n        452, 188, 452, 13, 9, 23, 452, 436, 42, 38,\n        258, 213, 287, 225, 41, 193, 32, 77, 3, 230,\n        302, 295, 274, 275, 1, 75, 128, 132, 189, 83,\n        211, 10, 79, 436, 200, 204, 436, 107, 452, 153,\n        436, 212, 250, 215, 452, 206, 452, 26, 85, 4,\n        452, 436, 42, 38, 258, 213, 306, 310, 41, 193,\n        246, 77, 3, 116, 302, 302, 274, 275, 1, 75,\n        127, 247, 189, 171, 211, 10, 79, 436, 7, 18,\n        436, 107, 452, 166, 436, 212, 250, 215, 452, 206,\n        452, 13, 202, 74, 452, 436, 42, 38, 258, 213,\n        238, 310, 41, 193, 97, 77, 3, 175, 302, 205,\n        274, 275, 1, 75, 127, 247, 179, 240, 211, 10,\n        79, 436, 321, 204, 436, 107, 452, 190, 436, 212,\n        250, 215, 452, 194, 452, 13, 253, 74, 452, 436,\n        42, 38, 258, 213, 37, 310, 41, 193, 168, 77,\n        3, 294, 302, 14, 274, 275, 1, 75, 127, 17,\n        177, 149, 211, 10, 79, 436, 266, 267, 436, 107,\n        452, 265, 436, 212, 250, 215, 452, 206, 452, 13,\n        190, 190, 452, 436, 42, 38, 258, 213, 129, 310,\n        41, 193, 190, 77, 3, 11, 302, 201, 274, 275,\n        1, 75, 126, 436, 189, 22, 211, 10, 79, 436,\n        436, 17, 436, 107, 452, 167, 436, 212, 250, 215,\n        128, 206, 255, 13, 39, 28, 307, 87, 42, 38,\n        258, 213, 312, 310, 41, 193, 89, 77, 3, 175,\n        302, 232, 274, 275, 1, 75, 127, 173, 189, 267,\n        211, 10, 79, 261, 252, 77, 12, 107, 302, 279,\n        251, 212, 250, 215, 35, 178, 182, 13, 260, 21,\n        14, 92, 42, 38, 258, 213, 17, 310, 41, 193,\n        158, 77, 3, 138, 302, 259, 274, 275, 1, 75,\n        127, 252, 184, 12, 211, 10, 79, 251, 219, 30,\n        104, 107, 423, 5, 302, 212, 250, 215, 31, 206,\n        226, 13, 144, 423, 105, 291, 42, 38, 258, 213,\n        151, 310, 41, 193, 20, 77, 3, 205, 302, 207,\n        274, 275, 1, 75, 125, 452, 189, 452, 211, 10,\n        79, 452, 161, 292, 24, 107, 233, 6, 302, 212,\n        250, 215, 128, 206, 218, 8, 21, 4, 136, 92,\n        42, 38, 258, 213, 308, 310, 41, 193, 265, 77,\n        3, 116, 302, 452, 274, 275, 1, 75, 91, 252,\n        76, 12, 211, 10, 79, 251, 171, 77, 104, 107,\n        302, 164, 423, 212, 250, 215, 301, 206, 209, 13,\n        220, 315, 135, 423, 42, 38, 258, 213, 229, 310,\n        41, 193, 265, 77, 3, 175, 302, 222, 274, 275,\n        1, 75, 128, 452, 189, 452, 211, 10, 79, 452,\n        171, 190, 241, 107, 237, 80, 298, 212, 250, 215,\n        34, 206, 92, 26, 24, 231, 244, 423, 42, 38,\n        258, 213, 247, 310, 23, 193, 78, 77, 423, 33,\n        302, 305, 214, 209, 280, 75, 84, 103, 129, 181,\n        94, 56, 302, 131, 74, 11, 95, 170, 101, 256,\n        245, 16, 436, 424, 309, 192, 311, 281, 316, 436,\n        305, 214, 209, 280, 424, 84, 103, 190, 180, 94,\n        64, 175, 253, 163, 262, 95, 160, 292, 256, 245,\n        376, 302, 216, 309, 192, 311, 305, 316, 209, 217,\n        196, 100, 99, 376, 195, 106, 68, 175, 133, 376,\n        19, 95, 86, 283, 256, 245, 154, 236, 265, 309,\n        192, 311, 305, 316, 209, 276, 265, 100, 103, 205,\n        180, 94, 64, 187, 297, 282, 175, 95, 155, 264,\n        256, 245, 377, 257, 227, 309, 192, 311, 265, 316,\n        271, 272, 273, 270, 122, 377, 269, 274, 275, 1,\n        24, 377, 290, 284, 423, 211, 10, 79, 169, 134,\n        221, 249, 107, 88, 216, 423, 212, 250, 215, 265,\n        305, 210, 209, 152, 99, 98, 263, 343, 195, 114,\n        50, 172, 210, 265, 228, 95, 247, 175, 256, 245,\n        343, 190, 278, 309, 192, 311, 343, 316, 117, 299,\n        142, 137, 264, 264, 344, 274, 275, 2, 74, 300,\n        161, 292, 216, 211, 10, 79, 268, 344, 209, 239,\n        107, 299, 99, 344, 212, 250, 215, 274, 275, 2,\n        157, 300, 190, 37, 167, 211, 10, 79, 92, 139,\n        265, 110, 107, 39, 28, 307, 212, 250, 215, 99,\n        303, 143, 286, 27, 305, 190, 209, 43, 175, 98,\n        147, 265, 195, 114, 45, 277, 108, 104, 262, 95,\n        265, 81, 256, 245, 285, 27, 109, 309, 192, 311,\n        305, 316, 209, 264, 113, 100, 148, 208, 195, 106,\n        68, 82, 40, 36, 95, 95, 162, 292, 256, 245,\n        190, 508, 90, 309, 192, 311, 316, 316, 320, 318,\n        317, 314, 305, 379, 209, 203, 199, 100, 296, 138,\n        195, 114, 63, 130, 92, 289, 379, 95, 264, 150,\n        256, 245, 379, 293, 247, 309, 192, 311, 343, 316,\n        305, 159, 209, 293, 343, 100, 197, 293, 195, 114,\n        63, 293, 293, 293, 293, 95, 74, 293, 256, 245,\n        293, 293, 293, 309, 192, 311, 293, 316, 293, 293,\n        305, 293, 209, 293, 198, 100, 293, 293, 195, 114,\n        63, 293, 293, 293, 293, 95, 293, 293, 256, 245,\n        293, 293, 293, 309, 192, 311, 293, 316, 293, 293,\n        293, 305, 293, 209, 191, 293, 100, 293, 293, 195,\n        114, 49, 293, 190, 293, 43, 95, 293, 293, 256,\n        245, 293, 293, 293, 309, 192, 311, 293, 316, 305,\n        293, 209, 293, 293, 100, 293, 293, 195, 114, 61,\n        293, 293, 293, 293, 95, 293, 293, 256, 245, 293,\n        40, 36, 309, 192, 311, 305, 316, 209, 293, 293,\n        100, 293, 293, 195, 114, 69, 320, 318, 317, 314,\n        95, 293, 293, 256, 245, 293, 293, 293, 309, 192,\n        311, 293, 316, 293, 293, 305, 293, 209, 293, 293,\n        100, 293, 293, 195, 114, 66, 293, 190, 293, 43,\n        95, 293, 293, 256, 245, 293, 293, 293, 309, 192,\n        311, 293, 316, 305, 293, 209, 293, 293, 100, 293,\n        293, 195, 114, 54, 146, 293, 293, 293, 95, 293,\n        293, 256, 245, 293, 40, 36, 309, 192, 311, 305,\n        316, 209, 293, 293, 100, 293, 293, 195, 114, 53,\n        320, 318, 317, 314, 95, 293, 293, 256, 245, 293,\n        293, 293, 309, 192, 311, 293, 316, 293, 293, 305,\n        293, 209, 293, 293, 100, 293, 293, 195, 114, 47,\n        293, 190, 25, 43, 95, 293, 293, 256, 245, 293,\n        293, 293, 309, 192, 311, 293, 316, 305, 293, 209,\n        293, 293, 100, 293, 293, 195, 96, 59, 293, 293,\n        293, 293, 95, 293, 293, 256, 245, 293, 40, 36,\n        309, 192, 311, 305, 316, 209, 293, 293, 100, 293,\n        293, 195, 114, 73, 320, 318, 317, 314, 95, 293,\n        293, 256, 245, 293, 293, 293, 309, 192, 311, 293,\n        316, 293, 293, 305, 293, 209, 293, 293, 100, 293,\n        293, 195, 114, 71, 293, 190, 293, 43, 95, 293,\n        293, 256, 245, 293, 293, 293, 309, 192, 311, 293,\n        316, 305, 293, 209, 293, 293, 100, 293, 293, 185,\n        102, 52, 293, 293, 293, 293, 95, 293, 293, 256,\n        245, 234, 40, 36, 309, 192, 311, 305, 316, 209,\n        293, 293, 100, 293, 293, 195, 93, 65, 320, 318,\n        317, 314, 95, 293, 293, 256, 245, 293, 293, 293,\n        309, 192, 311, 293, 316, 293, 293, 305, 293, 209,\n        293, 293, 100, 293, 293, 195, 114, 46, 293, 190,\n        293, 43, 95, 293, 293, 256, 245, 293, 293, 293,\n        309, 192, 311, 293, 316, 305, 293, 209, 293, 293,\n        100, 293, 293, 195, 114, 58, 293, 293, 293, 293,\n        95, 293, 293, 256, 245, 223, 40, 36, 309, 192,\n        311, 305, 316, 209, 293, 293, 100, 293, 293, 195,\n        114, 50, 320, 318, 317, 314, 95, 293, 293, 256,\n        245, 293, 293, 293, 309, 192, 311, 293, 316, 293,\n        293, 305, 293, 209, 293, 293, 100, 293, 293, 195,\n        114, 44, 293, 190, 293, 43, 95, 293, 293, 256,\n        245, 293, 293, 293, 309, 192, 311, 293, 316, 305,\n        293, 209, 293, 293, 100, 293, 293, 195, 114, 48,\n        293, 293, 293, 293, 95, 293, 293, 256, 245, 293,\n        40, 36, 309, 192, 311, 305, 316, 209, 293, 293,\n        100, 293, 293, 195, 114, 72, 320, 318, 317, 314,\n        95, 293, 293, 256, 245, 293, 293, 293, 309, 192,\n        311, 293, 316, 293, 293, 305, 293, 209, 293, 293,\n        100, 293, 293, 195, 114, 51, 293, 293, 293, 43,\n        95, 293, 293, 256, 245, 293, 293, 293, 309, 192,\n        311, 293, 316, 305, 293, 209, 293, 293, 100, 293,\n        293, 195, 114, 67, 293, 293, 293, 293, 95, 293,\n        293, 256, 245, 293, 40, 36, 309, 192, 311, 305,\n        316, 209, 293, 293, 100, 293, 293, 186, 114, 57,\n        320, 318, 317, 314, 95, 293, 293, 256, 245, 293,\n        293, 293, 309, 192, 311, 293, 316, 293, 293, 305,\n        293, 209, 293, 293, 100, 293, 293, 195, 114, 60,\n        293, 293, 293, 293, 95, 293, 293, 256, 245, 293,\n        293, 293, 309, 192, 311, 293, 316, 305, 293, 209,\n        293, 293, 100, 293, 293, 195, 114, 62, 293, 293,\n        293, 293, 95, 293, 293, 256, 245, 293, 293, 293,\n        309, 192, 311, 305, 316, 209, 293, 293, 100, 293,\n        293, 195, 114, 70, 293, 293, 293, 293, 95, 293,\n        293, 256, 245, 293, 293, 293, 309, 192, 311, 293,\n        316, 293, 293, 305, 293, 209, 293, 293, 100, 293,\n        293, 195, 93, 55, 389, 389, 389, 293, 95, 293,\n        293, 256, 245, 293, 293, 293, 309, 192, 311, 293,\n        316, 305, 293, 209, 293, 293, 100, 293, 293, 195,\n        118, 293, 293, 293, 293, 293, 95, 293, 293, 423,\n        304, 389, 389, 293, 309, 192, 311, 190, 316, 43,\n        423, 190, 293, 43, 293, 293, 293, 389, 389, 389,\n        389, 293, 293, 293, 293, 293, 293, 305, 293, 209,\n        293, 29, 100, 14, 293, 195, 123, 14, 293, 17,\n        293, 293, 95, 17, 40, 36, 243, 293, 40, 36,\n        309, 192, 311, 293, 316, 293, 293, 293, 293, 293,\n        320, 318, 317, 314, 320, 318, 317, 314, 204, 293,\n        293, 293, 293, 305, 293, 209, 293, 452, 100, 452,\n        293, 195, 121, 452, 436, 293, 293, 293, 95, 293,\n        293, 293, 293, 293, 293, 293, 309, 192, 311, 305,\n        316, 209, 293, 190, 100, 43, 293, 195, 112, 293,\n        436, 293, 293, 436, 95, 452, 174, 436, 313, 293,\n        293, 293, 309, 192, 311, 293, 316, 305, 293, 209,\n        293, 293, 100, 140, 293, 195, 111, 167, 293, 293,\n        40, 36, 95, 265, 293, 293, 39, 28, 307, 293,\n        309, 192, 311, 293, 316, 293, 320, 318, 317, 314,\n        293, 175, 305, 293, 209, 293, 293, 100, 293, 293,\n        195, 119, 293, 305, 293, 209, 293, 95, 100, 293,\n        293, 195, 115, 293, 293, 309, 192, 311, 95, 316,\n        293, 293, 293, 293, 293, 293, 309, 192, 311, 293,\n        316, 305, 190, 209, 43, 293, 100, 293, 293, 195,\n        120, 293, 293, 293, 293, 293, 95, 293, 293, 293,\n        293, 293, 293, 293, 309, 192, 311, 293, 316, 293,\n        190, 156, 43, 293, 190, 167, 43, 293, 293, 40,\n        36, 265, 293, 235, 39, 28, 307, 288, 293, 293,\n        293, 293, 293, 319, 293, 320, 318, 317, 314, 175,\n        190, 293, 43, 293, 190, 293, 43, 40, 36, 293,\n        293, 40, 36, 242, 293, 293, 293, 176, 293, 293,\n        293, 293, 293, 320, 318, 317, 314, 320, 318, 317,\n        314, 293, 293, 293, 293, 293, 293, 40, 36, 293,\n        293, 40, 36, 293, 293, 293, 293, 293, 293, 293,\n        293, 293, 293, 320, 318, 317, 314, 320, 318, 317,\n        314, 293, 190, 293, 293, 293, 293, 293, 383, 293,\n        293, 293, 293, 293, 293, 347, 383, 293, 383, 224,\n        293, 383, 293, 293, 293, 293, 293, 383, 14, 383,\n        293, 383, 293, 252, 17, 12, 293, 423, 205, 251,\n        293, 293, 293, 293, 293, 293, 293, 293, 423, 14,\n        293, 145, 293, 293, 293, 17,\n    );\n    static public $yy_lookahead     = array(\n        3, 13, 65, 70, 67, 11, 73, 13, 11, 12,\n        13, 17, 15, 80, 17, 81, 19, 20, 21, 93,\n        27, 2, 89, 26, 36, 92, 33, 30, 31, 32,\n        11, 34, 13, 36, 35, 16, 17, 18, 41, 42,\n        43, 44, 105, 46, 3, 48, 22, 50, 51, 52,\n        53, 52, 11, 12, 13, 58, 15, 15, 17, 35,\n        19, 20, 21, 44, 64, 2, 47, 26, 49, 93,\n        51, 30, 31, 32, 11, 34, 13, 36, 36, 16,\n        17, 18, 41, 42, 43, 44, 91, 46, 3, 48,\n        17, 50, 51, 98, 53, 53, 11, 12, 13, 58,\n        15, 23, 17, 100, 19, 20, 21, 44, 36, 2,\n        47, 26, 49, 76, 51, 30, 31, 32, 11, 34,\n        13, 36, 49, 45, 17, 18, 41, 42, 43, 44,\n        52, 46, 3, 48, 80, 50, 51, 100, 53, 44,\n        11, 12, 13, 58, 15, 23, 17, 52, 19, 20,\n        21, 44, 98, 2, 47, 26, 49, 1, 51, 30,\n        31, 32, 11, 34, 13, 36, 101, 45, 17, 18,\n        41, 42, 43, 44, 2, 46, 3, 48, 81, 50,\n        51, 59, 53, 27, 11, 12, 13, 58, 15, 33,\n        17, 72, 19, 20, 21, 44, 9, 10, 47, 26,\n        49, 82, 51, 30, 31, 32, 11, 34, 13, 36,\n        1, 1, 17, 18, 41, 42, 43, 44, 44, 46,\n        3, 48, 1, 50, 51, 51, 53, 18, 11, 12,\n        13, 58, 15, 44, 17, 27, 19, 20, 21, 44,\n        51, 33, 47, 26, 49, 76, 51, 30, 31, 32,\n        15, 34, 17, 36, 85, 86, 87, 93, 41, 42,\n        43, 44, 52, 46, 3, 48, 81, 50, 51, 100,\n        53, 52, 11, 12, 13, 58, 15, 8, 17, 10,\n        19, 20, 21, 48, 11, 50, 13, 26, 53, 69,\n        17, 30, 31, 32, 13, 34, 15, 36, 17, 16,\n        27, 18, 41, 42, 43, 44, 33, 46, 3, 48,\n        50, 50, 51, 93, 53, 34, 11, 12, 13, 58,\n        15, 11, 17, 13, 19, 20, 21, 17, 17, 16,\n        47, 26, 36, 36, 53, 30, 31, 32, 13, 34,\n        15, 36, 17, 47, 47, 69, 41, 42, 43, 44,\n        50, 46, 3, 48, 24, 50, 51, 44, 53, 49,\n        11, 12, 13, 58, 15, 11, 17, 13, 19, 20,\n        21, 17, 96, 97, 35, 26, 37, 36, 53, 30,\n        31, 32, 15, 34, 17, 36, 16, 16, 72, 18,\n        41, 42, 43, 44, 91, 46, 3, 48, 82, 50,\n        51, 98, 53, 49, 11, 12, 13, 58, 15, 11,\n        17, 13, 19, 20, 21, 17, 100, 50, 47, 26,\n        53, 76, 36, 30, 31, 32, 65, 34, 67, 36,\n        44, 17, 72, 47, 41, 42, 43, 44, 52, 46,\n        3, 48, 82, 50, 51, 100, 53, 49, 11, 12,\n        13, 58, 15, 11, 17, 13, 19, 20, 21, 17,\n        100, 1, 17, 26, 15, 104, 105, 30, 31, 32,\n        29, 34, 18, 36, 35, 52, 37, 36, 41, 42,\n        43, 44, 23, 46, 16, 48, 17, 50, 47, 29,\n        53, 65, 66, 67, 68, 58, 70, 71, 44, 73,\n        74, 75, 53, 15, 45, 51, 80, 76, 17, 83,\n        84, 40, 44, 36, 88, 89, 90, 14, 92, 51,\n        65, 66, 67, 68, 47, 70, 71, 1, 73, 74,\n        75, 100, 101, 76, 94, 80, 96, 97, 83, 84,\n        14, 53, 70, 88, 89, 90, 65, 92, 67, 77,\n        78, 70, 80, 27, 73, 74, 75, 100, 72, 33,\n        16, 80, 76, 34, 83, 84, 72, 23, 82, 88,\n        89, 90, 65, 92, 67, 68, 82, 70, 71, 44,\n        73, 74, 75, 102, 103, 14, 100, 80, 72, 95,\n        83, 84, 14, 17, 16, 88, 89, 90, 82, 92,\n        4, 5, 6, 7, 8, 27, 9, 11, 12, 13,\n        35, 33, 37, 34, 36, 19, 20, 21, 15, 72,\n        17, 17, 26, 76, 70, 47, 30, 31, 32, 82,\n        65, 77, 67, 72, 80, 70, 17, 14, 73, 74,\n        75, 17, 77, 82, 37, 80, 23, 100, 83, 84,\n        27, 1, 15, 88, 89, 90, 33, 92, 17, 5,\n        93, 93, 95, 95, 14, 11, 12, 13, 45, 15,\n        96, 97, 70, 19, 20, 21, 65, 27, 67, 77,\n        26, 5, 80, 33, 30, 31, 32, 11, 12, 13,\n        72, 15, 1, 2, 76, 19, 20, 21, 18, 70,\n        82, 79, 26, 85, 86, 87, 30, 31, 32, 80,\n        97, 72, 58, 59, 65, 1, 67, 3, 100, 70,\n        72, 82, 73, 74, 75, 82, 77, 47, 94, 80,\n        82, 80, 83, 84, 58, 59, 22, 88, 89, 90,\n        65, 92, 67, 95, 70, 70, 93, 73, 73, 74,\n        75, 80, 38, 39, 80, 80, 96, 97, 83, 84,\n        1, 61, 62, 88, 89, 90, 92, 92, 54, 55,\n        56, 57, 65, 14, 67, 63, 64, 70, 103, 93,\n        73, 74, 75, 80, 18, 14, 27, 80, 95, 93,\n        83, 84, 33, 106, 23, 88, 89, 90, 27, 92,\n        65, 93, 67, 106, 33, 70, 99, 106, 73, 74,\n        75, 106, 106, 106, 106, 80, 45, 106, 83, 84,\n        106, 106, 106, 88, 89, 90, 106, 92, 106, 106,\n        65, 106, 67, 106, 99, 70, 106, 106, 73, 74,\n        75, 106, 106, 106, 106, 80, 106, 106, 83, 84,\n        106, 106, 106, 88, 89, 90, 106, 92, 106, 106,\n        106, 65, 106, 67, 99, 106, 70, 106, 106, 73,\n        74, 75, 106, 1, 106, 3, 80, 106, 106, 83,\n        84, 106, 106, 106, 88, 89, 90, 106, 92, 65,\n        106, 67, 106, 106, 70, 106, 106, 73, 74, 75,\n        106, 106, 106, 106, 80, 106, 106, 83, 84, 106,\n        38, 39, 88, 89, 90, 65, 92, 67, 106, 106,\n        70, 106, 106, 73, 74, 75, 54, 55, 56, 57,\n        80, 59, 106, 83, 84, 106, 106, 106, 88, 89,\n        90, 106, 92, 106, 106, 65, 106, 67, 106, 106,\n        70, 106, 106, 73, 74, 75, 106, 1, 106, 3,\n        80, 106, 106, 83, 84, 106, 106, 106, 88, 89,\n        90, 106, 92, 65, 106, 67, 106, 106, 70, 106,\n        106, 73, 74, 75, 28, 106, 106, 106, 80, 106,\n        106, 83, 84, 106, 38, 39, 88, 89, 90, 65,\n        92, 67, 106, 106, 70, 106, 106, 73, 74, 75,\n        54, 55, 56, 57, 80, 106, 106, 83, 84, 106,\n        106, 106, 88, 89, 90, 106, 92, 106, 106, 65,\n        106, 67, 106, 106, 70, 106, 106, 73, 74, 75,\n        106, 1, 2, 3, 80, 106, 106, 83, 84, 106,\n        106, 106, 88, 89, 90, 106, 92, 65, 106, 67,\n        106, 106, 70, 106, 106, 73, 74, 75, 106, 106,\n        106, 106, 80, 106, 106, 83, 84, 106, 38, 39,\n        88, 89, 90, 65, 92, 67, 106, 106, 70, 106,\n        106, 73, 74, 75, 54, 55, 56, 57, 80, 106,\n        106, 83, 84, 106, 106, 106, 88, 89, 90, 106,\n        92, 106, 106, 65, 106, 67, 106, 106, 70, 106,\n        106, 73, 74, 75, 106, 1, 106, 3, 80, 106,\n        106, 83, 84, 106, 106, 106, 88, 89, 90, 106,\n        92, 65, 106, 67, 106, 106, 70, 106, 106, 73,\n        74, 75, 106, 106, 106, 106, 80, 106, 106, 83,\n        84, 37, 38, 39, 88, 89, 90, 65, 92, 67,\n        106, 106, 70, 106, 106, 73, 74, 75, 54, 55,\n        56, 57, 80, 106, 106, 83, 84, 106, 106, 106,\n        88, 89, 90, 106, 92, 106, 106, 65, 106, 67,\n        106, 106, 70, 106, 106, 73, 74, 75, 106, 1,\n        106, 3, 80, 106, 106, 83, 84, 106, 106, 106,\n        88, 89, 90, 106, 92, 65, 106, 67, 106, 106,\n        70, 106, 106, 73, 74, 75, 106, 106, 106, 106,\n        80, 106, 106, 83, 84, 37, 38, 39, 88, 89,\n        90, 65, 92, 67, 106, 106, 70, 106, 106, 73,\n        74, 75, 54, 55, 56, 57, 80, 106, 106, 83,\n        84, 106, 106, 106, 88, 89, 90, 106, 92, 106,\n        106, 65, 106, 67, 106, 106, 70, 106, 106, 73,\n        74, 75, 106, 1, 106, 3, 80, 106, 106, 83,\n        84, 106, 106, 106, 88, 89, 90, 106, 92, 65,\n        106, 67, 106, 106, 70, 106, 106, 73, 74, 75,\n        106, 106, 106, 106, 80, 106, 106, 83, 84, 106,\n        38, 39, 88, 89, 90, 65, 92, 67, 106, 106,\n        70, 106, 106, 73, 74, 75, 54, 55, 56, 57,\n        80, 106, 106, 83, 84, 106, 106, 106, 88, 89,\n        90, 106, 92, 106, 106, 65, 106, 67, 106, 106,\n        70, 106, 106, 73, 74, 75, 106, 106, 106, 3,\n        80, 106, 106, 83, 84, 106, 106, 106, 88, 89,\n        90, 106, 92, 65, 106, 67, 106, 106, 70, 106,\n        106, 73, 74, 75, 106, 106, 106, 106, 80, 106,\n        106, 83, 84, 106, 38, 39, 88, 89, 90, 65,\n        92, 67, 106, 106, 70, 106, 106, 73, 74, 75,\n        54, 55, 56, 57, 80, 106, 106, 83, 84, 106,\n        106, 106, 88, 89, 90, 106, 92, 106, 106, 65,\n        106, 67, 106, 106, 70, 106, 106, 73, 74, 75,\n        106, 106, 106, 106, 80, 106, 106, 83, 84, 106,\n        106, 106, 88, 89, 90, 106, 92, 65, 106, 67,\n        106, 106, 70, 106, 106, 73, 74, 75, 106, 106,\n        106, 106, 80, 106, 106, 83, 84, 106, 106, 106,\n        88, 89, 90, 65, 92, 67, 106, 106, 70, 106,\n        106, 73, 74, 75, 106, 106, 106, 106, 80, 106,\n        106, 83, 84, 106, 106, 106, 88, 89, 90, 106,\n        92, 106, 106, 65, 106, 67, 106, 106, 70, 106,\n        106, 73, 74, 75, 1, 2, 3, 106, 80, 106,\n        106, 83, 84, 106, 106, 106, 88, 89, 90, 106,\n        92, 65, 106, 67, 106, 106, 70, 106, 106, 73,\n        74, 106, 106, 106, 106, 106, 80, 106, 106, 36,\n        84, 38, 39, 106, 88, 89, 90, 1, 92, 3,\n        47, 1, 106, 3, 106, 106, 106, 54, 55, 56,\n        57, 106, 106, 106, 106, 106, 106, 65, 106, 67,\n        106, 25, 70, 27, 106, 73, 74, 27, 106, 33,\n        106, 106, 80, 33, 38, 39, 84, 106, 38, 39,\n        88, 89, 90, 106, 92, 106, 106, 106, 106, 106,\n        54, 55, 56, 57, 54, 55, 56, 57, 2, 106,\n        106, 106, 106, 65, 106, 67, 106, 11, 70, 13,\n        106, 73, 74, 17, 18, 106, 106, 106, 80, 106,\n        106, 106, 106, 106, 106, 106, 88, 89, 90, 65,\n        92, 67, 106, 1, 70, 3, 106, 73, 74, 106,\n        44, 106, 106, 47, 80, 49, 14, 51, 52, 106,\n        106, 106, 88, 89, 90, 106, 92, 65, 106, 67,\n        106, 106, 70, 72, 106, 73, 74, 76, 106, 106,\n        38, 39, 80, 82, 106, 106, 85, 86, 87, 106,\n        88, 89, 90, 106, 92, 106, 54, 55, 56, 57,\n        106, 100, 65, 106, 67, 106, 106, 70, 106, 106,\n        73, 74, 106, 65, 106, 67, 106, 80, 70, 106,\n        106, 73, 74, 106, 106, 88, 89, 90, 80, 92,\n        106, 106, 106, 106, 106, 106, 88, 89, 90, 106,\n        92, 65, 1, 67, 3, 106, 70, 106, 106, 73,\n        74, 106, 106, 106, 106, 106, 80, 106, 106, 106,\n        106, 106, 106, 106, 88, 89, 90, 106, 92, 106,\n        1, 72, 3, 106, 1, 76, 3, 106, 106, 38,\n        39, 82, 106, 14, 85, 86, 87, 14, 106, 106,\n        106, 106, 106, 52, 106, 54, 55, 56, 57, 100,\n        1, 106, 3, 106, 1, 106, 3, 38, 39, 106,\n        106, 38, 39, 14, 106, 106, 106, 14, 106, 106,\n        106, 106, 106, 54, 55, 56, 57, 54, 55, 56,\n        57, 106, 106, 106, 106, 106, 106, 38, 39, 106,\n        106, 38, 39, 106, 106, 106, 106, 106, 106, 106,\n        106, 106, 106, 54, 55, 56, 57, 54, 55, 56,\n        57, 106, 1, 106, 106, 106, 106, 106, 14, 106,\n        106, 106, 106, 106, 106, 14, 22, 106, 24, 18,\n        106, 27, 106, 106, 106, 106, 106, 33, 27, 35,\n        106, 37, 106, 11, 33, 13, 106, 36, 44, 17,\n        106, 106, 106, 106, 106, 106, 106, 106, 47, 27,\n        106, 29, 106, 106, 106, 33,\n    );\n    static public $yy_shift_ofst    = array(\n        -13, 393, 393, 305, 85, 85, 85, 85, 349, 305,\n        349, -3, 85, 85, 129, 85, 217, 85, 173, 85,\n        85, 85, 129, 261, 85, 85, 85, 85, 85, 85,\n        85, 85, 85, 85, 85, 85, 41, 41, 437, 437,\n        437, 437, 437, 437, 1586, 1590, 1590, 1040, 1843, 1839,\n        1208, 1124, 1781, 1682, 714, 956, 1813, 872, 1809, 1292,\n        1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292,\n        1292, 1292, 1376, 1376, 235, 676, 1901, 367, 156, 42,\n        654, 1922, 273, 42, 371, 42, 156, 454, 156, 691,\n        596, 63, 325, 759, 650, 398, 526, -6, 283, -6,\n        680, 209, 210, -7, 603, 603, 460, 208, -7, 488,\n        -7, 221, 221, 766, 221, 221, 766, 221, 221, 221,\n        -13, -13, -13, -13, 1646, 19, 107, 151, 195, 281,\n        310, 442, 468, -7, -7, -7, -7, 174, 174, 544,\n        -7, 174, 174, -7, -12, 449, 449, -7, 174, -7,\n        174, 189, -7, 174, -7, -7, -7, -7, 189, 174,\n        766, 766, 766, 221, 221, 172, 221, 221, 172, 72,\n        221, -13, -13, -13, -13, -13, -13, 1543, 1894, 578,\n        623, 771, 354, 386, 441, 78, 122, -1, 95, 296,\n        73, 339, 297, 477, 313, 459, 24, 439, 575, 269,\n        187, 641, 604, 597, 576, 529, 535, 619, 260, 571,\n        607, 637, 624, 579, 503, 491, 370, 330, 300, 219,\n        311, 341, 414, 471, 469, 423, 72, 445,\n    );\n    static public $yy_reduce_ofst   = array(\n        700, 455, 426, 481, 507, 765, 707, 735, 565, 675,\n        649, 1076, 1160, 1186, 1102, 1244, 964, 992, 1018, 1048,\n        1216, 1438, 1468, 1384, 1412, 1270, 1300, 1354, 1328, 1132,\n        824, 934, 908, 880, 850, 796, 1496, 1542, 1642, 1614,\n        1677, 1716, 1688, 1588, 1739, 1641, 618, 169, 169, 169,\n        169, 169, 169, 169, 169, 169, 169, 169, 169, 169,\n        169, 169, 169, 169, 169, 169, 169, 169, 169, 169,\n        169, 169, 169, 169, -67, 361, 486, 674, 547, 472,\n        -63, 494, 648, 602, 276, 554, 316, 440, 360, 431,\n        611, 220, 54, 37, 37, 568, 37, 567, 574, 568,\n        574, 345, 37, 119, 303, -5, 37, 561, 516, 629,\n        639, 37, 37, 574, 37, 37, 660, 457, 37, 37,\n        37, 37, 712, 37, 686, 686, 686, 686, 686, 703,\n        693, 686, 686, 643, 643, 643, 643, 634, 634, 622,\n        643, 634, 634, 643, 653, 671, 651, 643, 634, 643,\n        634, 696, 643, 634, 643, 643, 643, 643, 708, 634,\n        613, 613, 613, 3, 3, 65, 3, 3, 65, 164,\n        3, 97, 185, 0, -24, -66, -74,\n    );\n    static public $yyExpectedTokens = array(\n        array(),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 52, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 53, 58,),\n        array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 53, 58,),\n        array(1, 3, 25, 27, 33, 38, 39, 54, 55, 56, 57,),\n        array(1, 3, 27, 33, 38, 39, 54, 55, 56, 57,),\n        array(1, 3, 27, 33, 38, 39, 54, 55, 56, 57,),\n        array(1, 2, 3, 38, 39, 54, 55, 56, 57,),\n        array(1, 3, 14, 38, 39, 54, 55, 56, 57,),\n        array(1, 3, 14, 38, 39, 54, 55, 56, 57,),\n        array(1, 3, 37, 38, 39, 54, 55, 56, 57,),\n        array(1, 3, 37, 38, 39, 54, 55, 56, 57,),\n        array(1, 3, 38, 39, 52, 54, 55, 56, 57,),\n        array(1, 3, 14, 38, 39, 54, 55, 56, 57,),\n        array(1, 3, 22, 38, 39, 54, 55, 56, 57,),\n        array(1, 3, 28, 38, 39, 54, 55, 56, 57,),\n        array(1, 3, 14, 38, 39, 54, 55, 56, 57,),\n        array(1, 3, 38, 39, 54, 55, 56, 57, 59,),\n        array(1, 3, 14, 38, 39, 54, 55, 56, 57,),\n        array(1, 3, 38, 39, 54, 55, 56, 57,),\n        array(1, 3, 38, 39, 54, 55, 56, 57,),\n        array(1, 3, 38, 39, 54, 55, 56, 57,),\n        array(1, 3, 38, 39, 54, 55, 56, 57,),\n        array(1, 3, 38, 39, 54, 55, 56, 57,),\n        array(1, 3, 38, 39, 54, 55, 56, 57,),\n        array(1, 3, 38, 39, 54, 55, 56, 57,),\n        array(1, 3, 38, 39, 54, 55, 56, 57,),\n        array(1, 3, 38, 39, 54, 55, 56, 57,),\n        array(1, 3, 38, 39, 54, 55, 56, 57,),\n        array(1, 3, 38, 39, 54, 55, 56, 57,),\n        array(1, 3, 38, 39, 54, 55, 56, 57,),\n        array(1, 3, 38, 39, 54, 55, 56, 57,),\n        array(3, 38, 39, 54, 55, 56, 57,),\n        array(3, 38, 39, 54, 55, 56, 57,),\n        array(15, 17, 48, 50, 53,),\n        array(5, 11, 12, 13, 15, 19, 20, 21, 26, 30, 31, 32, 58, 59,),\n        array(1, 14, 18, 27, 33, 36, 47,),\n        array(15, 17, 50, 53,),\n        array(1, 27, 33,),\n        array(15, 36, 53,),\n        array(5, 11, 12, 13, 15, 19, 20, 21, 26, 30, 31, 32, 58, 59,),\n        array(11, 13, 17, 27, 29, 33,),\n        array(11, 13, 17, 27, 33,),\n        array(15, 36, 53,),\n        array(16, 18, 47,),\n        array(15, 36, 53,),\n        array(1, 27, 33,),\n        array(18, 44, 51,),\n        array(1, 27, 33,),\n        array(1, 2,),\n        array(4, 5, 6, 7, 8, 11, 12, 13, 19, 20, 21, 26, 30, 31, 32,),\n        array(2, 11, 13, 16, 17, 18, 44, 47, 49, 51,),\n        array(13, 15, 17, 53,),\n        array(1, 14, 27, 33,),\n        array(1, 14, 27, 33,),\n        array(11, 13, 17, 49,),\n        array(1, 14, 27, 33,),\n        array(11, 13, 17,),\n        array(16, 18, 47,),\n        array(11, 13, 17,),\n        array(18, 47,),\n        array(1, 18,),\n        array(1, 52,),\n        array(27, 33,),\n        array(15, 17,),\n        array(15, 17,),\n        array(1, 29,),\n        array(27, 33,),\n        array(27, 33,),\n        array(15, 53,),\n        array(27, 33,),\n        array(1,),\n        array(1,),\n        array(18,),\n        array(1,),\n        array(1,),\n        array(18,),\n        array(1,),\n        array(1,),\n        array(1,),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(2, 11, 13, 17, 18, 44, 47, 49, 51, 52,),\n        array(2, 11, 13, 16, 17, 18, 44, 47, 49, 51,),\n        array(2, 11, 13, 17, 18, 44, 47, 49, 51,),\n        array(2, 11, 13, 17, 18, 44, 47, 49, 51,),\n        array(11, 13, 17, 18, 44, 47, 49, 51,),\n        array(13, 15, 17, 34, 53,),\n        array(11, 13, 17, 49,),\n        array(11, 13, 17,),\n        array(16, 44, 51,),\n        array(27, 33,),\n        array(27, 33,),\n        array(27, 33,),\n        array(27, 33,),\n        array(44, 51,),\n        array(44, 51,),\n        array(16, 23,),\n        array(27, 33,),\n        array(44, 51,),\n        array(44, 51,),\n        array(27, 33,),\n        array(13, 36,),\n        array(15, 53,),\n        array(15, 53,),\n        array(27, 33,),\n        array(44, 51,),\n        array(27, 33,),\n        array(44, 51,),\n        array(44, 51,),\n        array(27, 33,),\n        array(44, 51,),\n        array(27, 33,),\n        array(27, 33,),\n        array(27, 33,),\n        array(27, 33,),\n        array(44, 51,),\n        array(44, 51,),\n        array(18,),\n        array(18,),\n        array(18,),\n        array(1,),\n        array(1,),\n        array(2,),\n        array(1,),\n        array(1,),\n        array(2,),\n        array(36,),\n        array(1,),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(1, 2, 3, 36, 38, 39, 47, 54, 55, 56, 57,),\n        array(14, 22, 24, 27, 33, 35, 37, 44,),\n        array(14, 16, 27, 33, 36, 47,),\n        array(14, 23, 27, 33, 45,),\n        array(14, 23, 27, 33, 45,),\n        array(11, 13, 17, 49,),\n        array(36, 44, 47, 52,),\n        array(29, 36, 47,),\n        array(23, 45, 52,),\n        array(23, 45, 59,),\n        array(35, 52,),\n        array(44, 52,),\n        array(36, 47,),\n        array(17, 49,),\n        array(35, 37,),\n        array(36, 47,),\n        array(36, 47,),\n        array(16, 44,),\n        array(23, 45,),\n        array(22, 35,),\n        array(35, 37,),\n        array(35, 37,),\n        array(8, 10,),\n        array(9, 10,),\n        array(17,),\n        array(17,),\n        array(9,),\n        array(17,),\n        array(34,),\n        array(44,),\n        array(17,),\n        array(50,),\n        array(14,),\n        array(37,),\n        array(15,),\n        array(17,),\n        array(34,),\n        array(14,),\n        array(17,),\n        array(16,),\n        array(24,),\n        array(50,),\n        array(52,),\n        array(17,),\n        array(36,),\n        array(17,),\n        array(40,),\n        array(17,),\n        array(52,),\n        array(36,),\n        array(17,),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n    );\n    static public $yy_default       = array(\n        333, 507, 507, 492, 507, 471, 471, 471, 507, 507,\n        507, 507, 507, 507, 507, 507, 507, 507, 507, 507,\n        507, 507, 507, 507, 507, 507, 507, 507, 507, 507,\n        507, 507, 507, 507, 507, 507, 507, 507, 507, 507,\n        507, 507, 507, 507, 373, 352, 373, 507, 507, 507,\n        507, 507, 507, 507, 507, 378, 345, 507, 507, 375,\n        384, 380, 469, 470, 345, 378, 493, 395, 495, 494,\n        385, 357, 400, 399, 507, 507, 411, 507, 373, 507,\n        507, 373, 373, 507, 426, 507, 373, 483, 373, 364,\n        322, 425, 507, 387, 387, 436, 387, 436, 426, 436,\n        426, 367, 387, 373, 507, 507, 387, 373, 354, 507,\n        373, 404, 394, 426, 387, 403, 480, 369, 398, 390,\n        402, 391, 331, 478, 425, 425, 425, 425, 425, 507,\n        438, 436, 452, 346, 349, 350, 348, 434, 433, 507,\n        353, 464, 462, 356, 436, 507, 507, 362, 461, 342,\n        430, 429, 363, 463, 361, 355, 359, 360, 431, 432,\n        484, 458, 481, 370, 368, 473, 420, 393, 472, 436,\n        365, 477, 477, 331, 436, 477, 436, 411, 407, 411,\n        401, 401, 437, 411, 411, 401, 401, 507, 407, 411,\n        507, 507, 507, 421, 407, 401, 507, 507, 507, 329,\n        507, 507, 507, 507, 507, 409, 407, 507, 507, 507,\n        507, 507, 507, 507, 507, 507, 507, 381, 507, 507,\n        507, 482, 507, 413, 507, 416, 452, 507, 386, 443,\n        451, 445, 444, 466, 413, 457, 358, 452, 448, 382,\n        446, 374, 442, 479, 467, 392, 475, 405, 414, 474,\n        366, 455, 456, 476, 415, 423, 388, 389, 406, 441,\n        440, 424, 435, 439, 454, 372, 328, 330, 332, 327,\n        326, 323, 324, 325, 334, 335, 341, 371, 351, 339,\n        338, 336, 337, 408, 410, 496, 497, 498, 504, 503,\n        468, 340, 459, 501, 500, 489, 491, 490, 499, 506,\n        502, 505, 453, 460, 397, 419, 422, 396, 418, 412,\n        416, 417, 449, 447, 488, 427, 428, 487, 486, 450,\n        485, 465,\n    );\n    public static $yyFallback       = array();\n    public static $yyRuleName       = array(\n        'start ::= template',\n        'template ::= template PHP',\n        'template ::= template TEXT',\n        'template ::= template STRIPON',\n        'template ::= template STRIPOFF',\n        'template ::= template LITERALSTART literal_e2 LITERALEND',\n        'literal_e2 ::= literal_e1 LITERALSTART literal_e1 LITERALEND',\n        'literal_e2 ::= literal_e1',\n        'literal_e1 ::= literal_e1 LITERAL',\n        'literal_e1 ::=',\n        'template ::= template smartytag',\n        'template ::=',\n        'smartytag ::= SIMPELOUTPUT',\n        'smartytag ::= SIMPLETAG',\n        'smartytag ::= LDEL tagbody RDEL',\n        'smartytag ::= tag RDEL',\n        'tagbody ::= outattr',\n        'tagbody ::= DOLLARID eqoutattr',\n        'tagbody ::= varindexed eqoutattr',\n        'eqoutattr ::= EQUAL outattr',\n        'outattr ::= output attributes',\n        'output ::= variable',\n        'output ::= value',\n        'output ::= expr',\n        'tag ::= LDEL ID attributes',\n        'tag ::= LDEL ID',\n        'tag ::= LDEL ID modifierlist attributes',\n        'tag ::= LDEL ID PTR ID attributes',\n        'tag ::= LDEL ID PTR ID modifierlist attributes',\n        'tag ::= LDELMAKENOCACHE DOLLARID',\n        'tag ::= LDELIF expr',\n        'tag ::= LDELIF expr attributes',\n        'tag ::= LDELIF statement',\n        'tag ::= LDELIF statement attributes',\n        'tag ::= LDELFOR statements SEMICOLON expr SEMICOLON varindexed foraction attributes',\n        'foraction ::= EQUAL expr',\n        'foraction ::= INCDEC',\n        'tag ::= LDELFOR statement TO expr attributes',\n        'tag ::= LDELFOR statement TO expr STEP expr attributes',\n        'tag ::= LDELFOREACH SPACE expr AS varvar attributes',\n        'tag ::= LDELFOREACH SPACE expr AS varvar APTR varvar attributes',\n        'tag ::= LDELFOREACH attributes',\n        'tag ::= LDELSETFILTER ID modparameters',\n        'tag ::= LDELSETFILTER ID modparameters modifierlist',\n        'smartytag ::= CLOSETAG',\n        'tag ::= LDELSLASH ID',\n        'tag ::= LDELSLASH ID modifierlist',\n        'tag ::= LDELSLASH ID PTR ID',\n        'tag ::= LDELSLASH ID PTR ID modifierlist',\n        'attributes ::= attributes attribute',\n        'attributes ::= attribute',\n        'attributes ::=',\n        'attribute ::= SPACE ID EQUAL ID',\n        'attribute ::= ATTR expr',\n        'attribute ::= ATTR value',\n        'attribute ::= SPACE ID',\n        'attribute ::= SPACE expr',\n        'attribute ::= SPACE value',\n        'attribute ::= SPACE INTEGER EQUAL expr',\n        'statements ::= statement',\n        'statements ::= statements COMMA statement',\n        'statement ::= DOLLARID EQUAL INTEGER',\n        'statement ::= DOLLARID EQUAL expr',\n        'statement ::= varindexed EQUAL expr',\n        'statement ::= OPENP statement CLOSEP',\n        'expr ::= value',\n        'expr ::= ternary',\n        'expr ::= DOLLARID COLON ID',\n        'expr ::= expr MATH value',\n        'expr ::= expr UNIMATH value',\n        'expr ::= array',\n        'expr ::= expr modifierlist',\n        'expr ::= expr tlop value',\n        'expr ::= expr lop expr',\n        'expr ::= expr scond',\n        'expr ::= expr ISIN array',\n        'expr ::= expr ISIN value',\n        'ternary ::= OPENP expr CLOSEP QMARK DOLLARID COLON expr',\n        'ternary ::= OPENP expr CLOSEP QMARK expr COLON expr',\n        'value ::= variable',\n        'value ::= UNIMATH value',\n        'value ::= NOT value',\n        'value ::= TYPECAST value',\n        'value ::= variable INCDEC',\n        'value ::= HEX',\n        'value ::= INTEGER',\n        'value ::= INTEGER DOT INTEGER',\n        'value ::= INTEGER DOT',\n        'value ::= DOT INTEGER',\n        'value ::= ID',\n        'value ::= function',\n        'value ::= OPENP expr CLOSEP',\n        'value ::= variable INSTANCEOF ns1',\n        'value ::= variable INSTANCEOF variable',\n        'value ::= SINGLEQUOTESTRING',\n        'value ::= doublequoted_with_quotes',\n        'value ::= varindexed DOUBLECOLON static_class_access',\n        'value ::= smartytag',\n        'value ::= value modifierlist',\n        'value ::= NAMESPACE',\n        'value ::= ns1 DOUBLECOLON static_class_access',\n        'ns1 ::= ID',\n        'ns1 ::= NAMESPACE',\n        'variable ::= DOLLARID',\n        'variable ::= varindexed',\n        'variable ::= varvar AT ID',\n        'variable ::= object',\n        'variable ::= HATCH ID HATCH',\n        'variable ::= HATCH ID HATCH arrayindex',\n        'variable ::= HATCH variable HATCH',\n        'variable ::= HATCH variable HATCH arrayindex',\n        'varindexed ::= DOLLARID arrayindex',\n        'varindexed ::= varvar arrayindex',\n        'arrayindex ::= arrayindex indexdef',\n        'arrayindex ::=',\n        'indexdef ::= DOT DOLLARID',\n        'indexdef ::= DOT varvar',\n        'indexdef ::= DOT varvar AT ID',\n        'indexdef ::= DOT ID',\n        'indexdef ::= DOT INTEGER',\n        'indexdef ::= DOT LDEL expr RDEL',\n        'indexdef ::= OPENB ID CLOSEB',\n        'indexdef ::= OPENB ID DOT ID CLOSEB',\n        'indexdef ::= OPENB SINGLEQUOTESTRING CLOSEB',\n        'indexdef ::= OPENB INTEGER CLOSEB',\n        'indexdef ::= OPENB DOLLARID CLOSEB',\n        'indexdef ::= OPENB variable CLOSEB',\n        'indexdef ::= OPENB value CLOSEB',\n        'indexdef ::= OPENB expr CLOSEB',\n        'indexdef ::= OPENB CLOSEB',\n        'varvar ::= DOLLARID',\n        'varvar ::= DOLLAR',\n        'varvar ::= varvar varvarele',\n        'varvarele ::= ID',\n        'varvarele ::= SIMPELOUTPUT',\n        'varvarele ::= LDEL expr RDEL',\n        'object ::= varindexed objectchain',\n        'objectchain ::= objectelement',\n        'objectchain ::= objectchain objectelement',\n        'objectelement ::= PTR ID arrayindex',\n        'objectelement ::= PTR varvar arrayindex',\n        'objectelement ::= PTR LDEL expr RDEL arrayindex',\n        'objectelement ::= PTR ID LDEL expr RDEL arrayindex',\n        'objectelement ::= PTR method',\n        'function ::= ns1 OPENP params CLOSEP',\n        'method ::= ID OPENP params CLOSEP',\n        'method ::= DOLLARID OPENP params CLOSEP',\n        'params ::= params COMMA expr',\n        'params ::= expr',\n        'params ::=',\n        'modifierlist ::= modifierlist modifier modparameters',\n        'modifierlist ::= modifier modparameters',\n        'modifier ::= VERT AT ID',\n        'modifier ::= VERT ID',\n        'modparameters ::= modparameters modparameter',\n        'modparameters ::=',\n        'modparameter ::= COLON value',\n        'modparameter ::= COLON array',\n        'static_class_access ::= method',\n        'static_class_access ::= method objectchain',\n        'static_class_access ::= ID',\n        'static_class_access ::= DOLLARID arrayindex',\n        'static_class_access ::= DOLLARID arrayindex objectchain',\n        'lop ::= LOGOP',\n        'lop ::= SLOGOP',\n        'tlop ::= TLOGOP',\n        'scond ::= SINGLECOND',\n        'array ::= OPENB arrayelements CLOSEB',\n        'arrayelements ::= arrayelement',\n        'arrayelements ::= arrayelements COMMA arrayelement',\n        'arrayelements ::=',\n        'arrayelement ::= value APTR expr',\n        'arrayelement ::= ID APTR expr',\n        'arrayelement ::= expr',\n        'doublequoted_with_quotes ::= QUOTE QUOTE',\n        'doublequoted_with_quotes ::= QUOTE doublequoted QUOTE',\n        'doublequoted ::= doublequoted doublequotedcontent',\n        'doublequoted ::= doublequotedcontent',\n        'doublequotedcontent ::= BACKTICK variable BACKTICK',\n        'doublequotedcontent ::= BACKTICK expr BACKTICK',\n        'doublequotedcontent ::= DOLLARID',\n        'doublequotedcontent ::= LDEL variable RDEL',\n        'doublequotedcontent ::= LDEL expr RDEL',\n        'doublequotedcontent ::= smartytag',\n        'doublequotedcontent ::= TEXT',\n    );\n    public static $yyRuleInfo       = array(\n        array(0 => 61, 1 => 1),\n        array(0 => 62, 1 => 2),\n        array(0 => 62, 1 => 2),\n        array(0 => 62, 1 => 2),\n        array(0 => 62, 1 => 2),\n        array(0 => 62, 1 => 4),\n        array(0 => 63, 1 => 4),\n        array(0 => 63, 1 => 1),\n        array(0 => 64, 1 => 2),\n        array(0 => 64, 1 => 0),\n        array(0 => 62, 1 => 2),\n        array(0 => 62, 1 => 0),\n        array(0 => 65, 1 => 1),\n        array(0 => 65, 1 => 1),\n        array(0 => 65, 1 => 3),\n        array(0 => 65, 1 => 2),\n        array(0 => 66, 1 => 1),\n        array(0 => 66, 1 => 2),\n        array(0 => 66, 1 => 2),\n        array(0 => 69, 1 => 2),\n        array(0 => 68, 1 => 2),\n        array(0 => 71, 1 => 1),\n        array(0 => 71, 1 => 1),\n        array(0 => 71, 1 => 1),\n        array(0 => 67, 1 => 3),\n        array(0 => 67, 1 => 2),\n        array(0 => 67, 1 => 4),\n        array(0 => 67, 1 => 5),\n        array(0 => 67, 1 => 6),\n        array(0 => 67, 1 => 2),\n        array(0 => 67, 1 => 2),\n        array(0 => 67, 1 => 3),\n        array(0 => 67, 1 => 2),\n        array(0 => 67, 1 => 3),\n        array(0 => 67, 1 => 8),\n        array(0 => 79, 1 => 2),\n        array(0 => 79, 1 => 1),\n        array(0 => 67, 1 => 5),\n        array(0 => 67, 1 => 7),\n        array(0 => 67, 1 => 6),\n        array(0 => 67, 1 => 8),\n        array(0 => 67, 1 => 2),\n        array(0 => 67, 1 => 3),\n        array(0 => 67, 1 => 4),\n        array(0 => 65, 1 => 1),\n        array(0 => 67, 1 => 2),\n        array(0 => 67, 1 => 3),\n        array(0 => 67, 1 => 4),\n        array(0 => 67, 1 => 5),\n        array(0 => 72, 1 => 2),\n        array(0 => 72, 1 => 1),\n        array(0 => 72, 1 => 0),\n        array(0 => 82, 1 => 4),\n        array(0 => 82, 1 => 2),\n        array(0 => 82, 1 => 2),\n        array(0 => 82, 1 => 2),\n        array(0 => 82, 1 => 2),\n        array(0 => 82, 1 => 2),\n        array(0 => 82, 1 => 4),\n        array(0 => 78, 1 => 1),\n        array(0 => 78, 1 => 3),\n        array(0 => 77, 1 => 3),\n        array(0 => 77, 1 => 3),\n        array(0 => 77, 1 => 3),\n        array(0 => 77, 1 => 3),\n        array(0 => 75, 1 => 1),\n        array(0 => 75, 1 => 1),\n        array(0 => 75, 1 => 3),\n        array(0 => 75, 1 => 3),\n        array(0 => 75, 1 => 3),\n        array(0 => 75, 1 => 1),\n        array(0 => 75, 1 => 2),\n        array(0 => 75, 1 => 3),\n        array(0 => 75, 1 => 3),\n        array(0 => 75, 1 => 2),\n        array(0 => 75, 1 => 3),\n        array(0 => 75, 1 => 3),\n        array(0 => 83, 1 => 7),\n        array(0 => 83, 1 => 7),\n        array(0 => 74, 1 => 1),\n        array(0 => 74, 1 => 2),\n        array(0 => 74, 1 => 2),\n        array(0 => 74, 1 => 2),\n        array(0 => 74, 1 => 2),\n        array(0 => 74, 1 => 1),\n        array(0 => 74, 1 => 1),\n        array(0 => 74, 1 => 3),\n        array(0 => 74, 1 => 2),\n        array(0 => 74, 1 => 2),\n        array(0 => 74, 1 => 1),\n        array(0 => 74, 1 => 1),\n        array(0 => 74, 1 => 3),\n        array(0 => 74, 1 => 3),\n        array(0 => 74, 1 => 3),\n        array(0 => 74, 1 => 1),\n        array(0 => 74, 1 => 1),\n        array(0 => 74, 1 => 3),\n        array(0 => 74, 1 => 1),\n        array(0 => 74, 1 => 2),\n        array(0 => 74, 1 => 1),\n        array(0 => 74, 1 => 3),\n        array(0 => 89, 1 => 1),\n        array(0 => 89, 1 => 1),\n        array(0 => 73, 1 => 1),\n        array(0 => 73, 1 => 1),\n        array(0 => 73, 1 => 3),\n        array(0 => 73, 1 => 1),\n        array(0 => 73, 1 => 3),\n        array(0 => 73, 1 => 4),\n        array(0 => 73, 1 => 3),\n        array(0 => 73, 1 => 4),\n        array(0 => 70, 1 => 2),\n        array(0 => 70, 1 => 2),\n        array(0 => 93, 1 => 2),\n        array(0 => 93, 1 => 0),\n        array(0 => 94, 1 => 2),\n        array(0 => 94, 1 => 2),\n        array(0 => 94, 1 => 4),\n        array(0 => 94, 1 => 2),\n        array(0 => 94, 1 => 2),\n        array(0 => 94, 1 => 4),\n        array(0 => 94, 1 => 3),\n        array(0 => 94, 1 => 5),\n        array(0 => 94, 1 => 3),\n        array(0 => 94, 1 => 3),\n        array(0 => 94, 1 => 3),\n        array(0 => 94, 1 => 3),\n        array(0 => 94, 1 => 3),\n        array(0 => 94, 1 => 3),\n        array(0 => 94, 1 => 2),\n        array(0 => 80, 1 => 1),\n        array(0 => 80, 1 => 1),\n        array(0 => 80, 1 => 2),\n        array(0 => 95, 1 => 1),\n        array(0 => 95, 1 => 1),\n        array(0 => 95, 1 => 3),\n        array(0 => 92, 1 => 2),\n        array(0 => 96, 1 => 1),\n        array(0 => 96, 1 => 2),\n        array(0 => 97, 1 => 3),\n        array(0 => 97, 1 => 3),\n        array(0 => 97, 1 => 5),\n        array(0 => 97, 1 => 6),\n        array(0 => 97, 1 => 2),\n        array(0 => 88, 1 => 4),\n        array(0 => 98, 1 => 4),\n        array(0 => 98, 1 => 4),\n        array(0 => 99, 1 => 3),\n        array(0 => 99, 1 => 1),\n        array(0 => 99, 1 => 0),\n        array(0 => 76, 1 => 3),\n        array(0 => 76, 1 => 2),\n        array(0 => 100, 1 => 3),\n        array(0 => 100, 1 => 2),\n        array(0 => 81, 1 => 2),\n        array(0 => 81, 1 => 0),\n        array(0 => 101, 1 => 2),\n        array(0 => 101, 1 => 2),\n        array(0 => 91, 1 => 1),\n        array(0 => 91, 1 => 2),\n        array(0 => 91, 1 => 1),\n        array(0 => 91, 1 => 2),\n        array(0 => 91, 1 => 3),\n        array(0 => 86, 1 => 1),\n        array(0 => 86, 1 => 1),\n        array(0 => 85, 1 => 1),\n        array(0 => 87, 1 => 1),\n        array(0 => 84, 1 => 3),\n        array(0 => 102, 1 => 1),\n        array(0 => 102, 1 => 3),\n        array(0 => 102, 1 => 0),\n        array(0 => 103, 1 => 3),\n        array(0 => 103, 1 => 3),\n        array(0 => 103, 1 => 1),\n        array(0 => 90, 1 => 2),\n        array(0 => 90, 1 => 3),\n        array(0 => 104, 1 => 2),\n        array(0 => 104, 1 => 1),\n        array(0 => 105, 1 => 3),\n        array(0 => 105, 1 => 3),\n        array(0 => 105, 1 => 1),\n        array(0 => 105, 1 => 3),\n        array(0 => 105, 1 => 3),\n        array(0 => 105, 1 => 1),\n        array(0 => 105, 1 => 1),\n    );\n    public static $yyReduceMap      = array(\n        0   => 0,\n        1   => 1,\n        2   => 2,\n        3   => 3,\n        4   => 4,\n        5   => 5,\n        6   => 6,\n        7   => 7,\n        21  => 7,\n        22  => 7,\n        23  => 7,\n        36  => 7,\n        56  => 7,\n        57  => 7,\n        65  => 7,\n        66  => 7,\n        70  => 7,\n        79  => 7,\n        84  => 7,\n        85  => 7,\n        90  => 7,\n        94  => 7,\n        95  => 7,\n        99  => 7,\n        101 => 7,\n        106 => 7,\n        168 => 7,\n        173 => 7,\n        8   => 8,\n        9   => 9,\n        10  => 10,\n        12  => 12,\n        13  => 13,\n        14  => 14,\n        15  => 15,\n        16  => 16,\n        17  => 17,\n        18  => 18,\n        19  => 19,\n        20  => 20,\n        24  => 24,\n        25  => 25,\n        26  => 26,\n        27  => 27,\n        28  => 28,\n        29  => 29,\n        30  => 30,\n        31  => 31,\n        33  => 31,\n        32  => 32,\n        34  => 34,\n        35  => 35,\n        37  => 37,\n        38  => 38,\n        39  => 39,\n        40  => 40,\n        41  => 41,\n        42  => 42,\n        43  => 43,\n        44  => 44,\n        45  => 45,\n        46  => 46,\n        47  => 47,\n        48  => 48,\n        49  => 49,\n        50  => 50,\n        59  => 50,\n        148 => 50,\n        152 => 50,\n        156 => 50,\n        157 => 50,\n        51  => 51,\n        149 => 51,\n        155 => 51,\n        52  => 52,\n        53  => 53,\n        54  => 53,\n        55  => 55,\n        133 => 55,\n        58  => 58,\n        60  => 60,\n        61  => 61,\n        62  => 61,\n        63  => 63,\n        64  => 64,\n        67  => 67,\n        68  => 68,\n        69  => 68,\n        71  => 71,\n        98  => 71,\n        72  => 72,\n        73  => 73,\n        74  => 74,\n        75  => 75,\n        76  => 76,\n        77  => 77,\n        78  => 78,\n        80  => 80,\n        82  => 80,\n        83  => 80,\n        113 => 80,\n        81  => 81,\n        86  => 86,\n        87  => 87,\n        88  => 88,\n        89  => 89,\n        91  => 91,\n        92  => 92,\n        93  => 92,\n        96  => 96,\n        97  => 97,\n        100 => 100,\n        102 => 102,\n        103 => 103,\n        104 => 104,\n        105 => 105,\n        107 => 107,\n        108 => 108,\n        109 => 109,\n        110 => 110,\n        111 => 111,\n        112 => 112,\n        114 => 114,\n        170 => 114,\n        115 => 115,\n        116 => 116,\n        117 => 117,\n        118 => 118,\n        119 => 119,\n        120 => 120,\n        128 => 120,\n        121 => 121,\n        122 => 122,\n        123 => 123,\n        124 => 123,\n        126 => 123,\n        127 => 123,\n        125 => 125,\n        129 => 129,\n        130 => 130,\n        131 => 131,\n        174 => 131,\n        132 => 132,\n        134 => 134,\n        135 => 135,\n        136 => 136,\n        137 => 137,\n        138 => 138,\n        139 => 139,\n        140 => 140,\n        141 => 141,\n        142 => 142,\n        143 => 143,\n        144 => 144,\n        145 => 145,\n        146 => 146,\n        147 => 147,\n        150 => 150,\n        151 => 151,\n        153 => 153,\n        154 => 154,\n        158 => 158,\n        159 => 159,\n        160 => 160,\n        161 => 161,\n        162 => 162,\n        163 => 163,\n        164 => 164,\n        165 => 165,\n        166 => 166,\n        167 => 167,\n        169 => 169,\n        171 => 171,\n        172 => 172,\n        175 => 175,\n        176 => 176,\n        177 => 177,\n        178 => 178,\n        181 => 178,\n        179 => 179,\n        182 => 179,\n        180 => 180,\n        183 => 183,\n        184 => 184,\n    );\n    /**\n     * result status\n     *\n     * @var bool\n     */\n    public $successful = true;\n    /**\n     * return value\n     *\n     * @var mixed\n     */\n    public $retvalue = 0;\n    /**\n     * @var\n     */\n    public $yymajor;\n    /**\n     * last index of array variable\n     *\n     * @var mixed\n     */\n    public $last_index;\n    /**\n     * last variable name\n     *\n     * @var string\n     */\n    public $last_variable;\n    /**\n     * root parse tree buffer\n     *\n     * @var Smarty_Internal_ParseTree\n     */\n    public $root_buffer;\n    /**\n     * current parse tree object\n     *\n     * @var Smarty_Internal_ParseTree\n     */\n    public $current_buffer;\n    /**\n     * lexer object\n     *\n     * @var Smarty_Internal_Templatelexer\n     */\n    public $lex;\n    /**\n     * {strip} status\n     *\n     * @var bool\n     */\n    public $strip = false;\n    /**\n     * compiler object\n     *\n     * @var Smarty_Internal_TemplateCompilerBase\n     */\n    public $compiler = null;\n    /**\n     * smarty object\n     *\n     * @var Smarty\n     */\n    public $smarty = null;\n    /**\n     * template object\n     *\n     * @var Smarty_Internal_Template\n     */\n    public $template = null;\n    /**\n     * block nesting level\n     *\n     * @var int\n     */\n    public $block_nesting_level = 0;\n    /**\n     * security object\n     *\n     * @var Smarty_Security\n     */\n    public $security = null;\n    /**\n     * template prefix array\n     *\n     * @var \\Smarty_Internal_ParseTree[]\n     */\n    public $template_prefix = array();\n    /**\n     * template prefix array\n     *\n     * @var \\Smarty_Internal_ParseTree[]\n     */\n    public $template_postfix = array();\n    public $yyTraceFILE;\n    public $yyTracePrompt;\n    public $yyidx;\n    public $yyerrcnt;\n    public $yystack          = array();\n    public $yyTokenName      = array(\n        '$', 'VERT', 'COLON', 'UNIMATH',\n        'PHP', 'TEXT', 'STRIPON', 'STRIPOFF',\n        'LITERALSTART', 'LITERALEND', 'LITERAL', 'SIMPELOUTPUT',\n        'SIMPLETAG', 'LDEL', 'RDEL', 'DOLLARID',\n        'EQUAL', 'ID', 'PTR', 'LDELMAKENOCACHE',\n        'LDELIF', 'LDELFOR', 'SEMICOLON', 'INCDEC',\n        'TO', 'STEP', 'LDELFOREACH', 'SPACE',\n        'AS', 'APTR', 'LDELSETFILTER', 'CLOSETAG',\n        'LDELSLASH', 'ATTR', 'INTEGER', 'COMMA',\n        'OPENP', 'CLOSEP', 'MATH', 'ISIN',\n        'QMARK', 'NOT', 'TYPECAST', 'HEX',\n        'DOT', 'INSTANCEOF', 'SINGLEQUOTESTRING', 'DOUBLECOLON',\n        'NAMESPACE', 'AT', 'HATCH', 'OPENB',\n        'CLOSEB', 'DOLLAR', 'LOGOP', 'SLOGOP',\n        'TLOGOP', 'SINGLECOND', 'QUOTE', 'BACKTICK',\n        'error', 'start', 'template', 'literal_e2',\n        'literal_e1', 'smartytag', 'tagbody', 'tag',\n        'outattr', 'eqoutattr', 'varindexed', 'output',\n        'attributes', 'variable', 'value', 'expr',\n        'modifierlist', 'statement', 'statements', 'foraction',\n        'varvar', 'modparameters', 'attribute', 'ternary',\n        'array', 'tlop', 'lop', 'scond',\n        'function', 'ns1', 'doublequoted_with_quotes', 'static_class_access',\n        'object', 'arrayindex', 'indexdef', 'varvarele',\n        'objectchain', 'objectelement', 'method', 'params',\n        'modifier', 'modparameter', 'arrayelements', 'arrayelement',\n        'doublequoted', 'doublequotedcontent',\n    );\n    /**\n     * internal error flag\n     *\n     * @var bool\n     */\n    private $internalError = false;                    /* Index of top element in stack */\n    private $_retvalue;                 /* Shifts left before out of the error */\n    /**\n     * constructor\n     *\n     * @param Smarty_Internal_Templatelexer        $lex\n     * @param Smarty_Internal_TemplateCompilerBase $compiler\n     */\n    function __construct(Smarty_Internal_Templatelexer $lex, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        $this->lex = $lex;\n        $this->compiler = $compiler;\n        $this->template = $this->compiler->template;\n        $this->smarty = $this->template->smarty;\n        $this->security = isset($this->smarty->security_policy) ? $this->smarty->security_policy : false;\n        $this->current_buffer = $this->root_buffer = new Smarty_Internal_ParseTree_Template();\n    }  /* The parser's stack */\n    public static function yy_destructor($yymajor, $yypminor)\n    {\n        switch ($yymajor) {\n            default:\n                break;   /* If no destructor action specified: do nothing */\n        }\n    }\n\n    /**\n     * insert PHP code in current buffer\n     *\n     * @param string $code\n     */\n    public function insertPhpCode($code)\n    {\n        $this->current_buffer->append_subtree($this, new Smarty_Internal_ParseTree_Tag($this, $code));\n    }\n\n    /**\n     * error rundown\n     *\n     */\n    public function errorRunDown()\n    {\n        while ($this->yystack !== array()) {\n            $this->yy_pop_parser_stack();\n        }\n        if (is_resource($this->yyTraceFILE)) {\n            fclose($this->yyTraceFILE);\n        }\n    }\n\n    /**\n     *  merge PHP code with prefix code and return parse tree tag object\n     *\n     * @param string $code\n     *\n     * @return Smarty_Internal_ParseTree_Tag\n     */\n    public function mergePrefixCode($code)\n    {\n        $tmp = '';\n        foreach ($this->compiler->prefix_code as $preCode) {\n            $tmp .= $preCode;\n        }\n        $this->compiler->prefix_code = array();\n        $tmp .= $code;\n        return new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode($tmp, true));\n    }\n\n    public function Trace($TraceFILE, $zTracePrompt)\n    {\n        if (!$TraceFILE) {\n            $zTracePrompt = 0;\n        } else if (!$zTracePrompt) {\n            $TraceFILE = 0;\n        }\n        $this->yyTraceFILE = $TraceFILE;\n        $this->yyTracePrompt = $zTracePrompt;\n    }\n\n    public function PrintTrace()\n    {\n        $this->yyTraceFILE = fopen('php://output', 'w');\n        $this->yyTracePrompt = '<br>';\n    }\n\n    public function tokenName($tokenType)\n    {\n        if ($tokenType === 0) {\n            return 'End of Input';\n        }\n        if ($tokenType > 0 && $tokenType < count($this->yyTokenName)) {\n            return $this->yyTokenName[ $tokenType ];\n        } else {\n            return 'Unknown';\n        }\n    }\n\n    public function yy_pop_parser_stack()\n    {\n        if (empty($this->yystack)) {\n            return;\n        }\n        $yytos = array_pop($this->yystack);\n        if ($this->yyTraceFILE && $this->yyidx >= 0) {\n            fwrite($this->yyTraceFILE,\n                   $this->yyTracePrompt . 'Popping ' . $this->yyTokenName[ $yytos->major ] .\n                   \"\\n\");\n        }\n        $yymajor = $yytos->major;\n        self::yy_destructor($yymajor, $yytos->minor);\n        $this->yyidx--;\n        return $yymajor;\n    }\n\n    public function __destruct()\n    {\n        while ($this->yystack !== Array()) {\n            $this->yy_pop_parser_stack();\n        }\n        if (is_resource($this->yyTraceFILE)) {\n            fclose($this->yyTraceFILE);\n        }\n    }\n\n    public function yy_get_expected_tokens($token)\n    {\n        static $res3 = array();\n        static $res4 = array();\n        $state = $this->yystack[ $this->yyidx ]->stateno;\n        $expected = self::$yyExpectedTokens[ $state ];\n        if (isset($res3[ $state ][ $token ])) {\n            if ($res3[ $state ][ $token ]) {\n                return $expected;\n            }\n        } else {\n            if ($res3[ $state ][ $token ] = in_array($token, self::$yyExpectedTokens[ $state ], true)) {\n                return $expected;\n            }\n        }\n        $stack = $this->yystack;\n        $yyidx = $this->yyidx;\n        do {\n            $yyact = $this->yy_find_shift_action($token);\n            if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {\n                // reduce action\n                $done = 0;\n                do {\n                    if ($done++ === 100) {\n                        $this->yyidx = $yyidx;\n                        $this->yystack = $stack;\n                        // too much recursion prevents proper detection\n                        // so give up\n                        return array_unique($expected);\n                    }\n                    $yyruleno = $yyact - self::YYNSTATE;\n                    $this->yyidx -= self::$yyRuleInfo[ $yyruleno ][ 1 ];\n                    $nextstate = $this->yy_find_reduce_action(\n                        $this->yystack[ $this->yyidx ]->stateno,\n                        self::$yyRuleInfo[ $yyruleno ][ 0 ]);\n                    if (isset(self::$yyExpectedTokens[ $nextstate ])) {\n                        $expected = array_merge($expected, self::$yyExpectedTokens[ $nextstate ]);\n                        if (isset($res4[ $nextstate ][ $token ])) {\n                            if ($res4[ $nextstate ][ $token ]) {\n                                $this->yyidx = $yyidx;\n                                $this->yystack = $stack;\n                                return array_unique($expected);\n                            }\n                        } else {\n                            if ($res4[ $nextstate ][ $token ] =\n                                in_array($token, self::$yyExpectedTokens[ $nextstate ], true)) {\n                                $this->yyidx = $yyidx;\n                                $this->yystack = $stack;\n                                return array_unique($expected);\n                            }\n                        }\n                    }\n                    if ($nextstate < self::YYNSTATE) {\n                        // we need to shift a non-terminal\n                        $this->yyidx++;\n                        $x = new TP_yyStackEntry;\n                        $x->stateno = $nextstate;\n                        $x->major = self::$yyRuleInfo[ $yyruleno ][ 0 ];\n                        $this->yystack[ $this->yyidx ] = $x;\n                        continue 2;\n                    } else if ($nextstate === self::YYNSTATE + self::YYNRULE + 1) {\n                        $this->yyidx = $yyidx;\n                        $this->yystack = $stack;\n                        // the last token was just ignored, we can't accept\n                        // by ignoring input, this is in essence ignoring a\n                        // syntax error!\n                        return array_unique($expected);\n                    } else if ($nextstate === self::YY_NO_ACTION) {\n                        $this->yyidx = $yyidx;\n                        $this->yystack = $stack;\n                        // input accepted, but not shifted (I guess)\n                        return $expected;\n                    } else {\n                        $yyact = $nextstate;\n                    }\n                } while (true);\n            }\n            break;\n        } while (true);\n        $this->yyidx = $yyidx;\n        $this->yystack = $stack;\n        return array_unique($expected);\n    }\n\n    public function yy_is_expected_token($token)\n    {\n        static $res = array();\n        static $res2 = array();\n        if ($token === 0) {\n            return true; // 0 is not part of this\n        }\n        $state = $this->yystack[ $this->yyidx ]->stateno;\n        if (isset($res[ $state ][ $token ])) {\n            if ($res[ $state ][ $token ]) {\n                return true;\n            }\n        } else {\n            if ($res[ $state ][ $token ] = in_array($token, self::$yyExpectedTokens[ $state ], true)) {\n                return true;\n            }\n        }\n        $stack = $this->yystack;\n        $yyidx = $this->yyidx;\n        do {\n            $yyact = $this->yy_find_shift_action($token);\n            if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {\n                // reduce action\n                $done = 0;\n                do {\n                    if ($done++ === 100) {\n                        $this->yyidx = $yyidx;\n                        $this->yystack = $stack;\n                        // too much recursion prevents proper detection\n                        // so give up\n                        return true;\n                    }\n                    $yyruleno = $yyact - self::YYNSTATE;\n                    $this->yyidx -= self::$yyRuleInfo[ $yyruleno ][ 1 ];\n                    $nextstate = $this->yy_find_reduce_action(\n                        $this->yystack[ $this->yyidx ]->stateno,\n                        self::$yyRuleInfo[ $yyruleno ][ 0 ]);\n                    if (isset($res2[ $nextstate ][ $token ])) {\n                        if ($res2[ $nextstate ][ $token ]) {\n                            $this->yyidx = $yyidx;\n                            $this->yystack = $stack;\n                            return true;\n                        }\n                    } else {\n                        if ($res2[ $nextstate ][ $token ] = (isset(self::$yyExpectedTokens[ $nextstate ]) &&\n                                                             in_array($token,\n                                                                      self::$yyExpectedTokens[ $nextstate ],\n                                                                      true))) {\n                            $this->yyidx = $yyidx;\n                            $this->yystack = $stack;\n                            return true;\n                        }\n                    }\n                    if ($nextstate < self::YYNSTATE) {\n                        // we need to shift a non-terminal\n                        $this->yyidx++;\n                        $x = new TP_yyStackEntry;\n                        $x->stateno = $nextstate;\n                        $x->major = self::$yyRuleInfo[ $yyruleno ][ 0 ];\n                        $this->yystack[ $this->yyidx ] = $x;\n                        continue 2;\n                    } else if ($nextstate === self::YYNSTATE + self::YYNRULE + 1) {\n                        $this->yyidx = $yyidx;\n                        $this->yystack = $stack;\n                        if (!$token) {\n                            // end of input: this is valid\n                            return true;\n                        }\n                        // the last token was just ignored, we can't accept\n                        // by ignoring input, this is in essence ignoring a\n                        // syntax error!\n                        return false;\n                    } else if ($nextstate === self::YY_NO_ACTION) {\n                        $this->yyidx = $yyidx;\n                        $this->yystack = $stack;\n                        // input accepted, but not shifted (I guess)\n                        return true;\n                    } else {\n                        $yyact = $nextstate;\n                    }\n                } while (true);\n            }\n            break;\n        } while (true);\n        $this->yyidx = $yyidx;\n        $this->yystack = $stack;\n        return true;\n    }\n\n    public function yy_find_shift_action($iLookAhead)\n    {\n        $stateno = $this->yystack[ $this->yyidx ]->stateno;\n        /* if ($this->yyidx < 0) return self::YY_NO_ACTION;  */\n        if (!isset(self::$yy_shift_ofst[ $stateno ])) {\n            // no shift actions\n            return self::$yy_default[ $stateno ];\n        }\n        $i = self::$yy_shift_ofst[ $stateno ];\n        if ($i === self::YY_SHIFT_USE_DFLT) {\n            return self::$yy_default[ $stateno ];\n        }\n        if ($iLookAhead === self::YYNOCODE) {\n            return self::YY_NO_ACTION;\n        }\n        $i += $iLookAhead;\n        if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||\n            self::$yy_lookahead[ $i ] != $iLookAhead) {\n            if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback)\n                && ($iFallback = self::$yyFallback[ $iLookAhead ]) != 0) {\n                if ($this->yyTraceFILE) {\n                    fwrite($this->yyTraceFILE,\n                           $this->yyTracePrompt . 'FALLBACK ' .\n                           $this->yyTokenName[ $iLookAhead ] . ' => ' .\n                           $this->yyTokenName[ $iFallback ] . \"\\n\");\n                }\n                return $this->yy_find_shift_action($iFallback);\n            }\n            return self::$yy_default[ $stateno ];\n        } else {\n            return self::$yy_action[ $i ];\n        }\n    }\n\n    public function yy_find_reduce_action($stateno, $iLookAhead)\n    {\n        /* $stateno = $this->yystack[$this->yyidx]->stateno; */\n        if (!isset(self::$yy_reduce_ofst[ $stateno ])) {\n            return self::$yy_default[ $stateno ];\n        }\n        $i = self::$yy_reduce_ofst[ $stateno ];\n        if ($i === self::YY_REDUCE_USE_DFLT) {\n            return self::$yy_default[ $stateno ];\n        }\n        if ($iLookAhead === self::YYNOCODE) {\n            return self::YY_NO_ACTION;\n        }\n        $i += $iLookAhead;\n        if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||\n            self::$yy_lookahead[ $i ] != $iLookAhead) {\n            return self::$yy_default[ $stateno ];\n        } else {\n            return self::$yy_action[ $i ];\n        }\n    }\n\n    #line 234 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    public function yy_shift($yyNewState, $yyMajor, $yypMinor)\n    {\n        $this->yyidx++;\n        if ($this->yyidx >= self::YYSTACKDEPTH) {\n            $this->yyidx--;\n            if ($this->yyTraceFILE) {\n                fprintf($this->yyTraceFILE, \"%sStack Overflow!\\n\", $this->yyTracePrompt);\n            }\n            while ($this->yyidx >= 0) {\n                $this->yy_pop_parser_stack();\n            }\n            #line 221 \"../smarty/lexer/smarty_internal_templateparser.y\"\n            $this->internalError = true;\n            $this->compiler->trigger_template_error('Stack overflow in template parser');\n            return;\n        }\n        $yytos = new TP_yyStackEntry;\n        $yytos->stateno = $yyNewState;\n        $yytos->major = $yyMajor;\n        $yytos->minor = $yypMinor;\n        $this->yystack[] = $yytos;\n        if ($this->yyTraceFILE && $this->yyidx > 0) {\n            fprintf($this->yyTraceFILE,\n                    \"%sShift %d\\n\",\n                    $this->yyTracePrompt,\n                    $yyNewState);\n            fprintf($this->yyTraceFILE, \"%sStack:\", $this->yyTracePrompt);\n            for ($i = 1; $i <= $this->yyidx; $i++) {\n                fprintf($this->yyTraceFILE,\n                        \" %s\",\n                        $this->yyTokenName[ $this->yystack[ $i ]->major ]);\n            }\n            fwrite($this->yyTraceFILE, \"\\n\");\n        }\n    }\n\n    #line 242 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r0()\n    {\n        $this->root_buffer->prepend_array($this, $this->template_prefix);\n        $this->root_buffer->append_array($this, $this->template_postfix);\n        $this->_retvalue = $this->root_buffer->to_smarty_php($this);\n    }\n\n    #line 251 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r1()\n    {\n        $code = $this->compiler->compileTag('private_php',\n                                            array(array('code' => $this->yystack[ $this->yyidx + 0 ]->minor),\n                                                  array('type' => $this->lex->phpType)),\n                                            array());\n        if ($this->compiler->has_code && !empty($code)) {\n            $tmp = '';\n            foreach ($this->compiler->prefix_code as $code) {\n                $tmp .= $code;\n            }\n            $this->compiler->prefix_code = array();\n            $this->current_buffer->append_subtree($this,\n                                                  new Smarty_Internal_ParseTree_Tag($this,\n                                                                                    $this->compiler->processNocacheCode($tmp .\n                                                                                                                        $code,\n                                                                                                                        true)));\n        }\n    }\n\n    #line 255 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r2()\n    {\n        $this->current_buffer->append_subtree($this,\n                                              $this->compiler->processText($this->yystack[ $this->yyidx + 0 ]->minor));\n    }\n\n    #line 259 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r3()\n    {\n        $this->strip = true;\n    }\n\n    #line 264 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r4()\n    {\n        $this->strip = false;\n    }\n\n    #line 269 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r5()\n    {\n        $this->current_buffer->append_subtree($this,\n                                              new Smarty_Internal_ParseTree_Text($this->yystack[ $this->yyidx +\n                                                                                                 -1 ]->minor));\n    }\n\n    #line 272 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r6()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -3 ]->minor . $this->yystack[ $this->yyidx + -1 ]->minor;\n    }\n\n    #line 276 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r7()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 281 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r8()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 285 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r9()\n    {\n        $this->_retvalue = '';\n    }\n\n    #line 297 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r10()\n    {\n        if ($this->compiler->has_code) {\n            $this->current_buffer->append_subtree($this,\n                                                  $this->mergePrefixCode($this->yystack[ $this->yyidx + 0 ]->minor));\n        }\n        $this->compiler->has_variable_string = false;\n        $this->block_nesting_level = count($this->compiler->_tag_stack);\n    }\n\n    #line 307 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r12()\n    {\n        $var = trim(substr($this->yystack[ $this->yyidx + 0 ]->minor,\n                           $this->compiler->getLdelLength(),\n                           -$this->compiler->getRdelLength()),\n                    ' $');\n        if (preg_match('/^(.*)(\\s+nocache)$/', $var, $match)) {\n            $this->_retvalue = $this->compiler->compileTag('private_print_expression',\n                                                           array('nocache'),\n                                                           array('value' => $this->compiler->compileVariable('\\'' .\n                                                                                                             $match[ 1 ] .\n                                                                                                             '\\'')));\n        } else {\n            $this->_retvalue = $this->compiler->compileTag('private_print_expression',\n                                                           array(),\n                                                           array('value' => $this->compiler->compileVariable('\\'' .\n                                                                                                             $var .\n                                                                                                             '\\'')));\n        }\n    }\n\n    #line 327 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r13()\n    {\n        $tag = trim(substr($this->yystack[ $this->yyidx + 0 ]->minor,\n                           $this->compiler->getLdelLength(),\n                           -$this->compiler->getRdelLength()));\n        if ($tag == 'strip') {\n            $this->strip = true;\n            $this->_retvalue = null;;\n        } else {\n            if (defined($tag)) {\n                if ($this->security) {\n                    $this->security->isTrustedConstant($tag, $this->compiler);\n                }\n                $this->_retvalue =\n                    $this->compiler->compileTag('private_print_expression', array(), array('value' => $tag));\n            } else {\n                if (preg_match('/^(.*)(\\s+nocache)$/', $tag, $match)) {\n                    $this->_retvalue = $this->compiler->compileTag($match[ 1 ], array('\\'nocache\\''));\n                } else {\n                    $this->_retvalue = $this->compiler->compileTag($tag, array());\n                }\n            }\n        }\n    }\n\n    #line 331 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r14()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor;\n    }\n\n    #line 335 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r15()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor;\n    }\n\n    #line 344 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r16()\n    {\n        $this->_retvalue = $this->compiler->compileTag('private_print_expression',\n                                                       $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ],\n                                                       array('value' => $this->yystack[ $this->yyidx +\n                                                                                        0 ]->minor[ 0 ]));\n    }\n\n    #line 348 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r17()\n    {\n        $this->_retvalue = $this->compiler->compileTag('assign',\n                                                       array_merge(array(array('value' => $this->yystack[ $this->yyidx +\n                                                                                                          0 ]->minor[ 0 ]),\n                                                                         array('var' => '\\'' .\n                                                                                        substr($this->yystack[ $this->yyidx +\n                                                                                                               -1 ]->minor,\n                                                                                               1) . '\\'')),\n                                                                   $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ]));\n    }\n\n    #line 352 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r18()\n    {\n        $this->_retvalue = $this->compiler->compileTag('assign',\n                                                       array_merge(array(array('value' => $this->yystack[ $this->yyidx +\n                                                                                                          0 ]->minor[ 0 ]),\n                                                                         array('var' => $this->yystack[ $this->yyidx +\n                                                                                                        -1 ]->minor[ 'var' ])),\n                                                                   $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ]),\n                                                       array('smarty_internal_index' => $this->yystack[ $this->yyidx +\n                                                                                                        -1 ]->minor[ 'smarty_internal_index' ]));\n    }\n\n    #line 356 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r19()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 371 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r20()\n    {\n        $this->_retvalue = array($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 381 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r24()\n    {\n        if (defined($this->yystack[ $this->yyidx + -1 ]->minor)) {\n            if ($this->security) {\n                $this->security->isTrustedConstant($this->yystack[ $this->yyidx + -1 ]->minor, $this->compiler);\n            }\n            $this->_retvalue = $this->compiler->compileTag('private_print_expression',\n                                                           $this->yystack[ $this->yyidx + 0 ]->minor,\n                                                           array('value' => $this->yystack[ $this->yyidx +\n                                                                                            -1 ]->minor));\n        } else {\n            $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -1 ]->minor,\n                                                           $this->yystack[ $this->yyidx + 0 ]->minor);\n        }\n    }\n\n    #line 394 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r25()\n    {\n        if (defined($this->yystack[ $this->yyidx + 0 ]->minor)) {\n            if ($this->security) {\n                $this->security->isTrustedConstant($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler);\n            }\n            $this->_retvalue = $this->compiler->compileTag('private_print_expression',\n                                                           array(),\n                                                           array('value' => $this->yystack[ $this->yyidx + 0 ]->minor));\n        } else {\n            $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + 0 ]->minor, array());\n        }\n    }\n\n    #line 406 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r26()\n    {\n        if (defined($this->yystack[ $this->yyidx + -2 ]->minor)) {\n            if ($this->security) {\n                $this->security->isTrustedConstant($this->yystack[ $this->yyidx + -2 ]->minor, $this->compiler);\n            }\n            $this->_retvalue = $this->compiler->compileTag('private_print_expression',\n                                                           $this->yystack[ $this->yyidx + 0 ]->minor,\n                                                           array('value'        => $this->yystack[ $this->yyidx +\n                                                                                                   -2 ]->minor,\n                                                                 'modifierlist' => $this->yystack[ $this->yyidx +\n                                                                                                   -1 ]->minor));\n        } else {\n            $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -2 ]->minor,\n                                                           $this->yystack[ $this->yyidx + 0 ]->minor,\n                                                           array('modifierlist' => $this->yystack[ $this->yyidx +\n                                                                                                   -1 ]->minor));\n        }\n    }\n\n    #line 411 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r27()\n    {\n        $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -3 ]->minor,\n                                                       $this->yystack[ $this->yyidx + 0 ]->minor,\n                                                       array('object_method' => $this->yystack[ $this->yyidx +\n                                                                                                -1 ]->minor));\n    }\n\n    #line 416 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r28()\n    {\n        $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -4 ]->minor,\n                                                       $this->yystack[ $this->yyidx + 0 ]->minor,\n                                                       array('modifierlist'  => $this->yystack[ $this->yyidx +\n                                                                                                -1 ]->minor,\n                                                             'object_method' => $this->yystack[ $this->yyidx +\n                                                                                                -2 ]->minor));\n    }\n\n    #line 421 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r29()\n    {\n        $this->_retvalue = $this->compiler->compileTag('make_nocache',\n                                                       array(array('var' => '\\'' . substr($this->yystack[ $this->yyidx +\n                                                                                                          0 ]->minor,\n                                                                                          1) . '\\'')));\n    }\n\n    #line 426 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r30()\n    {\n        $tag = trim(substr($this->yystack[ $this->yyidx + -1 ]->minor, $this->compiler->getLdelLength()));\n        $this->_retvalue = $this->compiler->compileTag(($tag === 'else if') ? 'elseif' : $tag,\n                                                       array(),\n                                                       array('if condition' => $this->yystack[ $this->yyidx +\n                                                                                               0 ]->minor));\n    }\n\n    #line 431 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r31()\n    {\n        $tag = trim(substr($this->yystack[ $this->yyidx + -2 ]->minor, $this->compiler->getLdelLength()));\n        $this->_retvalue = $this->compiler->compileTag(($tag === 'else if') ? 'elseif' : $tag,\n                                                       $this->yystack[ $this->yyidx + 0 ]->minor,\n                                                       array('if condition' => $this->yystack[ $this->yyidx +\n                                                                                               -1 ]->minor));\n    }\n\n    #line 442 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r32()\n    {\n        $tag = trim(substr($this->yystack[ $this->yyidx + -1 ]->minor, $this->compiler->getLdelLength()));\n        $this->_retvalue = $this->compiler->compileTag(($tag === 'else if') ? 'elseif' : $tag,\n                                                       array(),\n                                                       array('if condition' => $this->yystack[ $this->yyidx +\n                                                                                               0 ]->minor));\n    }\n\n    #line 446 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r34()\n    {\n        $this->_retvalue = $this->compiler->compileTag('for',\n                                                       array_merge($this->yystack[ $this->yyidx + 0 ]->minor,\n                                                                   array(array('start' => $this->yystack[ $this->yyidx +\n                                                                                                          -6 ]->minor),\n                                                                         array('ifexp' => $this->yystack[ $this->yyidx +\n                                                                                                          -4 ]->minor),\n                                                                         array('var' => $this->yystack[ $this->yyidx +\n                                                                                                        -2 ]->minor),\n                                                                         array('step' => $this->yystack[ $this->yyidx +\n                                                                                                         -1 ]->minor))),\n                                                       1);\n    }\n\n    #line 454 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r35()\n    {\n        $this->_retvalue = '=' . $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 458 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r37()\n    {\n        $this->_retvalue = $this->compiler->compileTag('for',\n                                                       array_merge($this->yystack[ $this->yyidx + 0 ]->minor,\n                                                                   array(array('start' => $this->yystack[ $this->yyidx +\n                                                                                                          -3 ]->minor),\n                                                                         array('to' => $this->yystack[ $this->yyidx +\n                                                                                                       -1 ]->minor))),\n                                                       0);\n    }\n\n    #line 463 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r38()\n    {\n        $this->_retvalue = $this->compiler->compileTag('for',\n                                                       array_merge($this->yystack[ $this->yyidx + 0 ]->minor,\n                                                                   array(array('start' => $this->yystack[ $this->yyidx +\n                                                                                                          -5 ]->minor),\n                                                                         array('to' => $this->yystack[ $this->yyidx +\n                                                                                                       -3 ]->minor),\n                                                                         array('step' => $this->yystack[ $this->yyidx +\n                                                                                                         -1 ]->minor))),\n                                                       0);\n    }\n\n    #line 467 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r39()\n    {\n        $this->_retvalue = $this->compiler->compileTag('foreach',\n                                                       array_merge($this->yystack[ $this->yyidx + 0 ]->minor,\n                                                                   array(array('from' => $this->yystack[ $this->yyidx +\n                                                                                                         -3 ]->minor),\n                                                                         array('item' => $this->yystack[ $this->yyidx +\n                                                                                                         -1 ]->minor))));\n    }\n\n    #line 470 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r40()\n    {\n        $this->_retvalue = $this->compiler->compileTag('foreach',\n                                                       array_merge($this->yystack[ $this->yyidx + 0 ]->minor,\n                                                                   array(array('from' => $this->yystack[ $this->yyidx +\n                                                                                                         -5 ]->minor),\n                                                                         array('item' => $this->yystack[ $this->yyidx +\n                                                                                                         -1 ]->minor),\n                                                                         array('key' => $this->yystack[ $this->yyidx +\n                                                                                                        -3 ]->minor))));\n    }\n\n    #line 475 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r41()\n    {\n        $this->_retvalue = $this->compiler->compileTag('foreach', $this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 479 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r42()\n    {\n        $this->_retvalue = $this->compiler->compileTag('setfilter',\n                                                       array(),\n                                                       array('modifier_list' => array(array_merge(array($this->yystack[ $this->yyidx +\n                                                                                                                        -1 ]->minor),\n                                                                                                  $this->yystack[ $this->yyidx +\n                                                                                                                  0 ]->minor))));\n    }\n\n    #line 485 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r43()\n    {\n        $this->_retvalue = $this->compiler->compileTag('setfilter',\n                                                       array(),\n                                                       array('modifier_list' => array_merge(array(array_merge(array($this->yystack[ $this->yyidx +\n                                                                                                                                    -2 ]->minor),\n                                                                                                              $this->yystack[ $this->yyidx +\n                                                                                                                              -1 ]->minor)),\n                                                                                            $this->yystack[ $this->yyidx +\n                                                                                                            0 ]->minor)));\n    }\n\n    #line 494 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r44()\n    {\n        $tag = trim(substr($this->yystack[ $this->yyidx + 0 ]->minor,\n                           $this->compiler->getLdelLength(),\n                           -$this->compiler->getRdelLength()),\n                    ' /');\n        if ($tag === 'strip') {\n            $this->strip = false;\n            $this->_retvalue = null;\n        } else {\n            $this->_retvalue = $this->compiler->compileTag($tag . 'close', array());\n        }\n    }\n\n    #line 498 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r45()\n    {\n        $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + 0 ]->minor . 'close', array());\n    }\n\n    #line 503 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r46()\n    {\n        $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -1 ]->minor . 'close',\n                                                       array(),\n                                                       array('modifier_list' => $this->yystack[ $this->yyidx +\n                                                                                                0 ]->minor));\n    }\n\n    #line 507 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r47()\n    {\n        $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -2 ]->minor . 'close',\n                                                       array(),\n                                                       array('object_method' => $this->yystack[ $this->yyidx +\n                                                                                                0 ]->minor));\n    }\n\n    #line 515 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r48()\n    {\n        $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -3 ]->minor . 'close',\n                                                       array(),\n                                                       array('object_method' => $this->yystack[ $this->yyidx +\n                                                                                                -1 ]->minor,\n                                                             'modifier_list' => $this->yystack[ $this->yyidx +\n                                                                                                0 ]->minor));\n    }\n\n    #line 521 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r49()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor;\n        $this->_retvalue[] = $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 526 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r50()\n    {\n        $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 531 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r51()\n    {\n        $this->_retvalue = array();\n    }\n\n    #line 542 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r52()\n    {\n        if (defined($this->yystack[ $this->yyidx + 0 ]->minor)) {\n            if ($this->security) {\n                $this->security->isTrustedConstant($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler);\n            }\n            $this->_retvalue =\n                array($this->yystack[ $this->yyidx + -2 ]->minor => $this->yystack[ $this->yyidx + 0 ]->minor);\n        } else {\n            $this->_retvalue =\n                array($this->yystack[ $this->yyidx + -2 ]->minor => '\\'' . $this->yystack[ $this->yyidx + 0 ]->minor .\n                                                                    '\\'');\n        }\n    }\n\n    #line 550 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r53()\n    {\n        $this->_retvalue =\n            array(trim($this->yystack[ $this->yyidx + -1 ]->minor, \" =\\n\\r\\t\") => $this->yystack[ $this->yyidx +\n                                                                                                  0 ]->minor);\n    }\n\n    #line 562 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r55()\n    {\n        $this->_retvalue = '\\'' . $this->yystack[ $this->yyidx + 0 ]->minor . '\\'';\n    }\n\n    #line 575 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r58()\n    {\n        $this->_retvalue =\n            array($this->yystack[ $this->yyidx + -2 ]->minor => $this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 580 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r60()\n    {\n        $this->yystack[ $this->yyidx + -2 ]->minor[] = $this->yystack[ $this->yyidx + 0 ]->minor;\n        $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor;\n    }\n\n    #line 587 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r61()\n    {\n        $this->_retvalue = array('var'   => '\\'' . substr($this->yystack[ $this->yyidx + -2 ]->minor, 1) . '\\'',\n                                 'value' => $this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 591 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r63()\n    {\n        $this->_retvalue = array('var'   => $this->yystack[ $this->yyidx + -2 ]->minor,\n                                 'value' => $this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 611 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r64()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor;\n    }\n\n    #line 616 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r67()\n    {\n        $this->_retvalue =\n            '$_smarty_tpl->getStreamVariable(\\'' . substr($this->yystack[ $this->yyidx + -2 ]->minor, 1) . '://' .\n            $this->yystack[ $this->yyidx + 0 ]->minor . '\\')';\n    }\n\n    #line 630 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r68()\n    {\n        $this->_retvalue =\n            $this->yystack[ $this->yyidx + -2 ]->minor . trim($this->yystack[ $this->yyidx + -1 ]->minor) .\n            $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 636 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r71()\n    {\n        $this->_retvalue = $this->compiler->compileTag('private_modifier',\n                                                       array(),\n                                                       array('value'        => $this->yystack[ $this->yyidx +\n                                                                                               -1 ]->minor,\n                                                             'modifierlist' => $this->yystack[ $this->yyidx +\n                                                                                               0 ]->minor));\n    }\n\n    #line 640 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r72()\n    {\n        $this->_retvalue =\n            $this->yystack[ $this->yyidx + -1 ]->minor[ 'pre' ] . $this->yystack[ $this->yyidx + -2 ]->minor .\n            $this->yystack[ $this->yyidx + -1 ]->minor[ 'op' ] . $this->yystack[ $this->yyidx + 0 ]->minor . ')';\n    }\n\n    #line 644 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r73()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor . $this->yystack[ $this->yyidx + -1 ]->minor .\n                           $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 648 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r74()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor . $this->yystack[ $this->yyidx + -1 ]->minor . ')';\n    }\n\n    #line 652 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r75()\n    {\n        $this->_retvalue =\n            'in_array(' . $this->yystack[ $this->yyidx + -2 ]->minor . ',' . $this->yystack[ $this->yyidx + 0 ]->minor .\n            ')';\n    }\n\n    #line 660 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r76()\n    {\n        $this->_retvalue = 'in_array(' . $this->yystack[ $this->yyidx + -2 ]->minor . ',(array)' .\n                           $this->yystack[ $this->yyidx + 0 ]->minor . ')';\n    }\n\n    #line 664 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r77()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -5 ]->minor . ' ? ' . $this->compiler->compileVariable('\\'' .\n                                                                                                                 substr($this->yystack[ $this->yyidx +\n                                                                                                                                        -2 ]->minor,\n                                                                                                                        1) .\n                                                                                                                 '\\'') .\n                           ' : ' . $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 674 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r78()\n    {\n        $this->_retvalue =\n            $this->yystack[ $this->yyidx + -5 ]->minor . ' ? ' . $this->yystack[ $this->yyidx + -2 ]->minor . ' : ' .\n            $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 679 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r80()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 700 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r81()\n    {\n        $this->_retvalue = '!' . $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 704 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r86()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor . '.' . $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 708 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r87()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . '.';\n    }\n\n    #line 713 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r88()\n    {\n        $this->_retvalue = '.' . $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 730 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r89()\n    {\n        if (defined($this->yystack[ $this->yyidx + 0 ]->minor)) {\n            if ($this->security) {\n                $this->security->isTrustedConstant($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler);\n            }\n            $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor;\n        } else {\n            $this->_retvalue = '\\'' . $this->yystack[ $this->yyidx + 0 ]->minor . '\\'';\n        }\n    }\n\n    #line 734 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r91()\n    {\n        $this->_retvalue = '(' . $this->yystack[ $this->yyidx + -1 ]->minor . ')';\n    }\n\n    #line 752 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r92()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor . $this->yystack[ $this->yyidx + -1 ]->minor .\n                           $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 763 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r96()\n    {\n        $prefixVar = $this->compiler->getNewPrefixVariable();\n        if ($this->yystack[ $this->yyidx + -2 ]->minor[ 'var' ] === '\\'smarty\\'') {\n            $this->compiler->appendPrefixCode(\"<?php {$prefixVar} = \" .\n                                              $this->compiler->compileTag('private_special_variable',\n                                                                          array(),\n                                                                          $this->yystack[ $this->yyidx +\n                                                                                          -2 ]->minor[ 'smarty_internal_index' ]) .\n                                              ';?>');\n        } else {\n            $this->compiler->appendPrefixCode(\"<?php  {$prefixVar} = \" .\n                                              $this->compiler->compileVariable($this->yystack[ $this->yyidx +\n                                                                                               -2 ]->minor[ 'var' ]) .\n                                              $this->yystack[ $this->yyidx + -2 ]->minor[ 'smarty_internal_index' ] .\n                                              ';?>');\n        }\n        $this->_retvalue = $prefixVar . '::' . $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ] .\n                           $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ];\n    }\n\n    #line 780 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r97()\n    {\n        $prefixVar = $this->compiler->getNewPrefixVariable();\n        $tmp = $this->compiler->appendCode('<?php ob_start();?>', $this->yystack[ $this->yyidx + 0 ]->minor);\n        $this->compiler->appendPrefixCode($this->compiler->appendCode($tmp, \"<?php {$prefixVar} = ob_get_clean();?>\"));\n        $this->_retvalue = $prefixVar;\n    }\n\n    #line 799 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r100()\n    {\n        if (!in_array(strtolower($this->yystack[ $this->yyidx + -2 ]->minor), array('self', 'parent')) &&\n            (!$this->security || $this->security->isTrustedStaticClassAccess($this->yystack[ $this->yyidx + -2 ]->minor,\n                                                                             $this->yystack[ $this->yyidx + 0 ]->minor,\n                                                                             $this->compiler))) {\n            if (isset($this->smarty->registered_classes[ $this->yystack[ $this->yyidx + -2 ]->minor ])) {\n                $this->_retvalue =\n                    $this->smarty->registered_classes[ $this->yystack[ $this->yyidx + -2 ]->minor ] . '::' .\n                    $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ] . $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ];\n            } else {\n                $this->_retvalue =\n                    $this->yystack[ $this->yyidx + -2 ]->minor . '::' . $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ] .\n                    $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ];\n            }\n        } else {\n            $this->compiler->trigger_template_error('static class \\'' . $this->yystack[ $this->yyidx + -2 ]->minor .\n                                                    '\\' is undefined or not allowed by security setting');\n        }\n    }\n\n    #line 810 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r102()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 813 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r103()\n    {\n        $this->_retvalue =\n            $this->compiler->compileVariable('\\'' . substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . '\\'');\n    }\n\n    #line 826 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r104()\n    {\n        if ($this->yystack[ $this->yyidx + 0 ]->minor[ 'var' ] === '\\'smarty\\'') {\n            $smarty_var = $this->compiler->compileTag('private_special_variable',\n                                                      array(),\n                                                      $this->yystack[ $this->yyidx +\n                                                                      0 ]->minor[ 'smarty_internal_index' ]);\n            $this->_retvalue = $smarty_var;\n        } else {\n            // used for array reset,next,prev,end,current\n            $this->last_variable = $this->yystack[ $this->yyidx + 0 ]->minor[ 'var' ];\n            $this->last_index = $this->yystack[ $this->yyidx + 0 ]->minor[ 'smarty_internal_index' ];\n            $this->_retvalue = $this->compiler->compileVariable($this->yystack[ $this->yyidx + 0 ]->minor[ 'var' ]) .\n                               $this->yystack[ $this->yyidx + 0 ]->minor[ 'smarty_internal_index' ];\n        }\n    }\n\n    #line 836 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r105()\n    {\n        $this->_retvalue = '$_smarty_tpl->tpl_vars[' . $this->yystack[ $this->yyidx + -2 ]->minor . ']->' .\n                           $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 840 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r107()\n    {\n        $this->_retvalue =\n            $this->compiler->compileConfigVariable('\\'' . $this->yystack[ $this->yyidx + -1 ]->minor . '\\'');\n    }\n\n    #line 844 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r108()\n    {\n        $this->_retvalue = '(is_array($tmp = ' .\n                           $this->compiler->compileConfigVariable('\\'' . $this->yystack[ $this->yyidx + -2 ]->minor .\n                                                                  '\\'') . ') ? $tmp' .\n                           $this->yystack[ $this->yyidx + 0 ]->minor . ' :null)';\n    }\n\n    #line 848 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r109()\n    {\n        $this->_retvalue = $this->compiler->compileConfigVariable($this->yystack[ $this->yyidx + -1 ]->minor);\n    }\n\n    #line 852 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r110()\n    {\n        $this->_retvalue =\n            '(is_array($tmp = ' . $this->compiler->compileConfigVariable($this->yystack[ $this->yyidx + -2 ]->minor) .\n            ') ? $tmp' . $this->yystack[ $this->yyidx + 0 ]->minor . ' : null)';\n    }\n\n    #line 855 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r111()\n    {\n        $this->_retvalue = array('var'                   => '\\'' .\n                                                            substr($this->yystack[ $this->yyidx + -1 ]->minor, 1) .\n                                                            '\\'',\n                                 'smarty_internal_index' => $this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 868 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r112()\n    {\n        $this->_retvalue = array('var'                   => $this->yystack[ $this->yyidx + -1 ]->minor,\n                                 'smarty_internal_index' => $this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 874 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r114()\n    {\n        return;\n    }\n\n    #line 877 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r115()\n    {\n        $this->_retvalue =\n            '[' . $this->compiler->compileVariable('\\'' . substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . '\\'') .\n            ']';\n    }\n\n    #line 881 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r116()\n    {\n        $this->_retvalue = '[' . $this->compiler->compileVariable($this->yystack[ $this->yyidx + 0 ]->minor) . ']';\n    }\n\n    #line 885 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r117()\n    {\n        $this->_retvalue = '[' . $this->compiler->compileVariable($this->yystack[ $this->yyidx + -2 ]->minor) . '->' .\n                           $this->yystack[ $this->yyidx + 0 ]->minor . ']';\n    }\n\n    #line 889 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r118()\n    {\n        $this->_retvalue = '[\\'' . $this->yystack[ $this->yyidx + 0 ]->minor . '\\']';\n    }\n\n    #line 894 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r119()\n    {\n        $this->_retvalue = '[' . $this->yystack[ $this->yyidx + 0 ]->minor . ']';\n    }\n\n    #line 899 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r120()\n    {\n        $this->_retvalue = '[' . $this->yystack[ $this->yyidx + -1 ]->minor . ']';\n    }\n\n    #line 903 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r121()\n    {\n        $this->_retvalue = '[' . $this->compiler->compileTag('private_special_variable',\n                                                             array(),\n                                                             '[\\'section\\'][\\'' .\n                                                             $this->yystack[ $this->yyidx + -1 ]->minor .\n                                                             '\\'][\\'index\\']') . ']';\n    }\n\n    #line 906 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r122()\n    {\n        $this->_retvalue = '[' . $this->compiler->compileTag('private_special_variable',\n                                                             array(),\n                                                             '[\\'section\\'][\\'' .\n                                                             $this->yystack[ $this->yyidx + -3 ]->minor . '\\'][\\'' .\n                                                             $this->yystack[ $this->yyidx + -1 ]->minor . '\\']') . ']';\n    }\n\n    #line 912 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r123()\n    {\n        $this->_retvalue = '[' . $this->yystack[ $this->yyidx + -1 ]->minor . ']';\n    }\n\n    #line 928 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r125()\n    {\n        $this->_retvalue = '[' . $this->compiler->compileVariable('\\'' .\n                                                                  substr($this->yystack[ $this->yyidx + -1 ]->minor,\n                                                                         1) . '\\'') . ']';;\n    }\n\n    #line 938 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r129()\n    {\n        $this->_retvalue = '[]';\n    }\n\n    #line 942 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r130()\n    {\n        $this->_retvalue = '\\'' . substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . '\\'';\n    }\n\n    #line 947 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r131()\n    {\n        $this->_retvalue = '\\'\\'';\n    }\n\n    #line 955 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r132()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . '.' . $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 961 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r134()\n    {\n        $var = trim(substr($this->yystack[ $this->yyidx + 0 ]->minor,\n                           $this->compiler->getLdelLength(),\n                           -$this->compiler->getRdelLength()),\n                    ' $');\n        $this->_retvalue = $this->compiler->compileVariable('\\'' . $var . '\\'');\n    }\n\n    #line 968 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r135()\n    {\n        $this->_retvalue = '(' . $this->yystack[ $this->yyidx + -1 ]->minor . ')';\n    }\n\n    #line 977 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r136()\n    {\n        if ($this->yystack[ $this->yyidx + -1 ]->minor[ 'var' ] === '\\'smarty\\'') {\n            $this->_retvalue = $this->compiler->compileTag('private_special_variable',\n                                                           array(),\n                                                           $this->yystack[ $this->yyidx +\n                                                                           -1 ]->minor[ 'smarty_internal_index' ]) .\n                               $this->yystack[ $this->yyidx + 0 ]->minor;\n        } else {\n            $this->_retvalue = $this->compiler->compileVariable($this->yystack[ $this->yyidx + -1 ]->minor[ 'var' ]) .\n                               $this->yystack[ $this->yyidx + -1 ]->minor[ 'smarty_internal_index' ] .\n                               $this->yystack[ $this->yyidx + 0 ]->minor;\n        }\n    }\n\n    #line 982 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r137()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 987 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r138()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 994 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r139()\n    {\n        if ($this->security && substr($this->yystack[ $this->yyidx + -1 ]->minor, 0, 1) === '_') {\n            $this->compiler->trigger_template_error(self::Err1);\n        }\n        $this->_retvalue =\n            '->' . $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 1001 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r140()\n    {\n        if ($this->security) {\n            $this->compiler->trigger_template_error(self::Err2);\n        }\n        $this->_retvalue = '->{' . $this->compiler->compileVariable($this->yystack[ $this->yyidx + -1 ]->minor) .\n                           $this->yystack[ $this->yyidx + 0 ]->minor . '}';\n    }\n\n    #line 1008 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r141()\n    {\n        if ($this->security) {\n            $this->compiler->trigger_template_error(self::Err2);\n        }\n        $this->_retvalue =\n            '->{' . $this->yystack[ $this->yyidx + -2 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor . '}';\n    }\n\n    #line 1016 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r142()\n    {\n        if ($this->security) {\n            $this->compiler->trigger_template_error(self::Err2);\n        }\n        $this->_retvalue =\n            '->{\\'' . $this->yystack[ $this->yyidx + -4 ]->minor . '\\'.' . $this->yystack[ $this->yyidx + -2 ]->minor .\n            $this->yystack[ $this->yyidx + 0 ]->minor . '}';\n    }\n\n    #line 1024 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r143()\n    {\n        $this->_retvalue = '->' . $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 1032 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r144()\n    {\n        $this->_retvalue = $this->compiler->compilePHPFunctionCall($this->yystack[ $this->yyidx + -3 ]->minor,\n                                                                   $this->yystack[ $this->yyidx + -1 ]->minor);\n    }\n\n    #line 1039 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r145()\n    {\n        if ($this->security && substr($this->yystack[ $this->yyidx + -3 ]->minor, 0, 1) === '_') {\n            $this->compiler->trigger_template_error(self::Err1);\n        }\n        $this->_retvalue = $this->yystack[ $this->yyidx + -3 ]->minor . '(' .\n                           implode(',', $this->yystack[ $this->yyidx + -1 ]->minor) . ')';\n    }\n\n    #line 1050 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r146()\n    {\n        if ($this->security) {\n            $this->compiler->trigger_template_error(self::Err2);\n        }\n        $prefixVar = $this->compiler->getNewPrefixVariable();\n        $this->compiler->appendPrefixCode(\"<?php {$prefixVar} = \" . $this->compiler->compileVariable('\\'' .\n                                                                                                     substr($this->yystack[ $this->yyidx +\n                                                                                                                            -3 ]->minor,\n                                                                                                            1) . '\\'') .\n                                          ';?>');\n        $this->_retvalue = $prefixVar . '(' . implode(',', $this->yystack[ $this->yyidx + -1 ]->minor) . ')';\n    }\n\n    #line 1067 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r147()\n    {\n        $this->_retvalue =\n            array_merge($this->yystack[ $this->yyidx + -2 ]->minor, array($this->yystack[ $this->yyidx + 0 ]->minor));\n    }\n\n    #line 1071 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r150()\n    {\n        $this->_retvalue = array_merge($this->yystack[ $this->yyidx + -2 ]->minor,\n                                       array(array_merge($this->yystack[ $this->yyidx + -1 ]->minor,\n                                                         $this->yystack[ $this->yyidx + 0 ]->minor)));\n    }\n\n    #line 1079 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r151()\n    {\n        $this->_retvalue =\n            array(array_merge($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor));\n    }\n\n    #line 1087 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r153()\n    {\n        $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 1106 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r154()\n    {\n        $this->_retvalue =\n            array_merge($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 1111 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r158()\n    {\n        $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor, '', 'method');\n    }\n\n    #line 1116 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r159()\n    {\n        $this->_retvalue =\n            array($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor, 'method');\n    }\n\n    #line 1121 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r160()\n    {\n        $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor, '');\n    }\n\n    #line 1126 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r161()\n    {\n        $this->_retvalue =\n            array($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor, 'property');\n    }\n\n    #line 1132 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r162()\n    {\n        $this->_retvalue = array($this->yystack[ $this->yyidx + -2 ]->minor,\n                                 $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor,\n                                 'property');\n    }\n\n    #line 1136 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r163()\n    {\n        $this->_retvalue = ' ' . trim($this->yystack[ $this->yyidx + 0 ]->minor) . ' ';\n    }\n\n    #line 1155 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r164()\n    {\n        static $lops = array(\n            'eq'  => ' == ',\n            'ne'  => ' != ',\n            'neq' => ' != ',\n            'gt'  => ' > ',\n            'ge'  => ' >= ',\n            'gte' => ' >= ',\n            'lt'  => ' < ',\n            'le'  => ' <= ',\n            'lte' => ' <= ',\n            'mod' => ' % ',\n            'and' => ' && ',\n            'or'  => ' || ',\n            'xor' => ' xor ',\n        );\n        $op = strtolower(preg_replace('/\\s*/', '', $this->yystack[ $this->yyidx + 0 ]->minor));\n        $this->_retvalue = $lops[ $op ];\n    }\n\n    #line 1168 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r165()\n    {\n        static $tlops = array(\n            'isdivby'     => array('op' => ' % ', 'pre' => '!('),\n            'isnotdivby'  => array('op' => ' % ', 'pre' => '('),\n            'isevenby'    => array('op' => ' / ', 'pre' => '!(1 & '),\n            'isnotevenby' => array('op' => ' / ', 'pre' => '(1 & '),\n            'isoddby'     => array('op' => ' / ', 'pre' => '(1 & '),\n            'isnotoddby'  => array('op' => ' / ', 'pre' => '!(1 & '),\n        );\n        $op = strtolower(preg_replace('/\\s*/', '', $this->yystack[ $this->yyidx + 0 ]->minor));\n        $this->_retvalue = $tlops[ $op ];\n    }\n\n    #line 1182 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r166()\n    {\n        static $scond = array(\n            'iseven'    => '!(1 & ',\n            'isnoteven' => '(1 & ',\n            'isodd'     => '(1 & ',\n            'isnotodd'  => '!(1 & ',\n        );\n        $op = strtolower(str_replace(' ', '', $this->yystack[ $this->yyidx + 0 ]->minor));\n        $this->_retvalue = $scond[ $op ];\n    }\n\n    #line 1190 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r167()\n    {\n        $this->_retvalue = 'array(' . $this->yystack[ $this->yyidx + -1 ]->minor . ')';\n    }\n\n    #line 1198 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r169()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor . ',' . $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 1202 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r171()\n    {\n        $this->_retvalue =\n            $this->yystack[ $this->yyidx + -2 ]->minor . '=>' . $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 1218 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r172()\n    {\n        $this->_retvalue =\n            '\\'' . $this->yystack[ $this->yyidx + -2 ]->minor . '\\'=>' . $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 1224 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r175()\n    {\n        $this->compiler->leaveDoubleQuote();\n        $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor->to_smarty_php($this);\n    }\n\n    #line 1229 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r176()\n    {\n        $this->yystack[ $this->yyidx + -1 ]->minor->append_subtree($this, $this->yystack[ $this->yyidx + 0 ]->minor);\n        $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor;\n    }\n\n    #line 1233 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r177()\n    {\n        $this->_retvalue = new Smarty_Internal_ParseTree_Dq($this, $this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 1237 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r178()\n    {\n        $this->_retvalue = new Smarty_Internal_ParseTree_Code('(string)' . $this->yystack[ $this->yyidx + -1 ]->minor);\n    }\n\n    #line 1241 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r179()\n    {\n        $this->_retvalue =\n            new Smarty_Internal_ParseTree_Code('(string)(' . $this->yystack[ $this->yyidx + -1 ]->minor . ')');\n    }\n\n    #line 1253 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r180()\n    {\n        $this->_retvalue = new Smarty_Internal_ParseTree_Code('(string)$_smarty_tpl->tpl_vars[\\'' .\n                                                              substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) .\n                                                              '\\']->value');\n    }\n\n    #line 1257 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    function yy_r183()\n    {\n        $this->_retvalue = new Smarty_Internal_ParseTree_Tag($this, $this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    function yy_r184()\n    {\n        $this->_retvalue = new Smarty_Internal_ParseTree_DqContent($this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    public function yy_reduce($yyruleno)\n    {\n        if ($this->yyTraceFILE && $yyruleno >= 0\n            && $yyruleno < count(self::$yyRuleName)) {\n            fprintf($this->yyTraceFILE,\n                    \"%sReduce (%d) [%s].\\n\",\n                    $this->yyTracePrompt,\n                    $yyruleno,\n                    self::$yyRuleName[ $yyruleno ]);\n        }\n        $this->_retvalue = $yy_lefthand_side = null;\n        if (isset(self::$yyReduceMap[ $yyruleno ])) {\n            // call the action\n            $this->_retvalue = null;\n            $this->{'yy_r' . self::$yyReduceMap[ $yyruleno ]}();\n            $yy_lefthand_side = $this->_retvalue;\n        }\n        $yygoto = self::$yyRuleInfo[ $yyruleno ][ 0 ];\n        $yysize = self::$yyRuleInfo[ $yyruleno ][ 1 ];\n        $this->yyidx -= $yysize;\n        for ($i = $yysize; $i; $i--) {\n            // pop all of the right-hand side parameters\n            array_pop($this->yystack);\n        }\n        $yyact = $this->yy_find_reduce_action($this->yystack[ $this->yyidx ]->stateno, $yygoto);\n        if ($yyact < self::YYNSTATE) {\n            if (!$this->yyTraceFILE && $yysize) {\n                $this->yyidx++;\n                $x = new TP_yyStackEntry;\n                $x->stateno = $yyact;\n                $x->major = $yygoto;\n                $x->minor = $yy_lefthand_side;\n                $this->yystack[ $this->yyidx ] = $x;\n            } else {\n                $this->yy_shift($yyact, $yygoto, $yy_lefthand_side);\n            }\n        } else if ($yyact === self::YYNSTATE + self::YYNRULE + 1) {\n            $this->yy_accept();\n        }\n    }\n\n    public function yy_parse_failed()\n    {\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE, \"%sFail!\\n\", $this->yyTracePrompt);\n        }\n        while ($this->yyidx >= 0) {\n            $this->yy_pop_parser_stack();\n        }\n    }\n\n    public function yy_syntax_error($yymajor, $TOKEN)\n    {\n        #line 214 \"../smarty/lexer/smarty_internal_templateparser.y\"\n        $this->internalError = true;\n        $this->yymajor = $yymajor;\n        $this->compiler->trigger_template_error();\n    }\n\n    public function yy_accept()\n    {\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE, \"%sAccept!\\n\", $this->yyTracePrompt);\n        }\n        while ($this->yyidx >= 0) {\n            $this->yy_pop_parser_stack();\n        }\n        #line 207 \"../smarty/lexer/smarty_internal_templateparser.y\"\n        $this->successful = !$this->internalError;\n        $this->internalError = false;\n        $this->retvalue = $this->_retvalue;\n    }\n\n    public function doParse($yymajor, $yytokenvalue)\n    {\n        $yyerrorhit = 0;   /* True if yymajor has invoked an error */\n        if ($this->yyidx === null || $this->yyidx < 0) {\n            $this->yyidx = 0;\n            $this->yyerrcnt = -1;\n            $x = new TP_yyStackEntry;\n            $x->stateno = 0;\n            $x->major = 0;\n            $this->yystack = array();\n            $this->yystack[] = $x;\n        }\n        $yyendofinput = ($yymajor == 0);\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE,\n                    \"%sInput %s\\n\",\n                    $this->yyTracePrompt,\n                    $this->yyTokenName[ $yymajor ]);\n        }\n        do {\n            $yyact = $this->yy_find_shift_action($yymajor);\n            if ($yymajor < self::YYERRORSYMBOL &&\n                !$this->yy_is_expected_token($yymajor)) {\n                // force a syntax error\n                $yyact = self::YY_ERROR_ACTION;\n            }\n            if ($yyact < self::YYNSTATE) {\n                $this->yy_shift($yyact, $yymajor, $yytokenvalue);\n                $this->yyerrcnt--;\n                if ($yyendofinput && $this->yyidx >= 0) {\n                    $yymajor = 0;\n                } else {\n                    $yymajor = self::YYNOCODE;\n                }\n            } else if ($yyact < self::YYNSTATE + self::YYNRULE) {\n                $this->yy_reduce($yyact - self::YYNSTATE);\n            } else if ($yyact === self::YY_ERROR_ACTION) {\n                if ($this->yyTraceFILE) {\n                    fprintf($this->yyTraceFILE,\n                            \"%sSyntax Error!\\n\",\n                            $this->yyTracePrompt);\n                }\n                if (self::YYERRORSYMBOL) {\n                    if ($this->yyerrcnt < 0) {\n                        $this->yy_syntax_error($yymajor, $yytokenvalue);\n                    }\n                    $yymx = $this->yystack[ $this->yyidx ]->major;\n                    if ($yymx === self::YYERRORSYMBOL || $yyerrorhit) {\n                        if ($this->yyTraceFILE) {\n                            fprintf($this->yyTraceFILE,\n                                    \"%sDiscard input token %s\\n\",\n                                    $this->yyTracePrompt,\n                                    $this->yyTokenName[ $yymajor ]);\n                        }\n                        $this->yy_destructor($yymajor, $yytokenvalue);\n                        $yymajor = self::YYNOCODE;\n                    } else {\n                        while ($this->yyidx >= 0 &&\n                               $yymx !== self::YYERRORSYMBOL &&\n                               ($yyact = $this->yy_find_shift_action(self::YYERRORSYMBOL)) >= self::YYNSTATE\n                        ) {\n                            $this->yy_pop_parser_stack();\n                        }\n                        if ($this->yyidx < 0 || $yymajor == 0) {\n                            $this->yy_destructor($yymajor, $yytokenvalue);\n                            $this->yy_parse_failed();\n                            $yymajor = self::YYNOCODE;\n                        } else if ($yymx !== self::YYERRORSYMBOL) {\n                            $u2 = 0;\n                            $this->yy_shift($yyact, self::YYERRORSYMBOL, $u2);\n                        }\n                    }\n                    $this->yyerrcnt = 3;\n                    $yyerrorhit = 1;\n                } else {\n                    if ($this->yyerrcnt <= 0) {\n                        $this->yy_syntax_error($yymajor, $yytokenvalue);\n                    }\n                    $this->yyerrcnt = 3;\n                    $this->yy_destructor($yymajor, $yytokenvalue);\n                    if ($yyendofinput) {\n                        $this->yy_parse_failed();\n                    }\n                    $yymajor = self::YYNOCODE;\n                }\n            } else {\n                $this->yy_accept();\n                $yymajor = self::YYNOCODE;\n            }\n        } while ($yymajor !== self::YYNOCODE && $this->yyidx >= 0);\n    }\n}\n\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_testinstall.php",
    "content": "<?php\n/**\n * Smarty Internal TestInstall\n * Test Smarty installation\n *\n * @package    Smarty\n * @subpackage Utilities\n * @author     Uwe Tews\n */\n\n/**\n * TestInstall class\n *\n * @package    Smarty\n * @subpackage Utilities\n */\nclass Smarty_Internal_TestInstall\n{\n    /**\n     * diagnose Smarty setup\n     * If $errors is secified, the diagnostic report will be appended to the array, rather than being output.\n     *\n     * @param \\Smarty $smarty\n     * @param  array  $errors array to push results into rather than outputting them\n     *\n     * @return bool status, true if everything is fine, false else\n     */\n    public static function testInstall(Smarty $smarty, &$errors = null)\n    {\n        $status = true;\n        if ($errors === null) {\n            echo \"<PRE>\\n\";\n            echo \"Smarty Installation test...\\n\";\n            echo \"Testing template directory...\\n\";\n        }\n        $_stream_resolve_include_path = function_exists('stream_resolve_include_path');\n        // test if all registered template_dir are accessible\n        foreach ($smarty->getTemplateDir() as $template_dir) {\n            $_template_dir = $template_dir;\n            $template_dir = realpath($template_dir);\n            // resolve include_path or fail existence\n            if (!$template_dir) {\n                if ($smarty->use_include_path && !preg_match('/^([\\/\\\\\\\\]|[a-zA-Z]:[\\/\\\\\\\\])/', $_template_dir)) {\n                    // try PHP include_path\n                    if ($_stream_resolve_include_path) {\n                        $template_dir = stream_resolve_include_path($_template_dir);\n                    } else {\n                        $template_dir = $smarty->ext->_getIncludePath->getIncludePath($_template_dir, null, $smarty);\n                    }\n                    if ($template_dir !== false) {\n                        if ($errors === null) {\n                            echo \"$template_dir is OK.\\n\";\n                        }\n                        continue;\n                    } else {\n                        $status = false;\n                        $message =\n                            \"FAILED: $_template_dir does not exist (and couldn't be found in include_path either)\";\n                        if ($errors === null) {\n                            echo $message . \".\\n\";\n                        } else {\n                            $errors[ 'template_dir' ] = $message;\n                        }\n                        continue;\n                    }\n                } else {\n                    $status = false;\n                    $message = \"FAILED: $_template_dir does not exist\";\n                    if ($errors === null) {\n                        echo $message . \".\\n\";\n                    } else {\n                        $errors[ 'template_dir' ] = $message;\n                    }\n                    continue;\n                }\n            }\n            if (!is_dir($template_dir)) {\n                $status = false;\n                $message = \"FAILED: $template_dir is not a directory\";\n                if ($errors === null) {\n                    echo $message . \".\\n\";\n                } else {\n                    $errors[ 'template_dir' ] = $message;\n                }\n            } else if (!is_readable($template_dir)) {\n                $status = false;\n                $message = \"FAILED: $template_dir is not readable\";\n                if ($errors === null) {\n                    echo $message . \".\\n\";\n                } else {\n                    $errors[ 'template_dir' ] = $message;\n                }\n            } else {\n                if ($errors === null) {\n                    echo \"$template_dir is OK.\\n\";\n                }\n            }\n        }\n        if ($errors === null) {\n            echo \"Testing compile directory...\\n\";\n        }\n        // test if registered compile_dir is accessible\n        $__compile_dir = $smarty->getCompileDir();\n        $_compile_dir = realpath($__compile_dir);\n        if (!$_compile_dir) {\n            $status = false;\n            $message = \"FAILED: {$__compile_dir} does not exist\";\n            if ($errors === null) {\n                echo $message . \".\\n\";\n            } else {\n                $errors[ 'compile_dir' ] = $message;\n            }\n        } else if (!is_dir($_compile_dir)) {\n            $status = false;\n            $message = \"FAILED: {$_compile_dir} is not a directory\";\n            if ($errors === null) {\n                echo $message . \".\\n\";\n            } else {\n                $errors[ 'compile_dir' ] = $message;\n            }\n        } else if (!is_readable($_compile_dir)) {\n            $status = false;\n            $message = \"FAILED: {$_compile_dir} is not readable\";\n            if ($errors === null) {\n                echo $message . \".\\n\";\n            } else {\n                $errors[ 'compile_dir' ] = $message;\n            }\n        } else if (!is_writable($_compile_dir)) {\n            $status = false;\n            $message = \"FAILED: {$_compile_dir} is not writable\";\n            if ($errors === null) {\n                echo $message . \".\\n\";\n            } else {\n                $errors[ 'compile_dir' ] = $message;\n            }\n        } else {\n            if ($errors === null) {\n                echo \"{$_compile_dir} is OK.\\n\";\n            }\n        }\n        if ($errors === null) {\n            echo \"Testing plugins directory...\\n\";\n        }\n        // test if all registered plugins_dir are accessible\n        // and if core plugins directory is still registered\n        $_core_plugins_dir = realpath(dirname(__FILE__) . '/../plugins');\n        $_core_plugins_available = false;\n        foreach ($smarty->getPluginsDir() as $plugin_dir) {\n            $_plugin_dir = $plugin_dir;\n            $plugin_dir = realpath($plugin_dir);\n            // resolve include_path or fail existence\n            if (!$plugin_dir) {\n                if ($smarty->use_include_path && !preg_match('/^([\\/\\\\\\\\]|[a-zA-Z]:[\\/\\\\\\\\])/', $_plugin_dir)) {\n                    // try PHP include_path\n                    if ($_stream_resolve_include_path) {\n                        $plugin_dir = stream_resolve_include_path($_plugin_dir);\n                    } else {\n                        $plugin_dir = $smarty->ext->_getIncludePath->getIncludePath($_plugin_dir, null, $smarty);\n                    }\n                    if ($plugin_dir !== false) {\n                        if ($errors === null) {\n                            echo \"$plugin_dir is OK.\\n\";\n                        }\n                        continue;\n                    } else {\n                        $status = false;\n                        $message = \"FAILED: $_plugin_dir does not exist (and couldn't be found in include_path either)\";\n                        if ($errors === null) {\n                            echo $message . \".\\n\";\n                        } else {\n                            $errors[ 'plugins_dir' ] = $message;\n                        }\n                        continue;\n                    }\n                } else {\n                    $status = false;\n                    $message = \"FAILED: $_plugin_dir does not exist\";\n                    if ($errors === null) {\n                        echo $message . \".\\n\";\n                    } else {\n                        $errors[ 'plugins_dir' ] = $message;\n                    }\n                    continue;\n                }\n            }\n            if (!is_dir($plugin_dir)) {\n                $status = false;\n                $message = \"FAILED: $plugin_dir is not a directory\";\n                if ($errors === null) {\n                    echo $message . \".\\n\";\n                } else {\n                    $errors[ 'plugins_dir' ] = $message;\n                }\n            } else if (!is_readable($plugin_dir)) {\n                $status = false;\n                $message = \"FAILED: $plugin_dir is not readable\";\n                if ($errors === null) {\n                    echo $message . \".\\n\";\n                } else {\n                    $errors[ 'plugins_dir' ] = $message;\n                }\n            } else if ($_core_plugins_dir && $_core_plugins_dir === realpath($plugin_dir)) {\n                $_core_plugins_available = true;\n                if ($errors === null) {\n                    echo \"$plugin_dir is OK.\\n\";\n                }\n            } else {\n                if ($errors === null) {\n                    echo \"$plugin_dir is OK.\\n\";\n                }\n            }\n        }\n        if (!$_core_plugins_available) {\n            $status = false;\n            $message = \"WARNING: Smarty's own libs/plugins is not available\";\n            if ($errors === null) {\n                echo $message . \".\\n\";\n            } else if (!isset($errors[ 'plugins_dir' ])) {\n                $errors[ 'plugins_dir' ] = $message;\n            }\n        }\n        if ($errors === null) {\n            echo \"Testing cache directory...\\n\";\n        }\n        // test if all registered cache_dir is accessible\n        $__cache_dir = $smarty->getCacheDir();\n        $_cache_dir = realpath($__cache_dir);\n        if (!$_cache_dir) {\n            $status = false;\n            $message = \"FAILED: {$__cache_dir} does not exist\";\n            if ($errors === null) {\n                echo $message . \".\\n\";\n            } else {\n                $errors[ 'cache_dir' ] = $message;\n            }\n        } else if (!is_dir($_cache_dir)) {\n            $status = false;\n            $message = \"FAILED: {$_cache_dir} is not a directory\";\n            if ($errors === null) {\n                echo $message . \".\\n\";\n            } else {\n                $errors[ 'cache_dir' ] = $message;\n            }\n        } else if (!is_readable($_cache_dir)) {\n            $status = false;\n            $message = \"FAILED: {$_cache_dir} is not readable\";\n            if ($errors === null) {\n                echo $message . \".\\n\";\n            } else {\n                $errors[ 'cache_dir' ] = $message;\n            }\n        } else if (!is_writable($_cache_dir)) {\n            $status = false;\n            $message = \"FAILED: {$_cache_dir} is not writable\";\n            if ($errors === null) {\n                echo $message . \".\\n\";\n            } else {\n                $errors[ 'cache_dir' ] = $message;\n            }\n        } else {\n            if ($errors === null) {\n                echo \"{$_cache_dir} is OK.\\n\";\n            }\n        }\n        if ($errors === null) {\n            echo \"Testing configs directory...\\n\";\n        }\n        // test if all registered config_dir are accessible\n        foreach ($smarty->getConfigDir() as $config_dir) {\n            $_config_dir = $config_dir;\n            // resolve include_path or fail existence\n            if (!$config_dir) {\n                if ($smarty->use_include_path && !preg_match('/^([\\/\\\\\\\\]|[a-zA-Z]:[\\/\\\\\\\\])/', $_config_dir)) {\n                    // try PHP include_path\n                    if ($_stream_resolve_include_path) {\n                        $config_dir = stream_resolve_include_path($_config_dir);\n                    } else {\n                        $config_dir = $smarty->ext->_getIncludePath->getIncludePath($_config_dir, null, $smarty);\n                    }\n                    if ($config_dir !== false) {\n                        if ($errors === null) {\n                            echo \"$config_dir is OK.\\n\";\n                        }\n                        continue;\n                    } else {\n                        $status = false;\n                        $message = \"FAILED: $_config_dir does not exist (and couldn't be found in include_path either)\";\n                        if ($errors === null) {\n                            echo $message . \".\\n\";\n                        } else {\n                            $errors[ 'config_dir' ] = $message;\n                        }\n                        continue;\n                    }\n                } else {\n                    $status = false;\n                    $message = \"FAILED: $_config_dir does not exist\";\n                    if ($errors === null) {\n                        echo $message . \".\\n\";\n                    } else {\n                        $errors[ 'config_dir' ] = $message;\n                    }\n                    continue;\n                }\n            }\n            if (!is_dir($config_dir)) {\n                $status = false;\n                $message = \"FAILED: $config_dir is not a directory\";\n                if ($errors === null) {\n                    echo $message . \".\\n\";\n                } else {\n                    $errors[ 'config_dir' ] = $message;\n                }\n            } else if (!is_readable($config_dir)) {\n                $status = false;\n                $message = \"FAILED: $config_dir is not readable\";\n                if ($errors === null) {\n                    echo $message . \".\\n\";\n                } else {\n                    $errors[ 'config_dir' ] = $message;\n                }\n            } else {\n                if ($errors === null) {\n                    echo \"$config_dir is OK.\\n\";\n                }\n            }\n        }\n        if ($errors === null) {\n            echo \"Testing sysplugin files...\\n\";\n        }\n        // test if sysplugins are available\n        $source = SMARTY_SYSPLUGINS_DIR;\n        if (is_dir($source)) {\n            $expectedSysplugins = array(\n                'smartycompilerexception.php'                               => true,\n                'smartyexception.php'                                       => true,\n                'smarty_cacheresource.php'                                  => true,\n                'smarty_cacheresource_custom.php'                           => true,\n                'smarty_cacheresource_keyvaluestore.php'                    => true,\n                'smarty_data.php'                                           => true,\n                'smarty_internal_block.php'                                 => true,\n                'smarty_internal_cacheresource_file.php'                    => true,\n                'smarty_internal_compilebase.php'                           => true,\n                'smarty_internal_compile_append.php'                        => true,\n                'smarty_internal_compile_assign.php'                        => true,\n                'smarty_internal_compile_block.php'                         => true,\n                'smarty_internal_compile_break.php'                         => true,\n                'smarty_internal_compile_call.php'                          => true,\n                'smarty_internal_compile_capture.php'                       => true,\n                'smarty_internal_compile_config_load.php'                   => true,\n                'smarty_internal_compile_continue.php'                      => true,\n                'smarty_internal_compile_debug.php'                         => true,\n                'smarty_internal_compile_eval.php'                          => true,\n                'smarty_internal_compile_extends.php'                       => true,\n                'smarty_internal_compile_for.php'                           => true,\n                'smarty_internal_compile_foreach.php'                       => true,\n                'smarty_internal_compile_function.php'                      => true,\n                'smarty_internal_compile_if.php'                            => true,\n                'smarty_internal_compile_include.php'                       => true,\n                'smarty_internal_compile_include_php.php'                   => true,\n                'smarty_internal_compile_insert.php'                        => true,\n                'smarty_internal_compile_ldelim.php'                        => true,\n                'smarty_internal_compile_make_nocache.php'                  => true,\n                'smarty_internal_compile_nocache.php'                       => true,\n                'smarty_internal_compile_private_block_plugin.php'          => true,\n                'smarty_internal_compile_private_foreachsection.php'        => true,\n                'smarty_internal_compile_private_function_plugin.php'       => true,\n                'smarty_internal_compile_private_modifier.php'              => true,\n                'smarty_internal_compile_private_object_block_function.php' => true,\n                'smarty_internal_compile_private_object_function.php'       => true,\n                'smarty_internal_compile_private_php.php'                   => true,\n                'smarty_internal_compile_private_print_expression.php'      => true,\n                'smarty_internal_compile_private_registered_block.php'      => true,\n                'smarty_internal_compile_private_registered_function.php'   => true,\n                'smarty_internal_compile_private_special_variable.php'      => true,\n                'smarty_internal_compile_rdelim.php'                        => true,\n                'smarty_internal_compile_section.php'                       => true,\n                'smarty_internal_compile_setfilter.php'                     => true,\n                'smarty_internal_compile_shared_inheritance.php'            => true,\n                'smarty_internal_compile_while.php'                         => true,\n                'smarty_internal_configfilelexer.php'                       => true,\n                'smarty_internal_configfileparser.php'                      => true,\n                'smarty_internal_config_file_compiler.php'                  => true,\n                'smarty_internal_data.php'                                  => true,\n                'smarty_internal_debug.php'                                 => true,\n                'smarty_internal_errorhandler.php'                          => true,\n                'smarty_internal_extension_handler.php'                     => true,\n                'smarty_internal_method_addautoloadfilters.php'             => true,\n                'smarty_internal_method_adddefaultmodifiers.php'            => true,\n                'smarty_internal_method_append.php'                         => true,\n                'smarty_internal_method_appendbyref.php'                    => true,\n                'smarty_internal_method_assignbyref.php'                    => true,\n                'smarty_internal_method_assignglobal.php'                   => true,\n                'smarty_internal_method_clearallassign.php'                 => true,\n                'smarty_internal_method_clearallcache.php'                  => true,\n                'smarty_internal_method_clearassign.php'                    => true,\n                'smarty_internal_method_clearcache.php'                     => true,\n                'smarty_internal_method_clearcompiledtemplate.php'          => true,\n                'smarty_internal_method_clearconfig.php'                    => true,\n                'smarty_internal_method_compileallconfig.php'               => true,\n                'smarty_internal_method_compilealltemplates.php'            => true,\n                'smarty_internal_method_configload.php'                     => true,\n                'smarty_internal_method_createdata.php'                     => true,\n                'smarty_internal_method_getautoloadfilters.php'             => true,\n                'smarty_internal_method_getconfigvariable.php'              => true,\n                'smarty_internal_method_getconfigvars.php'                  => true,\n                'smarty_internal_method_getdebugtemplate.php'               => true,\n                'smarty_internal_method_getdefaultmodifiers.php'            => true,\n                'smarty_internal_method_getglobal.php'                      => true,\n                'smarty_internal_method_getregisteredobject.php'            => true,\n                'smarty_internal_method_getstreamvariable.php'              => true,\n                'smarty_internal_method_gettags.php'                        => true,\n                'smarty_internal_method_gettemplatevars.php'                => true,\n                'smarty_internal_method_literals.php'                       => true,\n                'smarty_internal_method_loadfilter.php'                     => true,\n                'smarty_internal_method_loadplugin.php'                     => true,\n                'smarty_internal_method_mustcompile.php'                    => true,\n                'smarty_internal_method_registercacheresource.php'          => true,\n                'smarty_internal_method_registerclass.php'                  => true,\n                'smarty_internal_method_registerdefaultconfighandler.php'   => true,\n                'smarty_internal_method_registerdefaultpluginhandler.php'   => true,\n                'smarty_internal_method_registerdefaulttemplatehandler.php' => true,\n                'smarty_internal_method_registerfilter.php'                 => true,\n                'smarty_internal_method_registerobject.php'                 => true,\n                'smarty_internal_method_registerplugin.php'                 => true,\n                'smarty_internal_method_registerresource.php'               => true,\n                'smarty_internal_method_setautoloadfilters.php'             => true,\n                'smarty_internal_method_setdebugtemplate.php'               => true,\n                'smarty_internal_method_setdefaultmodifiers.php'            => true,\n                'smarty_internal_method_unloadfilter.php'                   => true,\n                'smarty_internal_method_unregistercacheresource.php'        => true,\n                'smarty_internal_method_unregisterfilter.php'               => true,\n                'smarty_internal_method_unregisterobject.php'               => true,\n                'smarty_internal_method_unregisterplugin.php'               => true,\n                'smarty_internal_method_unregisterresource.php'             => true,\n                'smarty_internal_nocache_insert.php'                        => true,\n                'smarty_internal_parsetree.php'                             => true,\n                'smarty_internal_parsetree_code.php'                        => true,\n                'smarty_internal_parsetree_dq.php'                          => true,\n                'smarty_internal_parsetree_dqcontent.php'                   => true,\n                'smarty_internal_parsetree_tag.php'                         => true,\n                'smarty_internal_parsetree_template.php'                    => true,\n                'smarty_internal_parsetree_text.php'                        => true,\n                'smarty_internal_resource_eval.php'                         => true,\n                'smarty_internal_resource_extends.php'                      => true,\n                'smarty_internal_resource_file.php'                         => true,\n                'smarty_internal_resource_php.php'                          => true,\n                'smarty_internal_resource_registered.php'                   => true,\n                'smarty_internal_resource_stream.php'                       => true,\n                'smarty_internal_resource_string.php'                       => true,\n                'smarty_internal_runtime_cachemodify.php'                   => true,\n                'smarty_internal_runtime_cacheresourcefile.php'             => true,\n                'smarty_internal_runtime_capture.php'                       => true,\n                'smarty_internal_runtime_codeframe.php'                     => true,\n                'smarty_internal_runtime_filterhandler.php'                 => true,\n                'smarty_internal_runtime_foreach.php'                       => true,\n                'smarty_internal_runtime_getincludepath.php'                => true,\n                'smarty_internal_runtime_inheritance.php'                   => true,\n                'smarty_internal_runtime_make_nocache.php'                  => true,\n                'smarty_internal_runtime_tplfunction.php'                   => true,\n                'smarty_internal_runtime_updatecache.php'                   => true,\n                'smarty_internal_runtime_updatescope.php'                   => true,\n                'smarty_internal_runtime_writefile.php'                     => true,\n                'smarty_internal_smartytemplatecompiler.php'                => true,\n                'smarty_internal_template.php'                              => true,\n                'smarty_internal_templatebase.php'                          => true,\n                'smarty_internal_templatecompilerbase.php'                  => true,\n                'smarty_internal_templatelexer.php'                         => true,\n                'smarty_internal_templateparser.php'                        => true,\n                'smarty_internal_testinstall.php'                           => true,\n                'smarty_internal_undefined.php'                             => true,\n                'smarty_resource.php'                                       => true,\n                'smarty_resource_custom.php'                                => true,\n                'smarty_resource_recompiled.php'                            => true,\n                'smarty_resource_uncompiled.php'                            => true,\n                'smarty_security.php'                                       => true,\n                'smarty_template_cached.php'                                => true,\n                'smarty_template_compiled.php'                              => true,\n                'smarty_template_config.php'                                => true,\n                'smarty_template_resource_base.php'                         => true,\n                'smarty_template_source.php'                                => true,\n                'smarty_undefined_variable.php'                             => true,\n                'smarty_variable.php'                                       => true,\n            );\n            $iterator = new DirectoryIterator($source);\n            foreach ($iterator as $file) {\n                if (!$file->isDot()) {\n                    $filename = $file->getFilename();\n                    if (isset($expectedSysplugins[ $filename ])) {\n                        unset($expectedSysplugins[ $filename ]);\n                    }\n                }\n            }\n            if ($expectedSysplugins) {\n                $status = false;\n                $message = \"FAILED: files missing from libs/sysplugins: \" . join(', ', array_keys($expectedSysplugins));\n                if ($errors === null) {\n                    echo $message . \".\\n\";\n                } else {\n                    $errors[ 'sysplugins' ] = $message;\n                }\n            } else if ($errors === null) {\n                echo \"... OK\\n\";\n            }\n        } else {\n            $status = false;\n            $message = \"FAILED: \" . SMARTY_SYSPLUGINS_DIR . ' is not a directory';\n            if ($errors === null) {\n                echo $message . \".\\n\";\n            } else {\n                $errors[ 'sysplugins_dir_constant' ] = $message;\n            }\n        }\n        if ($errors === null) {\n            echo \"Testing plugin files...\\n\";\n        }\n        // test if core plugins are available\n        $source = SMARTY_PLUGINS_DIR;\n        if (is_dir($source)) {\n            $expectedPlugins = array(\n                'block.textformat.php'                  => true,\n                'function.counter.php'                  => true,\n                'function.cycle.php'                    => true,\n                'function.fetch.php'                    => true,\n                'function.html_checkboxes.php'          => true,\n                'function.html_image.php'               => true,\n                'function.html_options.php'             => true,\n                'function.html_radios.php'              => true,\n                'function.html_select_date.php'         => true,\n                'function.html_select_time.php'         => true,\n                'function.html_table.php'               => true,\n                'function.mailto.php'                   => true,\n                'function.math.php'                     => true,\n                'modifier.capitalize.php'               => true,\n                'modifier.date_format.php'              => true,\n                'modifier.debug_print_var.php'          => true,\n                'modifier.escape.php'                   => true,\n                'modifier.mb_wordwrap.php'              => true,\n                'modifier.regex_replace.php'            => true,\n                'modifier.replace.php'                  => true,\n                'modifier.spacify.php'                  => true,\n                'modifier.truncate.php'                 => true,\n                'modifiercompiler.cat.php'              => true,\n                'modifiercompiler.count_characters.php' => true,\n                'modifiercompiler.count_paragraphs.php' => true,\n                'modifiercompiler.count_sentences.php'  => true,\n                'modifiercompiler.count_words.php'      => true,\n                'modifiercompiler.default.php'          => true,\n                'modifiercompiler.escape.php'           => true,\n                'modifiercompiler.from_charset.php'     => true,\n                'modifiercompiler.indent.php'           => true,\n                'modifiercompiler.lower.php'            => true,\n                'modifiercompiler.noprint.php'          => true,\n                'modifiercompiler.string_format.php'    => true,\n                'modifiercompiler.strip.php'            => true,\n                'modifiercompiler.strip_tags.php'       => true,\n                'modifiercompiler.to_charset.php'       => true,\n                'modifiercompiler.unescape.php'         => true,\n                'modifiercompiler.upper.php'            => true,\n                'modifiercompiler.wordwrap.php'         => true,\n                'outputfilter.trimwhitespace.php'       => true,\n                'shared.escape_special_chars.php'       => true,\n                'shared.literal_compiler_param.php'     => true,\n                'shared.make_timestamp.php'             => true,\n                'shared.mb_str_replace.php'             => true,\n                'shared.mb_unicode.php'                 => true,\n                'variablefilter.htmlspecialchars.php'   => true,\n            );\n            $iterator = new DirectoryIterator($source);\n            foreach ($iterator as $file) {\n                if (!$file->isDot()) {\n                    $filename = $file->getFilename();\n                    if (isset($expectedPlugins[ $filename ])) {\n                        unset($expectedPlugins[ $filename ]);\n                    }\n                }\n            }\n            if ($expectedPlugins) {\n                $status = false;\n                $message = \"FAILED: files missing from libs/plugins: \" . join(', ', array_keys($expectedPlugins));\n                if ($errors === null) {\n                    echo $message . \".\\n\";\n                } else {\n                    $errors[ 'plugins' ] = $message;\n                }\n            } else if ($errors === null) {\n                echo \"... OK\\n\";\n            }\n        } else {\n            $status = false;\n            $message = \"FAILED: \" . SMARTY_PLUGINS_DIR . ' is not a directory';\n            if ($errors === null) {\n                echo $message . \".\\n\";\n            } else {\n                $errors[ 'plugins_dir_constant' ] = $message;\n            }\n        }\n        if ($errors === null) {\n            echo \"Tests complete.\\n\";\n            echo \"</PRE>\\n\";\n        }\n        return $status;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_internal_undefined.php",
    "content": "<?php\n\n/**\n * Smarty Internal Undefined\n *\n * Class to handle undefined method calls or calls to obsolete runtime extensions\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Undefined\n{\n\n    /**\n     * Name of undefined extension class\n     *\n     * @var string|null\n     */\n    public $class = null;\n\n    /**\n     * Smarty_Internal_Undefined constructor.\n     *\n     * @param null|string $class name of undefined extension class\n     */\n    public function __construct($class = null)\n    {\n        $this->class = $class;\n    }\n\n    /**\n     * Wrapper for obsolete class Smarty_Internal_Runtime_ValidateCompiled\n     *\n     * @param  \\Smarty_Internal_Template $tpl\n     * @param  array                     $properties special template properties\n     * @param  bool                      $cache      flag if called from cache file\n     *\n     * @return bool false\n     */\n    public function decodeProperties(Smarty_Internal_Template $tpl, $properties, $cache = false)\n    {\n        if ($cache) {\n            $tpl->cached->valid = false;\n        } else {\n            $tpl->mustCompile = true;\n        }\n        return false;\n    }\n\n    /**\n     * Call error handler for undefined method\n     *\n     * @param string $name unknown method-name\n     * @param array  $args argument array\n     *\n     * @return mixed\n     * @throws SmartyException\n     */\n    public function __call($name, $args)\n    {\n        if (isset($this->class)) {\n            throw new SmartyException(\"undefined extension class '{$this->class}'\");\n        } else {\n            throw new SmartyException(get_class($args[ 0 ]) . \"->{$name}() undefined method\");\n        }\n    }\n}"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_resource.php",
    "content": "<?php\n/**\n * Smarty Resource Plugin\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Rodney Rehm\n */\n\n/**\n * Smarty Resource Plugin\n * Base implementation for resource plugins\n *\n * @package    Smarty\n * @subpackage TemplateResources\n *\n * @method renderUncompiled(Smarty_Template_Source $source, Smarty_Internal_Template $_template)\n * @method populateCompiledFilepath(Smarty_Template_Compiled $compiled, Smarty_Internal_Template $_template)\n * @method process(Smarty_Internal_Template $_smarty_tpl)\n */\nabstract class Smarty_Resource\n{\n    /**\n     * resource types provided by the core\n     *\n     * @var array\n     */\n    public static $sysplugins = array('file'    => 'smarty_internal_resource_file.php',\n                                      'string'  => 'smarty_internal_resource_string.php',\n                                      'extends' => 'smarty_internal_resource_extends.php',\n                                      'stream'  => 'smarty_internal_resource_stream.php',\n                                      'eval'    => 'smarty_internal_resource_eval.php',\n                                      'php'     => 'smarty_internal_resource_php.php');\n    /**\n     * Source is bypassing compiler\n     *\n     * @var boolean\n     */\n    public $uncompiled = false;\n    /**\n     * Source must be recompiled on every occasion\n     *\n     * @var boolean\n     */\n    public $recompiled = false;\n    /**\n     * Flag if resource does implement populateCompiledFilepath() method\n     *\n     * @var bool\n     */\n    public $hasCompiledHandler = false;\n\n    /**\n     * Load Resource Handler\n     *\n     * @param  Smarty $smarty smarty object\n     * @param  string $type   name of the resource\n     *\n     * @throws SmartyException\n     * @return Smarty_Resource Resource Handler\n     */\n    public static function load(Smarty $smarty, $type)\n    {\n        // try smarty's cache\n        if (isset($smarty->_cache[ 'resource_handlers' ][ $type ])) {\n            return $smarty->_cache[ 'resource_handlers' ][ $type ];\n        }\n        // try registered resource\n        if (isset($smarty->registered_resources[ $type ])) {\n            return $smarty->_cache[ 'resource_handlers' ][ $type ] =\n                $smarty->registered_resources[ $type ] instanceof Smarty_Resource ?\n                    $smarty->registered_resources[ $type ] : new Smarty_Internal_Resource_Registered();\n        }\n        // try sysplugins dir\n        if (isset(self::$sysplugins[ $type ])) {\n            $_resource_class = 'Smarty_Internal_Resource_' . ucfirst($type);\n            return $smarty->_cache[ 'resource_handlers' ][ $type ] = new $_resource_class();\n        }\n        // try plugins dir\n        $_resource_class = 'Smarty_Resource_' . ucfirst($type);\n        if ($smarty->loadPlugin($_resource_class)) {\n            if (class_exists($_resource_class, false)) {\n                return $smarty->_cache[ 'resource_handlers' ][ $type ] = new $_resource_class();\n            } else {\n                $smarty->registerResource($type,\n                                          array(\"smarty_resource_{$type}_source\", \"smarty_resource_{$type}_timestamp\",\n                                                \"smarty_resource_{$type}_secure\", \"smarty_resource_{$type}_trusted\"));\n                // give it another try, now that the resource is registered properly\n                return self::load($smarty, $type);\n            }\n        }\n        // try streams\n        $_known_stream = stream_get_wrappers();\n        if (in_array($type, $_known_stream)) {\n            // is known stream\n            if (is_object($smarty->security_policy)) {\n                $smarty->security_policy->isTrustedStream($type);\n            }\n            return $smarty->_cache[ 'resource_handlers' ][ $type ] = new Smarty_Internal_Resource_Stream();\n        }\n        // TODO: try default_(template|config)_handler\n        // give up\n        throw new SmartyException(\"Unknown resource type '{$type}'\");\n    }\n\n    /**\n     * extract resource_type and resource_name from template_resource and config_resource\n     * @note \"C:/foo.tpl\" was forced to file resource up till Smarty 3.1.3 (including).\n     *\n     * @param  string $resource_name    template_resource or config_resource to parse\n     * @param  string $default_resource the default resource_type defined in $smarty\n     *\n     * @return array with parsed resource name and type\n     */\n    public static function parseResourceName($resource_name, $default_resource)\n    {\n        if (preg_match('/^([A-Za-z0-9_\\-]{2,})[:]/', $resource_name, $match)) {\n            $type = $match[ 1 ];\n            $name = substr($resource_name, strlen($match[ 0 ]));\n        } else {\n            // no resource given, use default\n            // or single character before the colon is not a resource type, but part of the filepath\n            $type = $default_resource;\n            $name = $resource_name;\n        }\n        return array($name, $type);\n    }\n\n    /**\n     * modify template_resource according to resource handlers specifications\n     *\n     * @param  \\Smarty_Internal_Template|\\Smarty $obj               Smarty instance\n     * @param  string                            $template_resource template_resource to extract resource handler and name of\n     *\n     * @return string unique resource name\n     * @throws \\SmartyException\n     */\n    public static function getUniqueTemplateName($obj, $template_resource)\n    {\n        $smarty = $obj->_getSmartyObj();\n        list($name, $type) = self::parseResourceName($template_resource, $smarty->default_resource_type);\n        // TODO: optimize for Smarty's internal resource types\n        $resource = Smarty_Resource::load($smarty, $type);\n        // go relative to a given template?\n        $_file_is_dotted = $name[ 0 ] === '.' && ($name[ 1 ] === '.' || $name[ 1 ] === '/');\n        if ($obj->_isTplObj() && $_file_is_dotted &&\n            ($obj->source->type === 'file' || $obj->parent->source->type === 'extends')\n        ) {\n            $name = $smarty->_realpath(dirname($obj->parent->source->filepath) . DIRECTORY_SEPARATOR . $name);\n        }\n        return $resource->buildUniqueResourceName($smarty, $name);\n    }\n\n    /**\n     * initialize Source Object for given resource\n     * wrapper for backward compatibility to versions < 3.1.22\n     * Either [$_template] or [$smarty, $template_resource] must be specified\n     *\n     * @param  Smarty_Internal_Template $_template         template object\n     * @param  Smarty                   $smarty            smarty object\n     * @param  string                   $template_resource resource identifier\n     *\n     * @return \\Smarty_Template_Source Source Object\n     * @throws \\SmartyException\n     */\n    public static function source(Smarty_Internal_Template $_template = null,\n                                  Smarty $smarty = null,\n                                  $template_resource = null)\n    {\n        return Smarty_Template_Source::load($_template, $smarty, $template_resource);\n    }\n\n    /**\n     * Load template's source into current template object\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return string                 template source\n     * @throws SmartyException        if source cannot be loaded\n     */\n    abstract public function getContent(Smarty_Template_Source $source);\n\n    /**\n     * populate Source Object with meta data from Resource\n     *\n     * @param Smarty_Template_Source   $source    source object\n     * @param Smarty_Internal_Template $_template template object\n     */\n    abstract public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null);\n\n    /**\n     * populate Source Object with timestamp and exists from Resource\n     *\n     * @param Smarty_Template_Source $source source object\n     */\n    public function populateTimestamp(Smarty_Template_Source $source)\n    {\n        // intentionally left blank\n    }\n\n    /**\n     * modify resource_name according to resource handlers specifications\n     *\n     * @param  Smarty  $smarty        Smarty instance\n     * @param  string  $resource_name resource_name to make unique\n     * @param  boolean $isConfig      flag for config resource\n     *\n     * @return string unique resource name\n     */\n    public function buildUniqueResourceName(Smarty $smarty, $resource_name, $isConfig = false)\n    {\n        if ($isConfig) {\n            if (!isset($smarty->_joined_config_dir)) {\n                $smarty->getTemplateDir(null, true);\n            }\n            return get_class($this) . '#' . $smarty->_joined_config_dir . '#' . $resource_name;\n        } else {\n            if (!isset($smarty->_joined_template_dir)) {\n                $smarty->getTemplateDir();\n            }\n            return get_class($this) . '#' . $smarty->_joined_template_dir . '#' . $resource_name;\n        }\n    }\n\n    /*\n     * Check if resource must check time stamps when when loading complied or cached templates.\n     * Resources like 'extends' which use source components my disable timestamp checks on own resource.\n     *\n     * @return bool\n     */\n\n    /**\n     * Determine basename for compiled filename\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return string                 resource's basename\n     */\n    public function getBasename(Smarty_Template_Source $source)\n    {\n        return basename(preg_replace('![^\\w]+!', '_', $source->name));\n    }\n\n    /**\n     * @return bool\n     */\n    public function checkTimestamps()\n    {\n        return true;\n    }\n}\n\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_resource_custom.php",
    "content": "<?php\n/**\n * Smarty Resource Plugin\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Rodney Rehm\n */\n\n/**\n * Smarty Resource Plugin\n * Wrapper Implementation for custom resource plugins\n *\n * @package    Smarty\n * @subpackage TemplateResources\n */\nabstract class Smarty_Resource_Custom extends Smarty_Resource\n{\n    /**\n     * fetch template and its modification time from data source\n     *\n     * @param string  $name    template name\n     * @param string  &$source template source\n     * @param integer &$mtime  template modification timestamp (epoch)\n     */\n    abstract protected function fetch($name, &$source, &$mtime);\n\n    /**\n     * Fetch template's modification timestamp from data source\n     * {@internal implementing this method is optional.\n     *  Only implement it if modification times can be accessed faster than loading the complete template source.}}\n     *\n     * @param  string $name template name\n     *\n     * @return integer|boolean timestamp (epoch) the template was modified, or false if not found\n     */\n    protected function fetchTimestamp($name)\n    {\n        return null;\n    }\n\n    /**\n     * populate Source Object with meta data from Resource\n     *\n     * @param Smarty_Template_Source   $source    source object\n     * @param Smarty_Internal_Template $_template template object\n     */\n    public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)\n    {\n        $source->filepath = $source->type . ':' . substr(preg_replace('/[^A-Za-z0-9.]/','',$source->name),0,25);\n        $source->uid = sha1($source->type . ':' . $source->name);\n\n        $mtime = $this->fetchTimestamp($source->name);\n        if ($mtime !== null) {\n            $source->timestamp = $mtime;\n        } else {\n            $this->fetch($source->name, $content, $timestamp);\n            $source->timestamp = isset($timestamp) ? $timestamp : false;\n            if (isset($content)) {\n                $source->content = $content;\n            }\n        }\n        $source->exists = !!$source->timestamp;\n    }\n\n    /**\n     * Load template's source into current template object\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return string                 template source\n     * @throws SmartyException        if source cannot be loaded\n     */\n    public function getContent(Smarty_Template_Source $source)\n    {\n        $this->fetch($source->name, $content, $timestamp);\n        if (isset($content)) {\n            return $content;\n        }\n\n        throw new SmartyException(\"Unable to read template {$source->type} '{$source->name}'\");\n    }\n\n    /**\n     * Determine basename for compiled filename\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return string                 resource's basename\n     */\n    public function getBasename(Smarty_Template_Source $source)\n    {\n        return basename(substr(preg_replace('/[^A-Za-z0-9.]/','',$source->name),0,25));\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_resource_recompiled.php",
    "content": "<?php\n/**\n * Smarty Resource Plugin\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Rodney Rehm\n */\n\n/**\n * Smarty Resource Plugin\n * Base implementation for resource plugins that don't compile cache\n *\n * @package    Smarty\n * @subpackage TemplateResources\n */\nabstract class Smarty_Resource_Recompiled extends Smarty_Resource\n{\n    /**\n     * Flag that it's an recompiled resource\n     *\n     * @var bool\n     */\n    public $recompiled = true;\n\n    /**\n     * Resource does implement populateCompiledFilepath() method\n     *\n     * @var bool\n     */\n    public $hasCompiledHandler = true;\n\n    /**\n     * compile template from source\n     *\n     * @param Smarty_Internal_Template $_smarty_tpl do not change variable name, is used by compiled template\n     *\n     * @throws Exception\n     */\n    public function process(Smarty_Internal_Template $_smarty_tpl)\n    {\n        $compiled = &$_smarty_tpl->compiled;\n        $compiled->file_dependency = array();\n        $compiled->includes = array();\n        $compiled->nocache_hash = null;\n        $compiled->unifunc = null;\n        $level = ob_get_level();\n        ob_start();\n        $_smarty_tpl->loadCompiler();\n        // call compiler\n        try {\n            eval('?>' . $_smarty_tpl->compiler->compileTemplate($_smarty_tpl));\n        }\n        catch (Exception $e) {\n            unset($_smarty_tpl->compiler);\n            while (ob_get_level() > $level) {\n                ob_end_clean();\n            }\n            throw $e;\n        }\n        // release compiler object to free memory\n        unset($_smarty_tpl->compiler);\n        ob_get_clean();\n        $compiled->timestamp = time();\n        $compiled->exists = true;\n    }\n\n    /**\n     * populate Compiled Object with compiled filepath\n     *\n     * @param  Smarty_Template_Compiled $compiled  compiled object\n     * @param  Smarty_Internal_Template $_template template object\n     *\n     * @return void\n     */\n    public function populateCompiledFilepath(Smarty_Template_Compiled $compiled, Smarty_Internal_Template $_template)\n    {\n        $compiled->filepath = false;\n        $compiled->timestamp = false;\n        $compiled->exists = false;\n    }\n\n    /*\n       * Disable timestamp checks for recompiled resource.\n       *\n       * @return bool\n       */\n    /**\n     * @return bool\n     */\n    public function checkTimestamps()\n    {\n        return false;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_resource_uncompiled.php",
    "content": "<?php\n/**\n * Smarty Resource Plugin\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Rodney Rehm\n */\n\n/**\n * Smarty Resource Plugin\n * Base implementation for resource plugins that don't use the compiler\n *\n * @package    Smarty\n * @subpackage TemplateResources\n */\nabstract class Smarty_Resource_Uncompiled extends Smarty_Resource\n{\n    /**\n     * Flag that it's an uncompiled resource\n     *\n     * @var bool\n     */\n    public $uncompiled = true;\n\n    /**\n     * Resource does implement populateCompiledFilepath() method\n     *\n     * @var bool\n     */\n    public $hasCompiledHandler = true;\n\n    /**\n     * populate compiled object with compiled filepath\n     *\n     * @param Smarty_Template_Compiled $compiled  compiled object\n     * @param Smarty_Internal_Template $_template template object\n     */\n    public function populateCompiledFilepath(Smarty_Template_Compiled $compiled, Smarty_Internal_Template $_template)\n    {\n        $compiled->filepath = $_template->source->filepath;\n        $compiled->timestamp = $_template->source->timestamp;\n        $compiled->exists = $_template->source->exists;\n        if ($_template->smarty->merge_compiled_includes || $_template->source->handler->checkTimestamps()) {\n            $compiled->file_dependency[ $_template->source->uid ] =\n                array($compiled->filepath, $compiled->timestamp, $_template->source->type,);\n        }\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_security.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage Security\n * @author     Uwe Tews\n */\n\n/*\n * FIXME: Smarty_Security API\n *      - getter and setter instead of public properties would allow cultivating an internal cache properly\n *      - current implementation of isTrustedResourceDir() assumes that Smarty::$template_dir and Smarty::$config_dir are immutable\n *        the cache is killed every time either of the variables change. That means that two distinct Smarty objects with differing\n *        $template_dir or $config_dir should NOT share the same Smarty_Security instance,\n *        as this would lead to (severe) performance penalty! how should this be handled?\n */\n\n/**\n * This class does contain the security settings\n */\nclass Smarty_Security\n{\n    /**\n     * This determines how Smarty handles \"<?php ... ?>\" tags in templates.\n     * possible values:\n     * <ul>\n     *   <li>Smarty::PHP_PASSTHRU -> echo PHP tags as they are</li>\n     *   <li>Smarty::PHP_QUOTE    -> escape tags as entities</li>\n     *   <li>Smarty::PHP_REMOVE   -> remove php tags</li>\n     *   <li>Smarty::PHP_ALLOW    -> execute php tags</li>\n     * </ul>\n     *\n     * @var integer\n     */\n    public $php_handling = Smarty::PHP_PASSTHRU;\n\n    /**\n     * This is the list of template directories that are considered secure.\n     * $template_dir is in this list implicitly.\n     *\n     * @var array\n     */\n    public $secure_dir = array();\n\n    /**\n     * This is an array of directories where trusted php scripts reside.\n     * {@link $security} is disabled during their inclusion/execution.\n     *\n     * @var array\n     */\n    public $trusted_dir = array();\n\n    /**\n     * List of regular expressions (PCRE) that include trusted URIs\n     *\n     * @var array\n     */\n    public $trusted_uri = array();\n\n    /**\n     * List of trusted constants names\n     *\n     * @var array\n     */\n    public $trusted_constants = array();\n\n    /**\n     * This is an array of trusted static classes.\n     * If empty access to all static classes is allowed.\n     * If set to 'none' none is allowed.\n     *\n     * @var array\n     */\n    public $static_classes = array();\n\n    /**\n     * This is an nested array of trusted classes and static methods.\n     * If empty access to all static classes and methods is allowed.\n     * Format:\n     * array (\n     *         'class_1' => array('method_1', 'method_2'), // allowed methods listed\n     *         'class_2' => array(),                       // all methods of class allowed\n     *       )\n     * If set to null none is allowed.\n     *\n     * @var array\n     */\n    public $trusted_static_methods = array();\n\n    /**\n     * This is an array of trusted static properties.\n     * If empty access to all static classes and properties is allowed.\n     * Format:\n     * array (\n     *         'class_1' => array('prop_1', 'prop_2'), // allowed properties listed\n     *         'class_2' => array(),                   // all properties of class allowed\n     *       )\n     * If set to null none is allowed.\n     *\n     * @var array\n     */\n    public $trusted_static_properties = array();\n\n    /**\n     * This is an array of trusted PHP functions.\n     * If empty all functions are allowed.\n     * To disable all PHP functions set $php_functions = null.\n     *\n     * @var array\n     */\n    public $php_functions = array('isset', 'empty', 'count', 'sizeof', 'in_array', 'is_array', 'time',);\n\n    /**\n     * This is an array of trusted PHP modifiers.\n     * If empty all modifiers are allowed.\n     * To disable all modifier set $php_modifiers = null.\n     *\n     * @var array\n     */\n    public $php_modifiers = array('escape', 'count', 'nl2br',);\n\n    /**\n     * This is an array of allowed tags.\n     * If empty no restriction by allowed_tags.\n     *\n     * @var array\n     */\n    public $allowed_tags = array();\n\n    /**\n     * This is an array of disabled tags.\n     * If empty no restriction by disabled_tags.\n     *\n     * @var array\n     */\n    public $disabled_tags = array();\n\n    /**\n     * This is an array of allowed modifier plugins.\n     * If empty no restriction by allowed_modifiers.\n     *\n     * @var array\n     */\n    public $allowed_modifiers = array();\n\n    /**\n     * This is an array of disabled modifier plugins.\n     * If empty no restriction by disabled_modifiers.\n     *\n     * @var array\n     */\n    public $disabled_modifiers = array();\n\n    /**\n     * This is an array of disabled special $smarty variables.\n     *\n     * @var array\n     */\n    public $disabled_special_smarty_vars = array();\n\n    /**\n     * This is an array of trusted streams.\n     * If empty all streams are allowed.\n     * To disable all streams set $streams = null.\n     *\n     * @var array\n     */\n    public $streams = array('file');\n\n    /**\n     * + flag if constants can be accessed from template\n     *\n     * @var boolean\n     */\n    public $allow_constants = true;\n\n    /**\n     * + flag if super globals can be accessed from template\n     *\n     * @var boolean\n     */\n    public $allow_super_globals = true;\n\n    /**\n     * max template nesting level\n     *\n     * @var int\n     */\n    public $max_template_nesting = 0;\n\n    /**\n     * current template nesting level\n     *\n     * @var int\n     */\n    private $_current_template_nesting = 0;\n\n    /**\n     * Cache for $resource_dir lookup\n     *\n     * @var array\n     */\n    protected $_resource_dir = array();\n\n    /**\n     * Cache for $template_dir lookup\n     *\n     * @var array\n     */\n    protected $_template_dir = array();\n\n    /**\n     * Cache for $config_dir lookup\n     *\n     * @var array\n     */\n    protected $_config_dir = array();\n\n    /**\n     * Cache for $secure_dir lookup\n     *\n     * @var array\n     */\n    protected $_secure_dir = array();\n\n    /**\n     * Cache for $php_resource_dir lookup\n     *\n     * @var array\n     */\n    protected $_php_resource_dir = null;\n\n    /**\n     * Cache for $trusted_dir lookup\n     *\n     * @var array\n     */\n    protected $_trusted_dir = null;\n\n    /**\n     * Cache for include path status\n     *\n     * @var bool\n     */\n    protected $_include_path_status = false;\n\n    /**\n     * Cache for $_include_array lookup\n     *\n     * @var array\n     */\n    protected $_include_dir = array();\n\n    /**\n     * @param Smarty $smarty\n     */\n    public function __construct($smarty)\n    {\n        $this->smarty = $smarty;\n        $this->smarty->_cache[ 'template_dir_new' ] = true;\n        $this->smarty->_cache[ 'config_dir_new' ] = true;\n    }\n\n    /**\n     * Check if PHP function is trusted.\n     *\n     * @param  string $function_name\n     * @param  object $compiler compiler object\n     *\n     * @return boolean                 true if function is trusted\n     * @throws SmartyCompilerException if php function is not trusted\n     */\n    public function isTrustedPhpFunction($function_name, $compiler)\n    {\n        if (isset($this->php_functions) &&\n            (empty($this->php_functions) || in_array($function_name, $this->php_functions))\n        ) {\n            return true;\n        }\n\n        $compiler->trigger_template_error(\"PHP function '{$function_name}' not allowed by security setting\");\n\n        return false; // should not, but who knows what happens to the compiler in the future?\n    }\n\n    /**\n     * Check if static class is trusted.\n     *\n     * @param  string $class_name\n     * @param  object $compiler compiler object\n     *\n     * @return boolean                 true if class is trusted\n     * @throws SmartyCompilerException if static class is not trusted\n     */\n    public function isTrustedStaticClass($class_name, $compiler)\n    {\n        if (isset($this->static_classes) &&\n            (empty($this->static_classes) || in_array($class_name, $this->static_classes))\n        ) {\n            return true;\n        }\n\n        $compiler->trigger_template_error(\"access to static class '{$class_name}' not allowed by security setting\");\n\n        return false; // should not, but who knows what happens to the compiler in the future?\n    }\n\n    /**\n     * Check if static class method/property is trusted.\n     *\n     * @param  string $class_name\n     * @param  string $params\n     * @param  object $compiler compiler object\n     *\n     * @return boolean                 true if class method is trusted\n     * @throws SmartyCompilerException if static class method is not trusted\n     */\n    public function isTrustedStaticClassAccess($class_name, $params, $compiler)\n    {\n        if (!isset($params[ 2 ])) {\n            // fall back\n            return $this->isTrustedStaticClass($class_name, $compiler);\n        }\n        if ($params[ 2 ] === 'method') {\n            $allowed = $this->trusted_static_methods;\n            $name = substr($params[ 0 ], 0, strpos($params[ 0 ], '('));\n        } else {\n            $allowed = $this->trusted_static_properties;\n            // strip '$'\n            $name = substr($params[ 0 ], 1);\n        }\n        if (isset($allowed)) {\n            if (empty($allowed)) {\n                // fall back\n                return $this->isTrustedStaticClass($class_name, $compiler);\n            }\n            if (isset($allowed[ $class_name ]) &&\n                (empty($allowed[ $class_name ]) || in_array($name, $allowed[ $class_name ]))\n            ) {\n                return true;\n            }\n        }\n        $compiler->trigger_template_error(\"access to static class '{$class_name}' {$params[2]} '{$name}' not allowed by security setting\");\n        return false; // should not, but who knows what happens to the compiler in the future?\n    }\n\n    /**\n     * Check if PHP modifier is trusted.\n     *\n     * @param  string $modifier_name\n     * @param  object $compiler compiler object\n     *\n     * @return boolean                 true if modifier is trusted\n     * @throws SmartyCompilerException if modifier is not trusted\n     */\n    public function isTrustedPhpModifier($modifier_name, $compiler)\n    {\n        if (isset($this->php_modifiers) &&\n            (empty($this->php_modifiers) || in_array($modifier_name, $this->php_modifiers))\n        ) {\n            return true;\n        }\n\n        $compiler->trigger_template_error(\"modifier '{$modifier_name}' not allowed by security setting\");\n\n        return false; // should not, but who knows what happens to the compiler in the future?\n    }\n\n    /**\n     * Check if tag is trusted.\n     *\n     * @param  string $tag_name\n     * @param  object $compiler compiler object\n     *\n     * @return boolean                 true if tag is trusted\n     * @throws SmartyCompilerException if modifier is not trusted\n     */\n    public function isTrustedTag($tag_name, $compiler)\n    {\n        // check for internal always required tags\n        if (in_array($tag_name,\n                     array('assign', 'call', 'private_filter', 'private_block_plugin', 'private_function_plugin',\n                           'private_object_block_function', 'private_object_function', 'private_registered_function',\n                           'private_registered_block', 'private_special_variable', 'private_print_expression',\n                           'private_modifier'))) {\n            return true;\n        }\n        // check security settings\n        if (empty($this->allowed_tags)) {\n            if (empty($this->disabled_tags) || !in_array($tag_name, $this->disabled_tags)) {\n                return true;\n            } else {\n                $compiler->trigger_template_error(\"tag '{$tag_name}' disabled by security setting\", null, true);\n            }\n        } elseif (in_array($tag_name, $this->allowed_tags) && !in_array($tag_name, $this->disabled_tags)) {\n            return true;\n        } else {\n            $compiler->trigger_template_error(\"tag '{$tag_name}' not allowed by security setting\", null, true);\n        }\n\n        return false; // should not, but who knows what happens to the compiler in the future?\n    }\n\n    /**\n     * Check if special $smarty variable is trusted.\n     *\n     * @param  string $var_name\n     * @param  object $compiler compiler object\n     *\n     * @return boolean                 true if tag is trusted\n     * @throws SmartyCompilerException if modifier is not trusted\n     */\n    public function isTrustedSpecialSmartyVar($var_name, $compiler)\n    {\n        if (!in_array($var_name, $this->disabled_special_smarty_vars)) {\n            return true;\n        } else {\n            $compiler->trigger_template_error(\"special variable '\\$smarty.{$var_name}' not allowed by security setting\",\n                                              null, true);\n        }\n\n        return false; // should not, but who knows what happens to the compiler in the future?\n    }\n\n    /**\n     * Check if modifier plugin is trusted.\n     *\n     * @param  string $modifier_name\n     * @param  object $compiler compiler object\n     *\n     * @return boolean                 true if tag is trusted\n     * @throws SmartyCompilerException if modifier is not trusted\n     */\n    public function isTrustedModifier($modifier_name, $compiler)\n    {\n        // check for internal always allowed modifier\n        if (in_array($modifier_name, array('default'))) {\n            return true;\n        }\n        // check security settings\n        if (empty($this->allowed_modifiers)) {\n            if (empty($this->disabled_modifiers) || !in_array($modifier_name, $this->disabled_modifiers)) {\n                return true;\n            } else {\n                $compiler->trigger_template_error(\"modifier '{$modifier_name}' disabled by security setting\", null,\n                                                  true);\n            }\n        } elseif (in_array($modifier_name, $this->allowed_modifiers) &&\n                  !in_array($modifier_name, $this->disabled_modifiers)\n        ) {\n            return true;\n        } else {\n            $compiler->trigger_template_error(\"modifier '{$modifier_name}' not allowed by security setting\", null,\n                                              true);\n        }\n\n        return false; // should not, but who knows what happens to the compiler in the future?\n    }\n\n    /**\n     * Check if constants are enabled or trusted\n     *\n     * @param  string $const    constant name\n     * @param  object $compiler compiler object\n     *\n     * @return bool\n     */\n    public function isTrustedConstant($const, $compiler)\n    {\n        if (in_array($const, array('true', 'false', 'null'))) {\n            return true;\n        }\n        if (!empty($this->trusted_constants)) {\n            if (!in_array(strtolower($const), $this->trusted_constants)) {\n                $compiler->trigger_template_error(\"Security: access to constant '{$const}' not permitted\");\n                return false;\n            }\n            return true;\n        }\n        if ($this->allow_constants) {\n            return true;\n        }\n        $compiler->trigger_template_error(\"Security: access to constants not permitted\");\n        return false;\n    }\n\n    /**\n     * Check if stream is trusted.\n     *\n     * @param  string $stream_name\n     *\n     * @return boolean         true if stream is trusted\n     * @throws SmartyException if stream is not trusted\n     */\n    public function isTrustedStream($stream_name)\n    {\n        if (isset($this->streams) && (empty($this->streams) || in_array($stream_name, $this->streams))) {\n            return true;\n        }\n\n        throw new SmartyException(\"stream '{$stream_name}' not allowed by security setting\");\n    }\n\n    /**\n     * Check if directory of file resource is trusted.\n     *\n     * @param  string   $filepath\n     * @param null|bool $isConfig\n     *\n     * @return bool true if directory is trusted\n     * @throws \\SmartyException if directory is not trusted\n     */\n    public function isTrustedResourceDir($filepath, $isConfig = null)\n    {\n        if ($this->_include_path_status !== $this->smarty->use_include_path) {\n            foreach ($this->_include_dir as $directory) {\n                unset($this->_resource_dir[ $directory ]);\n            }\n            if ($this->smarty->use_include_path) {\n                $this->_include_dir = array();\n                $_dirs = $this->smarty->ext->_getIncludePath->getIncludePathDirs($this->smarty);\n                foreach ($_dirs as $directory) {\n                    $this->_include_dir[] = $directory;\n                    $this->_resource_dir[ $directory ] = true;\n                }\n            }\n            $this->_include_path_status = $this->smarty->use_include_path;\n        }\n        if ($isConfig !== true &&\n            (!isset($this->smarty->_cache[ 'template_dir_new' ]) || $this->smarty->_cache[ 'template_dir_new' ])\n        ) {\n            $_dir = $this->smarty->getTemplateDir();\n            if ($this->_template_dir !== $_dir) {\n                foreach ($this->_template_dir as $directory) {\n                    unset($this->_resource_dir[ $directory ]);\n                }\n                foreach ($_dir as $directory) {\n                    $this->_resource_dir[ $directory ] = true;\n                }\n                $this->_template_dir = $_dir;\n            }\n            $this->smarty->_cache[ 'template_dir_new' ] = false;\n        }\n        if ($isConfig !== false &&\n            (!isset($this->smarty->_cache[ 'config_dir_new' ]) || $this->smarty->_cache[ 'config_dir_new' ])\n        ) {\n            $_dir = $this->smarty->getConfigDir();\n            if ($this->_config_dir !== $_dir) {\n                foreach ($this->_config_dir as $directory) {\n                    unset($this->_resource_dir[ $directory ]);\n                }\n                foreach ($_dir as $directory) {\n                    $this->_resource_dir[ $directory ] = true;\n                }\n                $this->_config_dir = $_dir;\n            }\n            $this->smarty->_cache[ 'config_dir_new' ] = false;\n        }\n        if ($this->_secure_dir !== (array) $this->secure_dir) {\n            foreach ($this->_secure_dir as $directory) {\n                unset($this->_resource_dir[ $directory ]);\n            }\n            foreach ((array) $this->secure_dir as $directory) {\n                $directory = $this->smarty->_realpath($directory . DIRECTORY_SEPARATOR, true);\n                $this->_resource_dir[ $directory ] = true;\n            }\n            $this->_secure_dir = (array) $this->secure_dir;\n        }\n        $this->_resource_dir = $this->_checkDir($filepath, $this->_resource_dir);\n        return true;\n    }\n\n    /**\n     * Check if URI (e.g. {fetch} or {html_image}) is trusted\n     * To simplify things, isTrustedUri() resolves all input to \"{$PROTOCOL}://{$HOSTNAME}\".\n     * So \"http://username:password@hello.world.example.org:8080/some-path?some=query-string\"\n     * is reduced to \"http://hello.world.example.org\" prior to applying the patters from {@link $trusted_uri}.\n     *\n     * @param  string $uri\n     *\n     * @return boolean         true if URI is trusted\n     * @throws SmartyException if URI is not trusted\n     * @uses $trusted_uri for list of patterns to match against $uri\n     */\n    public function isTrustedUri($uri)\n    {\n        $_uri = parse_url($uri);\n        if (!empty($_uri[ 'scheme' ]) && !empty($_uri[ 'host' ])) {\n            $_uri = $_uri[ 'scheme' ] . '://' . $_uri[ 'host' ];\n            foreach ($this->trusted_uri as $pattern) {\n                if (preg_match($pattern, $_uri)) {\n                    return true;\n                }\n            }\n        }\n\n        throw new SmartyException(\"URI '{$uri}' not allowed by security setting\");\n    }\n\n    /**\n     * Check if directory of file resource is trusted.\n     *\n     * @param  string $filepath\n     *\n     * @return boolean         true if directory is trusted\n     * @throws SmartyException if PHP directory is not trusted\n     */\n    public function isTrustedPHPDir($filepath)\n    {\n        if (empty($this->trusted_dir)) {\n            throw new SmartyException(\"directory '{$filepath}' not allowed by security setting (no trusted_dir specified)\");\n        }\n\n        // check if index is outdated\n        if (!$this->_trusted_dir || $this->_trusted_dir !== $this->trusted_dir) {\n            $this->_php_resource_dir = array();\n\n            $this->_trusted_dir = $this->trusted_dir;\n            foreach ((array) $this->trusted_dir as $directory) {\n                $directory = $this->smarty->_realpath($directory . DIRECTORY_SEPARATOR, true);\n                $this->_php_resource_dir[ $directory ] = true;\n            }\n        }\n\n        $this->_php_resource_dir =\n            $this->_checkDir($this->smarty->_realpath($filepath, true), $this->_php_resource_dir);\n        return true;\n    }\n\n    /**\n     * Check if file is inside a valid directory\n     *\n     * @param string $filepath\n     * @param array  $dirs valid directories\n     *\n     * @return array\n     * @throws \\SmartyException\n     */\n    private function _checkDir($filepath, $dirs)\n    {\n        $directory = dirname($filepath) . DIRECTORY_SEPARATOR;\n        $_directory = array();\n        while (true) {\n            // remember the directory to add it to _resource_dir in case we're successful\n            $_directory[ $directory ] = true;\n            // test if the directory is trusted\n            if (isset($dirs[ $directory ])) {\n                // merge sub directories of current $directory into _resource_dir to speed up subsequent lookup\n                $dirs = array_merge($dirs, $_directory);\n\n                return $dirs;\n            }\n            // abort if we've reached root\n            if (!preg_match('#[\\\\\\/][^\\\\\\/]+[\\\\\\/]$#', $directory)) {\n                break;\n            }\n            // bubble up one level\n            $directory = preg_replace('#[\\\\\\/][^\\\\\\/]+[\\\\\\/]$#', DIRECTORY_SEPARATOR, $directory);\n        }\n\n        // give up\n        throw new SmartyException(\"directory '{$filepath}' not allowed by security setting\");\n    }\n\n    /**\n     * Loads security class and enables security\n     *\n     * @param \\Smarty                 $smarty\n     * @param  string|Smarty_Security $security_class if a string is used, it must be class-name\n     *\n     * @return \\Smarty current Smarty instance for chaining\n     * @throws \\SmartyException when an invalid class name is provided\n     */\n    public static function enableSecurity(Smarty $smarty, $security_class)\n    {\n        if ($security_class instanceof Smarty_Security) {\n            $smarty->security_policy = $security_class;\n            return $smarty;\n        } elseif (is_object($security_class)) {\n            throw new SmartyException(\"Class '\" . get_class($security_class) . \"' must extend Smarty_Security.\");\n        }\n        if ($security_class === null) {\n            $security_class = $smarty->security_class;\n        }\n        if (!class_exists($security_class)) {\n            throw new SmartyException(\"Security class '$security_class' is not defined\");\n        } elseif ($security_class !== 'Smarty_Security' && !is_subclass_of($security_class, 'Smarty_Security')) {\n            throw new SmartyException(\"Class '$security_class' must extend Smarty_Security.\");\n        } else {\n            $smarty->security_policy = new $security_class($smarty);\n        }\n        return $smarty;\n    }\n    /**\n     * Start template processing\n     *\n     * @param $template\n     *\n     * @throws SmartyException\n     */\n    public function startTemplate($template)\n    {\n        if ($this->max_template_nesting > 0 && $this->_current_template_nesting ++ >= $this->max_template_nesting) {\n            throw new SmartyException(\"maximum template nesting level of '{$this->max_template_nesting}' exceeded when calling '{$template->template_resource}'\");\n        }\n    }\n\n    /**\n     * Exit template processing\n     *\n     */\n    public function endTemplate()\n    {\n        if ($this->max_template_nesting > 0) {\n            $this->_current_template_nesting --;\n        }\n    }\n\n    /**\n     * Register callback functions call at start/end of template rendering\n     *\n     * @param \\Smarty_Internal_Template $template\n     */\n    public function registerCallBacks(Smarty_Internal_Template $template)\n    {\n        $template->startRenderCallbacks[] = array($this, 'startTemplate');\n        $template->endRenderCallbacks[] = array($this, 'endTemplate');\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_template_cached.php",
    "content": "<?php\n/**\n * Created by PhpStorm.\n * User: Uwe Tews\n * Date: 04.12.2014\n * Time: 06:08\n */\n\n/**\n * Smarty Resource Data Object\n * Cache Data Container for Template Files\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Rodney Rehm\n */\nclass Smarty_Template_Cached extends Smarty_Template_Resource_Base\n{\n    /**\n     * Cache Is Valid\n     *\n     * @var boolean\n     */\n    public $valid = null;\n\n    /**\n     * CacheResource Handler\n     *\n     * @var Smarty_CacheResource\n     */\n    public $handler = null;\n\n    /**\n     * Template Cache Id (Smarty_Internal_Template::$cache_id)\n     *\n     * @var string\n     */\n    public $cache_id = null;\n\n    /**\n     * saved cache lifetime in seconds\n     *\n     * @var integer\n     */\n    public $cache_lifetime = 0;\n\n    /**\n     * Id for cache locking\n     *\n     * @var string\n     */\n    public $lock_id = null;\n\n    /**\n     * flag that cache is locked by this instance\n     *\n     * @var bool\n     */\n    public $is_locked = false;\n\n    /**\n     * Source Object\n     *\n     * @var Smarty_Template_Source\n     */\n    public $source = null;\n\n    /**\n     * Nocache hash codes of processed compiled templates\n     *\n     * @var array\n     */\n    public $hashes = array();\n\n    /**\n     * Flag if this is a cache resource\n     *\n     * @var bool\n     */\n    public $isCache = true;\n\n    /**\n     * create Cached Object container\n     *\n     * @param Smarty_Internal_Template $_template template object\n     *\n     * @throws \\SmartyException\n     */\n    public function __construct(Smarty_Internal_Template $_template)\n    {\n        $this->compile_id = $_template->compile_id;\n        $this->cache_id = $_template->cache_id;\n        $this->source = $_template->source;\n        if (!class_exists('Smarty_CacheResource', false)) {\n            require SMARTY_SYSPLUGINS_DIR . 'smarty_cacheresource.php';\n        }\n        $this->handler = Smarty_CacheResource::load($_template->smarty);\n    }\n\n    /**\n     * @param Smarty_Internal_Template $_template\n     *\n     * @return Smarty_Template_Cached\n     */\n    static function load(Smarty_Internal_Template $_template)\n    {\n        $_template->cached = new Smarty_Template_Cached($_template);\n        $_template->cached->handler->populate($_template->cached, $_template);\n        // caching enabled ?\n        if (!$_template->caching || $_template->source->handler->recompiled\n        ) {\n            $_template->cached->valid = false;\n        }\n        return $_template->cached;\n    }\n\n    /**\n     * Render cache template\n     *\n     * @param \\Smarty_Internal_Template $_template\n     * @param  bool                     $no_output_filter\n     *\n     * @throws \\Exception\n     */\n    public function render(Smarty_Internal_Template $_template, $no_output_filter = true)\n    {\n        if ($this->isCached($_template)) {\n            if ($_template->smarty->debugging) {\n                if (!isset($_template->smarty->_debug)) {\n                    $_template->smarty->_debug = new Smarty_Internal_Debug();\n                }\n                $_template->smarty->_debug->start_cache($_template);\n            }\n            if (!$this->processed) {\n                $this->process($_template);\n            }\n            $this->getRenderedTemplateCode($_template);\n            if ($_template->smarty->debugging) {\n                $_template->smarty->_debug->end_cache($_template);\n            }\n            return;\n        } else {\n            $_template->smarty->ext->_updateCache->updateCache($this, $_template, $no_output_filter);\n        }\n    }\n\n    /**\n     * Check if cache is valid, lock cache if required\n     *\n     * @param \\Smarty_Internal_Template $_template\n     *\n     * @return bool flag true if cache is valid\n     */\n    public function isCached(Smarty_Internal_Template $_template)\n    {\n        if ($this->valid !== null) {\n            return $this->valid;\n        }\n        while (true) {\n            while (true) {\n                if ($this->exists === false || $_template->smarty->force_compile || $_template->smarty->force_cache) {\n                    $this->valid = false;\n                } else {\n                    $this->valid = true;\n                }\n                if ($this->valid && $_template->caching === Smarty::CACHING_LIFETIME_CURRENT &&\n                    $_template->cache_lifetime >= 0 && time() > ($this->timestamp + $_template->cache_lifetime)\n                ) {\n                    // lifetime expired\n                    $this->valid = false;\n                }\n                if ($this->valid && $_template->compile_check === Smarty::COMPILECHECK_ON &&\n                    $_template->source->getTimeStamp() > $this->timestamp\n                ) {\n                    $this->valid = false;\n                }\n                if ($this->valid || !$_template->smarty->cache_locking) {\n                    break;\n                }\n                if (!$this->handler->locked($_template->smarty, $this)) {\n                    $this->handler->acquireLock($_template->smarty, $this);\n                    break 2;\n                }\n                $this->handler->populate($this, $_template);\n            }\n            if ($this->valid) {\n                if (!$_template->smarty->cache_locking || $this->handler->locked($_template->smarty, $this) === null) {\n                    // load cache file for the following checks\n                    if ($_template->smarty->debugging) {\n                        $_template->smarty->_debug->start_cache($_template);\n                    }\n                    if ($this->handler->process($_template, $this) === false) {\n                        $this->valid = false;\n                    } else {\n                        $this->processed = true;\n                    }\n                    if ($_template->smarty->debugging) {\n                        $_template->smarty->_debug->end_cache($_template);\n                    }\n                } else {\n                    $this->is_locked = true;\n                    continue;\n                }\n            } else {\n                return $this->valid;\n            }\n            if ($this->valid && $_template->caching === Smarty::CACHING_LIFETIME_SAVED &&\n                $_template->cached->cache_lifetime >= 0 &&\n                (time() > ($_template->cached->timestamp + $_template->cached->cache_lifetime))\n            ) {\n                $this->valid = false;\n            }\n            if ($_template->smarty->cache_locking) {\n                if (!$this->valid) {\n                    $this->handler->acquireLock($_template->smarty, $this);\n                } elseif ($this->is_locked) {\n                    $this->handler->releaseLock($_template->smarty, $this);\n                }\n            }\n            return $this->valid;\n        }\n        return $this->valid;\n    }\n\n    /**\n     * Process cached template\n     *\n     * @param Smarty_Internal_Template $_template template object\n     * @param bool                     $update    flag if called because cache update\n     */\n    public function process(Smarty_Internal_Template $_template, $update = false)\n    {\n        if ($this->handler->process($_template, $this, $update) === false) {\n            $this->valid = false;\n        }\n        if ($this->valid) {\n            $this->processed = true;\n        } else {\n            $this->processed = false;\n        }\n    }\n\n    /**\n     * Read cache content from handler\n     *\n     * @param Smarty_Internal_Template $_template template object\n     *\n     * @return string|false content\n     */\n    public function read(Smarty_Internal_Template $_template)\n    {\n        if (!$_template->source->handler->recompiled) {\n            return $this->handler->readCachedContent($_template);\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_template_compiled.php",
    "content": "<?php\n\n/**\n * Smarty Resource Data Object\n * Meta Data Container for Template Files\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Rodney Rehm\n * @property string $content compiled content\n */\nclass Smarty_Template_Compiled extends Smarty_Template_Resource_Base\n{\n    /**\n     * nocache hash\n     *\n     * @var string|null\n     */\n    public $nocache_hash = null;\n\n    /**\n     * get a Compiled Object of this source\n     *\n     * @param  Smarty_Internal_Template $_template template object\n     *\n     * @return Smarty_Template_Compiled compiled object\n     */\n    static function load($_template)\n    {\n        $compiled = new Smarty_Template_Compiled();\n        if ($_template->source->handler->hasCompiledHandler) {\n            $_template->source->handler->populateCompiledFilepath($compiled, $_template);\n        } else {\n            $compiled->populateCompiledFilepath($_template);\n        }\n        return $compiled;\n    }\n\n    /**\n     * populate Compiled Object with compiled filepath\n     *\n     * @param Smarty_Internal_Template $_template template object\n     **/\n    public function populateCompiledFilepath(Smarty_Internal_Template $_template)\n    {\n        $source = &$_template->source;\n        $smarty = &$_template->smarty;\n        $this->filepath = $smarty->getCompileDir();\n        if (isset($_template->compile_id)) {\n            $this->filepath .= preg_replace('![^\\w]+!', '_', $_template->compile_id) .\n                               ($smarty->use_sub_dirs ? DIRECTORY_SEPARATOR : '^');\n        }\n        // if use_sub_dirs, break file into directories\n        if ($smarty->use_sub_dirs) {\n            $this->filepath .= $source->uid[ 0 ] . $source->uid[ 1 ] . DIRECTORY_SEPARATOR . $source->uid[ 2 ] .\n                               $source->uid[ 3 ] . DIRECTORY_SEPARATOR . $source->uid[ 4 ] . $source->uid[ 5 ] .\n                               DIRECTORY_SEPARATOR;\n        }\n        $this->filepath .= $source->uid . '_';\n        if ($source->isConfig) {\n            $this->filepath .= (int)$smarty->config_read_hidden + (int)$smarty->config_booleanize * 2 +\n                               (int)$smarty->config_overwrite * 4;\n        } else {\n            $this->filepath .= (int)$smarty->merge_compiled_includes + (int)$smarty->escape_html * 2 +\n                               (($smarty->merge_compiled_includes && $source->type === 'extends') ?\n                                   (int)$smarty->extends_recursion * 4 : 0);\n        }\n        $this->filepath .= '.' . $source->type;\n        $basename = $source->handler->getBasename($source);\n        if (!empty($basename)) {\n            $this->filepath .= '.' . $basename;\n        }\n        if ($_template->caching) {\n            $this->filepath .= '.cache';\n        }\n        $this->filepath .= '.php';\n        $this->timestamp = $this->exists = is_file($this->filepath);\n        if ($this->exists) {\n            $this->timestamp = filemtime($this->filepath);\n        }\n    }\n\n    /**\n     * render compiled template code\n     *\n     * @param Smarty_Internal_Template $_template\n     *\n     * @return string\n     * @throws Exception\n     */\n    public function render(Smarty_Internal_Template $_template)\n    {\n        // checks if template exists\n        if (!$_template->source->exists) {\n            $type = $_template->source->isConfig ? 'config' : 'template';\n            throw new SmartyException(\"Unable to load {$type} '{$_template->source->type}:{$_template->source->name}'\");\n        }\n        if ($_template->smarty->debugging) {\n            if (!isset($_template->smarty->_debug)) {\n                $_template->smarty->_debug = new Smarty_Internal_Debug();\n            }\n            $_template->smarty->_debug->start_render($_template);\n        }\n        if (!$this->processed) {\n            $this->process($_template);\n        }\n        if (isset($_template->cached)) {\n            $_template->cached->file_dependency =\n                array_merge($_template->cached->file_dependency, $this->file_dependency);\n        }\n        if ($_template->source->handler->uncompiled) {\n            $_template->source->handler->renderUncompiled($_template->source, $_template);\n        } else {\n            $this->getRenderedTemplateCode($_template);\n        }\n        if ($_template->caching && $this->has_nocache_code) {\n            $_template->cached->hashes[ $this->nocache_hash ] = true;\n        }\n        if ($_template->smarty->debugging) {\n            $_template->smarty->_debug->end_render($_template);\n        }\n    }\n\n    /**\n     * load compiled template or compile from source\n     *\n     * @param Smarty_Internal_Template $_smarty_tpl do not change variable name, is used by compiled template\n     *\n     * @throws Exception\n     */\n    public function process(Smarty_Internal_Template $_smarty_tpl)\n    {\n        $source = &$_smarty_tpl->source;\n        $smarty = &$_smarty_tpl->smarty;\n        if ($source->handler->recompiled) {\n            $source->handler->process($_smarty_tpl);\n        } else if (!$source->handler->uncompiled) {\n            if (!$this->exists || $smarty->force_compile ||\n                ($_smarty_tpl->compile_check && $source->getTimeStamp() > $this->getTimeStamp())\n            ) {\n                $this->compileTemplateSource($_smarty_tpl);\n                $compileCheck = $_smarty_tpl->compile_check;\n                $_smarty_tpl->compile_check = Smarty::COMPILECHECK_OFF;\n                $this->loadCompiledTemplate($_smarty_tpl);\n                $_smarty_tpl->compile_check = $compileCheck;\n            } else {\n                $_smarty_tpl->mustCompile = true;\n                @include($this->filepath);\n                if ($_smarty_tpl->mustCompile) {\n                    $this->compileTemplateSource($_smarty_tpl);\n                    $compileCheck = $_smarty_tpl->compile_check;\n                    $_smarty_tpl->compile_check = Smarty::COMPILECHECK_OFF;\n                    $this->loadCompiledTemplate($_smarty_tpl);\n                    $_smarty_tpl->compile_check = $compileCheck;\n                }\n            }\n            $_smarty_tpl->_subTemplateRegister();\n            $this->processed = true;\n        }\n    }\n\n    /**\n     * compile template from source\n     *\n     * @param Smarty_Internal_Template $_template\n     *\n     * @throws Exception\n     */\n    public function compileTemplateSource(Smarty_Internal_Template $_template)\n    {\n        $this->file_dependency = array();\n        $this->includes = array();\n        $this->nocache_hash = null;\n        $this->unifunc = null;\n        // compile locking\n        if ($saved_timestamp = (!$_template->source->handler->recompiled && is_file($this->filepath))) {\n            $saved_timestamp = $this->getTimeStamp();\n            touch($this->filepath);\n        }\n        // compile locking\n        try {\n            // call compiler\n            $_template->loadCompiler();\n            $this->write($_template, $_template->compiler->compileTemplate($_template));\n        }\n        catch (Exception $e) {\n            // restore old timestamp in case of error\n            if ($saved_timestamp && is_file($this->filepath)) {\n                touch($this->filepath, $saved_timestamp);\n            }\n            unset($_template->compiler);\n            throw $e;\n        }\n        // release compiler object to free memory\n        unset($_template->compiler);\n    }\n\n    /**\n     * Write compiled code by handler\n     *\n     * @param Smarty_Internal_Template $_template template object\n     * @param string                   $code      compiled code\n     *\n     * @return bool success\n     * @throws \\SmartyException\n     */\n    public function write(Smarty_Internal_Template $_template, $code)\n    {\n        if (!$_template->source->handler->recompiled) {\n            if ($_template->smarty->ext->_writeFile->writeFile($this->filepath, $code, $_template->smarty) === true) {\n                $this->timestamp = $this->exists = is_file($this->filepath);\n                if ($this->exists) {\n                    $this->timestamp = filemtime($this->filepath);\n                    return true;\n                }\n            }\n            return false;\n        }\n        return true;\n    }\n\n    /**\n     * Read compiled content from handler\n     *\n     * @param Smarty_Internal_Template $_template template object\n     *\n     * @return string content\n     */\n    public function read(Smarty_Internal_Template $_template)\n    {\n        if (!$_template->source->handler->recompiled) {\n            return file_get_contents($this->filepath);\n        }\n        return isset($this->content) ? $this->content : false;\n    }\n\n    /**\n     * Load fresh compiled template by including the PHP file\n     * HHVM requires a work around because of a PHP incompatibility\n     *\n     * @param \\Smarty_Internal_Template $_smarty_tpl do not change variable name, is used by compiled template\n     */\n    private function loadCompiledTemplate(Smarty_Internal_Template $_smarty_tpl)\n    {\n        if (function_exists('opcache_invalidate')\n            && (!function_exists('ini_get') || strlen(ini_get(\"opcache.restrict_api\")) < 1)\n        ) {\n            opcache_invalidate($this->filepath, true);\n        } else if (function_exists('apc_compile_file')) {\n            apc_compile_file($this->filepath);\n        }\n        if (defined('HHVM_VERSION')) {\n            eval('?>' . file_get_contents($this->filepath));\n        } else {\n            include($this->filepath);\n        }\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_template_config.php",
    "content": "<?php\n/**\n * Smarty Config Source Plugin\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Config Resource Data Object\n * Meta Data Container for Template Files\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Uwe Tews\n *\n */\nclass Smarty_Template_Config extends Smarty_Template_Source\n{\n    /**\n     * array of section names, single section or null\n     *\n     * @var null|string|array\n     */\n    public $config_sections = null;\n\n    /**\n     * scope into which the config variables shall be loaded\n     *\n     * @var int\n     */\n    public $scope = 0;\n\n    /**\n     * Flag that source is a config file\n     *\n     * @var bool\n     */\n    public $isConfig = true;\n\n    /**\n     * Name of the Class to compile this resource's contents with\n     *\n     * @var string\n     */\n    public $compiler_class = 'Smarty_Internal_Config_File_Compiler';\n\n    /**\n     * Name of the Class to tokenize this resource's contents with\n     *\n     * @var string\n     */\n    public $template_lexer_class = 'Smarty_Internal_Configfilelexer';\n\n    /**\n     * Name of the Class to parse this resource's contents with\n     *\n     * @var string\n     */\n    public $template_parser_class = 'Smarty_Internal_Configfileparser';\n\n    /**\n     * initialize Source Object for given resource\n     * Either [$_template] or [$smarty, $template_resource] must be specified\n     *\n     * @param  Smarty_Internal_Template $_template         template object\n     * @param  Smarty                   $smarty            smarty object\n     * @param  string                   $template_resource resource identifier\n     *\n     * @return Smarty_Template_Config Source Object\n     * @throws SmartyException\n     */\n    public static function load(Smarty_Internal_Template $_template = null, Smarty $smarty = null,\n                                $template_resource = null)\n    {\n        static $_incompatible_resources = array('extends' => true, 'php' => true);\n        if ($_template) {\n            $smarty = $_template->smarty;\n            $template_resource = $_template->template_resource;\n        }\n        if (empty($template_resource)) {\n            throw new SmartyException('Source: Missing  name');\n        }\n         // parse resource_name, load resource handler\n        list($name, $type) = Smarty_Resource::parseResourceName($template_resource, $smarty->default_config_type);\n        // make sure configs are not loaded via anything smarty can't handle\n        if (isset($_incompatible_resources[ $type ])) {\n            throw new SmartyException (\"Unable to use resource '{$type}' for config\");\n        }\n        $source = new Smarty_Template_Config($smarty, $template_resource, $type, $name);\n        $source->handler->populate($source, $_template);\n        if (!$source->exists && isset($smarty->default_config_handler_func)) {\n            Smarty_Internal_Method_RegisterDefaultTemplateHandler::_getDefaultTemplate($source);\n            $source->handler->populate($source, $_template);\n        }\n        return $source;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_template_resource_base.php",
    "content": "<?php\n\n/**\n * Smarty Template Resource Base Object\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Rodney Rehm\n */\nabstract class Smarty_Template_Resource_Base\n{\n    /**\n     * Compiled Filepath\n     *\n     * @var string\n     */\n    public $filepath = null;\n\n    /**\n     * Compiled Timestamp\n     *\n     * @var integer|bool\n     */\n    public $timestamp = false;\n\n    /**\n     * Compiled Existence\n     *\n     * @var boolean\n     */\n    public $exists = false;\n\n    /**\n     * Template Compile Id (Smarty_Internal_Template::$compile_id)\n     *\n     * @var string\n     */\n    public $compile_id = null;\n\n    /**\n     * Compiled Content Loaded\n     *\n     * @var boolean\n     */\n    public $processed = false;\n\n    /**\n     * unique function name for compiled template code\n     *\n     * @var string\n     */\n    public $unifunc = '';\n\n    /**\n     * flag if template does contain nocache code sections\n     *\n     * @var bool\n     */\n    public $has_nocache_code = false;\n\n    /**\n     * resource file dependency\n     *\n     * @var array\n     */\n    public $file_dependency = array();\n\n    /**\n     * Content buffer\n     *\n     * @var string\n     */\n    public $content = null;\n\n    /**\n     * required plugins\n     *\n     * @var array\n     */\n    public $required_plugins = array();\n\n    /**\n     * Included sub templates\n     * - index name\n     * - value use count\n     *\n     * @var int[]\n     */\n    public $includes = array();\n\n    /**\n     * Flag if this is a cache resource\n     *\n     * @var bool\n     */\n    public $isCache = false;\n\n    /**\n     * Process resource\n     *\n     * @param Smarty_Internal_Template $_template template object\n     */\n    abstract public function process(Smarty_Internal_Template $_template);\n\n    /**\n     * get rendered template content by calling compiled or cached template code\n     *\n     * @param \\Smarty_Internal_Template $_template\n     * @param string                    $unifunc function with template code\n     *\n     * @throws \\Exception\n     */\n    public function getRenderedTemplateCode(Smarty_Internal_Template $_template, $unifunc = null)\n    {\n        $smarty = &$_template->smarty;\n        $_template->isRenderingCache = $this->isCache;\n        $level = ob_get_level();\n        try {\n            if (!isset($unifunc)) {\n                $unifunc = $this->unifunc;\n            }\n            if (empty($unifunc) || !function_exists($unifunc)) {\n                throw new SmartyException(\"Invalid compiled template for '{$_template->template_resource}'\");\n            }\n            if ($_template->startRenderCallbacks) {\n                foreach ($_template->startRenderCallbacks as $callback) {\n                    call_user_func($callback, $_template);\n                }\n            }\n            $unifunc($_template);\n            foreach ($_template->endRenderCallbacks as $callback) {\n                call_user_func($callback, $_template);\n            }\n            $_template->isRenderingCache = false;\n        }\n        catch (Exception $e) {\n            $_template->isRenderingCache = false;\n            while (ob_get_level() > $level) {\n                ob_end_clean();\n            }\n            if (isset($smarty->security_policy)) {\n                $smarty->security_policy->endTemplate();\n            }\n            throw $e;\n        }\n    }\n\n    /**\n     * Get compiled time stamp\n     *\n     * @return int\n     */\n    public function getTimeStamp()\n    {\n        if ($this->exists && !$this->timestamp) {\n            $this->timestamp = filemtime($this->filepath);\n        }\n        return $this->timestamp;\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_template_source.php",
    "content": "<?php\n\n/**\n * Smarty Resource Data Object\n * Meta Data Container for Template Files\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Rodney Rehm\n *\n */\nclass Smarty_Template_Source\n{\n    /**\n     * Unique Template ID\n     *\n     * @var string\n     */\n    public $uid = null;\n\n    /**\n     * Template Resource (Smarty_Internal_Template::$template_resource)\n     *\n     * @var string\n     */\n    public $resource = null;\n\n    /**\n     * Resource Type\n     *\n     * @var string\n     */\n    public $type = null;\n\n    /**\n     * Resource Name\n     *\n     * @var string\n     */\n    public $name = null;\n\n    /**\n     * Source Filepath\n     *\n     * @var string\n     */\n    public $filepath = null;\n\n    /**\n     * Source Timestamp\n     *\n     * @var integer\n     */\n    public $timestamp = null;\n\n    /**\n     * Source Existence\n     *\n     * @var boolean\n     */\n    public $exists = false;\n\n    /**\n     * Source File Base name\n     *\n     * @var string\n     */\n    public $basename = null;\n\n    /**\n     * The Components an extended template is made of\n     *\n     * @var \\Smarty_Template_Source[]\n     */\n    public $components = null;\n\n    /**\n     * Resource Handler\n     *\n     * @var \\Smarty_Resource\n     */\n    public $handler = null;\n\n    /**\n     * Smarty instance\n     *\n     * @var Smarty\n     */\n    public $smarty = null;\n\n    /**\n     * Resource is source\n     *\n     * @var bool\n     */\n    public $isConfig = false;\n\n    /**\n     * Template source content eventually set by default handler\n     *\n     * @var string\n     */\n    public $content = null;\n\n    /**\n     * Name of the Class to compile this resource's contents with\n     *\n     * @var string\n     */\n    public $compiler_class = 'Smarty_Internal_SmartyTemplateCompiler';\n\n    /**\n     * Name of the Class to tokenize this resource's contents with\n     *\n     * @var string\n     */\n    public $template_lexer_class = 'Smarty_Internal_Templatelexer';\n\n    /**\n     * Name of the Class to parse this resource's contents with\n     *\n     * @var string\n     */\n    public $template_parser_class = 'Smarty_Internal_Templateparser';\n\n    /**\n     * create Source Object container\n     *\n     * @param Smarty $smarty   Smarty instance this source object belongs to\n     * @param string $resource full template_resource\n     * @param string $type     type of resource\n     * @param string $name     resource name\n     *\n     * @throws \\SmartyException\n     * @internal param \\Smarty_Resource $handler Resource Handler this source object communicates with\n     */\n    public function __construct(Smarty $smarty, $resource, $type, $name)\n    {\n        $this->handler =\n            isset($smarty->_cache[ 'resource_handlers' ][ $type ]) ? $smarty->_cache[ 'resource_handlers' ][ $type ] :\n                Smarty_Resource::load($smarty, $type);\n        $this->smarty = $smarty;\n        $this->resource = $resource;\n        $this->type = $type;\n        $this->name = $name;\n    }\n\n    /**\n     * initialize Source Object for given resource\n     * Either [$_template] or [$smarty, $template_resource] must be specified\n     *\n     * @param  Smarty_Internal_Template $_template         template object\n     * @param  Smarty                   $smarty            smarty object\n     * @param  string                   $template_resource resource identifier\n     *\n     * @return Smarty_Template_Source Source Object\n     * @throws SmartyException\n     */\n    public static function load(Smarty_Internal_Template $_template = null, Smarty $smarty = null,\n                                $template_resource = null)\n    {\n        if ($_template) {\n            $smarty = $_template->smarty;\n            $template_resource = $_template->template_resource;\n        }\n        if (empty($template_resource)) {\n            throw new SmartyException('Source: Missing  name');\n        }\n        // parse resource_name, load resource handler, identify unique resource name\n        if (preg_match('/^([A-Za-z0-9_\\-]{2,})[:]([\\s\\S]*)$/', $template_resource, $match)) {\n            $type = $match[ 1 ];\n            $name = $match[ 2 ];\n        } else {\n            // no resource given, use default\n            // or single character before the colon is not a resource type, but part of the filepath\n            $type = $smarty->default_resource_type;\n            $name = $template_resource;\n        }\n        // create new source  object\n        $source = new Smarty_Template_Source($smarty, $template_resource, $type, $name);\n        $source->handler->populate($source, $_template);\n        if (!$source->exists && isset($_template->smarty->default_template_handler_func)) {\n            Smarty_Internal_Method_RegisterDefaultTemplateHandler::_getDefaultTemplate($source);\n            $source->handler->populate($source, $_template);\n        }\n        return $source;\n    }\n\n    /**\n     * Get source time stamp\n     *\n     * @return int\n     */\n    public function getTimeStamp()\n    {\n        if (!isset($this->timestamp)) {\n            $this->handler->populateTimestamp($this);\n        }\n        return $this->timestamp;\n    }\n\n    /**\n     * Get source content\n     *\n     * @return string\n     * @throws \\SmartyException\n     */\n    public function getContent()\n    {\n        return isset($this->content) ? $this->content : $this->handler->getContent($this);\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_undefined_variable.php",
    "content": "<?php\n\n/**\n * class for undefined variable object\n * This class defines an object for undefined variable handling\n *\n * @package    Smarty\n * @subpackage Template\n */\nclass Smarty_Undefined_Variable extends Smarty_Variable\n{\n    /**\n     * Returns null for not existing properties\n     *\n     * @param  string $name\n     *\n     * @return null\n     */\n    public function __get($name)\n    {\n            return null;\n    }\n\n    /**\n     * Always returns an empty string.\n     *\n     * @return string\n     */\n    public function __toString()\n    {\n        return '';\n    }\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smarty_variable.php",
    "content": "<?php\n\n/**\n * class for the Smarty variable object\n * This class defines the Smarty variable object\n *\n * @package    Smarty\n * @subpackage Template\n */\nclass Smarty_Variable\n{\n    /**\n     * template variable\n     *\n     * @var mixed\n     */\n    public $value = null;\n\n    /**\n     * if true any output of this variable will be not cached\n     *\n     * @var boolean\n     */\n    public $nocache = false;\n\n    /**\n     * create Smarty variable object\n     *\n     * @param mixed   $value   the value to assign\n     * @param boolean $nocache if true any output of this variable will be not cached\n     */\n    public function __construct($value = null, $nocache = false)\n    {\n        $this->value = $value;\n        $this->nocache = $nocache;\n    }\n\n    /**\n     * <<magic>> String conversion\n     *\n     * @return string\n     */\n    public function __toString()\n    {\n        return (string) $this->value;\n    }\n}\n\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smartycompilerexception.php",
    "content": "<?php\n\n/**\n * Smarty compiler exception class\n *\n * @package Smarty\n */\nclass SmartyCompilerException extends SmartyException\n{\n    /**\n     * @return string\n     */\n    public function __toString()\n    {\n        return ' --> Smarty Compiler: ' . $this->message . ' <-- ';\n    }\n\n    /**\n     * The line number of the template error\n     *\n     * @type int|null\n     */\n    public $line = null;\n\n    /**\n     * The template source snippet relating to the error\n     *\n     * @type string|null\n     */\n    public $source = null;\n\n    /**\n     * The raw text of the error message\n     *\n     * @type string|null\n     */\n    public $desc = null;\n\n    /**\n     * The resource identifier or template name\n     *\n     * @type string|null\n     */\n    public $template = null;\n}\n"
  },
  {
    "path": "Extend/Package/smarty/sysplugins/smartyexception.php",
    "content": "<?php\n\n/**\n * Smarty exception class\n *\n * @package Smarty\n */\nclass SmartyException extends Exception\n{\n    public static $escape = false;\n\n    /**\n     * @return string\n     */\n    public function __toString()\n    {\n        return ' --> Smarty: ' . (self::$escape ? htmlentities($this->message) : $this->message) . ' <-- ';\n    }\n}\n"
  },
  {
    "path": "Framework/Config/frame.cfg.php",
    "content": "<?php\n\n/**\n * 系统基础配置\n */\nreturn [\n\n    /**\n     * 日志基础配置\n     */\n    'log' => [\n\n        /**\n         * 是否开启日志记录\n         */\n        'error_switch' => true,\n\n        /**\n         * 记录错误级别(E_ERROR|E_WARNING|E_PARSE)\n         * 全部错误(E_ALL)\n         * 致命错误(E_ERROR)\n         * 运行警告(E_WARNING)\n         * 语法错误(E_PARSE)\n         * 其他通知(E_NOTICE)\n         * 更多错误级别请参照(http://php.net/manual/zh/errorfunc.constants.php)\n         */\n        'error_level' => 'E_ALL'\n    ],\n\n    /**\n     * 异常处理配置\n     */\n    'Exception' => [\n\n        /**\n         * 是否开启异常显示\n         */\n        'display_switch' => true,\n\n        /**\n         * 显示错误的级别(E_ERROR|E_WARNING|E_PARSE)\n         * 全部错误(E_ALL)\n         * 致命错误(E_ERROR)\n         * 运行警告(E_WARNING)\n         * 语法错误(E_PARSE)\n         * 其他通知(E_NOTICE)\n         * 更多错误级别请参照(http://php.net/manual/zh/errorfunc.constants.php)\n         */\n        'display_level' => 'E_ALL'\n    ],\n\n    /**\n     * 访问信息配置\n     */\n    'Visit' => [\n\n        /**\n         * 默认加载实例的命名空间前缀(不建议修改)\n         */\n        'namespace' => 'App',\n\n        /**\n         * 默认实例名称\n         */\n        'Project' => 'Home',\n\n        /**\n         * 默认控制器名称\n         */\n        'Controller' => 'Index',\n\n        /**\n         * 默认方法名称\n         */\n        'Function' => 'index',\n\n        /**\n         * 静态扩展名\n         */\n        'extend' => '.html'\n    ],\n\n    /**\n     * 参数请求\n     */\n    'Parameter' => [\n\n        /**\n         * 默认实例key\n         */\n        'Project' => 'p',\n\n        /**\n         * 默认控制器key\n         */\n        'Controller' => 'c',\n\n        /**\n         * 默认方法key\n         */\n        'Function' => 'f',\n    ],\n\n    'View' => [\n\n        /**\n         * 模板左标记\n         */\n        'left_delimiter' => '_{',\n\n        /**\n         * 模板右标记\n         */\n        'right_delimiter' => '}_',\n\n        /**\n         * 是否启用缓存\n         */\n        'is_cache' => true,\n\n        /**\n         * 缓存周期\n         */\n        'cache_lifetime' => '0',\n    ]\n\n];"
  },
  {
    "path": "Framework/Library/Common/helper.php",
    "content": "<?php\n\n/**\n * 自定义dump\n * @param string $vars 打印的变量\n * @param string $label 追加标签\n * @param bool $return 是否直接返回\n * @return null|string\n */\nfunction dump($vars, $label = '', $return = false)\n{\n    if (ini_get('html_errors')) {\n        $content = \"<pre>\\n\";\n        if (!empty($label)) {\n            $content .= \"<strong>{$label} :</strong>\\n\";\n        }\n        $content .= htmlspecialchars(print_r($vars, true));\n        $content .= \"\\n</pre>\\n\";\n    } else {\n        $content = $label . \" :\\n\" . print_r($vars, true);\n    }\n    if ($return) {\n        return $content;\n    }\n    echo $content;\n    return null;\n}\n\n/**\n * 数据模型操作\n * @param string $table 操作的表名\n * @param null|array $config 操作的配置对象\n * @return \\Framework\\Library\\Interfaces\\DbInterface|bool|null\n */\nfunction Db($table = '', $config = null)\n{\n    /**\n     * @var \\Framework\\Library\\Process\\Db|\\Framework\\Library\\Process\\Drive\\Db\\Mysqli $link\n     */\n    $Db = \\Framework\\App::$app->get('Db')->getlink();\n    if (is_array($Db) && count($Db) > 0) {\n        if (is_null($config)) {\n            $link = current($Db);\n            $link = $link['obj']->setlink($link['link']);\n        }\n        if (!empty($Db[$config])){\n            $link = $Db[$config]['obj']->setlink($Db[$config]['link']);\n        }\n        if (isset($link)) {\n            if (empty($table)) return $link;\n            return $link->table($table);\n        }\n        return false;\n    } else {\n        \\Framework\\App::$app->get('LogicExceptions')->readErrorFile([\n            'message' => \"您操作了数据库,但是没有发现有效的数据库配置!\"\n        ]);\n        return null;\n    }\n}\n\n\n/**\n * 读取配置信息\n * @param string $configName 配置名称\n * @return \\Framework\\Library\\Interfaces\\ConfigInterface|bool\n */\nfunction Config($configName)\n{\n    if (empty($configName)) return false;\n    return \\Framework\\App::$app->get('Config')->get($configName);\n}\n\n/**\n * 缓存模型操作\n * @return \\Framework\\Library\\Interfaces\\CacheInterface|bool\n */\nfunction Cache()\n{\n    $Cache = \\Framework\\App::$app->get('Cache');\n    return $Cache->init()->getObj();\n}\n\n/**\n * 渲染视图信息\n * @param string $fileName 模板文件名\n * @param string $dir 其他模板文件\n * @return \\Framework\\Library\\Interfaces\\ViewInterface|bool\n */\nfunction View($fileName = '', $dir = '')\n{\n    /**\n     * @var \\Framework\\Library\\Process\\View $Object\n     */\n    $Object = \\Framework\\App::$app->get('View')->init();\n    if (empty($fileName) && empty($dir)) return $Object;\n    if (empty($dir) && !empty($fileName)) {\n        $ViewPath = \\Framework\\Library\\Process\\Running::$framworkPath . 'Project/view';\n        $fileName = $ViewPath . '/' . $fileName . '.html';\n    } else {\n        $fileName = $dir;\n    }\n    if (!file_exists($fileName)) {\n        $fileName = str_replace('\\\\', '/', $fileName);\n        \\Framework\\App::$app->get('LogicExceptions')->readErrorFile([\n            'file' => __FILE__,\n            'message' => \"[$fileName] 请检查您的模板是否存在!\",\n        ]);\n    }\n    $Object->set($fileName);\n    return $Object;\n}\n\n/**\n * 获取GET值\n * @param $value\n * @param string $null\n * @return string|int|null\n */\nfunction get($value, $null = '')\n{\n    return \\Framework\\Library\\Process\\Tool::Receive('get.' . $value, $null);\n}\n\n/**\n * 获取POST值\n * @param $value\n * @param string $null\n * @return string|int|null\n */\nfunction post($value, $null = '')\n{\n    return \\Framework\\Library\\Process\\Tool::Receive('post.' . $value, $null);\n}\n\n/**\n * 动态载入扩展\n * @param string $name 扩展文件名称(可传递数组)\n * @param int $type 是否为包(0=扩展文件,1=扩展包)\n * @return bool\n */\nfunction extend($name, $type = 0)\n{\n    $Extend = \\Framework\\App::$app->get('Extend');\n    if (!empty($name) && is_array($name)) {\n        foreach ($name as $value) {\n            if ($type == 1) {\n                $Extend->addPackage($value);\n            } else {\n                $Extend->addClass($value);\n            }\n        }\n        return true;\n    }\n    if ($type == 1) {\n        return $Extend->addPackage($name);\n    }\n    return $Extend->addClass($name);\n}\n\n/**\n * 获取系统应用实例对象\n * @return \\Framework\\App|Object\n */\nfunction getApp()\n{\n    return \\Framework\\App::$app;\n}\n\n/**\n * 展示成功状态页\n * @param string $msg 提示内容\n * @param string $url 跳转的地址\n * @param int $seconds 跳转的秒数\n * @param string $title 提示页标题\n */\nfunction Success($msg = '操作成功', $url = '', $seconds = 3, $title = '系统提示')\n{\n    \\Framework\\App::$app->get('LogicExceptions')->displayed('success', [\n        'title' => $title,\n        'second' => $seconds,\n        'url' => $url,\n        'message' => $title,\n        'describe' => $msg\n    ]);\n}\n\n/**\n * 展示成功状态页\n * @param string $msg 提示内容\n * @param string $url 跳转的地址\n * @param int $seconds 跳转的秒数\n * @param string $title 提示页标题\n */\nfunction Error($msg = '操作异常', $url = '', $seconds = 3, $title = '系统提示')\n{\n    \\Framework\\App::$app->get('LogicExceptions')->displayed('error', [\n        'title' => $title,\n        'second' => $seconds,\n        'url' => $url,\n        'message' => $title,\n        'describe' => $msg\n    ]);\n}\n\n/**\n * Session操作\n * @return \\Framework\\Library\\Interfaces\\SessionInterface\n */\nfunction Session()\n{\n    $Session = \\Framework\\App::$app->get('Session');\n    $Session->start();\n    return $Session;\n}\n\n/**\n * 操作cookie\n * @param string $name key名称\n * @param string $val value值\n * @param string $expire 过期时间\n * @return bool|null|string\n */\nfunction Cookie($name = '', $val = '', $expire = '0')\n{\n    $prefix = 'PHP300_';\n    if ($name === '') {\n        return $_COOKIE;\n    }\n    if ($name != '' && $val === '') {\n        return (!empty($_COOKIE[$prefix . $name])) ? ($_COOKIE[$prefix . $name]) : (NULL);\n    }\n    if ($name && $val) {\n        return setcookie($prefix . $name, $val, $expire);\n    }\n    if ($name && is_null($val)) {\n        return setcookie($prefix . $name, $val, time() - 1);\n    }\n    if (is_null($name) && is_null($val)) {\n        $_COOKIE = NULL;\n    }\n    return false;\n}\n\n/**\n * 操作日志\n * @param string $logs 日志内容\n * @param string $name 日志文件名称\n * @param string $path 日志文件文件夹\n * @return bool\n */\nfunction logs($logs = '', $name = 'logs', $path = 'MyLog')\n{\n    if (!empty($logs)) {\n        return \\Framework\\App::$app->get('Log')->Record($path, $name, $logs);\n    }\n    return false;\n}"
  },
  {
    "path": "Framework/Library/Interfaces/CacheInterface.php",
    "content": "<?php\n\nnamespace Framework\\Library\\Interfaces;\n\n/**\n * 缓存接口\n * Interface CacheInterface\n * @package Framework\\Library\\Interfaces\n */\ninterface CacheInterface\n{\n\n    /**\n     * 连接缓存服务器\n     * @param string $ip 服务器IP\n     * @param string|int $port 服务器端口\n     * @param array $auth 授权信息\n     * @return mixed\n     */\n    public function connect($ip, $port, $auth = []);\n\n    /**\n     * 获取一个缓存标识\n     * @param string $key 获取的键名称\n     * @return mixed|string|array\n     */\n    public function get($key);\n\n    /**\n     * 设定一个缓存标识\n     * @param string $key 键名称\n     * @param string|array $value 设置的值内容\n     * @param bool $isZip 是否启用压缩\n     * @param int $expire 缓存的周期\n     * @return mixed|bool\n     */\n    public function set($key, $value, $isZip = false, $expire = 3600);\n\n    /**\n     * 删除一个标识\n     * @param string $key 删除的键名称\n     * @param int $timeout 延迟删除(默认为0立即删除)\n     * @return mixed|bool\n     */\n    public function delete($key, $timeout = 0);\n\n    /**\n     * 替换标识\n     * @param string $key 替换的键名称\n     * @param string|array $value 替换的值内容\n     * @param bool $isZip 是否启用压缩\n     * @param int $expire 缓存的周期\n     * @return mixed|bool\n     */\n    public function replace($key, $value, $isZip = false, $expire = 3600);\n\n    /**\n     * 检查值是否存在\n     * @param string $key 检查的键名称\n     * @return mixed|bool\n     */\n    public function exists($key);\n\n    /**\n     * 重置所有标识\n     * @return mixed\n     */\n    public function flush();\n\n    /**\n     * 减少标识的值\n     * @param string $key 减少的键名称\n     * @param int $number\n     * @return mixed\n     */\n    public function decrement($key, $number = 1);\n\n    /**\n     * 增加标识的值\n     * @param string $key 增加的键名称\n     * @param int $number\n     * @return mixed\n     */\n    public function increment($key, $number = 1);\n\n    /**\n     * 获得版本号\n     * @return mixed|string\n     */\n    public function getVersion();\n\n    /**\n     * 获取服务器统计信息\n     * @return mixed\n     */\n    public function getStats();\n\n    /**\n     * 关闭与缓存服务器的连接\n     * @return mixed\n     */\n    public function close();\n}\n"
  },
  {
    "path": "Framework/Library/Interfaces/ConfigInterface.php",
    "content": "<?php\n\nnamespace Framework\\Library\\Interfaces;\n\n/**\n * 配置处理接口\n * Interface ConfigInterface\n * @package Framework\\Library\\Interfaces\n */\ninterface ConfigInterface\n{\n\n    /**\n     * 读取配置\n     * @param string $keys 获取的键名称\n     * @return mixed|string|array\n     */\n    public function get($keys);\n\n    /**\n     * 设置数据\n     * @param string $key 设置的键名称\n     * @param string|array $val 设置的值内容\n     * @return mixed|string|array\n     */\n    public function set($key, $val);\n}"
  },
  {
    "path": "Framework/Library/Interfaces/DbInterface.php",
    "content": "<?php\n\nnamespace Framework\\Library\\Interfaces;\nuse Framework\\Library\\Process\\Db;\n\n/**\n * 数据基础模型接口\n * Interface DbInterface\n * @package Framework\\Library\\Interfaces\n */\ninterface DbInterface\n{\n\n    /**\n     * 获取错误信息\n     * @return mixed\n     */\n    public function getError();\n\n    /**\n     * 连接数据库\n     * @param array $config 配置信息\n     * @return mixed\n     */\n    public function connect($config = []);\n\n    /**\n     * 执行SQL\n     * @param string $queryString 执行的SQL语句\n     * @param bool $select 是否系统查询\n     * @return mixed|self\n     */\n    public function query($queryString, $select = false);\n\n    /**\n     * 设置表\n     * @param string $tabName 表名称\n     * @return self\n     */\n    public function table($tabName);\n\n    /**\n     * 查询数据\n     * @param array $qryArray 条件信息\n     * @return self\n     */\n    public function select($qryArray = []);\n\n    /**\n     * 新增数据\n     * @param array $dataArray 插入的数据\n     * @return bool|int\n     */\n    public function insert($dataArray = []);\n\n    /**\n     * 新增数据\n     * @param array $dataArray 插入的数据\n     * @return bool|int\n     */\n    public function add($dataArray = []);\n\n    /**\n     * 修改数据\n     * @param array $dataArray 修改的数据\n     * @param array|string $where 修改条件\n     * @return mixed|bool|int\n     */\n    public function update($dataArray = [], $where = []);\n\n    /**\n     * 修改数据\n     * @param array $dataArray 修改的数据\n     * @param array|string $where 修改条件\n     * @return mixed|int\n     */\n    public function save($dataArray = [], $where = []);\n\n    /**\n     * 删除数据\n     * @param array|string $where 删除的条件\n     * @return bool\n     */\n    public function delete($where = []);\n\n    /**\n     * 删除数据\n     * @param array|string $where 删除的条件\n     * @return bool\n     */\n    public function del($where = []);\n\n    /**\n     * 打印调试信息\n     * @return mixed|array\n     */\n    public function debug();\n\n    /**\n     * 获取单条记录\n     * @return mixed|array\n     */\n    public function find();\n\n    /**\n     * 获取多条记录\n     * @return mixed|array\n     */\n    public function get();\n\n    /**\n     * 获取影响的条数\n     * @return int\n     */\n    public function total();\n}"
  },
  {
    "path": "Framework/Library/Interfaces/LogInterface.php",
    "content": "<?php\n\nnamespace Framework\\Library\\Interfaces;\n\n/**\n * 日志接口\n * Interface LogInterface\n * @package Framework\\Library\\Interfaces\n */\ninterface  LogInterface\n{\n    /**\n     * 写出日志\n     * @param string $LogPath 日志文件路径\n     * @param string $fileName 日志文件名\n     * @param string $Log 日志内容\n     * @return mixed\n     */\n    public function Record($LogPath, $fileName, $Log);\n}\n"
  },
  {
    "path": "Framework/Library/Interfaces/LogicExceptionsInterface.php",
    "content": "<?php\n\nnamespace Framework\\Library\\Interfaces;\n\n/**\n * 异常处理接口\n * Interface LogicExceptionsInterface\n * @package Framework\\Library\\Interfaces\n */\ninterface  LogicExceptionsInterface\n{\n    /**\n     * 挂载异常钩子\n     */\n    public function Mount();\n\n}"
  },
  {
    "path": "Framework/Library/Interfaces/RouterInterface.php",
    "content": "<?php\n\nnamespace Framework\\Library\\Interfaces;\n\n/**\n * 路由接口\n * Interface RouterInterface\n * @package Framework\\Library\\Interfaces\n */\ninterface  RouterInterface\n{\n    /**\n     * 路由方法\n     * @return mixed\n     */\n    public function Route();\n}\n"
  },
  {
    "path": "Framework/Library/Interfaces/SessionInterface.php",
    "content": "<?php\r\n\r\nnamespace Framework\\Library\\Interfaces;\r\n\r\n/**\r\n * Session接口\r\n * Interface SessionInterface\r\n * @package Framework\\Library\\Interfaces\r\n */\r\ninterface SessionInterface\r\n{\r\n    /**\r\n     * 启动session\r\n     * @return mixed\r\n     */\r\n    public function start();\r\n\r\n    /**\r\n     * 获取session\r\n     * @param string $name 获取的键名称\r\n     * @return mixed|string|array\r\n     */\r\n    public function get($name='');\r\n\r\n    /**\r\n     * 设置session\r\n     * @param string $name 设置的键名称\r\n     * @param string|array $value 设置的值\r\n     * @return mixed\r\n     */\r\n    public function set($name='php300',$value='');\r\n\r\n    /**\r\n     * 删除session\r\n     * @param string $name 删除的键名称\r\n     * @return mixed\r\n     */\r\n    public function del($name='');\r\n}"
  },
  {
    "path": "Framework/Library/Interfaces/ViewInterface.php",
    "content": "<?php\n\nnamespace Framework\\Library\\Interfaces;\n\n/**\n * 视图接口\n * Interface ViewInterface\n * @package Framework\\Library\\Interfaces\n */\ninterface ViewInterface\n{\n    /**\n     * 初始化视图\n     * @return mixed\n     */\n    public function init();\n\n    /**\n     * 设定操作文件\n     * @param string $fileName 文件名称\n     * @return mixed\n     */\n    public function set($fileName);\n\n    /**\n     * 获取渲染内容\n     * @return mixed|string\n     */\n    public function get();\n\n    /**\n     * 获取视图原型\n     * @return mixed|object\n     */\n    public function getView();\n\n    /**\n     * 赋值变量\n     * @param null|array $data 设置的变量数组\n     * @return mixed|self\n     */\n    public function data($data = null);\n}"
  },
  {
    "path": "Framework/Library/Interfaces/VisitInterface.php",
    "content": "<?php\n\nnamespace Framework\\Library\\Interfaces;\n\n/**\n * 访问处理接口\n * Interface VisitInterface\n * @package Framework\\Library\\Interfaces\n */\n\ninterface  VisitInterface\n{\n    /**\n     * 绑定数默认实例\n     * @param array $param 配置数组\n     * @return mixed\n     */\n    public function bind($param);\n}\n"
  },
  {
    "path": "Framework/Library/Process/Cache.class.php",
    "content": "<?php\nnamespace Framework\\Library\\Process;\n\nuse Framework\\App;\n\n/**\n * 缓存器\n * Class Cache\n * @package Framework\\Library\\Process\n */\nclass Cache\n{\n\n    /**\n     * @var object 操作对象\n     */\n    private $object;\n\n    /**\n     * @var array 数据库驱动映射\n     */\n    private $CacheType = [\n\n        'memcache' => 'Drive\\Cache\\Memcache',\n\n        'redis' => 'Drive\\Cache\\Redis',\n\n        'file' => 'Drive\\Cache\\File'\n    ];\n\n    /**\n     * 初始化缓存配置\n     */\n    public function init()\n    {\n        $CacheConfig = Config::$AppConfig['cache'];\n        if (is_array($CacheConfig) && isset($CacheConfig['ip'])) {\n            $this->object = App::$app->get($this->CacheType[strtolower($CacheConfig['cacheType'])]);\n            if(strtolower($CacheConfig['cacheType']) != 'file'){\n                $this->object->connect($CacheConfig['ip'], $CacheConfig['port']);\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * 获取操作对象实例\n     * @return object\n     */\n    public function getObj()\n    {\n        return $this->object;\n    }\n}"
  },
  {
    "path": "Framework/Library/Process/Config.class.php",
    "content": "<?php\n\nnamespace Framework\\Library\\Process;\n\nuse Framework\\App;\nuse \\Framework\\Library\\Interfaces\\ConfigInterface as ConfigInterfaces;\n\n/**\n * 配置处理器\n * Class Config\n * @package Framework\\Library\\Process\n */\nclass Config implements ConfigInterfaces\n{\n\n    /**\n     * @var string 配置路径\n     */\n    private $ConfigPath;\n\n    /**\n     * @var array 配置容器\n     */\n    private $Config = [];\n\n    /**\n     * @var array 应用配置\n     */\n    static public $AppConfig = [];\n\n    /**\n     * 初始化配置信息\n     * Config constructor.\n     */\n    public function __construct()\n    {\n        $this-> ConfigPath = Running::$framworkPath . 'Project/config';\n        if (!file_exists($this->ConfigPath)) {\n            App::$app->get('Structure')->createDir($this->ConfigPath);\n        } else {\n            $fileList = App::$app->get('Structure')->getDir($this->ConfigPath);\n            if (is_array($fileList)) {\n                foreach ($fileList as $key => $value) {\n                    if (strpos(strtolower($value), '.cfg.php')) {\n                        $this->read(str_replace('.cfg.php', '', $value), $this->ConfigPath . '/' . $value);\n                    }\n                }\n                if(isset($this->Config['App'])){\n                    self::$AppConfig = $this->Config['App'];\n                }\n            }\n        }\n        $this->loadFrameconf();\n    }\n\n    /**\n     * 读取配置文件\n     * @param string $configName\n     * @param string $filePath\n     */\n    private function read($configName = '', $filePath = '')\n    {\n        if (is_file($filePath)) $this->Config[$configName] = include_once $filePath;\n    }\n\n    /**\n     * 获取配置项\n     * @param $keys\n     * @return mixed\n     */\n    public function get($keys = null)\n    {\n        if (is_null($keys)) return $this->Config;\n        if (count($this->Config) > 0 && !empty($keys) && isset($this->Config[$keys])) {\n            return $this->Config[$keys];\n        }\n        return false;\n    }\n\n    /**\n     * 设置临时配置项\n     * @param $key\n     * @param $val\n     */\n    public function set($key, $val)\n    {\n        if (!empty($key) && isset($val)) {\n            $this->Config[] = [$key => $val];\n        }\n    }\n\n    /**\n     * 加载框架配置文件\n     */\n    private function loadFrameconf()\n    {\n        $this->read('frame', App::$app->corePath . 'Config/frame.cfg.php');\n    }\n}"
  },
  {
    "path": "Framework/Library/Process/Db.class.php",
    "content": "<?php\n\nnamespace Framework\\Library\\Process;\n\nuse Framework\\App;\n/**\n * 数据基础模型\n * Class Db\n * @package Framework\\Library\\Process\n */\nclass Db\n{\n\n    /**\n     * @var array 数据库连接标识组\n     */\n    private $link = [];\n\n    /**\n     * @var string 操作库对象\n     */\n    private $db = '';\n\n    /**\n     * @var array 数据库驱动映射\n     */\n    private $dbType = [\n\n        'mysqli' => 'Drive\\Db\\Mysqli',\n\n        'pdo' => 'Drive\\Db\\Pdo'\n    ];\n\n    /**\n     * 构造方法\n     * Db constructor\n     */\n    public function __construct()\n    {\n        $this->init(Config::$AppConfig['db']);\n    }\n\n    /**\n     * 初始化数据库连接\n     * @param array $configArr\n     */\n    public function init($configArr = [])\n    {\n        if (is_array($configArr)) {\n            foreach ($configArr as $key => $value) {\n                $this->addlink($key, $value);\n            }\n        }\n    }\n\n    /**\n     * 添加连接信息\n     * @param $name\n     * @param $config\n     */\n    private function addlink($name, $config)\n    {\n        if (!empty($name) && is_array($config) && $config['connect'] === true) {\n            if (isset($config['dbType']) && isset($this->dbType[strtolower($config['dbType'])]) && isset($config['username'])) {\n                if (!isset($this->link[$name])) {\n                    $this->db = \\Framework\\App::$app->get($this->dbType[strtolower($config['dbType'])]);\n                    $this->putlink($name, ['obj' => $this->db, 'link' => $this->db->connect($config)]);\n                }\n            }\n        }\n    }\n\n    /**\n     * 压入连接\n     * @param $link\n     */\n    private function putlink($name, $link)\n    {\n        $this->link[$name] = $link;\n    }\n\n    /**\n     * 获取所有建立的连接\n     * @return array\n     */\n    public function getlink()\n    {\n        return $this->link;\n    }\n\n}"
  },
  {
    "path": "Framework/Library/Process/Drive/Cache/File.php",
    "content": "<?php\n\nnamespace Framework\\Library\\Process\\Drive\\Cache;\nuse Framework\\Library\\Process\\Running;\n\n/**\n * 文件缓存类\n * Class File\n * @package Framework\\Library\\Process\\Drive\\Cache\n */\nclass File\n{\n    /**\n     * 缓存目录\n     * @var string\n     */\n    private $cache_dir = '';\n\n    /**\n     * 构造方法\n     * File constructor.\n     * @param array $options\n     */\n    public function __construct(array $options = array())\n    {\n        $this->cache_dir = Running::$framworkPath.'/Project/runtime/tmp';\n        $available_options = array('cache_dir');\n        foreach ($available_options as $name) {\n            if (isset($options[$name])) {\n                $this->$name = $options[$name];\n            }\n        }\n    }\n\n    /**\n     * 获取缓存\n     * @param $id\n     * @return bool|mixed\n     */\n    public function get($id)\n    {\n        $file_name = $this->getFileName($id);\n        if (!is_file($file_name) || !is_readable($file_name)) {\n            return false;\n        }\n        $lines = file($file_name);\n        $lifetime = array_shift($lines);\n        $lifetime = (int)trim($lifetime);\n        if ($lifetime !== 0 && $lifetime < time()) {\n            @unlink($file_name);\n            return false;\n        }\n        $serialized = join('', $lines);\n        $data = unserialize($serialized);\n        return $data;\n    }\n\n    /**\n     * 获取文件名称\n     * @param $id\n     * @return string\n     */\n    protected function getFileName($id)\n    {\n        $directory = $this->getDirectory($id);\n        $hash = sha1($id, false);\n        $file = $directory . DIRECTORY_SEPARATOR . $hash . '.cache';\n        return $file;\n    }\n\n    /**\n     * 获取目录\n     * @param $id\n     * @return string\n     */\n    protected function getDirectory($id)\n    {\n        $hash = sha1($id, false);\n        $dirs = array(\n            $this->getCacheDirectory(),\n            substr($hash, 0, 2),\n            substr($hash, 2, 2)\n        );\n        return join(DIRECTORY_SEPARATOR, $dirs);\n    }\n\n    /**\n     * 获取缓存目录\n     * @return string\n     */\n    protected function getCacheDirectory()\n    {\n        return $this->cache_dir;\n    }\n\n    /**\n     * 删除缓存\n     * @param $id\n     * @return bool\n     */\n    public function delete($id)\n    {\n        $file_name = $this->getFileName($id);\n\t\tif(is_file($file_name)){\n\t\t\treturn unlink($file_name);\n\t\t}\n        return false;\n    }\n\n    /**\n     * 保存缓存\n     * @param $id\n     * @param $data\n     * @param int $lifetime\n     * @return bool\n     */\n    public function set($id, $data, $lifetime = 3600)\n    {\n        $dir = $this->getDirectory($id);\n        if (!is_dir($dir)) {\n            if (!mkdir($dir, 0755, true)) {\n                return false;\n            }\n        }\n        $file_name = $this->getFileName($id);\n        $lifetime = time() + $lifetime;\n        $serialized = serialize($data);\n        $result = file_put_contents($file_name, $lifetime . PHP_EOL . $serialized);\n        if ($result === false) {\n            return false;\n        }\n        return true;\n    }\n}"
  },
  {
    "path": "Framework/Library/Process/Drive/Cache/Memcache.php",
    "content": "<?php\n\nnamespace Framework\\Library\\Process\\Drive\\Cache;\n\nuse \\Framework\\Library\\Interfaces\\CacheInterface as CacheInterfaces;\n\n/**\n * Class Memcache\n * @package Framework\\Library\\Process\\Drive\\Cache\n */\nclass Memcache implements CacheInterfaces\n{\n\n    /**\n     * 建立连接\n     * @var null\n     */\n    protected $link = null;\n\n    /**\n     * 实例对象\n     * @var\n     */\n    private $obj;\n\n\n    /**\n     * 构造方法\n     * Memcache constructor.\n     */\n    public function __construct()\n    {\n        $this->obj = new \\Memcache();\n    }\n\n    /**\n     * 连接缓存服务器\n     * @param string $ip 服务器IP\n     * @param int|string $port 服务器端口\n     * @param array $auth 授权信息\n     * @return mixed|void\n     */\n    public function connect($ip, $port, $auth = [])\n    {\n        $this->obj->connect($ip, $port);\n    }\n\n    /**\n     * 获取一个缓存标识\n     * @param $key\n     * @return mixed\n     */\n    public function get($key)\n    {\n        if (!empty($key)) {\n            return $this->obj->get($key);\n        }\n        return false;\n    }\n\n    /**\n     * 设定一个缓存标识\n     * @param string $key 缓存key\n     * @param string|array $value 缓存value\n     * @param bool $iszip 是否压缩\n     * @param int $expire 缓存周期\n     * @return bool|mixed\n     */\n    public function set($key, $value, $iszip = false, $expire = 3600)\n    {\n        return $this->obj->add($key, $value, $iszip, $expire);\n    }\n\n    /**\n     * 删除一个标识\n     * @param string $key 缓存key\n     * @param int $timeout\n     * @return bool|mixed\n     */\n    public function delete($key, $timeout = 0)\n    {\n        if (!empty($key)) {\n            return $this->obj->delete($key, $timeout);\n        }\n        return false;\n    }\n\n    /**\n     * 替换标识\n     * @param $key\n     * @param $value\n     * @param bool $iszip\n     * @param int $expire\n     * @return bool|mixed\n     */\n    public function replace($key, $value, $iszip = false, $expire = 3600)\n    {\n        return $this->obj->replace($key, $value, $iszip, $expire);\n    }\n\n    /**\n     * 检测key是否存在\n     * @param $key\n     * @return bool\n     */\n    public function exists($key)\n    {\n        $data = $this->get($key);\n        return $data !== false;\n    }\n\n    /**\n     * 重置所有标识\n     */\n    public function flush()\n    {\n        return $this->obj->flush();\n    }\n\n    /**\n     * 减少标识的值\n     * @param $key\n     * @param int $number\n     * @return mixed\n     */\n    public function decrement($key, $number = 1)\n    {\n        return $this->obj->decrement($key, $number);\n    }\n\n    /**\n     * 增加标识的值\n     * @param $key\n     * @param int $number\n     * @return mixed\n     */\n    public function increment($key, $number = 1)\n    {\n        return $this->obj->increment($key, $number);\n    }\n\n    /**\n     * 获得版本号\n     * @return mixed\n     */\n    public function getVersion()\n    {\n        return $this->obj->getVersion();\n    }\n\n    /**\n     * 获取服务器统计信息\n     * @return mixed\n     */\n    public function getStats()\n    {\n        return $this->obj->getStats();\n    }\n\n    /**\n     * 关闭与缓存服务器的连接\n     */\n    public function close()\n    {\n        $this->obj->close();\n    }\n}\n"
  },
  {
    "path": "Framework/Library/Process/Drive/Cache/Redis.php",
    "content": "<?php\n\nnamespace Framework\\Library\\Process\\Drive\\Cache;\n\nuse \\Framework\\Library\\Interfaces\\CacheInterface as CacheInterfaces;\n\n/**\n * Class Redis\n * @package Framework\\Library\\Process\\Drive\\Cache\n */\nclass Redis implements CacheInterfaces\n{\n\n    /**\n     * 建立连接\n     * @var null\n     */\n    protected $link = null;\n\n    /**\n     * 实例对象\n     * @var\n     */\n    private $obj;\n\n    /**\n     * 构造方法\n     * Memcache constructor.\n     */\n    public function __construct()\n    {\n        $this->obj = new \\Redis();\n    }\n\n    /**\n     * 连接缓存服务器\n     * @param string $ip 服务器IP\n     * @param int|string $port 服务器端口\n     * @param array $auth 授权信息\n     * @return mixed|void\n     */\n    public function connect($ip, $port, $auth = [])\n    {\n        $this->obj->connect($ip, $port);\n        if (!empty($auth['password'])) {\n            $this->obj->auth($auth['password']);\n        }\n    }\n\n    /**\n     * 获取一个缓存标识\n     * @param $key\n     * @return mixed\n     */\n    public function get($key)\n    {\n        if (!empty($key)) {\n            return $this->obj->get($key);\n        }\n        return false;\n    }\n\n    /**\n     * 设定一个缓存标识\n     * @param $key\n     * @param $value\n     * @param bool $iszip\n     * @param int $expire\n     * @return bool|mixed\n     */\n    public function set($key, $value, $iszip = false, $expire = 3600)\n    {\n        return $this->obj->set($key, $value, $expire);\n    }\n\n    /**\n     * 删除一个标识\n     * @param $key\n     * @param int $timeout\n     * @return bool|int|mixed\n     */\n    public function delete($key, $timeout = 0)\n    {\n        if (!empty($key)) {\n            return $this->obj->delete($key);\n        }\n        return false;\n    }\n\n    /**\n     * 替换标识\n     * @param $key\n     * @param $value\n     * @param bool $iszip\n     * @param int $expire\n     * @return mixed|string\n     */\n    public function replace($key, $value, $iszip = false, $expire = 3600)\n    {\n        return $this->obj->getSet($key, $value);\n    }\n\n    /**\n     * 检测key是否存在\n     * @param $key\n     * @return bool\n     */\n    public function exists($key)\n    {\n        return $this->obj->exists($key);\n    }\n\n    /**\n     * 重置所有标识\n     */\n    public function flush()\n    {\n        return $this->obj->flushAll();\n    }\n\n    /**\n     * 减少标识的值\n     * @param $key\n     * @param int $number\n     * @return mixed\n     */\n    public function decrement($key, $number = 1)\n    {\n        return $this->obj->decrBy($key, $number);\n    }\n\n    /**\n     * 增加标识的值\n     * @param $key\n     * @param int $number\n     * @return mixed\n     */\n    public function increment($key, $number = 1)\n    {\n        return $this->obj->incrBy($key, $number);\n    }\n\n    /**\n     * 获得版本号\n     * @return mixed\n     */\n    public function getVersion()\n    {\n        $info = $this->getStats();\n        return $info['redis_version'];\n    }\n\n    /**\n     * 获取服务器统计信息\n     * @return mixed\n     */\n    public function getStats()\n    {\n        return $this->obj->info();\n    }\n\n    /**\n     * 关闭与缓存服务器的连接\n     */\n    public function close()\n    {\n        $this->obj->close();\n    }\n\n}\n"
  },
  {
    "path": "Framework/Library/Process/Drive/Db/Mysqli.php",
    "content": "<?php\n\nnamespace Framework\\Library\\Process\\Drive\\Db;\n\nuse Framework\\App;\nuse Framework\\Library\\Interfaces\\DbInterface as DbInterfaces;\nuse Framework\\Library\\Process\\Running;\nuse Framework\\Library\\Process\\Tool;\n\n/**\n * Mysqli Driver\n * Class Mysqli\n */\nclass Mysqli implements DbInterfaces\n{\n\n\n    /**\n     * @var string 操作表\n     */\n    public $tableName = '';\n\n    /**\n     * @var null|\\mysqli 连接资源\n     */\n    public $link = null;\n\n    /**\n     * @var int 对象ID\n     */\n    public $queryId;\n\n    /**\n     * @var bool|\\mysqli_result|array 结果集\n     */\n    protected $result = false;\n\n    /**\n     * @var bool 调试信息\n     */\n    protected $queryDebug = false;\n\n    /**\n     * @var int 影响条数\n     */\n    protected $total;\n\n    /**\n     * @var string 数据主键\n     */\n    protected $key = '';\n\n    /**\n     * @var bool 是否缓存数据\n     */\n    protected $iscache = false;\n\n    /**\n     * @var array 数据表信息\n     */\n    protected $data = [];\n\n    /**\n     * @var string 数据库名\n     */\n    protected $database = '';\n\n    /**\n     * @var string 表前缀\n     */\n    protected $tabPrefix = '';\n\n    /**\n     * 获取错误信息\n     * @return string|null\n     */\n    public function getError()\n    {\n        if (is_resource($this->link)) {\n            return mysqli_error($this->link);\n        }\n        return 'Invalid resources';\n    }\n\n    /**\n     * 连接数据库\n     * @param array $config\n     * @return bool|mixed|\\mysqli|null\n     */\n    public function connect($config = [])\n    {\n        $this->link = @mysqli_connect($config['host'], $config['username'], $config['password'], $config['database'], $config['port']);\n        if ($this->link != null) {\n            $this->database = $config['database'];\n            mysqli_query($this->link, 'set names ' . $config['char']);\n            if (!empty($config['tabprefix'])) {\n                $this->tabPrefix = $config['tabprefix'];\n            }\n            return $this->link;\n        } else {\n            App::$app->get('LogicExceptions')->readErrorFile([\n                'file' => __FILE__,\n                'message' => 'Mysql Host[ ' . $config['host'] . ' ] :: ' . Tool::toUTF8(mysqli_connect_error())\n            ]);\n        }\n        return false;\n    }\n\n    /**\n     * 操作多数据库连接\n     * @param $link\n     * @return $this\n     */\n    public function setlink($link)\n    {\n        $this->link = $link;\n        return $this;\n    }\n\n    /**\n     * 关闭数据库\n     */\n    public function disconnect()\n    {\n        mysqli_close($this->link);\n    }\n\n\n    /**\n     * 获取所有记录\n     * @return bool\n     */\n    public function get()\n    {\n        return $this->result;\n    }\n\n    /**\n     * 获取默认记录\n     * @return null|array\n     */\n    public function find()\n    {\n        if ($this->result) {\n            return count($this->result) > 0 ? $this->result[0] : NULL;\n        }\n\n        return NULL;\n    }\n\n    /**\n     * debug\n     * @return bool|mixed\n     */\n    public function debug()\n    {\n        return $this->queryDebug;\n    }\n\n    /**\n     * 获取影响条数\n     * @return mixed\n     */\n    public function total()\n    {\n        return $this->total;\n    }\n\n    /**\n     * 设定查询表\n     * @param string $tabName\n     * @return $this|bool|mixed\n     */\n    public function table($tabName = '')\n    {\n        if (!empty($tabName)) {\n            $this->tableName = '`' . $this->tabPrefix . $tabName . '`';\n            $this->getTableInfo();\n            return $this;\n        } else {\n            App::$app->get('LogicExceptions')->readErrorFile([\n                'file' => __FILE__,\n                'message' => 'Need to fill in Table Value!',\n            ]);\n        }\n        return false;\n    }\n\n    /**\n     * 返回数据表信息\n     * @return bool|\\mysqli_result\n     */\n    protected function getTableInfo()\n    {\n        if ($this->tableName == '') {\n            App::$app->get('LogicExceptions')->readErrorFile([\n                'message' => '尚未设定操作的数据表名称'\n            ]);\n        } else {\n            $string = str_replace('`', '', \"SELECT COLUMN_NAME,DATA_TYPE,COLUMN_DEFAULT,COLUMN_KEY,COLUMN_COMMENT  FROM information_schema.COLUMNS WHERE table_name = '\" . $this->tableName . \"';\");\n            $info = mysqli_query($this->link, $string);\n            if ($info !== false) {\n                $this->data = mysqli_fetch_all($info, MYSQLI_ASSOC);\n                foreach ($this->data as $key => $value) {\n                    if ($this->data[$key]['COLUMN_KEY'] == 'PRI') {\n                        $this->key = $this->data[$key]['COLUMN_NAME'];\n                        break;\n                    }\n                    return $info;\n                }\n                return false;\n            }\n        }\n        return false;\n    }\n\n    /**\n     * 插入数据\n     * @param array $qryArray\n     * @return $this\n     */\n    public function select($qryArray = [])\n    {\n        $field = '';\n        $join = '';\n        $where = '';\n        $order = '';\n        $group = '';\n        $limit = '';\n\n        if (isset($qryArray['field'])) {\n            if (is_array($qryArray['field'])) {\n                if (isset($qryArray['field']['NOT'])) {\n                    if (is_array($qryArray['field']['NOT'])) {\n                        $field_arr = $this->getField();\n                        if (is_array($field_arr)) {\n                            foreach ($field_arr as $key => $value) {\n                                if (!in_array($value['COLUMN_NAME'], $qryArray['field']['NOT'])) {\n                                    $field .= '`' . $value['COLUMN_NAME'] . '`,';\n                                }\n                            }\n                            $field = rtrim($field, '.,');\n                        }\n                    }\n                } else {\n                    foreach ($qryArray['field'] as $key => $value) {\n                        $field .= $this->inlon($value);\n                    }\n                    $field = rtrim($field, '.,');\n                }\n            } else {\n                $field = $qryArray['field'];\n            }\n        }\n        if (empty($field)) $field = ' * ';\n\n        if (isset($qryArray['join'])) {\n            $join = is_array($qryArray['join']) ? ' ' . implode(' ', $qryArray['join']) : ' ' . $qryArray['join'];\n        }\n        if (isset($qryArray['where'])) {\n            $where = $this->structureWhere($qryArray['where']);\n        }\n        if (isset($qryArray['orderby'])) {\n            $order = is_array($qryArray['orderby']) ? implode(',', $qryArray['orderby']) : $qryArray['orderby'];\n            $order = ' ORDER BY ' . $order;\n        }\n        if (isset($qryArray['groupby'])) {\n            $group = is_array($qryArray['groupby']) ? implode(',', $qryArray['groupby']) : $qryArray['groupby'];\n            $group = ' GROUP BY ' . $group;\n        }\n        if (isset($qryArray['limit'])) {\n            $limit = is_array($qryArray['limit']) ? implode(',', $qryArray['limit']) : $qryArray['limit'];\n            $limit = ' LIMIT ' . $limit;\n        }\n        if (isset($qryArray['page'])) {\n            $page = 1;\n            $limit = 10;\n            if (is_numeric($qryArray['page'])) {\n                $page = $qryArray['page'];\n            }\n            if (is_array($qryArray['page'])) {\n                if (isset($qryArray['page'][0]) && isset($qryArray['page'][1])) {\n                    $page = is_numeric($qryArray['page'][0]) ? $qryArray['page'][0] : 1;\n                    $limit = is_numeric($qryArray['page'][1]) ? $qryArray['page'][1] : 10;\n\n                }\n            }\n            $start = ($page - 1) * $limit;\n            $limit = ' LIMIT ' . $start . ',' . $limit;\n        }\n        $queryString = 'SELECT ' . $field . ' FROM ' . $this->tableName . $join . $where . $group . $order . $limit;\n\n        $res = $this->query($queryString, true);\n\n        if ($res) {\n            $this->result = mysqli_fetch_all($res, MYSQLI_ASSOC);\n        }\n\n        $this->total = $this->affectedRows();\n\n        $this->queryDebug = ['string' => $queryString, 'affectedRows' => $this->total];\n\n        return $this;\n    }\n\n    /**\n     * 条件构造\n     * @param array $whereData\n     * @return string\n     */\n    private function structureWhere($whereData = [])\n    {\n        if (empty($whereData)) {\n            return '';\n        }\n        $where = ' WHERE ';\n        if (is_array($whereData)) {\n            foreach ($whereData as $key => $value) {\n                if (is_array($value) && count($value) > 1) {\n                    $value[1] = mysqli_real_escape_string($this->link, $value[1]);\n                    switch (strtolower($value[0])) {\n                        case 'in':\n                            $key = $this->inlon($key);\n                            $key = rtrim($key, '.,');\n                            $where .= $key . ' IN(' . $value[1] . ') AND ';\n                            break;\n                        case 'string':\n                            $where .= $key . $value[1] . ' AND ';\n                            break;\n                        default:\n                            $value[1] = is_numeric($value[1]) ? $value[1] : \"'\" . $value[1] . \"'\";\n                            $key = $this->inlon($key);\n                            $key = rtrim($key, '.,');\n                            $where .= $key . ' ' . $value[0] . ' ' . $value[1] . ' AND ';\n                            break;\n                    }\n                } else {\n                    $value = mysqli_real_escape_string($this->link, $value);\n                    $value = is_numeric($value) ? $value : \"'\" . $value . \"'\";\n                    $key = $this->inlon($key);\n                    $key = rtrim($key, '.,');\n                    $where .= $key . '=' . $value . ' AND ';\n                }\n            }\n            return rtrim($where, '. AND ');\n        }\n        return $where . $whereData;\n    }\n\n    /**\n     * 追加字段标识符\n     * @param $key\n     * @return string\n     */\n    private function inlon($key)\n    {\n        $val_arr = explode('.', $key);\n        if (count($val_arr) > 1) {\n            $str = '';\n            foreach ($val_arr as $values) {\n                $str .= '`' . $values . '`.';\n            }\n            if(!empty($str)){\n                $str = rtrim($str, '.');\n            }\n            return $str . ',';\n        } else {\n            return '`' . $key . '`,';\n        }\n    }\n\n    /**\n     * 执行SQL\n     * @param string $queryString\n     * @param bool $select\n     * @return $this|bool|\\mysqli_result\n     */\n    public function query($queryString = '', $select = false)\n    {\n        if ($this->link != null) {\n            $this->queryId = mysqli_query($this->link, $queryString);\n\n            $errorMsg = '';\n            if ($this->queryId === false) {\n                $status = 'error';\n                $errorMsg = mysqli_error($this->link);\n            } else {\n                $status = 'success';\n            }\n            $Logs = \"[{$status}] \" . $queryString;\n            if (!empty($errorMsg)) {\n                $Logs .= \"\\r\\n[message] \" . $errorMsg;\n            }\n            App::$app->get('Log')->Record(Running::$framworkPath . '/Project/runtime/datebase', 'sql', $Logs);\n            if ($this->queryId === false) {\n                $message = $errorMsg . ' (SQL：' . $queryString . ')';\n                App::$app->get('LogicExceptions')->readErrorFile([\n                    'type' => 'DataBase Error',\n                    'message' => $message\n                ]);\n\n            }\n            if ($this->startsWith(strtolower($queryString), \"select\") && $select === false) {\n                $this->result = mysqli_fetch_all($this->queryId, MYSQLI_ASSOC);\n                return $this;\n            }\n            return $this->queryId;\n        } else {\n            App::$app->get('LogicExceptions')->readErrorFile([\n                'message' => '数据库连接失败或尚未连接'\n            ]);\n        }\n        return false;\n    }\n\n    /**\n     * If string starts with\n     *\n     * @param $haystack\n     * @param $needle\n     * @return bool\n     */\n    protected function startsWith($haystack, $needle)\n    {\n        return $needle === \"\" || strrpos($haystack, $needle, -strlen($haystack)) !== FALSE;\n    }\n\n    /**\n     * 返回影响记录\n     * @return int\n     */\n    public function affectedRows()\n    {\n        return mysqli_affected_rows($this->link);\n    }\n\n    /**\n     * 插入数据(别名)\n     * @param array $dataArray\n     * @return bool\n     */\n    public function add($dataArray = [])\n    {\n        return $this->insert($dataArray);\n    }\n\n    /**\n     * 插入数据\n     * @param array $dataArray\n     * @return bool\n     */\n    public function insert($dataArray = [])\n    {\n        $value = '';\n        if (is_array($dataArray) && count($dataArray) > 0) {\n            $v_key = '';\n            $v_value = '';\n            foreach ($dataArray as $key => $value) {\n                $v_key .= '`' . $key . '`,';\n                $v_value .= is_int($value) ? $value . ',' : \"'{$value}',\";\n            }\n            $v_key = rtrim($v_key, '.,');\n            $v_value = rtrim($v_value, '.,');\n\n            $queryString = 'INSERT INTO ' . $this->tableName . ' (' . $v_key . ') VALUES(' . $v_value . ');';\n\n            $res = $this->query($queryString, true);\n\n            $this->queryDebug = ['string' => $queryString, 'value' => $value, 'insertedId' => $this->insert_id()];\n\n            return $res === false ? false : $this->queryDebug['insertedId'];\n        }\n        return false;\n    }\n\n    /**\n     * 获取最后插入的ID\n     * @return int|string\n     */\n    public function insert_id()\n    {\n        return mysqli_insert_id($this->link);\n    }\n\n    /**\n     * 修改数据(别名)\n     * @param array $dataArray\n     * @param string $where\n     * @return bool\n     */\n    public function save($dataArray = [], $where = '')\n    {\n        return $this->update($dataArray, $where);\n    }\n\n    /**\n     * 修改数据\n     * @param array $dataArray\n     * @param string $where\n     * @return bool|int\n     */\n    public function update($dataArray = [], $where = '')\n    {\n        if (is_array($dataArray) && count($dataArray) > 0) {\n            $updata = '';\n            foreach ($dataArray as $key => $value) {\n                $value = is_int($value) ? $value : \"'{$value}'\";\n                $updata .= \"`$key`={$value},\";\n            }\n            if (!empty($where)) $where = $this->structureWhere($where);\n            $queryString = 'UPDATE ' . $this->tableName . ' SET ' . rtrim($updata, '.,') . $where;\n\n            $res = $this->query($queryString, true);\n\n            $this->total = $this->affectedRows();\n\n            $this->queryDebug = ['string' => $queryString, 'update' => $updata, 'affectedRows' => $this->total];\n\n            return $res === false ? false : $this->total;\n        }\n        return false;\n    }\n\n    /**\n     * 删除数据(别名)\n     * @param array $where\n     * @return bool\n     */\n    public function del($where = [])\n    {\n        return $this->delete($where);\n    }\n\n    /**\n     * 删除数据\n     * @param array $where\n     * @return bool|int|mixed\n     */\n    public function delete($where = [])\n    {\n        if (!empty($where)) $where = $this->structureWhere($where);\n\n        $queryString = 'DELETE FROM ' . $this->tableName . $where;\n\n        $res = $this->query($queryString, true);\n\n        $this->total = $this->affectedRows();\n\n        $this->queryDebug = ['string' => $queryString, 'affectedRows' => $this->total];\n\n        return $res === false ? false : $this->total;\n    }\n\n    /**\n     * 获取数据表主键\n     * @return string\n     */\n    public function getkey()\n    {\n        return $this->key;\n    }\n\n    /**\n     * 获取所有字段信息\n     * @return array\n     */\n    public function getField()\n    {\n        return $this->data;\n    }\n\n    /**\n     * 获取所有数据表\n     * @return array|bool|null\n     */\n    public function getTables()\n    {\n        $res = mysqli_query($this->link, \"SELECT table_name FROM information_schema.tables WHERE table_schema='\" . $this->database . \"' AND table_type='base table';\");\n        if ($res !== false) {\n            $list = mysqli_fetch_all($res, MYSQLI_ASSOC);\n            if (is_array($list)) {\n                $_list = [];\n                foreach ($list as $key => $value) {\n                    $_list[] = $list[$key]['table_name'];\n                }\n                return $_list;\n            }\n            return $list;\n\n        }\n        return false;\n    }\n\n}"
  },
  {
    "path": "Framework/Library/Process/Drive/Db/PDO.php",
    "content": "<?php\n\nnamespace Framework\\Library\\Process\\Drive\\Db;\n\nuse Framework\\App;\nuse Framework\\Library\\Interfaces\\DbInterface as DbInterfaces;\nuse Framework\\Library\\Process\\Running;\n\n/**\n * PDO Driver\n * Class PDO\n */\nclass Pdo implements DbInterfaces\n{\n\n    /**\n     * @var string 数据错误信息\n     */\n    public $dbErrorMsg = 'SQL IN WRONG: ';\n\n    /**\n     * @var int 获取方式\n     */\n    public $fetchMethod = \\PDO::FETCH_OBJ;\n\n    /**\n     * @var \\PDO 实例对象\n     */\n    protected $pdo;\n\n    /**\n     * @var bool|\\PDORow|array 结果集\n     */\n    protected $result = false;\n\n    /**\n     * @var int 影响条数\n     */\n    protected $total;\n\n    /**\n     * @var null|string 操作表名\n     */\n    protected $tableName = NULL;\n\n    /**\n     * @var array debug\n     */\n    protected $queryDebug = [];\n\n    /**\n     * @var string 数据主键\n     */\n    protected $key = '';\n\n    /**\n     * @var bool 是否缓存数据\n     */\n    protected $iscache = false;\n\n    /**\n     * @var array 数据表信息\n     */\n    protected $data = [];\n\n    /**\n     * @var string 数据库名\n     */\n    protected $database = '';\n\n    /**\n     * @var string 表前缀\n     */\n    protected $tabprefix = '';\n\n    /**\n     * 获取异常信息\n     * @return mixed\n     */\n    public function getError()\n    {\n        return $this->pdo->errorInfo();\n    }\n\n    /**\n     * 连接数据库\n     * @param array $config\n     * @return bool|mixed|\\PDO\n     */\n    public function connect($config = [])\n    {\n        if (count($config) == 0) {\n            return false;\n        }\n        try {\n\n            $dsn = !empty($config['dsn']) ? $config['dsn'] : \"mysql:host=\" . $config['host'] . \";port=\" . $config['port'] . \";dbname=\" . $config['database'];\n            $opt = array(\n                \\PDO::ATTR_ERRMODE => \\PDO::ERRMODE_EXCEPTION,\n                \\PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES '\" . $config['char'] . \"'\"\n            );\n\n            $this->pdo = new \\PDO($dsn, $config['username'], $config['password'], $opt);\n            $this->database = $config['database'];\n            if(!empty($config['tabprefix'])){\n                $this->tabprefix = $config['tabprefix'];\n            }\n            return $this->pdo;\n        } catch (\\PDOException $ex) {\n            exit($this->dbErrorMsg . $ex->getMessage());\n        }\n    }\n\n    /**\n     * 操作多数据库连接\n     * @param $link\n     * @return $this\n     */\n    public function setlink($link)\n    {\n        $this->pdo = $link;\n        return $this;\n    }\n\n\n    /**\n     * 销毁连接\n     * @return bool\n     */\n    public function disconnect()\n    {\n        $this->pdo = NULL;\n\n        return true;\n    }\n\n\n    /**\n     * 获取所有记录\n     * @return bool\n     */\n    public function get()\n    {\n        return $this->result;\n    }\n\n\n    /**\n     * 获取默认记录\n     * @return array|mixed|null\n     */\n    public function find()\n    {\n        if ($this->result) {\n            return count($this->result) > 0 ? $this->result[0] : NULL;\n        }\n\n        return NULL;\n    }\n\n\n    /**\n     * debug\n     * @return array\n     */\n    public function debug()\n    {\n        return $this->queryDebug;\n    }\n\n    /**\n     * 获取影响的条数\n     * @return mixed\n     */\n    public function total()\n    {\n        return $this->total;\n    }\n\n    /**\n     * 执行SQL\n     * @param $queryString\n     * @param bool $select\n     * @return $this\n     */\n    public function query($queryString, $select = false)\n    {\n        try {\n            $qry = $this->pdo->prepare($queryString);\n            $qry->execute();\n            $qry->setFetchMode($this->fetchMethod);\n\n            if ($this->startsWith(strtolower($queryString), \"select\")) {\n                $this->result = $qry->fetchAll();\n            }\n\n            $this->total = $qry->rowCount();\n\n            $this->queryDebug = ['string' => $queryString, 'total' => $this->total];\n\n            $this->handleres($queryString);\n\n        } catch (\\PDOException $ex) {\n            $this->handleres($queryString, true . $ex);\n        }\n\n        return $this;\n    }\n\n    /**\n     * If string starts with\n     *\n     * @param $haystack\n     * @param $needle\n     * @return bool\n     */\n    protected function startsWith($haystack, $needle)\n    {\n        return $needle === \"\" || strrpos($haystack, $needle, -strlen($haystack)) !== FALSE;\n    }\n\n    /**\n     * 处理结果\n     * @param $sql\n     * @param bool $iserror\n     * @param array $ex\n     */\n    private function handleres($sql, $iserror = false, $ex = [])\n    {\n        /**\n         * @var \\PDOException $ex\n         */\n        $errorMsg = '';\n        if ($iserror) {\n            $status = 'error';\n            $errorMsg = $ex->getMessage();\n        } else {\n            $status = 'success';\n        }\n        $Logs = \"[{$status}] \" . $sql;\n        if (isset($errorMsg)) {\n            $Logs .= \"\\r\\n[message] \" . $errorMsg;\n        }\n\n        App::$app->get('Log')->Record(Running::$framworkPath . '/Project/runtime/datebase', 'sql', $Logs);\n        if ($iserror) {\n            $message = $errorMsg . ' (SQL：' . $sql . ')';\n            App::$app->get('LogicExceptions')->readErrorFile([\n                'type' => 'DataBase Error',\n                'message' => $message\n            ]);\n        }\n    }\n\n    /**\n     * 选择数据表\n     * @param $tableName\n     * @return $this|bool\n     */\n    public function table($tableName = '')\n    {\n        if (!empty($tableName)) {\n            $this->tableName = '`' . $this->tabprefix . $tableName . '`';\n            $this->getTableInfo();\n            return $this;\n        } else {\n            App::$app->get('LogicExceptions')->readErrorFile([\n                'file' => __FILE__,\n                'message' => 'Need to fill in Table Value!',\n            ]);\n        }\n        return false;\n    }\n\n    /**\n     * 返回数据表信息\n     * @return array|bool\n     */\n    protected function getTableInfo()\n    {\n        if ($this->tableName == '') {\n            App::$app->get('LogicExceptions')->readErrorFile([\n                'message' => '尚未设定操作的数据表名称'\n            ]);\n        } else {\n            $queryString = str_replace('`', '', \"select COLUMN_NAME,DATA_TYPE,COLUMN_DEFAULT,COLUMN_KEY,COLUMN_COMMENT  from information_schema.COLUMNS where table_name = '\" . $this->tableName . \"';\");\n\n            $qry = $this->pdo->prepare($queryString);\n\n            $qry->execute();\n\n            $qry->setFetchMode(\\PDO::FETCH_ASSOC);\n\n            $this->data = $qry->fetchAll();\n\n            if ($this->data) {\n                foreach ($this->data as $key => $value) {\n                    if ($this->data[$key]['COLUMN_KEY'] == 'PRI') {\n                        $this->key = $this->data[$key]['COLUMN_NAME'];\n                        break;\n                    }\n                    return $this->data;\n                }\n                return false;\n            }\n        }\n        return false;\n    }\n\n    /**\n     * 查询数据\n     * @param array $qryArray\n     * @return $this|bool\n     */\n    public function select($qryArray = [])\n    {\n        $field = '';\n        $join = '';\n        $where = '';\n        $order = '';\n        $group = '';\n        $limit = '';\n\n        if (isset($qryArray['field'])) {\n            if(is_array($qryArray['field'])){\n                if(isset($qryArray['field']['NOT'])){\n                    if(is_array($qryArray['field']['NOT'])){\n                        $field_arr = $this->getField();\n                        if(is_array($field_arr)){\n                            foreach ($field_arr as $key=>$value) {\n                                if(!in_array($value['COLUMN_NAME'] , $qryArray['field']['NOT'])){\n                                    $field .= '`'.$value['COLUMN_NAME'] . '`,';\n                                }\n                            }\n                            $field = rtrim($field,'.,');\n                        }\n                    }\n                }else{\n                    foreach ($qryArray['field'] as $key=>$value){\n                        $field .= $this->inlon($value);\n                    }\n                    $field = rtrim($field,'.,');\n                }\n            }else{\n                $field = $qryArray['field'];\n            }\n        }\n        if (empty($field)) $field = ' * ';\n\n        if (isset($qryArray['join'])) {\n            $join = is_array($qryArray['join']) ? ' '.implode(' ', $qryArray['join']) : ' '.$qryArray['join'];\n        }\n        if (isset($qryArray['where'])) {\n            $where = $this->structureWhere($qryArray['where']);\n        }\n        if (isset($qryArray['orderby'])) {\n            $order = is_array($qryArray['orderby']) ? implode(',', $qryArray['orderby']) : $qryArray['orderby'];\n            $order = ' ORDER BY ' . $order;\n        }\n        if (isset($qryArray['groupby'])) {\n            $group = is_array($qryArray['groupby']) ? implode(',', $qryArray['groupby']) : $qryArray['groupby'];\n            $group = ' GROUP BY ' . $group;\n        }\n        if (isset($qryArray['limit'])) {\n            $limit = is_array($qryArray['limit']) ? implode(',', $qryArray['limit']) : $qryArray['limit'];\n            $limit = ' LIMIT ' . $limit;\n        }\n        $queryString = 'SELECT ' . $field . ' FROM ' . $this->tableName . $join . $where . $group . $order . $limit;\n\n        try {\n\n            $qry = $this->pdo->prepare($queryString);\n\n            $qry->execute();\n\n            $qry->setFetchMode($this->fetchMethod);\n\n            $this->result = $qry->fetchAll();\n\n            $this->total = $qry->rowCount();\n\n            $this->queryDebug = ['string' => $queryString, 'affectedRows' => $this->total];\n\n            $this->handleres($queryString);\n\n            return $this;\n        } catch (\\PDOException $ex) {\n            $this->handleres($queryString, true, $ex);\n        }\n        return false;\n    }\n\n    /**\n     * 条件构造\n     * @param array $whereData\n     * @return string\n     */\n    private function structureWhere($whereData = [])\n    {\n        if(empty($whereData)){ return ''; }\n        $where = ' WHERE ';\n        if (is_array($whereData)) {\n            foreach ($whereData as $key => $value) {\n                if (is_array($value) && count($value) > 1) {\n                    $value[1] = addslashes($value[1]);\n                    switch (strtolower($value[0])) {\n                        case 'in':\n                            $key = $this->inlon($key);\n                            $key = rtrim($key,'.,');\n                            $where .= $key . ' IN(' . $value[1] . ') AND ';\n                            break;\n                        case 'string':\n                            $where .= $key . $value[1] . ' AND ';\n                            break;\n                        default:\n                            $value[1] = is_numeric($value[1]) ? $value[1] : \"'\" . $value[1] . \"'\";\n                            $key = $this->inlon($key);\n                            $key = rtrim($key,'.,');\n                            $where .= $key . ' ' . $value[0] . ' ' . $value[1] . ' AND ';\n                            break;\n                    }\n                } else {\n                    $value = addslashes($value);\n                    $value = is_numeric($value) ? $value : \"'\" . $value . \"'\";\n                    $key = $this->inlon($key);\n                    $key = rtrim($key,'.,');\n                    $where .= $key . '=' . $value . ' AND ';\n                }\n            }\n            return rtrim($where, '. AND ');\n        }\n        return $where . $whereData;\n    }\n\n    /**\n     * 追加字段标识符\n     * @param $key\n     * @return string\n     */\n    private function inlon($key)\n    {\n        $val_arr = explode('.',$key);\n        if(count($val_arr) > 1){\n            $str = '';\n            foreach ($val_arr as $values){\n                $str .= '`'.$values.'`.';\n            }\n            if(!empty($str)){\n                $str = rtrim($str, '.');\n            }\n            return $str . ',';\n        }else{\n            return '`'.$key . '`,';\n        }\n    }\n\n    /**\n     * 插入数据(别名)\n     * @param array $dataArray\n     * @return bool\n     */\n    public function add($dataArray = [])\n    {\n        return $this->insert($dataArray);\n    }\n\n    /**\n     * 插入数据\n     * @param array $dataArray\n     * @return bool|mixed\n     */\n    public function insert($dataArray = [])\n    {\n        if (is_array($dataArray) && count($dataArray) > 0) {\n            $v_key = '';\n            $v_value = '';\n            foreach ($dataArray as $key => $value) {\n                $v_key .= '`' . $key . '`,';\n                $v_value .= is_int($value) ? $value . ',' : \"'{$value}',\";\n            }\n            $v_key = rtrim($v_key, '.,');\n            $v_value = rtrim($v_value, '.,');\n\n            $queryString = 'INSERT INTO ' . $this->tableName . ' (' . $v_key . ') VALUES(' . $v_value . ');';\n\n            try {\n                $this->pdo->exec($queryString);\n\n                $lastInsertedId = $this->pdo->lastInsertId();\n\n                $this->queryDebug = ['string' => $queryString, 'value' => $value, 'insertedid' => $lastInsertedId];\n\n                $this->handleres($queryString);\n\n                return $lastInsertedId;\n            } catch (\\PDOException $ex) {\n                $this->handleres($queryString, true, $ex);\n            }\n        }\n        return false;\n    }\n\n    /**\n     * 修改数据(别名)\n     * @param array $dataArray\n     * @param string $where\n     * @return bool\n     */\n    public function save($dataArray = [], $where = '')\n    {\n        return $this->update($dataArray, $where);\n    }\n\n    /**\n     * 修改数据\n     * @param array $dataArray\n     * @param array $where\n     * @return bool\n     */\n    public function update($dataArray = [], $where = [])\n    {\n        if (is_array($dataArray) && count($dataArray) > 0) {\n            $updata = '';\n            foreach ($dataArray as $key => $value) {\n                $value = is_int($value) ? $value : \"'{$value}'\";\n                $updata .= \"`$key`={$value},\";\n            }\n            if (!empty($where)) $where = $this->structureWhere($where);\n            $queryString = 'UPDATE ' . $this->tableName . ' SET ' . rtrim($updata, '.,') . $where;\n\n            try {\n                $this->total = $this->pdo->exec($queryString);\n\n                $this->queryDebug = ['string' => $queryString, 'update' => $updata, 'affectedRows' => $this->total];\n\n                $this->handleres($queryString);\n\n                return $this->total;\n            } catch (\\PDOException $ex) {\n                $this->handleres($queryString, true, $ex);\n            }\n\n        }\n        return false;\n    }\n\n    /**\n     * 删除数据(别名)\n     * @param array $where\n     * @return bool\n     */\n    public function del($where = [])\n    {\n        return $this->delete($where);\n    }\n\n    /**\n     * 删除数据\n     * @param array|string $where\n     * @return bool|int\n     */\n    public function delete($where = [])\n    {\n        if (!empty($where)) $where = $this->structureWhere($where);\n\n        $queryString = 'DELETE FROM ' . $this->tableName . $where;\n\n        try {\n            $this->total = $this->pdo->exec($queryString);\n\n            $this->queryDebug = ['string' => $queryString, 'affectedRows' => $this->total];\n\n            $this->handleres($queryString);\n\n            return $this->total;\n        } catch (\\PDOException $ex) {\n            $this->handleres($queryString, true, $ex);\n        }\n        return false;\n    }\n\n    /**\n     * 获取数据表主键\n     * @return string\n     */\n    public function getkey()\n    {\n        return $this->key;\n    }\n\n    /**\n     * 获取所有字段信息\n     * @return array\n     */\n    public function getField()\n    {\n        return $this->data;\n    }\n\n    /**\n     * 获取所有数据表\n     * @return array|bool|null\n     */\n    public function getTables()\n    {\n        $queryString = \"select table_name from information_schema.tables where table_schema='\" . $this->database . \"' and table_type='base table';\";\n\n        $qry = $this->pdo->prepare($queryString);\n\n        $qry->execute();\n\n        $qry->setFetchMode(\\PDO::FETCH_ASSOC);\n\n        $list = $qry->fetchAll();\n\n        if (is_array($list)) {\n            $_list = [];\n            foreach ($list as $key => $value) {\n                $_list[] = $list[$key]['table_name'];\n            }\n            return $_list;\n        }\n        return $list;\n    }\n\n}\n"
  },
  {
    "path": "Framework/Library/Process/Extend.class.php",
    "content": "<?php\n\nnamespace Framework\\Library\\Process;\n\nuse Framework\\App;\n\n/**\n * 系统扩展器\n * Class Extend\n * @package Framework\\Library\\Process\n */\nclass Extend\n{\n    /**\n     * @var string 包路径\n     */\n    public $PackagePath;\n\n    /**\n     * @var string 类路径\n     */\n    public $ClassPath;\n\n    /**\n     * @var string 已加载的扩展容器\n     */\n    public $Extendbox;\n\n    /**\n     * 初始化相关路径\n     * Extend constructor.\n     */\n    public function __construct()\n    {\n        $this->PackagePath = Running::$framworkPath . 'Extend/Package/';\n        $this->ClassPath = Running::$framworkPath . 'Extend/Class/';\n        if (file_exists(Running::$framworkPath . 'vendor/autoload.php')){\n            require_once Running::$framworkPath . 'vendor/autoload.php';\n        }\n    }\n\n    /**\n     * 加入新的扩展包\n     * @param string $PackageName\n     * @return bool\n     */\n    public function addPackage($PackageName = '')\n    {\n        if (!empty($PackageName) && file_exists($this->PackagePath . $PackageName)) {\n            $PackageName = $this->PackagePath . $PackageName;\n            $extension = self::get_extension($PackageName);\n            if (strtolower($extension) == 'php') {\n                include_once $PackageName;\n                return true;\n            }\n            if (in_array($extension, ['zip', 'tar', 'rar'])) {\n                $Packagezip = $this->getPackageName($PackageName);\n                $this->releasePackage($PackageName, $this->PackagePath . 'Cache', $Packagezip);\n            }\n        }\n        return false;\n    }\n\n    /**\n     * 获取扩展信息\n     * @param $file\n     * @return mixed\n     */\n    public static function get_extension($file)\n    {\n        return pathinfo($file, PATHINFO_EXTENSION);\n    }\n\n    /**\n     * 返回包名\n     * @param $Package\n     * @return bool|mixed\n     */\n    private function getPackageName($Package)\n    {\n        $extension = self::get_extension($Package);\n        $path = explode('Package/', $Package);\n        if (isset($path[1])) {\n            return str_replace(array('.', $extension), '', $path[1]);\n        }\n        return false;\n    }\n\n    /**\n     * 释放压缩文件\n     * @param string $zipfile\n     * @param string $folder\n     * @param $Packagezip\n     * @return bool\n     */\n    private function releasePackage($zipfile = '', $folder = '', $Packagezip)\n    {\n        if ($this->iszipload($folder, $Packagezip)) {\n            return true;\n        }\n        if (class_exists('ZipArchive', false)) {\n            $zip = new \\ZipArchive;\n            $res = $zip->open($zipfile);\n            if ($res === TRUE) {\n                $zip->extractTo($folder);\n                $zip->close();\n                $this->iszipload($folder, $Packagezip);\n            } else {\n                App::$app->get('LogicExceptions')->readErrorFile([\n                    'file' => $zipfile,\n                    'message' => \"'{$zipfile}' 读取文件失败!\"\n                ]);\n            }\n        } else {\n            App::$app->get('LogicExceptions')->readErrorFile([\n                'file' => $zipfile,\n                'message' => \"你需要先启动 PHP-ZipArchive 扩展!\"\n            ]);\n        }\n        return true;\n    }\n\n    /**\n     * 加载扩展文件\n     * @param $folder\n     * @param $Packagezip\n     * @return bool\n     */\n    private function iszipload($folder, $Packagezip)\n    {\n        $autoload = $folder . '/' . $Packagezip . '/autoload.php';\n        if (file_exists($autoload)) {\n            include_once $autoload;\n            $this->Extendbox[$Packagezip] = $this->getPackageInfo($folder . '/' . $Packagezip . '/info.php');\n            file_put_contents($folder . '/' . $Packagezip . '/marked.txt', 'This is an automatically unpacked package. Please do not manually modify or delete it!  - PHP300Framework2x');\n            return true;\n        }\n        return false;\n    }\n\n    /**\n     * 获取zip包信息\n     * @param string $infoPath\n     * @return bool|mixed\n     */\n    private function getPackageInfo($infoPath = '')\n    {\n        if (file_exists($infoPath)) {\n            return include $infoPath;\n        }\n        return false;\n    }\n\n    /**\n     * 加入新的扩展类\n     * @param string $ClassName\n     * @return bool\n     */\n    public function addClass($ClassName = '')\n    {\n        if (!empty($ClassName) && file_exists($this->ClassPath . $ClassName)) {\n            include_once $this->ClassPath . $ClassName;\n        }\n        return false;\n    }\n\n    /**\n     * 返回已加载的包信息\n     * @return string\n     */\n    public function getPackagebox()\n    {\n        return $this->Extendbox;\n    }\n}"
  },
  {
    "path": "Framework/Library/Process/Log.class.php",
    "content": "<?php\n\nnamespace Framework\\Library\\Process;\n\nuse \\Framework\\Library\\Interfaces\\LogInterface as LogInterfaces;\n\n/**\n * 日志处理器\n * Class Log\n * @package Framework\\Library\\Process\n */\nclass Log implements LogInterfaces\n{\n\n    /**\n     * @var string 日志文件后缀\n     */\n    public $extend = '.log';\n\n    /**\n     * 写出动作(划分日期和大小)\n     * @param $fileName\n     * @param $Content\n     * @param int $count\n     */\n    private function Write($fileName, $Content, $count = 0)\n    {\n        $fileExt = $count > 0 ? '(' . $count . ')' : '';\n        $fileLine = $fileName . '_' . date('Y-m-d', time()) . $fileExt;\n        $fileNames = $fileLine . $this->extend;\n        if (file_exists($fileNames)) {\n            $size = number_format(filesize($fileNames) / 1024 / 1024, 3);\n            if ($size > 3) {\n                $number = intval(substr($fileLine, -2, 1)) + 1;\n                $this->Write($fileName, $Content, $number);\n            } else {\n                file_put_contents($fileNames, $Content, FILE_APPEND);\n            }\n        } else {\n            file_put_contents($fileNames, $Content, FILE_APPEND);\n        }\n    }\n\n    /**\n     * 记录动作\n     * @param $LogPath\n     * @param $fileName\n     * @param $Log\n     * @return bool|mixed\n     */\n    public function Record($LogPath, $fileName, $Log)\n    {\n        if (strpos($LogPath, '/') === false) $LogPath = Running::$framworkPath . '/Project/runtime/' . $LogPath . '/log';\n        if (!empty($Log)) {\n            if (!file_exists($LogPath)) {\n                Structure::createDir($LogPath);\n            }\n            $Log = \"[\" . date('Y-m-d H:i:s') . \"]\\r\\n$Log\\r\\n------------------\\r\\n\\r\\n \";\n            $this->Write($LogPath . '/' . $fileName, $Log);\n            return true;\n        }\n        return false;\n    }\n\n}"
  },
  {
    "path": "Framework/Library/Process/LogicExceptions.class.php",
    "content": "<?php\n\nnamespace Framework\\Library\\Process;\n\n/**\n * 异常处理器\n * Class LogicExceptions\n * @package Framework\\Library\\Process\n */\nuse Framework\\App;\nuse Framework\\Library\\Interfaces\\LogicExceptionsInterface as LogicExceptionsInterfaces;\n\nclass LogicExceptions implements LogicExceptionsInterfaces\n{\n    /**\n     * @var array 配置信息\n     */\n    static public $Config;\n\n    /**\n     * 构造函数,挂载中断回调\n     * LogicExceptions constructor.\n     */\n    public function __construct()\n    {\n        error_reporting(0);\n        register_shutdown_function([&$this, 'Mount']);\n        self::$Config = App::$app->get('Config')->get('frame');\n        Running::$Debug = self::$Config['Exception']['display_switch'];\n    }\n\n    /**\n     * 挂载异常钩子\n     */\n    public function Mount()\n    {\n        $error = error_get_last();\n        if ($error != NULL) {\n            $errorType = [\n                1 => 'E_ERROR',\n                2 => 'E_WARNING',\n                4 => 'E_PARSE',\n                8 => 'E_NOTICE',\n                16 => 'E_CORE_ERROR',\n                32 => 'E_CORE_WARNING',\n                64 => 'E_COMPILE_ERROR',\n                128 => 'E_COMPILE_WARNING',\n                256 => 'E_USER_ERROR',\n                512 => 'E_USER_WARNING',\n                1024 => 'E_USER_NOTICE',\n                2048 => 'E_STRICT',\n                4096 => 'E_RECOVERABLE_ERROR',\n                8192 => 'E_DEPRECATED',\n                16384 => 'E_USER_DEPRECATED',\n                30719 => 'E_ALL',\n            ];\n            $error['type'] = (!empty($errorType[$error['type']])) ? ($errorType[$error['type']]) : ('Unknown');\n            $error['message'] = Tool::toUTF8($error['message']);\n            if (isset(self::$Config['log']['error_switch']) && self::$Config['log']['error_switch'] === true) {\n\n                if ($this->judgeLevel($error['type'], self::$Config['log']['error_level'])) {\n                    $log = 'type: ';\n                    $log .= $error['type'];\n                    $log .= \"\\r\\n\" . 'message: ' . $error['message'] . \"\\r\\n\";\n                    $log .= 'file: ' . $error['file'] . \"\\r\\n\";\n                    $log .= 'line: ' . $error['line'];\n\n                    $Project = $this->getProjectName($error['file']);\n                    if ($Project) {\n                        App::$app->get('Log')->Record(Running::$framworkPath . '/Project/runtime/' . $Project . '/log', 'error', $log);\n                    }\n                }\n            }\n            if (isset(self::$Config['Exception']['display_switch']) && self::$Config['Exception']['display_switch'] === true) {\n                if ($this->judgeLevel($error['type'], self::$Config['Exception']['display_level'])) {\n                    $this->readErrorFile($error);\n                }\n            }\n        }\n    }\n\n    /**\n     * 判断错误级别\n     * @param $errorlevel\n     * @param $error\n     * @return bool\n     */\n    private function judgeLevel($errorlevel, $error)\n    {\n        if (!empty($errorlevel) && !empty($error)) {\n            if ($error == 'E_ALL') return true;\n            $errorList = explode('|', $error);\n            foreach ($errorList as $key => $value) {\n                $errorList[$key] = trim($value);\n            }\n            return in_array($errorlevel, $errorList);\n        }\n        return false;\n    }\n\n    /**\n     * 返回关联应用\n     * @param $Path\n     * @return bool\n     */\n    private function getProjectName($Path)\n    {\n        App::$app->get('Structure');\n        $Path = str_replace('\\\\', '/', $Path);\n        $Temporary = explode('Project/', $Path);\n        if (!empty($Temporary[1])) {\n            $Temporary = explode('/', $Temporary[1]);\n            if (!empty($Temporary[0]) && in_array($Temporary[0], Structure::$ProjectList)) {\n                return $Temporary[0];\n            }\n            return false;\n        }\n        return false;\n    }\n\n    /**\n     * 处理错误文件\n     * @param $error\n     */\n    public function readErrorFile($error)\n    {\n        if (Running::$runMode == 'cli') {\n            $error_string = \"\\r\\nPHP300FrameworkError:\\r\\nerror_messag:{$error['message']}\";\n            if (isset($error['file'])) $error_string .= \"\\r\\nerror_file:{$error['file']}\";\n            if (isset($error['line'])) $error_string .= \"\\r\\nerror_line:{$error['line']}\";\n            die($error_string);\n        } else {\n            ob_clean();\n        }\n        if (Running::$Debug === true) {\n            header('HTTP/1.1 ' . Tool::httpcode(500));\n            if (isset($error['file'])) {\n                $path = $error['file'];\n                $line = isset($error['line']) && is_int($error['line']) ? $error['line'] : 0;\n                if (file_exists($path) && $line > 0) {\n                    $handle = fopen($path, \"r\");\n                    $count = 1;\n                    $content = [];\n                    while ($lines = fgets($handle)) {\n                        $content[] = array($count, $lines);\n                        $count++;\n                        if ($line == ($count - 5)) {\n                            break;\n                        }\n                    }\n                    fclose($handle);\n                    if (count($content) > 10) {\n                        $content = array_slice($content, -10, 15);\n                    }\n                    $code = '';\n                    foreach ($content as $key => $value) {\n                        if ($value[0] == $line) {\n                            $value[0] = '<span color=\"red\">>></span>';\n                        }\n                        $code .= $value[0] . ' ' . $value[1];\n                    }\n                    $error['code'] = $code;\n                }\n            }\n            $View = View('', App::$app->corePath . 'Library/Process/Tpl/error.tpl');\n            $View->getView()->left_delimiter = '{';\n            $View->getView()->right_delimiter = '}';\n            die($View->data([\n                'Path' => Tool::getPublic(),\n                'Error' => $error,\n                'Server' => $_SERVER\n            ])->get());\n        }\n        $this->displayed('error', [\n            'title' => '网站抽风啦!',\n            'second' => '3',\n            'message' => '出错啦~~~',\n            'describe' => '系统异常，请联系管理员!',\n            'url' => ''\n        ]);\n    }\n\n    /**\n     * 展示状态页\n     * @param string $page\n     * @param array $data\n     */\n    public function displayed($page = 'success', $data = array())\n    {\n        $View = View('', App::$app->corePath . 'Library/Process/Tpl/' . $page . '_page.tpl');\n        $View->getView()->left_delimiter = '{';\n        $View->getView()->right_delimiter = '}';\n        die($View->data(['data' => $data])->get());\n    }\n}"
  },
  {
    "path": "Framework/Library/Process/ReturnHandle.class.php",
    "content": "<?php\n\nnamespace Framework\\Library\\Process;\n\n/**\n * 返回值处理器\n * Class ReturnHandle\n * @package Framework\\Library\\Process\n */\nclass ReturnHandle\n{\n    /**\n     * 处理返回值输出\n     * @param string $Obj 反馈的数据信息\n     */\n    public function Output($Obj = '')\n    {\n        if(is_object($Obj) || is_array($Obj)){\n            header('content-type:application/json;charset=utf-8');\n            echo json_encode($Obj);\n        }else{\n            echo $Obj;\n        }\n    }\n\n}"
  },
  {
    "path": "Framework/Library/Process/Router.class.php",
    "content": "<?php\r\n\r\nnamespace Framework\\Library\\Process;\r\n\r\nuse Framework\\App;\r\nuse Framework\\Library\\Interfaces\\RouterInterface as RouterInterfaces;\r\n\r\n/**\r\n * 系统路由\r\n * Class Router\r\n * @package Framework\\Library\\Process\r\n */\r\nclass Router implements RouterInterfaces\r\n{\r\n\r\n    /**\r\n     * @var string 用户请求地址\r\n     */\r\n    static public $requestUrl = '';\r\n\r\n    /**\r\n     * @var array 路由配置信息\r\n     */\r\n    private $RouteConfig = [];\r\n\r\n    /**\r\n     * 初始化构造\r\n     * Router constructor.\r\n     */\r\n    public function __construct()\r\n    {\r\n        if(Running::$runMode != 'cli'){\r\n            $this->RouteConfig = Config::$AppConfig['router'];\r\n            self::$requestUrl = !empty($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : $_SERVER['REQUEST_URI'];\r\n            $this->Route();\r\n            $this->Matching();\r\n            $this->TraditionUrl();\r\n        }\r\n    }\r\n\r\n    /**\r\n     * 默认路由\r\n     * @return mixed|void\r\n     */\r\n    public function Route()\r\n    {\r\n        if (strpos(self::$requestUrl, '?')) {\r\n            preg_match_all('/^\\/(.*)\\?/', self::$requestUrl, $Url);\r\n        } else {\r\n            preg_match_all('/^\\/(.*)/', self::$requestUrl, $Url);\r\n        }\r\n        if (empty($Url[1][0])) return;\r\n        $Url = $Url[1][0];\r\n        $Url = explode('/', $Url);\r\n        App::$app->get('Visit')->bind($Url);\r\n    }\r\n\r\n    /**\r\n     * 路由匹配\r\n     */\r\n    private function Matching()\r\n    {\r\n        if (self::$requestUrl == '') {\r\n            $Url = '/';\r\n        } else {\r\n            $Url = '/' . ucwords(Visit::$param['Project']) . '/' . ucwords(Visit::$param['Controller']) . '/' . Visit::$param['Function'];\r\n        }\r\n        $Url = strtolower($Url);\r\n        if (count($this->RouteConfig) > 0 && isset($this->RouteConfig[$Url])) {\r\n            $function = $this->RouteConfig[$Url];\r\n            if (gettype($function) == 'object') {\r\n                App::$app->get('ReturnHandle')->Output($function());\r\n                die();\r\n            }\r\n        }\r\n    }\r\n\r\n    /**\r\n     * 传统URL请求匹配\r\n     */\r\n    private function TraditionUrl()\r\n    {\r\n        $Project = get(Visit::$request['Project']);\r\n        $Controller = get(Visit::$request['Controller']);\r\n        $Function = get(Visit::$request['Function']);\r\n        if (!empty($Project)) {\r\n            $list = Structure::$ProjectList;\r\n            $ins = ['model','view'];\r\n            foreach ($list as $key=>$val){\r\n                if(in_array($val,$ins)){ unset($list[$key]); }\r\n            }\r\n            if(in_array($Project,$list)){\r\n                Visit::$param['Project'] = $Project;\r\n            }else{\r\n                App::$app->get('LogicExceptions')->readErrorFile([\r\n                    'message' => '抱歉,您请求的实例不存在!(请检查您的GET参数'.Visit::$request['Project'].')'\r\n                ]);\r\n            }\r\n        }\r\n        if (!empty($Controller)) {\r\n            Visit::$param['Controller'] = $Controller;\r\n        }\r\n        if (!empty($Function)) {\r\n            Visit::$param['Function'] = $Function;\r\n        }\r\n    }\r\n}"
  },
  {
    "path": "Framework/Library/Process/Running.class.php",
    "content": "<?php\n\nnamespace Framework\\Library\\Process;\n\n/**\n * 运行监视器\n * Class Running\n * @package Framework\\Library\\Process\n */\nclass Running\n{\n\n    /**\n     * 是否系统异常\n     * @var bool\n     */\n    static public $iserror = false;\n\n    /**\n     * 运行模式\n     * @var string\n     */\n    static public $runMode = 'cgi';\n\n    /**\n     * 开发模式(true=>调试模式,false=>线上模式)\n     * @var bool\n     */\n    static public $Debug;\n\n    /**\n     * 路径信息\n     * @var string\n     */\n    static public $framworkPath;\n\n    /**\n     * 监视运行参数\n     * @var array\n     */\n    public $param = [];\n\n    /**\n     * 运行构造\n     * Running constructor.\n     */\n    public function __construct()\n    {\n        self::$framworkPath = str_replace('Framework/', '', \\Framework\\App::$app->corePath);\n    }\n\n    /**\n     * 预定义常量信息\n     */\n    static public function setconstant()\n    {\n        $define = [\n            'RES' => Tool::getPublic(),\n            '_P' => Visit::$param['Project'],\n            '_C' => Visit::$param['Controller'],\n            '_F' => Visit::$param['Function'],\n            '_T' => time(),\n            '_V' => '2.5.3'\n        ];\n        foreach ($define as $key => $value) {\n            define($key, $value);\n        }\n    }\n\n    /**\n     * 设定开发模式\n     * @param bool $status\n     */\n    public function isDev($status = true)\n    {\n        self::$Debug = $status;\n    }\n\n    /**\n     * 开始记录信息\n     */\n    public function startRecord()\n    {\n        $this->param['startTime'] = microtime(true);\n        $this->param['startRam'] = (function_exists('memory_get_usage')) ? (memory_get_usage()) : (0);\n    }\n\n    /**\n     * 停止记录信息\n     */\n    public function endRecord()\n    {\n        $this->param['endTime'] = microtime(true);\n        $this->param['endRam'] = (function_exists('memory_get_usage')) ? (memory_get_usage()) : (0);\n        $this->param['consumeRam'] = $this->consumeRam(($this->param['endRam'] - $this->param['startRam']));\n    }\n\n    /**\n     * 计算消耗的内存\n     */\n    private function consumeRam($size)\n    {\n        $unit = array('b', 'kb', 'mb', 'gb', 'tb', 'pb');\n        return @round($size / pow(1024, ($i = floor(log($size, 1024)))), 2) . ' ' . $unit[$i];\n    }\n\n    /**\n     * 程序汇总处理\n     * @return array\n     */\n    public function TotalInfo()\n    {\n        return $this->param;\n    }\n}"
  },
  {
    "path": "Framework/Library/Process/Session.class.php",
    "content": "<?php\r\n\r\nnamespace Framework\\Library\\Process;\r\n\r\nuse \\Framework\\Library\\Interfaces\\SessionInterface as SessionInterfaces;\r\n\r\n/**\r\n * Session操作器\r\n * Class Session\r\n * @package Framework\\Library\\Process\r\n */\r\nclass Session implements SessionInterfaces\r\n{\r\n\r\n    /**\r\n     * @var string 缓存名称\r\n     */\r\n    private $Name = 'PHP300SESSION';\r\n\r\n    /**\r\n     * @var string 缓存周期,单位：秒\r\n     */\r\n    private $Second = 0;\r\n\r\n    /**\r\n     * 开启session\r\n     */\r\n    public function start()\r\n    {\r\n        if (!isset($_SESSION)) {\r\n            ini_set('session.name', $this->Name);\r\n            ini_set('session.auto_start', '1');\r\n            ini_set('session.cookie_lifetime', $this->Second);\r\n            session_start();\r\n        }\r\n    }\r\n\r\n    /**\r\n     * 获取session\r\n     * @param string $name\r\n     * @return bool\r\n     */\r\n    public function get($name = '')\r\n    {\r\n        if (!empty($name)) {\r\n            return (!empty($_SESSION[$name])) ? ($_SESSION[$name]) : (FALSE);\r\n        }\r\n        return $_SESSION;\r\n    }\r\n\r\n    /**\r\n     * 设置session\r\n     * @param string $name\r\n     * @param string $value\r\n     * @return string\r\n     */\r\n    public function set($name = 'php300', $value = '')\r\n    {\r\n        $_SESSION[$name] = $value;\r\n        return true;\r\n    }\r\n\r\n    /**\r\n     * 删除session\r\n     * @param string $name\r\n     * @return string\r\n     */\r\n    public function del($name = '')\r\n    {\r\n        if (empty($name)) {\r\n            session_destroy();\r\n        } else {\r\n            $_SESSION[$name] = NULL;\r\n\r\n        }\r\n        return true;\r\n    }\r\n}"
  },
  {
    "path": "Framework/Library/Process/Structure.class.php",
    "content": "<?php\n\nnamespace Framework\\Library\\Process;\n\nuse Framework\\App;\n\n/**\n * 系统结构加载器\n * Class Structure\n * @package Framework\\library\\_class\n */\nclass Structure\n{\n\n    /**\n     * @var array 应用列表\n     */\n    static public $ProjectList = [];\n\n    /**\n     * @var string 最后读入的文件\n     */\n    static public $endfile = null;\n\n    /**\n     * @var string 后缀信息\n     */\n    private $extend;\n\n    /**\n     * 初始化构造\n     * Structure constructor.\n     */\n    public function __construct()\n    {\n        spl_autoload_register([&$this, '__autoload']);\n        $this->getProjectList();\n        $this->RunTimeInit();\n    }\n\n    /**\n     * 获取应用列表\n     */\n    public function getProjectList()\n    {\n        $getPath = Running::$framworkPath . '/Project/';\n        $Project = $this->getDir($getPath);\n        if (is_array($Project) && count($Project) > 0) {\n            $array = ['runtime','config'];\n            foreach ($Project as $value) {\n                if (is_dir($getPath . $value) && !in_array($value, $array)) {\n                    self::$ProjectList[] = $value;\n                }\n            }\n        }\n    }\n\n    /**\n     * 获取目录\n     * @param $path\n     * @return array|bool\n     */\n    static public function getDir($path)\n    {\n        if (is_dir($path)) {\n            return array_merge(array_diff(scandir($path), array('.', '..')));\n        }\n        return false;\n    }\n\n    /**\n     * 初始化结构信息\n     */\n    private function RunTimeInit()\n    {\n        $this->checkPower(Running::$framworkPath . 'tmp');\n        $getPath = Running::$framworkPath . 'Project/';\n        $CreateDefaultDir = ['log'];\n        if (is_array(self::$ProjectList) && count(self::$ProjectList) > 0) {\n            foreach (self::$ProjectList as $value) {\n                foreach ($CreateDefaultDir as $default) {\n                    self::createDir($getPath . 'runtime/' . $value . '/' . $default);\n                }\n            }\n        }\n        require App::$app->corePath . 'Library/Common/helper.php';\n    }\n\n    /**\n     * 遍历创建目录\n     * @param $path\n     */\n    static public function createDir($path)\n    {\n        if (!is_dir($path)) {\n            self::createDir(dirname($path));\n            if (mkdir($path, 0777) === false) {\n                die('PHP300:No written permission -> (PATH:' . $path . ')');\n            }\n        }\n    }\n\n    /**\n     * 自动加载实现\n     * @param string $class 加载对象\n     */\n    public function __autoload($class)\n    {\n        $class = str_replace('\\\\', '/', $class);\n        $istrpos = strpos($class, '/Interfaces');\n        $framworkPath = $istrpos ? App::$app->corePath : Running::$framworkPath;\n        $this->extend = $istrpos ? '.php' : '.class.php';\n        $fileObj = strpos($class, 'App/') !== false ? $framworkPath . str_replace('App/', 'Project/', $class) . $this->extend : $framworkPath . str_replace('Framework/', '', $class) . $this->extend;\n        if (file_exists($fileObj)) {\n            self::$endfile = $fileObj;\n            include_once($fileObj);\n        } else {\n            Running::$iserror = true;\n            if (strpos($fileObj, 'Project/')) {\n                $this->getStaticTpl();\n                $error = [\n                    'message' => '您请求的方法不存在'\n                ];\n            } else {\n                $error = [\n                    'file' => $fileObj,\n                    'message' => '您引用了一个不存在的文件!'\n                ];\n            }\n            App::$app->get('LogicExceptions')->readErrorFile($error);\n        }\n    }\n\n    /**\n     * 寻找静态模板\n     */\n    public function getStaticTpl()\n    {\n        $file = Running::$framworkPath.'Project/view'.Router::$requestUrl;\n        if (file_exists($file) && is_file($file)) {\n            die(View('', $file)->get());\n        }\n    }\n\n    /**\n     * 检查权限\n     * @param $path\n     */\n    private function checkPower($path)\n    {\n        if (Tool::isWin() === false && file_exists($path) === false) {\n            if (file_put_contents($path, '') === false) {\n                die('PHP300Framework Adequate privileges are required to run!(' . $path . ')');\n            } else {\n                unlink($path);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Framework/Library/Process/Tool.class.php",
    "content": "<?php\n\nnamespace Framework\\Library\\Process;\n\n/**\n * 系统辅助器\n * Class Tool\n * @package Framework\\Library\\Process\n */\nclass Tool\n{\n    /**\n     * HTTP状态码\n     * @param string $code 状态码\n     * @return mixed|string\n     */\n    static public function httpcode($code = '200')\n    {\n        $http = [\n            '100' => '100 Continue',\n            '101' => '101 Switching Protocols',\n            '200' => '200 OK',\n            '201' => '201 Created',\n            '202' => '202 Accepted',\n            '203' => '203 Non-Authoritative Information',\n            '204' => '204 No Content',\n            '205' => '205 Reset Content',\n            '206' => '206 Partial Content',\n            '300' => '300 Multiple Choices',\n            '301' => '301 Moved Permanently',\n            '302' => '302 Found',\n            '303' => '303 See Other',\n            '304' => '304 Not Modified',\n            '305' => '305 Use Proxy',\n            '307' => '307 Temporary Redirect',\n            '400' => '400 Bad Request',\n            '401' => '401 Unauthorized',\n            '402' => '402 Payment Required',\n            '403' => '403 Forbidden',\n            '404' => '404 Not Found',\n            '405' => '405 Method Not Allowed',\n            '406' => '406 Not Acceptable',\n            '407' => '407 Proxy Authentication Required',\n            '408' => '408 Request Time-out',\n            '409' => '409 Conflict',\n            '410' => '410 Gone',\n            '411' => '411 Length Required',\n            '412' => '412 Precondition Failed',\n            '413' => '413 Request Entity Too Large',\n            '414' => '414 Request-URI Too Large',\n            '415' => '415 Unsupported Media Type',\n            '416' => '416 Requested range not satisfiable',\n            '417' => '417 Expectation Failed',\n            '500' => '500 Internal Server Error',\n            '501' => '501 Not Implemented',\n            '502' => '502 Bad Gateway',\n            '503' => '503 Service Unavailable',\n            '504' => '504 Gateway Time-out',\n            '505' => '505 HTTP Version not supported'\n        ];\n        return !empty($http[$code]) ? $http[$code] : 'Unknown';\n    }\n\n    /**\n     * 获取客户端IP\n     * @return string\n     */\n    static public function getIP()\n    {\n        if (isset($_SERVER)) {\n            if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n                $realip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n            } elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {\n                $realip = $_SERVER['HTTP_CLIENT_IP'];\n            } else {\n                $realip = $_SERVER['REMOTE_ADDR'];\n            }\n        } else {\n            if (getenv(\"HTTP_X_FORWARDED_FOR\")) {\n                $realip = getenv(\"HTTP_X_FORWARDED_FOR\");\n            } elseif (getenv(\"HTTP_CLIENT_IP\")) {\n                $realip = getenv(\"HTTP_CLIENT_IP\");\n            } else {\n                $realip = getenv(\"REMOTE_ADDR\");\n            }\n        }\n        return $realip;\n    }\n\n    /**\n     * 302重定向\n     * @param string $url 跳转的URL地址\n     */\n    static public function redirect($url)\n    {\n        header(\"Location: {$url}\");\n        die();\n    }\n\n    /**\n     * 生成URL\n     * @param string $name 地址\n     * @param string $parm 参数\n     * @return String\n     */\n    static public function Url($name, $parm = '')\n    {\n        if (!empty($name)) {\n            $SSL = (self::isSSL()) ? ('https://') : ('http://');\n            $Port = self::Receive('server.SERVER_PORT');\n            $Port = ($Port != '80') ? ($Port) : ('');\n            $ExecFile = explode('.php', self::Receive('server.PHP_SELF'));\n            $Path = (count($ExecFile) > 0) ? ($ExecFile[0] . '.php') : ('');\n            $Url = $SSL . self::Receive('server.HTTP_HOST') . $Port . $Path;\n            if (strpos($name, '/')) {\n                $PathArr = explode('/', $name);\n                foreach ($PathArr as $val) {\n                    if (!empty($val)) $Url .= '/' . $val;\n                }\n                if (!empty($parm)) $Url .= '?' . $parm;\n            }\n            return $Url;\n        }\n        return false;\n    }\n\n    /**\n     * 判断是否为SSL连接\n     * @return bool\n     */\n    static public function isSSL()\n    {\n        $HTTPS = self::Receive('server.HTTPS');\n        $PORT = self::Receive('server.SERVER_PORT');\n        if (isset($HTTPS) && ('1' == $HTTPS || 'on' == strtolower($HTTPS))) {\n            return true;\n        } elseif (isset($PORT) && ('443' == $PORT)) {\n            return true;\n        }\n        return false;\n    }\n\n    /**\n     * 获取http数据\n     * @param string $name 获取的名称\n     * @param string $null 默认返回\n     * @param bool $isEncode 是否编码\n     * @param string $function 编码函数\n     * @return string\n     */\n    static public function Receive($name = '', $null = '', $isEncode = true, $function = 'htmlspecialchars')\n    {\n        if (strpos($name, '.')) {\n            $method = explode('.', $name);\n            $name = $method[1];\n            $method = $method[0];\n        } else {\n            $method = '';\n        }\n        switch (strtolower($method)) {\n            case 'get':\n                $Data = &$_GET;\n                break;\n            case 'post':\n                $Data = &$_POST;\n                break;\n            case 'put':\n                parse_str(file_get_contents('php://input'), $Data);\n                break;\n            case 'globals':\n                $Data = &$GLOBALS;\n                break;\n            case 'session':\n                $Data = &$_SESSION;\n                break;\n            case 'server':\n                $Data = &$_SERVER;\n                break;\n            default:\n                switch ($_SERVER['REQUEST_METHOD']) {\n                    default:\n                        $Data = &$_GET;\n                        break;\n                    case 'POST':\n                        $Data = &$_POST;\n                        break;\n                    case 'PUT':\n                        parse_str(file_get_contents('php://input'), $Data);\n                        break;\n                };\n                break;\n        }\n        if (isset($Data[$name])) {\n            if (is_array($Data[$name])) {\n                foreach ($Data[$name] as $key => $val) {\n                    $Data[$key] = ($isEncode) ? ((function_exists($function)) ? ($function($val)) : ($val)) : ($val);\n                }\n                return $Data[$name];\n            } else {\n                $value = ($isEncode) ? ((function_exists($function)) ? ($function($Data[$name])) : ($Data[$name])) : ($Data[$name]);\n                return (!is_null($value)) ? ($value) : (($null) ? ($null) : (''));\n            }\n        } else {\n            return $null;\n        }\n    }\n\n    /**\n     * 将字符编码转换到utf8\n     * @param string $string 欲转换的字符串\n     * @return string\n     */\n    static public function toUTF8($string = '')\n    {\n        if (!empty($string)) {\n            $encoding = mb_detect_encoding($string, array('ASCII', 'UTF-8', 'GB2312', 'GBK', 'BIG5'));\n            if ($encoding != 'UTF-8') {\n                return iconv($encoding, 'UTF-8', $string);\n            }\n            return $string;\n        }\n        return false;\n    }\n\n    /**\n     * 判断是否为get请求\n     * @return bool\n     */\n    static public function isGET()\n    {\n        if (self::Receive('server.REQUEST_METHOD') == 'GET') {\n            return true;\n        }\n        return false;\n    }\n\n    /**\n     * 判断是否为POST请求\n     * @return bool\n     */\n    static public function isPOST()\n    {\n        if (self::Receive('server.REQUEST_METHOD') == 'POST') {\n            return true;\n        }\n        return false;\n    }\n\n    /**\n     * 判断是否为Ajax请求\n     * @return bool\n     */\n    static public function isAjax()\n    {\n        if (isset($_SERVER[\"HTTP_X_REQUESTED_WITH\"])){\n            if(strtolower($_SERVER[\"HTTP_X_REQUESTED_WITH\"]) == 'xmlhttprequest'){ return true; }\n        } else {\n            if(strpos('application/json',self::Receive('server.HTTP_ACCEPT'))){ return true; }\n            return false;\n        }\n        return false;\n    }\n\n    /**\n     * 判断是否为cli运行模式\n     * @return bool\n     */\n    static public function isCli()\n    {\n        if (Running::$runMode == 'cli') {\n            return true;\n        }\n        return false;\n    }\n\n    /**\n     * 判断是否为windows\n     * @return bool\n     */\n    static public function isWin()\n    {\n        if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {\n            return true;\n        }\n        return false;\n    }\n\n    /**\n     * 生成随机字符串\n     * @param int $len 字符长度\n     * @param bool $lower 是否转小写\n     * @return int|mixed|string\n     */\n    static public function RandStr($len = 8, $lower = false)\n    {\n        $str = null;\n        $strPol = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz\";\n        $max = strlen($strPol) - 1;\n\n        for ($i = 0; $i < $len; $i++) {\n            $str .= $strPol[rand(0, $max)]; //rand($min,$max)生成介于min和max两个数之间的一个随机整数\n        }\n        return ($lower) ? strtolower($str) : $str;\n    }\n\n    /**\n     * 通过一个文本影响加密字符\n     * @param string $pwd 影响密码\n     * @param string $str 欲加密的内容\n     * @return string\n     */\n    static public function impact($pwd,$str='')\n    {\n        return md5(md5(base64_encode($pwd)) . md5($str));\n    }\n\n    /**\n     * 获取Public路径\n     * @return string\n     */\n    static public function getPublic()\n    {\n        $scriptName = str_replace('\\\\', '/', dirname($_SERVER['SCRIPT_NAME']));\n        if (empty($scriptName)) $scriptName = '/';\n        if (substr($scriptName, -1) != '/') $scriptName .= '/';\n        return rtrim($scriptName) . 'Public/';\n    }\n}\n"
  },
  {
    "path": "Framework/Library/Process/Tpl/error.tpl",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n    <meta charset=\"utf-8\"/>\n    <meta name=\"renderer\" content=\"webkit\">\n    <title>PHP300Framework Error!</title>\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <link rel=\"icon\"\n          href=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAADZ0lEQVRoQ+2Yj5ENQRDGv4sAEbiLABEgAkSACLgIEAEiQASIABG4iwARIALq92q+V61vdnb2zd2pV7VddXV3Oz3d/X39Z2b3QHsuB3sev1YA/zuDawbWDAwysJbQIIHD29cMDFM4aOAiM3Ao6XqJ74ek74OxVrePALgp6YYkAr0j6aoknvXIiaRfkj4XYKeSeLZYlgAgwHuS7oeAFztsbDCgD5I+FoCz9nsAwO6TEviswaLwJSje7t2U9ADyumRp0kQLAEy/LCWyNAbbpaS+Lt2c9CmtF5IAdEZqAKjpN6VMdvEN+2QNeVRs7WIn76FfHudhkAHAOsFT77sKaX9aNr8q5berrbyPPgHENhsRQIutB42mokwI2CMTB2+LZ9YiGfwNSQ/L+rugm4PNunF968MAMPp+gqbfnRmBFabUrY6R6MxATLW2QyxTxN6lwQEA0m+NIHNNmz3SGacEvYOd2MAMAQRd2Haw9MgnSUehpvnfgh767ENMTuSYtSOckX47qiWBCfC8LFAaBmDdWIY4IptIZi4SAQB0XV4GFP0fSyJTCP6fVYI7xjljrnWCxjQzCfJcjwBwZLDZKYwCygERtKdVjcRI3BSAE5z/mah9P45pzrrccSgdhN+wb9Yy2Mgo7DPfDbY2rSJxtRLaOO0B0DqU4sSBRYIicORn6qtN05U1egVA7okMlruRq4Iyw1ZVCA6nXMpqkuvWjNFA9IMD8CC4FrJBkFFMhAOKmTUw9LGJbTcw09F9lWM8nWvieChNkQBTHH7YMmt5LEdG3bA99zDsum9q/jdNDCPc1a9UNPKhFHV80BAsf8OiM4TT6Divwb4bOL43OAQfju6vWvCcT4dmoTbG2BQPpVzTUxnpeX4e143tQWaHtRPPAH1I9QTXoxMzWxvNczbOXCW8gXKggSiV2MCtq8acs9p6zOzcGI/7KRuIrl7mrAjbgGAy+TWPZ616XAoiTh33wpwNCCX4f96t515oaMqpETvn8LzWmWCcMRH01nbPKIMhkOc70HkFOGXHV+1q4N7UA8C6cWwCqjZ2R0BR3wRLffPjg6xpcwmAbIhZzY8/q7De+wLvl35/VqHXLvyzylJ243cifwdaamNWfyQDs8YvQ2EFcBkst3ysGVgzMMjAWkKDBA5vXzMwTOGggb3PwF/kIbPOIIIdMQAAAABJRU5ErkJggg==\"/>\n    <link rel=\"stylesheet\" href=\"{$Path}system/css/bootstrap.min.css\"/>\n    <link rel=\"stylesheet\" href=\"{$Path}system/css/zenburn.min.css\"/>\n    <style>\n        span {\n            cursor: pointer;\n        }\n    </style>\n</head>\n<body>\n<div style=\"padding: 48px 0;\">\n    <div class=\"container\">\n        {if !empty($Error.type) }\n            <div class=\"alert alert-danger\">错误级别：{$Error.type}</div>\n        {/if}\n        {if !empty($Error.file) }\n            <div class=\"alert alert-danger\">错误文件：{$Error.file}</div>\n        {/if}\n        {if !empty($Error.message) }\n            <div class=\"alert alert-danger\">错误原因：{$Error.message}</div>\n        {/if}\n        {if !empty($Error.line) }\n            <div class=\"alert alert-danger\">错误行数：{$Error.line}</div>\n        {/if}\n        {if !empty($Error.code) }\n            <pre>\n<span class=\"label label-default\">区域预览</span>\n<code class=\"php\">\n{$Error.code}\n</code>\n<span class=\"label label-info\" data-toggle=\"modal\" data-target=\"#myModal\">$_SERVER</span>&nbsp;\n</pre>\n        {/if}\n    </div>\n</div>\n</body>\n<div class=\"text-center\">\n    <a href=\"http://framework.php300.cn\" target=\"_blank\">PHP300Framework2.0 - 更灵活,更强大</a>\n</div>\n\n<!-- 模态框（Modal） -->\n<div class=\"modal fade\" id=\"myModal\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\" aria-hidden=\"true\">\n    <div class=\"modal-dialog\" style=\"width: 80%\">\n        <div class=\"modal-content\">\n            <div class=\"modal-header\">\n                <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\">\n                    &times;\n                </button>\n                <h4 class=\"modal-title\" id=\"myModalLabel\">\n                    所有$_SERVER变量 (按CTRL+F即可搜索)\n                </h4>\n            </div>\n            <div class=\"modal-body\">\n                {foreach $Server as $value}\n                    <b>{$value@key}</b>\n                    <font color='red'>>>></font>\n                    <b>{$value}</b>\n                    <br/>\n                {/foreach}\n            </div>\n            <div class=\"modal-footer\">\n                <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">关闭\n                </button>\n            </div>\n        </div>\n    </div>\n</div>\n<script type=\"text/javascript\" src=\"{$Path}system/js/jquery.min.js\"></script>\n<script type=\"text/javascript\" src=\"{$Path}system/js/bootstrap.min.js\"></script>\n<script type=\"text/javascript\" src=\"{$Path}system/js/highlight.min.js\"></script>\n<script>\n    hljs.initHighlightingOnLoad();\n</script>\n</html>"
  },
  {
    "path": "Framework/Library/Process/Tpl/error_page.tpl",
    "content": "<!DOCTYPE html>\n<html>\n\n<head>\n    <meta charset=\"utf-8\" />\n    <title>{$data.title}</title>\n    <style>\n        body {\n            text-align: center;\n            margin-top: 10%;\n        }\n\n        h1 {\n            color: #666;\n            font-size: 36px;\n        }\n\n        p {\n            color: #999\n        }\n\n        .btn {\n            width: 25%;\n            height: 60px;\n            background: #028bfa;\n            line-height: 60px;\n            cursor: pointer;\n            color: #fff;\n            font-size: 18px;\n            border-radius: 4px;\n            margin: 0 auto;\n        }\n    </style>\n</head>\n\n<body>\n<img src=\"data:image/jpg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAQDAwQDAwQEBAQFBQQFBwsHBwYGBw4KCggLEA4RERAOEA8SFBoWEhMYEw8QFh8XGBsbHR0dERYgIh8cIhocHRz/2wBDAQUFBQcGBw0HBw0cEhASHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBz/wgARCADhAPsDAREAAhEBAxEB/8QAHAAAAgIDAQEAAAAAAAAAAAAAAAMEBwECBQYI/8QAGwEBAAIDAQEAAAAAAAAAAAAAAAECAwQFBgf/2gAMAwEAAhADEAAAAPv4AAAAwYNFtKytKotyqbPKx7aV5VsXbyaEiasmGKsRvaN1cmQAAAAAAADUwKrZa3msXSrbR9P4fV7nJpuLiUrKrcmvqNjlWLt+bsvd81NnG6aOV3tXJsAAAAAABqarJrPNrsU7zvZ19pekSnRZcSlZVbrELLi6Vuxl0r86fgffbfAkzV6jrRsrsAAAAAGpqsms8Gm9QPI+h8XDvKTosuJSsqt1iFlxdKyUrXWi9Oj4a6Oh42ZbHImj7UybAAAAGDURW/FpufPXH+jcjFuqTosuJSsqt1iFlxdKyUrXTUlkVWb/AOv4C6t7xsy2OVNG2psZAAADUXW0SMnz5yfonk9bsKTIti1OZTaVW6xCy4ulZKVr6HXvo+ZwdNS2qPrPu/KPf7HEnXxyWNlq7AAAYFrIrat9P0lJ8v3Sk6Le/wB3y3odjlVNzfa8XDvoWXF0rJStfQtvoeL9ts8H5l4f1PnV2Uretz8f7C73yTo3wTpxvtXdXIABqJraLGX5r430zgYehosuJ2nHafT8bMnWqLm+44OHopWSla+hbvQ8X7fZ4NLc329dafpUrKrKVvrHufKbS3fN9CcUucbLV2ADBqR638lh63zlxfpWiy4lKyq3ZbFbvU8T0LatK8v3fncXSWusuLo+K9xtcClOX7mt9P0qVlVlKy4m2t/yn1F2fmfUvgmzikWpuAGBdbRGSqND1VPc72q4lKyq3WIWdbHdXU8J0LatFcv3/nMXTujo+H9xtcGj+X7qttP0yVlVlKy4lLJ3svP+2/RfF+vbX6F8Mm1WK5AwKraHGSjub7qttH0yVlVusQsuLpWfbDevV8B1cmp5rB1fYbHEorme8rHR9QlZVZSsuJSyLTrV96+o+FdzJq9KcMucbbVyBqJreFGSiOV7yudT0qq3WIWXF0rJSteXbB9N9r5bOtip3nexpDm+3SsqspWXEpZFpRWyz7r9N8R9Vm53UnBMnE+1cgaket4kZKJ5nu6z0PUrELLi6VkpWusu7peFsbc85zMe1Mth+X+L9P8AHa3XSsuJSyLSitlil/vX03wz0mTQ6l8E2cbrU2A1E1vCjJTvP9hTfN9ohZcXSslK11lzdHxFhbfnaP5nuvAafoPprt/MupfU+WuJ9R8fr9ZLItKK2WKrfo5Nf7u9N8O7VtbqXwTZxutTYDUTW0OMvgdXufN/H+lLi6VkpWusuHoeK99t+epTm+4rLR9QlabOv9O9v5l0Lavy5xfqHj8HYRWyxVbrWsrc839e9/5P2b6/SnBMnE+1cgYFVtEjJyo2PlHgfWOPTcSla+hb3Q8X7vb4FLcv29a6fpkrKrKVp18H052fmPUvq/LPF+o+O1+sqt1rKT9Q9r5lePR8d1ra3SthmTjZauQMC1o1bc+malef7Oled7Za6arM3/K2VueXprm+2rfT9MlZVZSsuJSyTr631B2fmHUya3xr5/7Bz8eypPYy6X3D6P4t38mp1p1598Mq1N0ZADQTW8GMvEx7Xyrw/q3n8W8lk7+XmyZw+G1u8lZVZSsuJSyLSitp99ezN3zNMc32KV1rfVHa+X3P0PIde2v0r4J043WpuAAai62iMnPpl8Jr9z5g4f0+FGVSyYulZVZSsuJSyLSitliq3WspK1rj3/H/AFL2/mfUtg6c4OhfFKY2WrsAAYNSPW8OMnPrnrXT9H82cf6PArsJWVWUrLiUsi0orZYqt1rKSta1t7y31Z2vl/Vya/SnD0bYJU45FqbGQAANRdbR1oUZOfXP4jW7Hzfx/o/k8HVSsuJSyLSitliq3WspLZpfnU8Jf3T8L08mHoTgn2wzJxyVd7V2AAADBqKrZDJCpkgMvMrnqDQ9bTnO9h5HB1VrorZYqt1rS7YbS3vMXv0/C+rz82fbFPnDNthmzWSxstXJkAAAA1MCq3QvEi0KuaFGSHXJ5fD0vE6/a4eLejxadfD6jNy/bbHGnXwyJpMnHOnFMtilzV6jbU2MgAAAABqYFVslZEXiVyRl40XTF1p0iQ3mGIkTR6kuccm1HzSQrvauTYAAAAAADBg0rZKVrpiU1uhOkzhYMq7ofEOtR0w5RiN7VyZAAAAAAAAMGDBpW2idErW0hhIZRvJiu6GI2tXJkyAAAAAAAAAAYMAYNa2wAAZNrVyBkyAAAAAAAAAAAAAGAAAAAMgAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/8QAJhAAAgICAgEEAwEBAQAAAAAAAQIDBgQFAAcREhMgMAgQFEAYUP/aAAgBAQABAgD5+fUWMhkafLs0nYy9mY98xtgJVlWQSBvV5+4ku0m+u237d2NiJJZyYMzU9pV/unDz0lSRXU/aSz7TbWftBnJJJZySWdnJrlzpXaEUqSI4P1ks9islispJJJLOSSzs5LOzrL1n21DLFIjqfoPCWff7zf78kkklnJJZ2clnZ2dnL9Q9nQyxSI6kfM8YzS3q0kk4Ou2WoZySWdnJZ2dRmUpnZ4snrS8QSxOh+R4TI/aVkJJJoMudib/Rks7OSzs6ik0pn20rOz9aXDHnhkjcEfE8kMr27ckkk4Ox0O8zdfZK+zks7OopFIPL9fWdnZ2fpu0Y8kLIV+B4eSG87UkklnJwNjXbBsNdaK2zs6JR6MR2Df2dnZ2cn8fN7jyQPER8DxjKe4s8klnJJZ9ftazY9jrLbVkSi0EjsLsFnZ2dnJZ6HtMV8d4SnB+zyQynuLIJZySWdnJ1e4qtn2OoqfXDp2N2Kzs7Ozks7PDPrJ8cwmLg/Z5JyY9wlnJJZ2clnZ9JtdZJ6O6d4zs7Ozks7OSTVZccwmPg/Z5JybncsZJLOzks7Oide0L11217nTXujs7OSzs5JJOggxuQcj4v7PJOTc7pxCWdnJZ2dEodGR+yeydLvqXd95p75SCWdnJJJrOBiDG5ByPi/s8k5MOzNYzs5LOzolFo6nsXsVnZ9JvqZeN1qL5R2ckkknonTYoxxCI+D9nkglGbBY9WSzs6ikUoHsLsNnZ2dn0e/pd33WnvlGJJJJ/HysYqY4hCAfs8bkgnTuits7Oz9X6Pzf8AsFnZ2dnJZ9FYKXd91ptzhkk1CuanAxUgSMJwfA8kEybXX22vM7PVbraexmdnZ2clnZydFYdh+QcspJPRtAx48eOFIwPieMJUyI79S8/EZ2dnZ2dnJZ2ckkkkknpXq6CLHigjhRAvxPCJEljmi7G66z8NnZ2dnJZ2ckkkkknqjqLCw4IoIoY40UD5sJEljmiutAttGZ2clnZySSSScLB656Ex8aCCCKGONEHzPCGSSOWKWDMwbZ0Zv+vmLOSSSTrNNV/x9qlEhghghghiijRAB9B4QySRyRSwS48mPuKFn9Bz/jp/zlj/AI7azpvD1iY0WPDjwwRRRRoigfWQyNHJFJBJjtitjHG/m/kGImMmNHjxwRxJGiKAPr8EFGjaJomgOOcf+f8AnXHGOkCRJGsYT0+Pt8ekgoYzGYvZ9n2fZWJY1jCKOeP8Hj0+n0ej2/b9v2/R6PT6fH+Xx48ePHjx4/8AM//EAEYQAAIBAgIHAwYMAwYHAAAAAAECAwQFABEGEiExQVFhEyAwEBQiQFKRIzIzQmJxgaGxwcLRFUNyJDRTgqLSNVBgY3SUsv/aAAgBAQADPwDxABmTkOeLVRf3m5UkR5PKoPuzxo3HvusX2Bj+AxowT/xVfticfiMaPVRyjvFJ9Tvq/jiCrGtDOko5xuG9ZtNgDLVVOtPwgi9J/dw+3FxqCVt0CUqcHk9N/wBsXW6lvO6+eUeyXIX3Duz0j68Ezwv7UblT7xjSS1EA1nncQ+ZUjW+/fi1V5SK6RGhmOQ1/jxk/iMQ1kCzU8ySxOM1dCCCOhHqlLaaR6qrmEMK72fnyGKy469Pa9akpdxl/mOP04LlmY5k7STv8K7aK1HaW+pYRE5vA+2N/rXFs0rCUzHzS58aeQ7H6qePqVHo5QGqqn2nZHEPjSNyGK7SSsaerfJAfg4R8WMeK0TCSN2WRTmrA5EEcQcLcTDaL7MErdiw1T7BLyVuTeoU1ht01ZVH4NNgUb3Y7lGKvSG4PV1T79iRj4sa8FHj8sfxUR2G7Tf29BlBO5+XUcD9IeMERixyQbSTwGG0jupERPmFOSsK8+b/b+HlqrpK0VJC0rjactgA6k4rbSQKuFkDfFbYQftHgtK4jjDNIxyVRtJJ4DF+o6NquWgbsgNZgCrMBzKg+WWmmjnhkKTRsGV1ORDA5gg4j00sEc7kCvgyiqYx7fBh0Pim22sW6F8qitzDEbxGP33dyD+GVEaFe3EmbjjlkMsQ3CmeCdNaN945dR1xPY6jVf0oG+Tl59D177SuI4wzSMclUbSSeAwtmQV1citcGHorvEIP54WJGeQqsaglidgAG/PED3Osal2UzTOYx9Ascvu8raIaU008j5UNRlBUjhqE7G+zfgMAQ2YO4+HqhsG+X6sqwc4s9SL+gbB+/cnttSlTTPqyL7iORxBfKbtI/RmTZJFxBxBcaV6apTXifePzGKiwVOo3p00nycvA9D17ryyCOMM0jHJVG0kngMLZkFdXIrXBh6K7xCDw+vCojM5VUQZsTsAA4nBu7vbbc5FvU5PINhnI/T3TpDodSiV9aroT5tLmdpyHot9q+H/CdGq+YHKRl7Jf6m2d6otdWlTTPqyJ7iOR6YptIKTtIvRnTZJEd6H9sU90pJaWqj14pBtHEdRip0cq9R9aSlkPwU3A9D18ryyCONGaRjkqjaSTwGFsyCurgGuDDYu8Qg8B1wsSMzMqoozJOwADBu7vbLY5W3qcnlGwzkfp7xo9J6y1sfgq6HWH9abfwJxu8LUobdRg/KyNIR0UZfn36m0ViVVK+rKvuI4gjFLpHR9rF6M8eQlhO9D+2Ka7UctLVRLJC4yI5dRyOKrRes1H1pKSUnsZufQ8jh5pEiiRnkcgKo2kk8BhbHGlfXgPcWGxd4gB4DrhURnYqiKM2J2AAYN3eW2WtyLepyklGwzkfp75tGmlkquC1KK39LHVP3HwdnkJvdBDwWn1h9rkfl4FVZq2OrpJdWWPhwI4gjiMUmk1F2sPozpkJYSdqH8ximvNFLSVcaywSjIg8OoPA4pNGquarkfzup1yIXcZdmn+7rhURnYqqqMyx2AAcTg3l5bXa5SLchyklGwzkcB9HwGgmjlX48bhl+sHPHa08MntID7x4WWkdL/4i/wD2/g11nucFTbi3nWYVUAz7TP5pA354nqKKCWqg83qZIwXhz1tRiNozHkvFGIbbFCYLVOMzUIfl24oSNwHLwjLYbVId70sRP1lR4RF5oJfagK+5z+/gPLIkcaMzsQAoGZJO4AYSxolwuCBrm42LvEAPAfSwsUbSSFVRRmzE5AAbyTi06Tec/wAOqRMaZijruPRgD8088UV+ts1BXwrLTTDIg7weBB4HFboXcezkzmoJifN6nLYR7J5N4Jp7XRQ/4UCL7lAxu8H+y2ysHzJHi94BH4d95ZBHGjNIxyVRtJJ4DCWREr69Fa4sPRXeIAeA64WJGZiqogzZjsAA4nDXwy2q1SlbYpyklGwzkfoxW6OXGG4UEzRTxH7HHFSOIxQ6aWzt4CIquLIVFMTtjPMc15HFFfrfNQV8KzU0wyIO8HgQeBxWaF3HUkzmoJifN6nLYR7J5N32u2kVqoQM+3qY0I6FhnjVAA3Y3eCbhonXBRm8GU6/5Tmfu7zyyCNAzSMclUbSSeAwtmRK6uCtcGGxd4iB4DrhURnYqqKMyTsAA44a8l7Xa5StuU5SSjYZyP0+Wu0cuUNwt83ZTxH/ACuvFSOIxQ6aWzt4PgquLIT0xPpRtzHMcjijv1umoK+FZqaUZMDvB4EHgcVuhdw1JM5aCYnsKnLYR7J5N3jdtPIakjOK3RPOT9IjVGN3l2d9J43jkGtHICrA8Qdhw9jvVdb5P5EhCnmp2g+49x5ZBHGGaRjkqjaSTwGEsyCurgGuDD0V3iIHgOuFiRnYqEUZknYABhruXtdslYW9TlJKNhnI/T3a7Ry5w3Cgm1J4uHzXXipHEYodNLZ28HwVVHkJ6cn0o26cxyOKO/W6agr4VmpphkyneDwIPA4rdCrjqSZzW+Ynzepy2EeyeTd02vRaW6TJlPdJNYcxEmYX3nM43eGXigvcKbYsoZ8vZJ2N+Xcp3ppbrIgkqe0MUee3swAMyMKgZ3ZQqjMk7AAMNdy9stkpFvByklGwzkcB9Hv12jVzhuFvm7KeLePmuvFSOIxQ6a2sVMB1KpMhUU5PpRt+Y5HFFf7ZUW+vhWammGTA7weBB4HH8LutfQ6+v5rM8Otz1WIz+7yz6W6R0Vqgz+Hf4Rx8yMbWbENBRwUtMipBBGsSINwUDIDxIbjSVFLUprwzKUdTxBGWKjRe8z0E2sVHpRSf4kZ3Hy1WirSosSz0spzeInV9LdmDiu0hpvNIoRR0rfHVH1mk6Fshs8Gv0aucdwt83ZTx7+Kup3qRxGK+otzw0toip6xky847YuoPEhcsNLI8jFmdiSzHaSTvPlbRqym610WrdLkgIU74YuC/bvON3ixaW2oxDJK6HNqeU8DxU9Diot1VNSVUbRTwuVdH3gj1B79WQ6QXaHK1QPnBFIP7w4/SD7z6hDpXTGqpQsV2hHoPuEwHzG/I4qbbVy0tXDJBUxHJ43GRB8ao0tnhut2jeGxodZFOxqo8h9DmcR00McMMSpFEAqIgyCKBkAAPUbbphTatSnZVaD4KpjHpJ0PMdMXjRGcitg16UnJKqLMxvyz5HofDqrpVR0tHBLUVEpyWKIFmJ+oYEEkNy0pAllGTJQIc0B/7h4/VhUREVFVFACqNgAHAepxVELxTRpLFIMmRwGUjkQcW+vLz2WbzGY7exfNoifxXGkejhc1dtlaEfz4PhEy+sfng55HvXK9y9jbaCpq5OUSFvfli73FklvtSlBBvMMWUkpH4DFl0Qp+ytVEInYZPM/pSP9bH1fpjR+9ktXWmmlkIy1wmq3vGNGqo5wPXUnSOUMP9QOKI/JXupTo8Kt+BGKfjfp//AFh/uxY0IM9yuEv1aig/6caIW3daUnf2ql2k+4nLEFHCIqaBIYhuSNAqj7B5Onq/THTydMdMdMdPXenl6f8APRgYH/SH/8QALhEAAgECBAUCBgIDAAAAAAAAAgMABBIBICIwEBMxMkARYQUhQlFScRQVI0Fg/9oACAECAQE/AN3Fwj9U/lB+U/lJ/KC9ZfVMMbp6+Qx6190OtIu2Ewi7iyiVsCrYMXXCXd8oON3iGYiNxR1WRaR21uJfbEVQs/fhMYKx1RjiYWrepau7SXgMYKxuKMYTCuLwKSqu/wARdd+odzC9uIARdsNZD3bWKGCN1vESlM/nD77tW60bfvkpcdMPASG0oxZL2EIt1F14Hjq08aV3LZB28Y8+Yy7IBkJXDFsFgwwEhtKNSSyzIRbqLrwqKi7SPTLRM5i/1B2nnasswGQlcMWwWDDASG0o1JLLIint1F14VFRdpHpmoDtZb94O1WY6RHOBkJXDEuFgwwuG0o1JLLgim5eouvCoqLtI9M6DtYJQdqsx1DsAZLK4YlwsGGAkNpRNOKyu4VVVdpHpseswg7NZ37KzIS0wO3VwrmMHT/raX2jBmGxWdw7NNT8vUXXgtos7YYCwbSj0EkvbZXhpg7NdhpEthCOXqLrwqqq7SPSAwllcMQ8XDDAWDaUegkl7Z14XMEZhB2MZVBcss9Mi3UXXhUVF2kenFTCWVwxLxcMMBYNpR6CSXtmoQub+oMGYbGOEYHLK3KhFuouvCoqLtI9MoMJZXDEPFwwwFg2lHoJJe2WgXau77wdusX9WSkWNt3CoqLtI9M4MJZXDEPFwwwFg2lDwtK3ilfMZbAwtG2DtnhcNsasllbxS8lxtUTBt2VsJZXDMa8re3JQo5Y3F1xmEHcqEcwfeHgQlaXgUVLzC5pdOA71RTczUPWY4EOkt6lpCZqLtg4eC9AujUMT3bYiRaRlNQfU2enh44XR1CJdvyjKZi+4c4ARdsXQEXd8olC19vjWz0hoWXcMxoFlMfhw/lP64fyg/Dl/lApEj9MHC2ektlvj2y2Wz0npLZbLZb5Vstlstlvm+k9PN9Mvp/wAd/8QAQBEAAAUCAQgGBwYFBQAAAAAAAAECAwQFEhEGEyAhMDEyQRQiI1Gx4RAzQEJhgaFSYnGRwdEWQ1Pw8SQ0YHKy/9oACAEDAQE/ANlgLQkg1Bfc4WzP5AqJNV/LP6A6FP8A6f1ILpM1viZMKaU3xJwFotFow9ktEKlSZXq06u/kIuTLSfXqu+gYgx2fVNkWitpLibVpxEmgQnvdtP4CZku+31mFXF9Q40ptVqk4GDIW+w4BiO5IczTScTFOyfaZ67/WV9AlOymU2POTa6nX38xVKC/B63Ejv/cGQMhhtkkIMFyY5mm/8CBT2YbdrX57U03dVQrmTuZukxk9XmXd5AyBkDLaEIcRcp1LTQhQm4bOaa/zt8BlDQ8z/qWE9TmXd5AyBkD2aSFHp3Q2etxq3/t6X5DcdNzqsBGlsyPVK2JmlKblBurRHHM0lzX6VoS6mxe4Vqlqp79nuK4QZAy2SRk/Bzz2fVwp8dCuIczyVe7gGHnGXM6neIM5uU397mWmZpSm5Qq1WVIVmmuDxCSuV1RGSpLKc7xYFj6a5TunRFJTxJ1pCyBkD2CQkhS4vRYyW+fP8dB9ht5vNO7hOhORXLVbuQZfcZczrW8QJ7cxv73MtEzSlNyhVqt0hWaa4PEcQo1G6P27/H4eejlHB6LNVbwq1gyBg9MhSI/SJbafn+Wk/HbkN5p3cJ0FyG5ardyMMPuMuZ1reKdPbmN9Xi5l6TNKU3KFWq3SlZprg8RxCjUbo/bv8fh56WV0XORkv/ZP6GFkDB6SQkZMM3OOO9xab8duQ3mndwnwXIblqt3IwxIcjuZ1reKbUW5zf3i3kDUlKblCrVjpSs01weIT1hRKN0ft3+Pw89OrMZ6E818AsgYPSSEjJdHYOK+OwkRW5Dead3CowHILlqt3IwxIcjuJdaVgZCpVxyY2lpPVTz+PkE9YUSidH7d/j8PPYGi5NodK1SkhYMHokEjJf/bK/wC36FsZcdmQypL/AAh8kpcUlpVxd4xGTEWM5c+pVy08u747KcVr7n4n4hYMHokEjJY+wcT8dgakpTcoVmsKldgxwePkMLuqkTID8O3PpwuEWU5HcS60rBRCkVVuoN3J1LLeX98tjKXc8pXxMLBg9EgkZKudo4389MzSlNyhWKwqV2TXB4jC4UOh9H7d/j8PMSojMplTTqdQqdLep71quE9xiLIciuJdaVgohSKq3UG7k6llvLTnPZmM479kjCwsGD0UhIoT+Zmt/e1aRmlKblCrVZUrsmuDxGFwolE6P27/AB+Hn6ZURmUypp1OoVOlPU921XCe4xFkORXEutKwUQpVVbqDdydSy3l/fLSyqkZmApPNZ4fqFBYMHopCQ2u1VyRAkJlR0vp97QM0pTcoVarKkdk1weI4hRqN0ft3+Pw89GTEZmMqadTqFUpbtPdtVw8jEWQ5FcS60rBRCkVVuoN3J1LLeX98tHK6bnpeYTuR4mFhYMHpJCRkxOtUqMrnrLQyhluXpjJ4cBxCjUbo/bv8fh56cuIzMZU0+nUKnS3qe9arh5GIshyK4l1pWCiEZzPMpd+0RH6ajNTBjKfVy8Q+8pxxTit6gswYPTIJMMOqZcS6nekU6amYwl1Pz/H01GlNzretaouYp1DZhqzqlXK2MuIzMZU0+nEgzkeyly5Tlye7D9Qkreqn05T1bpj2Ya4EfUwswswYPYJCTFHqioL13uHvDLiXm0utKxI/YMpq6mO2qIwrrnv+HmDMGYMwexIJMJMUSsqgqzbmts/p8Qy8282l1pWKT21fyiTBSphjW5/58w44pSrlbwZgzBmD2STCTCTFLqz0FXV1p7hTqrGnJ7JXW+zz2bjzbKc66q0hWMq7rmIO77X7Ba7gZgzBmDPaJMJMJMNuKSq5OoxT8qnm+rJTcXfzESsQpXqnNfceo9N+UzHTc+ok/iJ2VzDfVjJuP8i/cT6pJnKufV8uQMwZgzBmDPbJMJMJMJMJWI1Vlx/VOGGcrZqeLBXy/YIyye95kvzH8ZOf0i/MLyxk+62RB/KOovfzLfw1Bx1TirlKxMGsGsGsGYMwZ+wJMJMJMJWErF4vFwuF4vBrBrBmDMGfsWIuGIxFwvF4vF4uGIxFwx9lxGIuFwxGIuFwxGPtOIxGIxGIx/4d/9k=\" />\n<h1>{$data.message}</h1>\n<p>{$data.describe}</p>\n<div class=\"btn\" onclick=\"window.history.back(-1);\">返回上一页</div>\n</body>\n<script type=\"text/javascript\">\n    var i = {$data.second} -1;\n    var url = \"{$data.url}\";\n    var intervalid;\n    intervalid = setInterval(\"fun()\", 1000);\n\n    function fun() {\n        if (i == 0) {\n            if (url == '') {\n                window.history.back(-1);\n            } else {\n                location.href = url;\n            }\n            clearInterval(intervalid);\n        }\n        i--;\n    }\n</script>\n</html>"
  },
  {
    "path": "Framework/Library/Process/Tpl/success_page.tpl",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n    <meta charset=\"utf-8\" />\n    <title>{$data.title}</title>\n    <style>\n        body {\n            text-align: center;\n            margin-top: 10%;\n        }\n\n        h1 {\n            color: #666;\n            font-size: 36px;\n        }\n\n        p {\n            color: #999\n        }\n\n        .btn {\n            width: 25%;\n            height: 60px;\n            background: #028bfa;\n            line-height: 60px;\n            cursor: pointer;\n            color: #fff;\n            font-size: 18px;\n            border-radius: 4px;\n            margin: 0 auto;\n        }\n    </style>\n</head>\n\n<body>\n<img src=\"data:image/jpg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAUEBAUEAwUFBAUGBgUGCA4JCAcHCBEMDQoOFBEVFBMRExMWGB8bFhceFxMTGyUcHiAhIyMjFRomKSYiKR8iIyL/2wBDAQYGBggHCBAJCRAiFhMWIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiL/wgARCADhAPsDAREAAhEBAxEB/8QAHAABAAIDAQEBAAAAAAAAAAAAAAEDAgQHBQYI/8QAGwEBAQEAAwEBAAAAAAAAAAAAAAECAwQGBQf/2gAMAwEAAhADEAAAAP2WAAAAYpjJjlhc+dxdfyOLq1TO1vk9fk7e1rknTOXLWsrc1AAAAAAAEGEmGceHw9TnPzfPfFdL5HlcfVxprJJr6TsfQ+47v2+g937+5rlstz1vO2QAAAAACErk1c8XJfj+Y5z83z1dyMaayRZFY6Lj0N9jr/0vW/c9r7l2tW63lbmoAAAAEFcx5XDwcJ+D4n5zr/PWDGmskWRWOi4U0izpnc9L1vvesv1u3e7bZUAAACCuY0OPi/PnnPCeHxdJYMaayRZFY6LhTSLIIuel9z0nXe76/Y1u7erLuQAAAVyVZxw34XjPh+l8ZYMaayRZFY6LhTSLIIuWos7f3vc/ddn7mxrd2uSy0AADFK8Z+J6fx+EfB8UsGNNZIsisdFwppFkEXLUWY16XJ2P0b3/0ff3z7Gt2b3moAArkpzx/n7z/AIX5frfNGNNZIsisdFwppFkC5+75vveJOj85PmtZizsPZ9n0js+k2tcl29W3YAEFUx4nB1Pzd5v89hMaayRZFY6LhTSLIM9Om9j1Hra7fIuHx2nevFivqN/U733P0Dd3y7Gt275JABCa+Mc9+f8AB4v8byGNNZIsisdFwppFkG5vk6v2fW23fH+DxupevFiiZ6v6Y7n6j6G+fa3yXa3naAMJKM8fJPleV5f8zzrWSLIrHRcKaRZB7PJ2+s9n1us4+PcHi9S8MWKJjouf0R2P0j6Ll+lt75L98lloArkoxx8d+T5Pm/Q86RZFfb9r7flzqfNcXzGkWQfVc31Op9j1XlTq8e4PF6t4YsUTHRcjvXP+g/Xc319zfLfvdt2AK5jXxjkvy/K8w+d5tZFY6fc9n7XQOz6D4vh+Hzvr+dxroHZ9B0Psei8THR451/F614YsUTHRchud95P0P6rm+rub5tje7bsAVzGvjHOPn+e478vyMVjouFdB7PoOg9r0PhY6GpOH67n+v4HF8/jXX8VrXiixRMdFyG4r9H8n6b7HL29zfNsb3bdgCuSjHH811/nfnn4ngMdFwppFnSe16XoPZ+/kvz2Pn8Y6vide8UWKJjouQ3Ir2L3f0Fv9F3+Xn3N8t+923YAwkozx62OP84/E/PfIx0lNIsgXPUe36n2OTu8b6vite8UWKJjouQ3IodGvpur8nrd7l7G3rkv3yWWgCEpxjVzjmnQ83yPoeSaRZBFy1FZVXrEWKJjouQ3IoZ2/oLX6P7vJ3t3fNs75Lt7zUACqY18Y0OPh/Pnyfz/xc9KCLlqLMaazFiiY6LkNyKCzo2vTdTvrt3k5dzfNs8m7buQACuSrONbHH8xwfM4L87wmvOJqLMaazFiiY6LkNyKCz6B9HuWvf73Jz72+XZ1yXb5LLQABBVMU4xqY4/juv8fifS8RQ48aazFiiY6LkNyKCz3X0O133fq8na3N823vkvurN7yUAADCSvONfONXOPm+H5nGen4vxXRixRMdFyG5FBZ9u+91W+w9Dk59rXJtb5djW7dbstAAAArkqzijONbONPHDz/g89z3i855E6WOi5Dcisl+ov1ei69N9K+ps75dnW9rfJfrdutWXcgAAAEGExVmU5xr5xRnFEx4XH8/5zPzfLnUrZv1yey730V+l6F57LybG9bGuS/W7tat1uy6kAAAAAgwkwziqZpzmmZqmKpnHOcAZmWtWXV13ddW61ZdW61ndSAAAAAADCTBMM5wmapMZnAiQSudZXVluerZd5LZaAAAAAAABBhJCY5zhZGRAWdM5ctalcrcgAAAAAAAAACExiAASZVKgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//EACQQAAICAQUBAQADAQEAAAAAAAECAwYFAAQHIDASEBETF0Bg/9oACAEBAAECAPH6LFi+6zs19/0WC67XIhw4YMGB9ySS2as+V5WyFk6JJjr3huVtnkA4YMD6kk7veWjk2WXxxWZq/ISurBgfMljmMzZ7b60zkKORWBB8SSclkbNZPUnXH1yR1ZSD4Es3IVp9Sfz+aBaEdGUjuSx5AsHqT+E6weX2W7RlKnsS5veX9CQK5S7VgP3jHMRshUjsxsWSJ8yYIK3Uc5m8jkf2hZGJoypXqdOeU955k43GYCt57O5DI9NvPtZoyhU9G055bn8icDXcXic/n8hkO1XmiKFerafXLI6VWr2CqfpNaqG22thsO/3/AHo7xFNL1bT65aj6VK0fNhpEiarFHVLHY99vvCmxxaj0uh0bT65U23WoWsLYKrW6T82ay73e+OK20Wo9LodG04uGw7U63KALRaN5vPGs7GIRBNL1bTiUWXF9CQaZcLRat3u/LjHFxCIIF6nTCQcnYP8ASfwNLL5QQYLFxLGECjqwcbrb2XBaJ/CfMnjquxLEqBQvYhxItpru82n4T5k1StbaCJI1QKOxDB1kS31Ld7QnzJrdZxuOjSNEVQo7kMrrIliq+drXnW6Fs9lHHGiIqgeJDK6PHuNtnONspW+yR4qh4OnpGkaRoiqoA8SCGVkeN4ni31U3XGb8Xf5fDxftOPNniFiWJIkjVFUADzIIZWQxtE0RiMX9X9QiESxLEsaoqgAexBUoUMZjMX9X9QiEYjCBAoAH/AQVKlChT4+AgQIFChf+T+Pn5+fn5+fn5/j/AMX/AP/EAEEQAAEDAgEIBgcFBwUBAAAAAAECAwQFEQAGEiEwMUFRYRMgIiOR0UBScYGhscEQFBVCcjJDU1VgYtIkJTOSk6T/2gAIAQEAAz8A1tMhkiZUYjKvVW6kHGTrGhdUbP6ELV8gcZM/zP8A+dz/ABxk+/8AsVaML+ucz5gYizEZ0OQy+ni2oKHwPpNLoLd6jKCHCLhlOlavdiW6SikQ0Mo3OP8AaV4bB8cVeqk/fqi+4k7UBdk/9Ro6q2nAtpRQsbFJNiPeMV6mWCJpfb9ST2x47fjiI+Q3WY5in+M1dSPDaPjiNPjJfhPtvMq2LQQR6IzCirflOoZZbF1LWbADD0kri5Okss75Sh2lfpG7Dj7q3XlrccWbqWolRJ4k6qfRZPT06QtlW9I0hQ4EbDiHWcyNUMyJPNgAT2HD/afofQolFpq5dQdzGk6OJUdwA44m5Sy+9JahoN2mAdA5nidcWSinV53Oa0JblKOlPAL5c8AgEG4OkHXx6ZT3pcxYbYZTnKJxJykqhkPkoYRcMMbkDz4n0AsuN0eqO3aVZMZ1R/Z4IJ4cNf8AjNVMCIu8CIogkHQ45vPu2D0G3twa1Svu0xd58QAKJOladyvodaaLk8WmFZsyZdtBG1I/Mr0N6iVqPOY09Ge2j1k7CMNS4jMhhWe06kLQobwRcaw1bK2TmKuxF7hv3HSfG+uJNhpJ2DGcEyqyjmiMfmrywmizUrYUDGkXLaSdKTvHU+9UR2nuqu5DVdH6FeRvqdH2fhWTs+beymWSUfq2J+OCSSTcnSSda7KkIZYbLjqzYISLknDVLCZM8B2btA2hvzPPEahQele7TqrhpoHSo/QYk1SauTLcznFaANyRuAHUNPywjAmzcq7Cvfs+IGq0YLOS7MdJ0yZABHEAE/O2tlVaYI8JGcs6So7EjiTiLQ4/d95JULOPEaTyHAYjUGF0j3bfXcNMg6VHyxJqk1yTMcz3F+CRuAHVXGltPt6FtLSse0G4wHmEOtm6VpCgeVrjVXfpTPBLi/lrJddkWaHRxknvHyNA5DicRaRDEeEjNTtKjpKjxJxGoMLPd7chY7pkHSo8TyxIqk1yVNcz3V+AG4AdcvZLUtZ2mMgE8wADqv8AdaariyofHqtSYa5lUaz0PJs02eHrYfpWe/Fu/C2k70e3z6r1WKZM0FqD4Fz2cueGYkdDEZoNtIFghIsBiNQIWcuzkpwd0zfbzPLEipzXJM1wuOr2ncBuAGoK8jKaTtCCPBRGq7+lOcQ6n4p6ob6KnVJVkaEsOndwScAix0jAez5VGSEubVRtgP6cLacW26koWk2KFCxB4EHBJsNJOwYJzJtaRzbjH4FflgAAAWA2DEegQ7mzktwd0z9TyxIqM1yTMcLjzhuVH5Aanosj6Yk72QrxJPU0dbPyejSALlmQAeQIPWC8ynVRfa0JZeVv4JJ+yJXW8/8A4ZgHZfSNvJQ34Yo7n3mYUSZgPZNuyjmBx5/ZHyfh7nJrg7tn6nlh+oTHJMt0uPOG5UfkNSSbDbuGPulLiRv4LKW/AAdTR1jUckaiwBdfRFaeN0nOAHh1xJzKbVF99oSy8r8/BJPH7WMn4maLOznB3TXDmrlh+fMdky3S484bqWdUahlRAj2ukuhavYntH5avQcGjZSTImxtKypv9B0jrEG424E0Ip1UX/qhoadV+8HA8/nhnJ6JmN2dnuDsNbgPWVyw/OmOyZbpdecN1LVtOrJdl1JY0JHQtE+4qOsMmA1VGE3di9h3iUE/Q9cggg2I0gjDj7pcecW44ratZKifaTq3JUlphhOe66oISkbyTYYRSaPGhNaeiT2lesraT46nQftbfjuMvJC2nElCkHYQRYjDuT9adjKuWFdthZ/MnzHoRK/xiWnimOk+BV9BrmsoaQuOuyZCO0w4fyq8jh+BMdjS2y2+0c1STuPoDtfqILgKYLJBeXx/tHPCGWUNtJCG0AJSkaABsAGvZyhidI1Zue0O7c3KHqqw/AlORpbRafbNlJVtGuk5QTLJBbhoPeP20DkOeGKdCbixEBtlsWCR8z6DBr8XNkpzJCRZuQkdpPmOWKhQHymW1nME2Q+jSlXl7NWb2GknEiepMmsBceLtDWxa/8RhmFGQxFaQ0y2LJQkWA9DbeZW28hDjahYoUAUkcCDiLKK3aO791cP7pVy2T804qtIuZsNwNj96ntp8R9eup1wIaSVrVoCUi5J5DFWqBCn0CGydq3v2vcnb42xTaLmraa6aSNr72kg8hu9H5Yo8+5k05jOO1aBmHxTbFMcuYz8ln3hYwsHsVQEc2PJWHv5kj/wAT54QDeTUlqHBDISfmcUVggutPSCP4zht4JtiFAFocRljRYlCACf65GpH9Gf/EACoRAAIBAwMEAgEEAwAAAAAAAAABAgMREgQgMCIyQEIFEDETUVJhFDNg/9oACAECAQE/AOS5KtCPdJD1dBex/m0f3FqaUvYU1LtLl/HraiFLukVPkpP/AFxJ16s+57UU9TVj7ENbGXcRlGXaX8OUoxjlI1HyEpdNIby7uKnOVPtKOpjPpl+S/g1asaUcpGo1M67/AK5qGo9ZCZfmnOMI5SNRXdeeUvAoVvWQmLl12o/VnjHtXhUZ5RE+TXV/0odP5fhweMshMXEzWVc6r/rnhD+RKOOyjLpxELhr1MISlzJEIYjeI3lspvFiFw/ISxpY/vypZEIYkniN5bUIQt7PkX1KPJCGRGOJJ4jeW+HaIW9nyH5W2jS6cpE6OO2nSyEiUsRvLgh2iFuYz5BfjbRq+svqdH2iW+qdL2kWJSxG8uGAhC2sZro9Cluo1fWX1OlGRTo4/UpYjeXEhC3s1EcqUo76VX1l9zliN5caELexlSGE5R30quXTIlPEby40IQuBmsp5Ry8RCELgZJZFSlg8fDQhcTK1LOI1jLq8FIQkLiY0VqWY1jzpCQkLkaGicIyJQceVISEhLmaGholR/iOMo8SQkJCXgNDQ0NDijAxMSxYsWLFhIS8KxYsWLFixYsWLFixbxbFixYsWLFixYt5FixYsWLebYt/yH//EADsRAAEDAgIHBAgFAwUAAAAAAAEAAgMEEQUSICEiMDFBUQYyQNETFCNCYXGhsRAzgcHwFZHhFkNSU2D/2gAIAQMBAT8A3V1dXT6qBnfeB+qdi1G331/WqL/n9D5JmKUjv90JkrH9xwKurq6v4S6qa6Cm77vNVGPvdsxNt81NW1E/fedEFze6oMWq4vfuPjrVN2hY7Znbb48lFMyVuZhuFdX8DdPlaxuZ5sFXY453s6bUOqc5znZnbqnqZaZ2aI2WHY1FU7Emy76FAoFX3xVRUspmZ5HalXYhLWO2tQ6b7C8ay+yndq5HzQKBQO8KmmZAxz5OAVdWvrJczuHIeAwXFMrhTSnVyP7IFAobsrF6/wBPL6Nvdb9T4LBsQ9aiyP7zfqOqBQKG5Kxes9Wgyt4u/h8HR1LqWYSt5KKVr2h7eBQKG4KKxaq9PVHoNW/oMJzbc/8AbzWI0Xqr8zeB0Oz1TngdE7i37FApqGmVWT+ghfJ0G+Y1z3ZW6yqDC2wbcmt32VZWMpWZnceQU875355OOhgs/oqsdHakCghplY9Llpw3qd7BTvqX+jYFRUDKVuzrPVVtYylZmdx5BTzvnfnk46Mb3McHN5KN2Zoc1BBDRKK7QO2mN+e8o6F9U7Z1DqqemZTMysCra1lKzM7jyCnnfO/PJx08PdmpY3fAIJqGiUV2h/NZ8tHD6Br2Z5Rx4earcPfBtN1t+2jQYY6p25NTfuo4msblaLBV1cylZtazyCnnfO/PIde4wc3omfJBBDRKK7RDXG75/to4biGW0T/0Ksq7Cc23Bx6eSIc12V34YfhPvz/280Aq6uZRs+J4BTTPle58jrk7nChlpI/kggholFY+zNAHdDpYZiOb2Uv6H8K3DYqpubgeqocKZT7cmt32VlX17KNnVx4BTTPle57zcndUrMkTI+gCCCGiUViMPpaV7fh9tenheJ5/ZS8eR/HEMQZRs6uPAKaZ8r3Pebk7rDofT1TGfH7a0xBBDRKKKroPVqh0f8tpXWFYp6X2UvHkeqxDEWUbMrdbjyUsr5XukkNyd32dp9b53fIfumIJqGkUVj1JnYJ28Rx+W4c4udmdrO7ja57hG3iVRUzaaARN5JqCCGkUU9rXtyu4FV9G6lmdHy5eCwGg1+sv/TzTAgEENwUQsQom1UWXnyUkT4nuY8WI8BhmHurJdrujj5KONrW5W8EAgE1DcFEIhYnhraxmZupw/llLE+J7o5BYjfYfhr6x/RvMqCBkDBGwWAQCAQCG6KIRCrsPiqm7XHqqygnpXbY1deW8w/BHy7c+odOZ8lFCyJuVgsAgEAgEBvCEQiE9jXNyu4KrwFj9qA5T05f4VRQVFN32auvLTAc52VqpsEqp+9sD4+SosKp6XaaLnqUAgEAgEAhvSEQiEQi1TYdSy95g+32UnZ6nd3SQj2cd7sv0/wAr/Tj/APt+iZ2cb70v0UWBUjO8CfmfKyhpoovy2gKyAQCAQCAVt/ZEIhEKyyrKsqyrKsqsgEAgFZW8DZWVlZWVllWVWVlZWVlbwtlZWVlZWVlZWVvEWVlZWVlZWVv/ABv/2Q==\" />\n<h1>{$data.message}</h1>\n<p>{$data.describe}</p>\n<div class=\"btn\" onclick=\"window.history.back(-1);\">返回上一页</div>\n</body>\n<script type=\"text/javascript\">\n    var i = {$data.second} -1;\n    var url = \"{$data.url}\";\n    var intervalid;\n    intervalid = setInterval(\"fun()\", 1000);\n\n    function fun() {\n        if (i == 0) {\n            if (url == '') {\n                window.history.back(-1);\n            } else {\n                location.href = url;\n            }\n            clearInterval(intervalid);\n        }\n        i--;\n    }\n</script>\n</html>"
  },
  {
    "path": "Framework/Library/Process/View.class.php",
    "content": "<?php\n\nnamespace Framework\\Library\\Process;\n\nuse \\Framework\\Library\\Interfaces\\ViewInterface as ViewInterfaces;\n\n/**\n * 视图处理器\n * Class View\n * @package Framework\\Library\\Process\n */\nclass View implements ViewInterfaces\n{\n    /**\n     * @var string 视图编译目录\n     */\n    private $ViewCompile = '';\n\n    /**\n     * @var string 视图存放目录\n     */\n    private $ViewPath = '';\n\n    /**\n     * @var string 视图缓存目录\n     */\n    private $ViewCache = '';\n\n    /**\n     * @var object 视图对象\n     */\n    private $View;\n\n    /**\n     * @var string 模板文件\n     */\n    private $file = '';\n\n    /**\n     * @var array 变量集合\n     */\n    private $variable = [];\n\n    /**\n     * 初始化视图信息\n     * @return mixed|\\Smarty\n     */\n    public function init()\n    {\n        $dir = Running::$iserror ? 'view' : Visit::$param['Project'];\n        $this->ViewCompile = Running::$framworkPath . 'Project/runtime/' . $dir . '/view';\n        $this->ViewPath = Running::$framworkPath . 'Project/view';\n        $this->ViewCache = $this->ViewCompile . '/cache';\n        $functions = spl_autoload_functions();\n        foreach ($functions as $function) {\n            spl_autoload_unregister($function);\n        }\n        \\Framework\\App::$app->get('Extend')->addPackage('smarty/Smarty.class.php');\n        $this->dirProcessing([\n            $this->ViewCompile,\n            $this->ViewPath,\n            $this->ViewCache\n        ]);\n        $this->View = $this->ViewConfig($this->ReturnView());\n        return $this;\n    }\n\n    /**\n     * 设定操作的文件\n     * @param $fileName\n     */\n    public function set($fileName)\n    {\n        $this->file = $fileName;\n    }\n\n    /**\n     * 获取渲染数据\n     * @return bool|string\n     */\n    public function get()\n    {\n        if ($this->file == '') {\n            return false;\n        }\n        foreach ($this->variable as $key => $value) {\n            $this->View->assign($key, $value);\n        }\n        $html = $this->View->fetch($this->file);\n        if (strpos($this->file, 'error.tpl') !== false && $html == '') {\n            die('程序异常,请查看日志!');\n        }\n        return $html;\n    }\n\n    /**\n     * 模板变量集合\n     * @param $name\n     * @param $value\n     */\n    public function __set($name, $value)\n    {\n        if (!in_array($name, $this->variable)) {\n            $this->variable[$name] = $value;\n        }\n    }\n\n    /**\n     * 设定模板变量\n     * @param null $data\n     * @return $this\n     */\n    public function data($data = null)\n    {\n        if (is_array($data)) {\n            foreach ($data as $key => $value) {\n                $this->variable[$key] = $value;\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * 处理文件夹\n     * @param $dir\n     */\n    private function dirProcessing($dir)\n    {\n        if (is_array($dir)) {\n            foreach ($dir as $value) {\n                Structure::createDir($value);\n            }\n        }\n    }\n\n    /**\n     * 实例化视图\n     * @return \\Smarty\n     */\n    private function ReturnView()\n    {\n        $view = new \\Smarty();\n        $view->setTemplateDir($this->ViewPath);\n        $view->setCompileDir($this->ViewCompile);\n        $view->setCacheDir($this->ViewCache);\n        return $view;\n    }\n\n    /**\n     * 配置视图\n     * @param $view\n     * @return mixed\n     */\n    private function ViewConfig($view)\n    {\n        $Config = LogicExceptions::$Config['View'];\n        $view->cache_lifetime = $Config['cache_lifetime'];\n        $view->caching = $Config['is_cache'];\n        $view->left_delimiter = $Config['left_delimiter'];\n        $view->right_delimiter = $Config['right_delimiter'];\n        return $view;\n    }\n\n    /**\n     * 获取Smarty原型\n     * @return mixed\n     */\n    public function getView()\n    {\n        return $this->View;\n    }\n}"
  },
  {
    "path": "Framework/Library/Process/Visit.class.php",
    "content": "<?php\n\nnamespace Framework\\Library\\Process;\n\nuse Framework\\App;\nuse Framework\\Library\\Interfaces\\VisitInterface as VisitInterfaces;\n\n/**\n * 访问处理器\n * Class Visit\n * @package Framework\\Library\\Process\n */\nclass Visit implements VisitInterfaces\n{\n\n    /**\n     * @var array 访问配置参数\n     */\n    static public $param;\n\n    /**\n     * @var array 默认请求参数\n     */\n    static public $request;\n\n    /**\n     * 初始化构造\n     * Visit constructor.\n     */\n    public function __construct()\n    {\n        $VisitConfig = App::$app->get('Config')->get('frame');\n        if (isset($VisitConfig['Visit'])) {\n            self::$param = $VisitConfig['Visit'];\n        }\n        if (isset($VisitConfig['Parameter'])) {\n            self::$request = $VisitConfig['Parameter'];\n        }\n        $VisitConfig = Config::$AppConfig['safe'];\n        $origin = isset($_SERVER['HTTP_ORIGIN']) ? $_SERVER['HTTP_ORIGIN'] : '';\n        if (!empty($origin)) {\n            if (in_array($origin, $VisitConfig['ajax_domain'])) {\n                header('Access-Control-Allow-Origin:' . $origin);\n            }\n        }\n    }\n\n    /**\n     * 合并访问对象\n     * @return string\n     */\n    static public function mergeParam()\n    {\n        App::$app->get('Router');\n        return self::$param['namespace'] . '\\\\' . strtolower(self::$param['Project']) . '\\\\' . ucwords(self::$param['Controller']);\n    }\n\n    /**\n     * 获取对象方法\n     * @return mixed\n     */\n    static public function getfunction()\n    {\n        if (empty(self::$param['Function'])) {\n            App::$app->get('LogicExceptions')->readErrorFile([\n                'file' => Structure::$endfile,\n                'message' => '无法执行空方法!'\n            ]);\n        }\n        return self::$param['Function'];\n    }\n\n    /**\n     * 设定CLI模式参数\n     * @return bool\n     */\n    static function setCliParam()\n    {\n        if (isset($_SERVER['argv'])) {\n            $param = $_SERVER['argv'];\n            if (count($param) > 3) {\n                foreach ($param as $key => $value) {\n                    if ($key > 0) {\n                        $param[($key - 1)] = $value;\n                    }\n                }\n                unset($param[3]);\n                App::$app->get('Visit')->bind($param);\n            } else {\n                if (count($param) === 1) {\n                    return true;\n                }\n                die('PHP300::Inadequacy of parameters!');\n            }\n        } else {\n            die('PHP300:server.argv not found');\n        }\n        return false;\n    }\n\n    /**\n     * 绑定数默认实例\n     * @param $param\n     */\n    public function bind($param)\n    {\n        if (is_array($param)) {\n            $count = count($param);\n            switch ($count) {\n                case 1:\n                    self::$param['Controller'] = $param[0];\n                    break;\n                case 2:\n                    self::$param['Controller'] = $param[0];\n                    self::$param['Function'] = $param[1];\n                    break;\n                case 3:\n                    $banList = ['model','config','runtime','view'];\n                    if(!in_array(strtolower($param[0]),$banList)){\n                        self::$param['Project'] = $param[0];\n                        self::$param['Controller'] = $param[1];\n                        self::$param['Function'] = $param[2];\n                    }\n                    break;\n            }\n            if (isset(self::$param['Function'])) {\n                self::$param['Function'] = str_replace(self::$param['extend'], '', self::$param['Function']);\n            }\n        }\n    }\n}"
  },
  {
    "path": "Framework/frame.php",
    "content": "<?php\n\nnamespace Framework;\n\nuse Framework\\Library\\Process\\Running;\nuse Framework\\Library\\Process\\Structure;\nuse Framework\\Library\\Process\\Visit;\n\n/**\n * 系统总线\n * Class App\n * @author chungui\n * @version 2.5.3\n * @package Framework\n */\nclass App\n{\n\n    /**\n     * @var Object 扩展实例\n     */\n    static public $extend;\n\n    /**\n     * @var Object 应用实例\n     */\n    static public $app;\n\n    /**\n     * @var String 框架路径\n     */\n    public $corePath;\n\n    /**\n     * @var array 钩子列表\n     */\n    private $hook = [];\n\n    /**\n     * App constructor.\n     * @param $Path\n     */\n    public function __construct($Path = '')\n    {\n        $ini = ini_get('date.timezone');\n        if (empty($ini)) {\n            ini_set('date.timezone', 'Asia/Shanghai');\n        }\n        self::$app = $this;\n        $this->corePath = is_dir($Path) ? $Path . '/Framework/' : __DIR__ . '/';\n        $this->inBatch(['Running', 'Tool', 'Structure', 'Config', 'Log', 'LogicExceptions']);\n        $this->get('Running')->startRecord();\n    }\n\n    /**\n     * 处理寄存队列\n     * @param $array\n     */\n    public function inBatch($array)\n    {\n        if (is_array($array)) {\n            foreach ($array as $value) {\n                $this->get($value);\n            }\n        }\n    }\n\n    /**\n     * 获取寄存数据\n     * @param $Name\n     * @return mixed\n     */\n    public function get($Name)\n    {\n        if (!empty($this->hook[$Name]) && is_object($this->hook[$Name])) return $this->hook[$Name];\n        $this->put($Name, $this->inProcess($Name));\n        return $this->hook[$Name];\n    }\n\n    /**\n     * 寄存实例对象\n     * @param string $Name\n     * @param $Obj\n     */\n    public function put($Name, $Obj)\n    {\n        if (!empty($Name) && is_object($Obj) && empty($this->hook[$Name])) $this->hook[$Name] = $Obj;\n    }\n\n    /**\n     * 处理实例化实现过程\n     * @param $Pointer\n     * @return mixed\n     */\n    public function inProcess($Pointer)\n    {\n        $PNamespace = \"\\Framework\\Library\\Process\\\\{$Pointer}\";\n        $Path = $this->corePath . 'Library/Process/' . str_replace('\\\\', '/', $Pointer);\n        $Path .= strpos($Pointer, 'Drive') !== false ? '.php' : '.class.php';\n        if (file_exists($Path)) {\n            require_once($Path);\n            return new $PNamespace();\n        }\n        return false;\n    }\n\n    /**\n     * 处理应用\n     * @return $this\n     */\n    public function __invoke()\n    {\n        $this->inBatch(['Visit', 'Db', 'Extend']);\n        return $this;\n    }\n\n    /**\n     * 运行应用\n     */\n    public function run()\n    {\n        Running::$runMode = php_sapi_name();\n        if (Running::$runMode == 'cli') {\n            Visit::setCliParam();\n        }\n        $object = Visit::mergeParam();\n        $function = Visit::getfunction();\n        Running::setconstant();\n        $app = new $object();\n        if (method_exists($app, $function)) {\n            $this->get('ReturnHandle')->Output($app->$function());\n        } else {\n            $this->get('LogicExceptions')->readErrorFile([\n                'file' => Structure::$endfile,\n                'message' => \"[{$function}] 方法不存在!\"\n            ]);\n        }\n    }\n}"
  },
  {
    "path": "LICENSE.txt",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"{}\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright {yyyy} {name of copyright owner}\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "Project/config/App.cfg.php",
    "content": "<?php\n\n/**\n * 应用配置\n */\nreturn [\n\n    /**\n     * 数据库配置\n     */\n    'db' => [\n        /**\n         * 默认连接\n         */\n        'default' => [\n\n            /** 目标IP/域名 */\n            'host' => '127.0.0.1',\n\n            /** 目标端口 */\n            'port' => 3306,\n\n            /** 数据库用户名 */\n            'username' => 'root',\n\n            /** 数据库密码 */\n            'password' => 'root',\n\n            /** 数据库名称 */\n            'database' => 'test',\n\n            /** 数据表前缀 */\n            'tabprefix' => '',\n\n            /** 数据库编码 */\n            'char' => 'utf8',\n\n            /**\n             * 数据库驱动类型\n             * mysqli\n             * pdo\n             */\n            'dbType' => 'mysqli',\n\n            /** 是否使用该数据库配置 */\n            'connect' => false\n        ]\n    ],\n\n    /**\n     * 缓存配置\n     */\n    'cache' => [\n        /**\n         * 缓存服务类型\n         * memcache(默认端口：11211)\n         * redis(默认端口：6379)\n         * file\n         */\n        'cacheType' => 'file',\n\n        /** 缓存服务器IP/域名（类型为file可忽略） */\n        'ip' => '',\n\n        /** 缓存服务器端口（类型为file可忽略） */\n        'port' => '',\n    ],\n\n    /**\n     * 路由配置\n     */\n    'router' => [\n\n        /**\n         * 演示路由\n         * 这里的实例名称和控制器名称全部小写\n         */\n        '/home/index/test' => function () {\n\n            //这里是自定义操作\n            return '这是router配置中路由的测试';\n        },\n    ],\n\n    /**\n     * 安全配置\n     */\n    'safe' => [\n\n        /**\n         * ajax域名白名单(默认只允许当前域名)\n         */\n        'ajax_domain' => [ /* 一行一个域名，需要带上协议，例如：https://www.baidu.com */\n\n        ]\n    ]\n\n];"
  },
  {
    "path": "Project/home/Index.class.php",
    "content": "<?php\n\nnamespace App\\home;\n\nuse \\Framework\\Library\\Process\\Tool;\n\n/**\n * 默认首页控制器\n * Class Index\n * @package App\\Home\n */\nclass Index\n{\n    /**\n     * 默认首页\n     * @return mixed\n     */\n    public function index()\n    {\n        //演示cli模式下处理\n        if (Tool::isCli()) {\n            return 'hello this is cli mode,framework version:'._V.'!';\n        }\n\n        return View('home/index')->data(['show' => 'PHP300Framework - 想象无极限', 'describe' => '每个人的生命都是一只小船，梦想是小船的风帆。'])->get();\n    }\n}"
  },
  {
    "path": "Project/model/UserModel.class.php",
    "content": "<?php\n\nnamespace App\\model;\n\n/**\n * 数据模型类演示\n * Class UserModel\n * @package App\\Model\n */\nclass UserModel\n{\n\n    public function registerUser()\n    {\n\n    }\n\n}"
  },
  {
    "path": "Project/view/home/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n    <meta charset=\"UTF-8\">\n    <title>Welcome PHP300Framework</title>\n    <style>\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        html, body {\n            height: 100%;\n            color: #ffffff;\n        }\n\n        body {\n            background: url(data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAAKAAD/4QMpaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjAtYzA2MCA2MS4xMzQ3NzcsIDIwMTAvMDIvMTItMTc6MzI6MDAgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCBDUzUgV2luZG93cyIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo5MTI0QjE1ODVDNEIxMUU4Qjk0QkYxQUNBODA3MjI0OCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo5MTI0QjE1OTVDNEIxMUU4Qjk0QkYxQUNBODA3MjI0OCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjkxMjRCMTU2NUM0QjExRThCOTRCRjFBQ0E4MDcyMjQ4IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjkxMjRCMTU3NUM0QjExRThCOTRCRjFBQ0E4MDcyMjQ4Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+/+4ADkFkb2JlAGTAAAAAAf/bAIQAFBAQGRIZJxcXJzImHyYyLiYmJiYuPjU1NTU1PkRBQUFBQUFERERERERERERERERERERERERERERERERERERERAEVGRkgHCAmGBgmNiYgJjZENisrNkREREI1QkRERERERERERERERERERERERERERERERERERERERERERERERERE/8AAEQgCWAMgAwEiAAIRAQMRAf/EAE0AAQEAAAAAAAAAAAAAAAAAAAADAQEBAQAAAAAAAAAAAAAAAAAAAwUQAQAAAAAAAAAAAAAAAAAAAAARAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AJALsYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/9k=) no-repeat center/cover;\n        }\n\n        .content {\n            width: 100%;\n            height: 100%;\n            text-align: center;\n            display: table;\n        }\n\n        .table-cell {\n            display: table-cell;\n            vertical-align: middle;\n        }\n\n        .content h2 {\n            margin-bottom: 30px;\n            font-size: 30px;\n        }\n\n        .btn {\n            margin: 50px 0;\n        }\n\n        .btn button {\n            border: 0;\n            width: 200px;\n            line-height: 38px;\n            color: #fff;\n            font-size: 20px;\n            cursor: pointer;\n            border-radius: 3px;\n        }\n\n        .doc {\n            background: rgba(93, 192, 110, 1);\n        }\n\n        .web {\n            margin-left: 10px;\n            background: rgba(70, 197, 240, 1);\n        }\n    </style>\n</head>\n<body>\n<div class=\"content\">\n    <div class=\"table-cell\">\n        <h2>_{$show}_</h2>\n        <p>_{$describe}_</p>\n        <div class=\"btn\">\n            <button class=\"doc\" onclick=\"location.href='http://api2.php300.cn'\">在线文档</button>\n            <button class=\"web\" onclick=\"location.href='http://framework.php300.cn'\">访问官网</button>\n        </div>\n        <p>Version：_{_V}_</p>\n    </div>\n</div>\n</body>\n</html>"
  },
  {
    "path": "README.md",
    "content": "PHP300framework2x -想象无极限\n====\n![image](https://github.com/xcg340122/PHP300Framework2x/blob/master/Framework/Library/Process/Tpl/php300.jpg)\n===\n[![](https://img.shields.io/badge/version-2.0-green.svg)](http://framework.php300.cn)\n[![](https://img.shields.io/badge/composer-2.0-brightgreen.svg)](https://packagist.org/packages/php300/framework)\n[![](https://img.shields.io/badge/group-480-brightgreen.svg)](https://jq.qq.com/?_wv=1027&k=5exsSYT)\n\n### 介绍\n&emsp;&emsp;PHP300Framework迎来2.0版本,随着时间的推移，我们将带来更多的技术集成点，不仅提高效,还综合提高质，您可以用它来构建开发PHP的WEB应用，因为它是通用的WEB开发框架，随着渐渐的理解它的做法，您将会体会到它带给您的方便和开发的乐趣，从小型企业站到大型门户网站它都是一个不错的选择，另外，我们在2.0版本注重于接口化，所以它将非常友好的支持对APP接口的编写和输出处理。另外您还可以通过Composer进行自由的扩展，系统将会自动的载入扩展的包或类，这里我们对异常处理和数据处理做出了非常多的工作，以便于开发中可以快速的发现并解决问题，祝您开发愉快！\n这里展示部分文档,更多介绍请详见：[在线手册](https://www.kancloud.cn/fold/php300_2/content)\n\n### 看点\n* MVC开发框架\n* 函数助手方便快捷\n* 支持CLI模式运行\n* 核心容器加载处理\n* 自动JSON编码\n* 自定义高可用扩展方法\n* `Composer`随意`DIY`\n* 自定义路由支持\n* 数据库驱动快速操作\n* 分离式入口更安全\n* 高速缓存扩展支持\n"
  },
  {
    "path": "Web/.htaccess",
    "content": "<IfModule mod_rewrite.c>\n  Options +FollowSymlinks\n  RewriteEngine On\n\n  RewriteCond %{REQUEST_FILENAME} !-d\n  RewriteCond %{REQUEST_FILENAME} !-f\n  RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]\n</IfModule>"
  },
  {
    "path": "Web/Public/system/noted.txt",
    "content": "友情提示：本目录不可被删除，如果被删除会导致异常反馈页显示错误"
  },
  {
    "path": "Web/index.php",
    "content": "<?php\n\n\n/** PHP300Framework默认入口 version:2.5.3 */\n\nif (substr(PHP_VERSION, 0, 3) < 5.4) die('<meta charset=\"UTF-8\">PHP300:请将PHP版本切换至5.3以上运行!');\n\n/** 引入框架文件 */\nrequire '../Framework/frame.php';\n\n/** @var object 实例化应用 $app */\n$app = new Framework\\App();\n\n/** 设定默认访问(应用,控制器,方法) */\n$app()->get('Visit')->bind(array('Home', 'Index', 'index'));\n\n/** 是否调试模式(true => 调试,false => 线上) */\n$app()->get('Running')->isDev(true);\n\n/** 运行应用 */\n$app()->run();"
  },
  {
    "path": "composer.json",
    "content": "{\n  \"name\":\"php300/framework\",\n  \"description\":\"Fast and efficient framework for development - php300\",\n  \"keywords\":[\"php300\", \"framework\", \"project\"],\n  \"homepage\":\"https://framework.php300.cn\",\n  \"license\":\"Apache-2.0\",\n  \"type\":\"project\",\n  \"authors\": [{\n    \"name\":\"Chungui\",\n    \"email\":\"php300@qq.com\",\n    \"homepage\":\"https://www.php300.cn\"\n  }],\n\n  \"require\": {\n    \"php\": \">=5.4.0\"\n  }\n}"
  }
]