From cab5582983595b6d6ab1ce25a995d0ac909ee18d Mon Sep 17 00:00:00 2001 From: mohrt Date: Fri, 30 Nov 2001 23:09:48 +0000 Subject: [PATCH] change variable names in fetch() fuction to smarty_* to avoid namespace conflicts --- NEWS | 2 +- Smarty.class.php | 46 +++++++++++++++++++++---------------------- libs/Smarty.class.php | 46 +++++++++++++++++++++---------------------- 3 files changed, 47 insertions(+), 47 deletions(-) diff --git a/NEWS b/NEWS index e82e0d39..9dd6b4a4 100644 --- a/NEWS +++ b/NEWS @@ -21,7 +21,7 @@ - fixed bug with clear_cache introduced in 1.4.6, third parameter should default to null. (Monte) - updated Config_File class to support '\' path separator in OS/2. (Monte, - Francesco Ciprianii) + Francesco Cipriani) - removed secure_ext setting (not used). (Monte) - made cache reading process more efficient. (Monte) - fixed bug, is_cached() now supports new 1.4.6 caching behavior. (Monte) diff --git a/Smarty.class.php b/Smarty.class.php index 319dc7ca..9dfb4927 100644 --- a/Smarty.class.php +++ b/Smarty.class.php @@ -497,7 +497,7 @@ class Smarty Function: fetch() Purpose: executes & returns or displays the template results \*======================================================================*/ - function fetch($tpl_file, $cache_id = null, $compile_id = null, $display = false) + function fetch($smarty_tpl_file, $smarty_cache_id = null, $smarty_compile_id = null, $smarty_display = false) { global $HTTP_SERVER_VARS, $QUERY_STRING, $HTTP_COOKIE_VARS; @@ -510,25 +510,25 @@ class Smarty // capture time for debugging info $debug_start_time = $this->_get_microtime(); $this->_smarty_debug_info[] = array('type' => 'template', - 'filename' => $tpl_file, + 'filename' => $smarty_tpl_file, 'depth' => 0); $included_tpls_idx = count($this->_smarty_debug_info) - 1; } - $this->_compile_id = $compile_id; + $this->_compile_id = $smarty_compile_id; $this->_inclusion_depth = 0; if ($this->caching) { - $this->_cache_info[] = array('template', $tpl_file); + $this->_cache_info[] = array('template', $smarty_tpl_file); - if ($this->_read_cache_file($tpl_file, $cache_id, $compile_id, $results)) { + if ($this->_read_cache_file($smarty_tpl_file, $smarty_cache_id, $smarty_compile_id, $smarty_results)) { if ($this->insert_tag_check) { - $results = $this->_process_cached_inserts($results); + $smarty_results = $this->_process_cached_inserts($smarty_results); } - if ($display) { - echo $results; + if ($smarty_display) { + echo $smarty_results; if ($this->debugging) { // capture time for debugging info @@ -538,7 +538,7 @@ class Smarty } return; } else { - return $results; + return $smarty_results; } } } @@ -566,46 +566,46 @@ class Smarty $info_header = ''; } - $compile_path = $this->_get_compile_path($tpl_file); + $compile_path = $this->_get_compile_path($smarty_tpl_file); // if we just need to display the results, don't perform output // buffering - for speed - if ($display && !$this->caching) { + if ($smarty_display && !$this->caching) { echo $info_header; - if ($this->_process_template($tpl_file, $compile_path)) + if ($this->_process_template($smarty_tpl_file, $compile_path)) { if ($this->show_info_include) { - echo "\n\n"; + echo "\n\n"; } include($compile_path); if ($this->show_info_include) { - echo "\n\n"; + echo "\n\n"; } } } else { ob_start(); echo $info_header; - if ($this->_process_template($tpl_file, $compile_path)) + if ($this->_process_template($smarty_tpl_file, $compile_path)) { if ($this->show_info_include) { - echo "\n\n"; + echo "\n\n"; } include($compile_path); if ($this->show_info_include) { - echo "\n\n"; + echo "\n\n"; } } - $results = ob_get_contents(); + $smarty_results = ob_get_contents(); ob_end_clean(); } if ($this->caching) { - $this->_write_cache_file($tpl_file, $cache_id, $compile_id, $results); - $results = $this->_process_cached_inserts($results); + $this->_write_cache_file($smarty_tpl_file, $smarty_cache_id, $smarty_compile_id, $smarty_results); + $smarty_results = $this->_process_cached_inserts($smarty_results); } - if ($display) { - if (isset($results)) { echo $results; } + if ($smarty_display) { + if (isset($smarty_results)) { echo $smarty_results; } if ($this->debugging) { // capture time for debugging info @@ -615,7 +615,7 @@ class Smarty } return; } else { - if (isset($results)) { return $results; } + if (isset($smarty_results)) { return $smarty_results; } } } diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 319dc7ca..9dfb4927 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -497,7 +497,7 @@ class Smarty Function: fetch() Purpose: executes & returns or displays the template results \*======================================================================*/ - function fetch($tpl_file, $cache_id = null, $compile_id = null, $display = false) + function fetch($smarty_tpl_file, $smarty_cache_id = null, $smarty_compile_id = null, $smarty_display = false) { global $HTTP_SERVER_VARS, $QUERY_STRING, $HTTP_COOKIE_VARS; @@ -510,25 +510,25 @@ class Smarty // capture time for debugging info $debug_start_time = $this->_get_microtime(); $this->_smarty_debug_info[] = array('type' => 'template', - 'filename' => $tpl_file, + 'filename' => $smarty_tpl_file, 'depth' => 0); $included_tpls_idx = count($this->_smarty_debug_info) - 1; } - $this->_compile_id = $compile_id; + $this->_compile_id = $smarty_compile_id; $this->_inclusion_depth = 0; if ($this->caching) { - $this->_cache_info[] = array('template', $tpl_file); + $this->_cache_info[] = array('template', $smarty_tpl_file); - if ($this->_read_cache_file($tpl_file, $cache_id, $compile_id, $results)) { + if ($this->_read_cache_file($smarty_tpl_file, $smarty_cache_id, $smarty_compile_id, $smarty_results)) { if ($this->insert_tag_check) { - $results = $this->_process_cached_inserts($results); + $smarty_results = $this->_process_cached_inserts($smarty_results); } - if ($display) { - echo $results; + if ($smarty_display) { + echo $smarty_results; if ($this->debugging) { // capture time for debugging info @@ -538,7 +538,7 @@ class Smarty } return; } else { - return $results; + return $smarty_results; } } } @@ -566,46 +566,46 @@ class Smarty $info_header = ''; } - $compile_path = $this->_get_compile_path($tpl_file); + $compile_path = $this->_get_compile_path($smarty_tpl_file); // if we just need to display the results, don't perform output // buffering - for speed - if ($display && !$this->caching) { + if ($smarty_display && !$this->caching) { echo $info_header; - if ($this->_process_template($tpl_file, $compile_path)) + if ($this->_process_template($smarty_tpl_file, $compile_path)) { if ($this->show_info_include) { - echo "\n\n"; + echo "\n\n"; } include($compile_path); if ($this->show_info_include) { - echo "\n\n"; + echo "\n\n"; } } } else { ob_start(); echo $info_header; - if ($this->_process_template($tpl_file, $compile_path)) + if ($this->_process_template($smarty_tpl_file, $compile_path)) { if ($this->show_info_include) { - echo "\n\n"; + echo "\n\n"; } include($compile_path); if ($this->show_info_include) { - echo "\n\n"; + echo "\n\n"; } } - $results = ob_get_contents(); + $smarty_results = ob_get_contents(); ob_end_clean(); } if ($this->caching) { - $this->_write_cache_file($tpl_file, $cache_id, $compile_id, $results); - $results = $this->_process_cached_inserts($results); + $this->_write_cache_file($smarty_tpl_file, $smarty_cache_id, $smarty_compile_id, $smarty_results); + $smarty_results = $this->_process_cached_inserts($smarty_results); } - if ($display) { - if (isset($results)) { echo $results; } + if ($smarty_display) { + if (isset($smarty_results)) { echo $smarty_results; } if ($this->debugging) { // capture time for debugging info @@ -615,7 +615,7 @@ class Smarty } return; } else { - if (isset($results)) { return $results; } + if (isset($smarty_results)) { return $smarty_results; } } }