From a21e5f513a3cff5c454ae0c1c5264934185fd3e1 Mon Sep 17 00:00:00 2001 From: andrey Date: Tue, 5 Jun 2001 16:22:11 +0000 Subject: [PATCH] Create config object in fetch() or just set the config path if it already exists. --- Smarty.class.php | 13 ++++++++----- libs/Smarty.class.php | 13 ++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Smarty.class.php b/Smarty.class.php index 5c1267c0..7d2d5908 100644 --- a/Smarty.class.php +++ b/Smarty.class.php @@ -175,11 +175,6 @@ class Smarty } } } - - /* Prepare the configuration object. */ - if (!class_exists('Config_File')) - include_once dirname(__FILE__) . '/Config_File.class.php'; - $this->_conf_obj = new Config_File($this->config_dir); } @@ -498,6 +493,14 @@ class Smarty } } + if ($this->_conf_obj === null) { + /* Prepare the configuration object. */ + if (!class_exists('Config_File')) + include_once dirname(__FILE__) . '/Config_File.class.php'; + $this->_conf_obj = new Config_File($this->config_dir); + } else + $this->_conf_obj->set_path($this->config_dir); + extract($this->_tpl_vars); if ($this->show_info_header) { diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 5c1267c0..7d2d5908 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -175,11 +175,6 @@ class Smarty } } } - - /* Prepare the configuration object. */ - if (!class_exists('Config_File')) - include_once dirname(__FILE__) . '/Config_File.class.php'; - $this->_conf_obj = new Config_File($this->config_dir); } @@ -498,6 +493,14 @@ class Smarty } } + if ($this->_conf_obj === null) { + /* Prepare the configuration object. */ + if (!class_exists('Config_File')) + include_once dirname(__FILE__) . '/Config_File.class.php'; + $this->_conf_obj = new Config_File($this->config_dir); + } else + $this->_conf_obj->set_path($this->config_dir); + extract($this->_tpl_vars); if ($this->show_info_header) {