<commit_before><?php
/**
 *  smarty view类文件
 * @file smarty_view.php
 * @package view
 * @author 陈金(<EMAIL>)
 */
/** 
 * smarty view类
 *
 */
class Smarty_View {
    /**
     * 是否启用缓存
     * @var boolean
     */
    var $_cachingEnabled;
    /**
     * 模版文件名
     * @var string
     */
    var $_templateName;
    /**
     * 模版对象
     * @var object
     */
    var $_templateObject;
    /**
     * 用户缓存的数据
     * @var array
     */
    var $_data;
    /**
     * view id
     * @var string
     */
    var $_viewId;
    /**
     * 缓存周期
     * @var integer
     */
    var $_httpCacheLifetime = 1800;
    /**
     * debug 开关
     * @var boolean
     */
    var $_debug = false;
    /**
     * module
     * @var string
     */
    var $_module ;
    /**
     * Constructor of the class
     *
     * @param $templateName A template name
     * @param $cachingEnabled default false.
     * If left as SMARTY_VIEW_CACHE_CHECK, the blog settings will checked to determine whether caching is enabled
     * or not.
     * @param $layout the template layout ('admin' or 'front')
     * @param $data Data that will be used to generate a unique id for the cached view (it will be ignored
     * if caching is not enabled)
     */
    function __construct($templateName, $layout, $module = 'default',$cachingEnabled = false, $data = array()) {
        // whether caching is enabled or not
        $this->_cachingEnabled = $cachingEnabled;
        // name of the tepmlate
        $this->_templateName = $templateName;
        $this->_module = $module;
        if ($this->_cachingEnabled) {
            // get a CachedTemplate object
            $this->_templateObject = new CachedTemplate($this->_templateName, APP_ROOT_PATH . "templates" . DS .$module . DS . $layout);
            // data used to calculate the view id
            $this->_data = !empty($data) ? $data : $_GET;
            $this->_viewId = $this->generateCacheId();
        }
        else {
            //require  dirname(__FILE__).DS.'template'.DS."/template.php" ;
            $this->_templateObject = new Template($this->_templateName, APP_ROOT_PATH . "templates" . DS .$module . DS . $layout);
        }
    }
    /**
     * set to debug mode for smarty
     * @param boolean $debug true or false
     */
    function setDebugMode($debug) {
        $this->_templateObject->setDebugMode($debug);
    }
    /**
     * 设置模版目录
     * @param string $dir 模版目录
     */
    function setTemplateDir($dir) {
        $this->_templateObject->setTemplateDir(APP_ROOT_PATH . "templates" . DS .$this->module.DS.$dir);
    }<commit_msg>Smarty template dir BUG<commit_after><?php
/**
 *  smarty view类文件
 * @file smarty_view.php
 * @package view
 * @author 陈金(<EMAIL>)
 */
/** 
 * smarty view类
 *
 */
class Smarty_View {
    /**
     * 是否启用缓存
     * @var boolean
     */
    var $_cachingEnabled;
    /**
     * 模版文件名
     * @var string
     */
    var $_templateName;
    /**
     * 模版对象
     * @var object
     */
    var $_templateObject;
    /**
     * 用户缓存的数据
     * @var array
     */
    var $_data;
    /**
     * view id
     * @var string
     */
    var $_viewId;
    /**
     * 缓存周期
     * @var integer
     */
    var $_httpCacheLifetime = 1800;
    /**
     * debug 开关
     * @var boolean
     */
    var $_debug = false;
    /**
     * module
     * @var string
     */
    var $_module ;
    /**
     * Constructor of the class
     *
     * @param $templateName A template name
     * @param $cachingEnabled default false.
     * If left as SMARTY_VIEW_CACHE_CHECK, the blog settings will checked to determine whether caching is enabled
     * or not.
     * @param $layout the template layout ('admin' or 'front')
     * @param $data Data that will be used to generate a unique id for the cached view (it will be ignored
     * if caching is not enabled)
     */
    function __construct($templateName, $layout, $module = 'default',$cachingEnabled = false, $data = array()) {
        // whether caching is enabled or not
        $this->_cachingEnabled = $cachingEnabled;
        // name of the tepmlate
        $this->_templateName = $templateName;
        $this->_module = $module;
        if ($this->_cachingEnabled) {
            // get a CachedTemplate object
            $this->_templateObject = new CachedTemplate($this->_templateName, APP_ROOT_PATH . "templates" . DS .$module . DS . $layout);
            // data used to calculate the view id
            $this->_data = !empty($data) ? $data : $_GET;
            $this->_viewId = $this->generateCacheId();
        }
        else {
            //require  dirname(__FILE__).DS.'template'.DS."/template.php" ;
            $this->_templateObject = new Template($this->_templateName, APP_ROOT_PATH . "templates" . DS .$module . DS . $layout);
        }
    }
    /**
     * set to debug mode for smarty
     * @param boolean $debug true or false
     */
    function setDebugMode($debug) {
        $this->_templateObject->setDebugMode($debug);
    }
    /**
     * 设置模版目录
     * @param string $dir 模版目录
     */
    function setTemplateDir($dir) {
        $this->_templateObject->setTemplateDir(APP_ROOT_PATH . "templates" . DS .$this->_module.DS.$dir);
    }
{'fraction_non_alphanumeric': 0.12918197640688456, 'fraction_numerical': 0.0015470895378070005, 'mean_word_length': 1.9655963302752293, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3082281', 'n_tokens_mistral': 1625, 'n_tokens_neox': 1622, 'n_words': 423}