- fixed bug on modifier plugins at nocache output

This commit is contained in:
Uwe.Tews
2009-12-27 22:26:06 +00:00
parent 36da15cee8
commit 997b8cd73f
2 changed files with 21 additions and 0 deletions

View File

@@ -10,6 +10,7 @@
- code cleanup for merging compiled templates - code cleanup for merging compiled templates
- couple of runtime optimizations (still not all done) - couple of runtime optimizations (still not all done)
- update of getCachedTimestamp() - update of getCachedTimestamp()
- fixed bug on modifier plugins at nocache output
12/19/2009 12/19/2009
- bugfix on comment lines in config files - bugfix on comment lines in config files

View File

@@ -266,6 +266,13 @@ class Smarty_Internal_TemplateCompilerBase {
if (isset($this->template->required_plugins['compiled'][$plugin_name])) { if (isset($this->template->required_plugins['compiled'][$plugin_name])) {
$this->template->required_plugins['cache'][$plugin_name] = $this->template->required_plugins['compiled'][$plugin_name]; $this->template->required_plugins['cache'][$plugin_name] = $this->template->required_plugins['compiled'][$plugin_name];
} }
} else {
if (isset($this->template->required_plugins['cache'][$plugin_name])) {
$this->template->required_plugins['compiled'][$plugin_name] = $this->template->required_plugins['compiled'][$plugin_name];
}
}
if ($type = 'modifier') {
$this->template->saved_modifer[$plugin_name] = true;
} }
return $this->template->required_plugins_call[$plugin_name][$type]; return $this->template->required_plugins_call[$plugin_name][$type];
} }
@@ -290,6 +297,10 @@ class Smarty_Internal_TemplateCompilerBase {
$this->template->required_plugins['compiled'][$plugin_name]['file'] = $file; $this->template->required_plugins['compiled'][$plugin_name]['file'] = $file;
$this->template->required_plugins['compiled'][$plugin_name]['type'] = $type; $this->template->required_plugins['compiled'][$plugin_name]['type'] = $type;
} }
if ($type = 'modifier') {
$this->template->saved_modifer[$plugin_name] = true;
}
return $plugin; return $plugin;
} else { } else {
throw new Exception("Plugin {$type} \"{$plugin_name}\" not callable"); throw new Exception("Plugin {$type} \"{$plugin_name}\" not callable");
@@ -319,6 +330,15 @@ class Smarty_Internal_TemplateCompilerBase {
$this->tag_nocache = false; $this->tag_nocache = false;
$_output = str_replace("'", "\'", $content); $_output = str_replace("'", "\'", $content);
$_output = "<?php echo '/*%%SmartyNocache%%*/" . $_output . "/*/%%SmartyNocache%%*/';?>\n"; $_output = "<?php echo '/*%%SmartyNocache%%*/" . $_output . "/*/%%SmartyNocache%%*/';?>\n";
// make sure we include modifer plugins for nocache code
if (isset($this->template->saved_modifer)) {
foreach ($this->template->saved_modifer as $plugin_name => $dummy) {
if (isset($this->template->required_plugins['compiled'][$plugin_name])) {
$this->template->required_plugins['cache'][$plugin_name] = $this->template->required_plugins['compiled'][$plugin_name];
}
}
unset($this->template->saved_modifer);
}
} else { } else {
$_output = $content; $_output = $content;
} }