cvs: smarty / NEWS /libs Smarty.class.php
| From: | Messju Mohr | Date: | Fri, 21 Mar 2003 15:50:04 +0000 |
| Subject: | cvs: smarty / NEWS /libs Smarty.class.php | ||
| Groups: | php.smarty.cvs | ||
| Request: | Send a blank email to php-smarty-cvs+get-493@lists.php.net to get a copy of this message | ||
messju Fri Mar 21 10:50:04 2003 EDT
Modified files:
/smarty NEWS
/smarty/libs Smarty.class.php
Log:
applied new var-names to fetch()
Index: smarty/NEWS
diff -u smarty/NEWS:1.326 smarty/NEWS:1.327
--- smarty/NEWS:1.326 Fri Mar 21 10:39:29 2003
+++ smarty/NEWS Fri Mar 21 10:50:03 2003
@@ -1,3 +1,4 @@
+ - applied local-var-naming-scheme to fetch() (messju)
- renamed $localvars to $_localvars in cache-file-handling-functions,
added _get_auto_id()-function (messju)
- swapped compile_id and cache_id in read_cache_file and write_cache_file
Index: smarty/libs/Smarty.class.php
diff -u smarty/libs/Smarty.class.php:1.369 smarty/libs/Smarty.class.php:1.370
--- smarty/libs/Smarty.class.php:1.369 Fri Mar 21 10:39:29 2003
+++ smarty/libs/Smarty.class.php Fri Mar 21 10:50:03 2003
@@ -1053,12 +1053,12 @@
/**
* executes & returns or displays the template results
*
- * @param string $_smarty_tpl_file
- * @param string $_smarty_cache_id
- * @param string $_smarty_compile_id
- * @param boolean $_smarty_display
- */
- function fetch($_smarty_tpl_file, $_smarty_cache_id = null, $_smarty_compile_id = null,
$_smarty_display = false)
+ * @param string $tpl_file
+ * @param string $cache_id
+ * @param string $compile_id
+ * @param boolean $display
+ */
+ function fetch($tpl_file, $cache_id = null, $compile_id = null, $display = false)
{
$_smarty_old_error_level = $this->debugging ? error_reporting() :
error_reporting(error_reporting() & ~E_NOTICE);
@@ -1077,16 +1077,16 @@
// capture time for debugging info
$debug_start_time = $this->_get_microtime();
$this->_smarty_debug_info[] = array('type' =>
'template',
- 'filename' => $_smarty_tpl_file,
+ 'filename' => $tpl_file,
'depth' => 0);
$included_tpls_idx = count($this->_smarty_debug_info) - 1;
}
- if (!isset($_smarty_compile_id)) {
- $_smarty_compile_id = $this->compile_id;
+ if (!isset($compile_id)) {
+ $compile_id = $this->compile_id;
}
- $this->_compile_id = $_smarty_compile_id;
+ $this->_compile_id = $compile_id;
$this->_inclusion_depth = 0;
if ($this->caching) {
@@ -1095,12 +1095,12 @@
$_cache_info = $this->_cache_info;
$this->_cache_info = array();
}
- if ($this->_read_cache_file($_smarty_tpl_file, $_smarty_cache_id,
$_smarty_compile_id, $_smarty_results)) {
+ if ($this->_read_cache_file($tpl_file, $cache_id, $compile_id, $_smarty_results)) {
if (@count($this->_cache_info['insert_tags'])) {
$this->_load_plugins($this->_cache_info['insert_tags']);
$_smarty_results = $this->_process_cached_inserts($_smarty_results);
}
- if ($_smarty_display) {
+ if ($display) {
if ($this->debugging)
{
// capture time for debugging info
@@ -1128,7 +1128,7 @@
return $_smarty_results;
}
} else {
- $this->_cache_info['template'][] = $_smarty_tpl_file;
+ $this->_cache_info['template'][] = $tpl_file;
if ($this->cache_modified_check) {
header("Last-Modified: ".gmdate('D, d M Y H:i:s',
time()).' GMT');
}
@@ -1143,18 +1143,18 @@
$this->_autoload_filters();
}
- $_smarty_compile_path = $this->_get_compile_path($_smarty_tpl_file);
+ $_smarty_compile_path = $this->_get_compile_path($tpl_file);
// if we just need to display the results, don't perform output
// buffering - for speed
- if ($_smarty_display && !$this->caching &&
count($this->_plugins['outputfilter']) == 0) {
- if ($this->_process_template($_smarty_tpl_file, $_smarty_compile_path))
+ if ($display && !$this->caching &&
count($this->_plugins['outputfilter']) == 0) {
+ if ($this->_process_template($tpl_file, $_smarty_compile_path))
{
include($_smarty_compile_path);
}
} else {
ob_start();
- if ($this->_process_template($_smarty_tpl_file, $_smarty_compile_path))
+ if ($this->_process_template($tpl_file, $_smarty_compile_path))
{
include($_smarty_compile_path);
}
@@ -1167,11 +1167,11 @@
}
if ($this->caching) {
- $this->_write_cache_file($_smarty_tpl_file, $_smarty_cache_id, $_smarty_compile_id,
$_smarty_results);
+ $this->_write_cache_file($tpl_file, $cache_id, $compile_id, $_smarty_results);
$_smarty_results = $this->_process_cached_inserts($_smarty_results);
}
- if ($_smarty_display) {
+ if ($display) {
if (isset($_smarty_results)) { echo $_smarty_results; }
if ($this->debugging) {
// capture time for debugging info
@@ -2369,6 +2369,12 @@
return true;
}
+ /**
+ * returns an auto_id for auto-file-functions
+ *
+ * @param string $cache_id
+ * @param string $compile_id
+ */
function _get_auto_id($cache_id=null, $compile_id=null) {
if (isset($cache_id))
return (isset($compile_id)) ? $cache_id . '|' . $compile_id : $cache_id;