From ef13d8b606a6477604d17f8c5d0c85713739b36c Mon Sep 17 00:00:00 2001 From: messju Date: Thu, 14 Aug 2003 10:59:30 +0000 Subject: [PATCH] fixes in config_load: - handling of section-attribute - reusing the same config-file multiple times - serialization of config-data for php<4.2.0 (no var_export) many thanks to atu for pointing this out and for testing --- NEWS | 3 +++ libs/plugins/function.config_load.php | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index b7374a6a..b981bcc7 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ + - fixed config_load: handling of section-attribute and use of + multiple config-files in one template (atu, messju) + Version 2.6.0-RC1 (August 11, 2003) ----------------------------------- diff --git a/libs/plugins/function.config_load.php b/libs/plugins/function.config_load.php index 6c4608b5..12b74620 100644 --- a/libs/plugins/function.config_load.php +++ b/libs/plugins/function.config_load.php @@ -64,7 +64,10 @@ function smarty_function_config_load($params, &$smarty) } $_file_path = $_config_dir . DIRECTORY_SEPARATOR . $_file; - $_compile_file = $smarty->_get_compile_path($_file_path); + if (isset($_section)) + $_compile_file = $smarty->_get_compile_path($_file_path.'|'.$_section); + else + $_compile_file = $smarty->_get_compile_path($_file_path); if($smarty->force_compile || !file_exists($_compile_file) @@ -85,13 +88,13 @@ function smarty_function_config_load($params, &$smarty) if(function_exists('var_export')) { $_output = ''; } else { - $_output = ''; + $_output = ''\\\'', '\\'=>'\\\\')) . '\'); ?>'; } $_params = (array('compile_path' => $_compile_file, 'compiled_content' => $_output, 'resource_timestamp' => filemtime($_file_path))); require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.write_compiled_resource.php'); smarty_core_write_compiled_resource($_params, $smarty); } else { - include_once($_compile_file); + include($_compile_file); } if ($smarty->caching) {