cvs: smarty /libs Smarty.class.php /libs/core core.load_plugins.php
"Messju Mohr" <[email protected]>
| Newsgroups | gmane.comp.php.cvs.smarty |
|---|---|
| Message-ID | <cvsmessju1060108034@cvsserver> |
messju Tue Aug 5 14:27:14 2003 EDT
Modified files:
/smarty/libs Smarty.class.php
/smarty/libs/core core.load_plugins.php
Log:
fixed bug that occurred when using the same not-cacheable plugin in multiple includes
Index: smarty/libs/Smarty.class.php
diff -u smarty/libs/Smarty.class.php:1.427 smarty/libs/Smarty.class.php:1.428
--- smarty/libs/Smarty.class.php:1.427 Thu Jul 31 09:51:28 2003
+++ smarty/libs/Smarty.class.php Tue Aug 5 14:27:14 2003
@@ -42,7 +42,7 @@
* @version 2.5.0-cvs
*/
-/* $Id: Smarty.class.php,v 1.427 2003/07/31 13:51:28 messju Exp $ */
+/* $Id: Smarty.class.php,v 1.428 2003/08/05 18:27:14 messju Exp $ */
/**
* DIR_SEP isn't used anymore, but third party apps might
@@ -1297,7 +1297,6 @@
}
$_smarty_compile_path = $this->_get_compile_path($resource_name);
- $this->_cache_include = substr($_smarty_compile_path, 0, -4).'.inc';
// if we just need to display the results, don't perform output
// buffering - for speed
@@ -1494,8 +1493,9 @@
$_source_content = $_params['source_content'];
$_resource_timestamp = $_params['resource_timestamp'];
+ $_cache_include = substr($compile_path, 0, -4).'.inc';
- if ($this->_compile_source($resource_name, $_source_content, $_compiled_content)) {
+ if ($this->_compile_source($resource_name, $_source_content, $_compiled_content, $_cache_include)) {
// if a _cache_serial was set, we also have to write an include-file:
if ($this->_cache_include_info) {
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.write_compiled_include.php');
@@ -1522,7 +1522,7 @@
* @param string $compiled_content
* @return boolean
*/
- function _compile_source($resource_name, &$source_content, &$compiled_content)
+ function _compile_source($resource_name, &$source_content, &$compiled_content, $cache_include_path=null)
{
if (file_exists(SMARTY_DIR . $this->compiler_file)) {
require_once(SMARTY_DIR . $this->compiler_file);
@@ -1561,7 +1561,7 @@
$smarty_compiler->_cache_paths_file = $this->_cache_paths_file;
$smarty_compiler->_cache_serial = null;
- $smarty_compiler->_cache_include = $this->_cache_include;
+ $smarty_compiler->_cache_include = $cache_include_path;
$_results = $smarty_compiler->_compile_file($resource_name, $source_content, $compiled_content);
@@ -1570,7 +1570,7 @@
$this->_cache_include_info = array(
'cache_serial'=>$smarty_compiler->_cache_serial
,'plugins_code'=>$smarty_compiler->_plugins_code
- ,'include_file_path' => $smarty_compiler->_cache_include);
+ ,'include_file_path' => $cache_include_path);
} else {
$this->_cache_include_info = null;
Index: smarty/libs/core/core.load_plugins.php
diff -u smarty/libs/core/core.load_plugins.php:1.4 smarty/libs/core/core.load_plugins.php:1.5
--- smarty/libs/core/core.load_plugins.php:1.4 Tue Jul 29 03:15:44 2003
+++ smarty/libs/core/core.load_plugins.php Tue Aug 5 14:27:14 2003
@@ -38,7 +38,7 @@
$_plugin[1] = $_tpl_file;
$_plugin[2] = $_tpl_line;
$_plugin[3] = true;
- $_plugin[4] = true; /* cacheable */
+ if (!isset($_plugin[4])) $_plugin[4] = true; /* cacheable */
}
}
continue;
--
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php