Exemplo n.º 1
0
        if ($previous !== $error_handler) {
            Smarty::$_previous_error_handler = $previous;
        }
    }
    /**
     * Disable error handler muting expected messages
     *
     * @return void
     */
    public static function unmuteExpectedErrors()
    {
        restore_error_handler();
    }
}
// Check if we're running on windows
Smarty::$_IS_WINDOWS = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN';
// let PCRE (preg_*) treat strings as ISO-8859-1 if we're not dealing with UTF-8
if (Smarty::$_CHARSET !== 'UTF-8') {
    Smarty::$_UTF8_MODIFIER = '';
}
/**
 * Smarty exception class
 * @package Smarty
 */
class SmartyException extends Exception
{
    public static $escape = true;
    public function __construct($message)
    {
        $this->message = self::$escape ? htmlentities($message) : $message;
    }
Exemplo n.º 2
0
 /**
  * Initialize new Smarty object
  */
 public function __construct()
 {
     if (is_callable('mb_internal_encoding')) {
         mb_internal_encoding(Smarty::$_CHARSET);
     }
     $this->start_time = microtime(true);
     // check default dirs for overloading
     if ($this->template_dir[0] !== './templates/' || isset($this->template_dir[1])) {
         $this->setTemplateDir($this->template_dir);
     }
     if ($this->config_dir[0] !== './configs/' || isset($this->config_dir[1])) {
         $this->setConfigDir($this->config_dir);
     }
     if ($this->compile_dir !== './templates_c/') {
         unset(self::$_muted_directories['./templates_c/']);
         $this->setCompileDir($this->compile_dir);
     }
     if ($this->cache_dir !== './cache/') {
         unset(self::$_muted_directories['./cache/']);
         $this->setCacheDir($this->cache_dir);
     }
     if (isset($this->plugins_dir)) {
         $this->setPluginsDir($this->plugins_dir);
     } else {
         $this->setPluginsDir(SMARTY_PLUGINS_DIR);
     }
     if (isset($_SERVER['SCRIPT_NAME'])) {
         Smarty::$global_tpl_vars['SCRIPT_NAME'] = new Smarty_Variable($_SERVER['SCRIPT_NAME']);
     }
     // Check if we're running on windows
     Smarty::$_IS_WINDOWS = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN';
     // let PCRE (preg_*) treat strings as ISO-8859-1 if we're not dealing with UTF-8
     if (Smarty::$_CHARSET !== 'UTF-8') {
         Smarty::$_UTF8_MODIFIER = '';
     }
 }
Exemplo n.º 3
0
 /**
  * Initialize new Smarty object
  */
 public function __construct()
 {
     if (is_callable('mb_internal_encoding')) {
         mb_internal_encoding(Smarty::$_CHARSET);
     }
     $this->start_time = microtime(true);
     if (isset($_SERVER['SCRIPT_NAME'])) {
         Smarty::$global_tpl_vars['SCRIPT_NAME'] = new Smarty_Variable($_SERVER['SCRIPT_NAME']);
     }
     // Check if we're running on windows
     Smarty::$_IS_WINDOWS = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN';
     // let PCRE (preg_*) treat strings as ISO-8859-1 if we're not dealing with UTF-8
     if (Smarty::$_CHARSET !== 'UTF-8') {
         Smarty::$_UTF8_MODIFIER = '';
     }
 }
Exemplo n.º 4
0
 /**
  * Initialize new Smarty object
  */
 public function __construct()
 {
     if (is_callable('mb_internal_encoding')) {
         mb_internal_encoding(Smarty::$_CHARSET);
     }
     $this->start_time = microtime(true);
     // check default dirs for overloading
     $this->setTemplateDir(APPPATH . 'views/');
     if ($this->config_dir[0] !== './configs/' || isset($this->config_dir[1])) {
         $this->setConfigDir($this->config_dir);
     }
     unset(self::$_muted_directories['./templates_c/']);
     $this->setCompileDir(APPPATH . 'Runtime/compile/');
     unset(self::$_muted_directories['./cache/']);
     $this->setCacheDir(APPPATH . 'Runtime/cache/');
     if (isset($this->plugins_dir)) {
         $this->setPluginsDir($this->plugins_dir);
     } else {
         $this->setPluginsDir(SMARTY_PLUGINS_DIR);
     }
     if (isset($_SERVER['SCRIPT_NAME'])) {
         Smarty::$global_tpl_vars['SCRIPT_NAME'] = new Smarty_Variable($_SERVER['SCRIPT_NAME']);
     }
     // Check if we're running on windows
     Smarty::$_IS_WINDOWS = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN';
 }