From 1ddce1c67e9de666f5f176db24fb0ca85a2d2bc4 Mon Sep 17 00:00:00 2001 From: andrey Date: Thu, 12 Apr 2001 21:00:47 +0000 Subject: [PATCH] *** empty log message *** --- NEWS | 2 ++ Smarty.class.php | 29 ++++++++++++++++------------- libs/Smarty.class.php | 29 ++++++++++++++++------------- 3 files changed, 34 insertions(+), 26 deletions(-) diff --git a/NEWS b/NEWS index ab7a1553..3ee6173b 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ + - added $compiler_class variable to allow specifying a different compiler + class. (Andrei) - changed Smarty to compile templates at runtime, allowing for arbitrary template resources. Also added fix for LOCK_EX under windows and changed a couple file permissions for security. (Monte) diff --git a/Smarty.class.php b/Smarty.class.php index 654ec238..2bb068b5 100644 --- a/Smarty.class.php +++ b/Smarty.class.php @@ -122,6 +122,9 @@ class Smarty var $version = '1.3.2'; // Smarty version number var $show_info_header = true; // display info header at top of page output + var $compiler_class = 'Smarty_Compiler'; // the compiler class used by + // Smarty to compile templates + /**************************************************************************/ /* END SMARTY CONFIGURATION SECTION */ /* There should be no need to touch anything below this line. */ @@ -533,19 +536,19 @@ class Smarty { include_once "Smarty_Compiler.class.php"; - $smarty_compiler = new Smarty_Compiler; + $smarty_compiler = new $this->compiler_class; - $smarty_compiler->template_dir = $this->template_dir; - $smarty_compiler->compile_dir = $this->compile_dir; - $smarty_compiler->config_dir = $this->config_dir; - $smarty_compiler->force_compile = $this->force_compile; - $smarty_compiler->caching = $this->caching; - $smarty_compiler->php_handling = $this->php_handling; - $smarty_compiler->left_delimiter = $this->left_delimiter; - $smarty_compiler->right_delimiter = $this->right_delimiter; - $smarty_compiler->custom_funcs = $this->custom_funcs; - $smarty_compiler->custom_mods = $this->custom_mods; - $smarty_compiler->version = $this->version; + $smarty_compiler->template_dir = $this->template_dir; + $smarty_compiler->compile_dir = $this->compile_dir; + $smarty_compiler->config_dir = $this->config_dir; + $smarty_compiler->force_compile = $this->force_compile; + $smarty_compiler->caching = $this->caching; + $smarty_compiler->php_handling = $this->php_handling; + $smarty_compiler->left_delimiter = $this->left_delimiter; + $smarty_compiler->right_delimiter = $this->right_delimiter; + $smarty_compiler->custom_funcs = $this->custom_funcs; + $smarty_compiler->custom_mods = $this->custom_mods; + $smarty_compiler->version = $this->version; if ($smarty_compiler->_compile_file($tpl_file, $template_source, $template_compiled)) return true; @@ -721,7 +724,7 @@ class Smarty \*======================================================================*/ function _trigger_error_msg($error_msg, $error_type = E_USER_WARNING) { - trigger_error($error_msg, $error_type); + trigger_error("Smarty error: $error_msg", $error_type); } } diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 654ec238..2bb068b5 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -122,6 +122,9 @@ class Smarty var $version = '1.3.2'; // Smarty version number var $show_info_header = true; // display info header at top of page output + var $compiler_class = 'Smarty_Compiler'; // the compiler class used by + // Smarty to compile templates + /**************************************************************************/ /* END SMARTY CONFIGURATION SECTION */ /* There should be no need to touch anything below this line. */ @@ -533,19 +536,19 @@ class Smarty { include_once "Smarty_Compiler.class.php"; - $smarty_compiler = new Smarty_Compiler; + $smarty_compiler = new $this->compiler_class; - $smarty_compiler->template_dir = $this->template_dir; - $smarty_compiler->compile_dir = $this->compile_dir; - $smarty_compiler->config_dir = $this->config_dir; - $smarty_compiler->force_compile = $this->force_compile; - $smarty_compiler->caching = $this->caching; - $smarty_compiler->php_handling = $this->php_handling; - $smarty_compiler->left_delimiter = $this->left_delimiter; - $smarty_compiler->right_delimiter = $this->right_delimiter; - $smarty_compiler->custom_funcs = $this->custom_funcs; - $smarty_compiler->custom_mods = $this->custom_mods; - $smarty_compiler->version = $this->version; + $smarty_compiler->template_dir = $this->template_dir; + $smarty_compiler->compile_dir = $this->compile_dir; + $smarty_compiler->config_dir = $this->config_dir; + $smarty_compiler->force_compile = $this->force_compile; + $smarty_compiler->caching = $this->caching; + $smarty_compiler->php_handling = $this->php_handling; + $smarty_compiler->left_delimiter = $this->left_delimiter; + $smarty_compiler->right_delimiter = $this->right_delimiter; + $smarty_compiler->custom_funcs = $this->custom_funcs; + $smarty_compiler->custom_mods = $this->custom_mods; + $smarty_compiler->version = $this->version; if ($smarty_compiler->_compile_file($tpl_file, $template_source, $template_compiled)) return true; @@ -721,7 +724,7 @@ class Smarty \*======================================================================*/ function _trigger_error_msg($error_msg, $error_type = E_USER_WARNING) { - trigger_error($error_msg, $error_type); + trigger_error("Smarty error: $error_msg", $error_type); } }