diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 1bb37b63..c6b26e30 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -96,6 +96,7 @@ require_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_template.php'; require_once SMARTY_SYSPLUGINS_DIR . 'smarty_resource.php'; require_once SMARTY_SYSPLUGINS_DIR . 'smarty_variable.php'; require_once SMARTY_SYSPLUGINS_DIR . 'smarty_template_source.php'; +require_once SMARTY_SYSPLUGINS_DIR . 'smarty_template_resource_base.php'; /** * This is the main Smarty class @@ -555,13 +556,6 @@ class Smarty extends Smarty_Internal_TemplateBase */ public $caching_type = 'file'; - /** - * internal config properties - * - * @var array - */ - public $properties = array(); - /** * config type * diff --git a/libs/sysplugins/smarty_cacheresource.php b/libs/sysplugins/smarty_cacheresource.php index 44b6e46d..98e873e7 100644 --- a/libs/sysplugins/smarty_cacheresource.php +++ b/libs/sysplugins/smarty_cacheresource.php @@ -73,7 +73,7 @@ abstract class Smarty_CacheResource { if ($_template->cached->handler->process($_template)) { ob_start(); - $_template->properties['unifunc']($_template); + $_template->cached->unifunc($_template); return ob_get_clean(); } diff --git a/libs/sysplugins/smarty_internal_compile_private_php.php b/libs/sysplugins/smarty_internal_compile_private_php.php index 1e269f84..584f70b0 100644 --- a/libs/sysplugins/smarty_internal_compile_private_php.php +++ b/libs/sysplugins/smarty_internal_compile_private_php.php @@ -42,12 +42,12 @@ class Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase $compiler->has_code = false; if ($_attr['type'] == 'xml') { $compiler->tag_nocache = true; - $save = $compiler->template->has_nocache_code; + $save = $compiler->template->compiled->has_nocache_code; $output = addcslashes($_attr['code'], "'\\"); $compiler->parser->current_buffer->append_subtree($compiler->parser, new Smarty_Internal_ParseTree_Tag($compiler->parser, $compiler->processNocacheCode("", $compiler, true))); - $compiler->template->has_nocache_code = $save; + $compiler->template->compiled->has_nocache_code = $save; return ''; } if ($_attr['type'] != 'tag') { @@ -60,12 +60,12 @@ class Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase return ''; } elseif ($compiler->php_handling == Smarty::PHP_PASSTHRU || $_attr['type'] == 'unmatched') { $compiler->tag_nocache = true; - $save = $compiler->template->has_nocache_code; + $save = $compiler->template->compiled->has_nocache_code; $output = addcslashes($_attr['code'], "'\\"); $compiler->parser->current_buffer->append_subtree($compiler->parser, new Smarty_Internal_ParseTree_Tag($compiler->parser, $compiler->processNocacheCode("", $compiler, true))); - $compiler->template->has_nocache_code = $save; + $compiler->template->compiled->has_nocache_code = $save; return ''; } elseif ($compiler->php_handling == Smarty::PHP_ALLOW) { if (!($compiler->smarty instanceof SmartyBC)) { diff --git a/libs/sysplugins/smarty_internal_config_file_compiler.php b/libs/sysplugins/smarty_internal_config_file_compiler.php index 9e55b0cc..a783b056 100644 --- a/libs/sysplugins/smarty_internal_config_file_compiler.php +++ b/libs/sysplugins/smarty_internal_config_file_compiler.php @@ -101,7 +101,7 @@ class Smarty_Internal_Config_File_Compiler public function compileTemplate(Smarty_Internal_Template $template) { $this->template = $template; - $this->template->properties['file_dependency'][$this->template->source->uid] = array($this->template->source->filepath, + $this->template->compiled->file_dependency[$this->template->source->uid] = array($this->template->source->filepath, $this->template->source->getTimeStamp(), $this->template->source->type); if ($this->smarty->debugging) { diff --git a/libs/sysplugins/smarty_internal_extension_config.php b/libs/sysplugins/smarty_internal_extension_config.php index 55663be8..c97e3d6d 100644 --- a/libs/sysplugins/smarty_internal_extension_config.php +++ b/libs/sysplugins/smarty_internal_extension_config.php @@ -29,7 +29,7 @@ class Smarty_Internal_Extension_Config Smarty_Internal_Debug::end_render($confObj); } if ($obj instanceof Smarty_Internal_Template) { - $obj->properties['file_dependency'][$confObj->source->uid] = array($confObj->source->filepath, $confObj->source->getTimeStamp(), $confObj->source->type); + $obj->compiled->file_dependency[$confObj->source->uid] = array($confObj->source->filepath, $confObj->source->getTimeStamp(), $confObj->source->type); } } diff --git a/libs/sysplugins/smarty_internal_nocache_insert.php b/libs/sysplugins/smarty_internal_nocache_insert.php index 0d2facfe..f9c9c120 100644 --- a/libs/sysplugins/smarty_internal_nocache_insert.php +++ b/libs/sysplugins/smarty_internal_nocache_insert.php @@ -46,6 +46,6 @@ class Smarty_Internal_Nocache_Insert $_tpl = $_tpl->parent; } - return "/*%%SmartyNocache:{$_tpl->properties['nocache_hash']}%%*/" . $_output . "/*/%%SmartyNocache:{$_tpl->properties['nocache_hash']}%%*/"; + return "/*%%SmartyNocache:{$_tpl->compiled->nocache_hash}%%*/" . $_output . "/*/%%SmartyNocache:{$_tpl->compiled->nocache_hash}%%*/"; } } diff --git a/libs/sysplugins/smarty_internal_smartytemplatecompiler.php b/libs/sysplugins/smarty_internal_smartytemplatecompiler.php index f17b01e6..45a8d2e4 100644 --- a/libs/sysplugins/smarty_internal_smartytemplatecompiler.php +++ b/libs/sysplugins/smarty_internal_smartytemplatecompiler.php @@ -71,7 +71,7 @@ class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCom $this->parser = new $this->parser_class(new $this->lexer_class(str_replace(array("\r\n", "\r"), "\n", $_content), $this), $this); if ($isTemplateSource) { - $this->parser->insertPhpCode("properties['nocache_hash'] = '{$this->nocache_hash}';\n?>\n"); + $this->parser->insertPhpCode("compiled->nocache_hash = '{$this->nocache_hash}';\n?>\n"); } if ($this->inheritance_child) { // start state on child templates diff --git a/libs/sysplugins/smarty_internal_templateparser.php b/libs/sysplugins/smarty_internal_templateparser.php index 37fdae7e..88b03401 100644 --- a/libs/sysplugins/smarty_internal_templateparser.php +++ b/libs/sysplugins/smarty_internal_templateparser.php @@ -1451,9 +1451,9 @@ class Smarty_Internal_Templateparser function yy_r7() { $this->compiler->tag_nocache = true; - $save = $this->template->has_nocache_code; + $save = $this->template->compiled->has_nocache_code; $this->_retvalue = new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode("yystack[$this->yyidx + 0]->minor}';?>\n", $this->compiler, true)); - $this->template->has_nocache_code = $save; + $this->template->compiled->has_nocache_code = $save; } #line 263 "../smarty/lexer/smarty_internal_templateparser.y" diff --git a/libs/sysplugins/smarty_template_source.php b/libs/sysplugins/smarty_template_source.php index 3a639e88..70bb6a48 100644 --- a/libs/sysplugins/smarty_template_source.php +++ b/libs/sysplugins/smarty_template_source.php @@ -205,7 +205,7 @@ class Smarty_Template_Source list($name, $type) = Smarty_Resource::parseResourceName($template_resource, $smarty->default_resource_type); $resource = Smarty_Resource::load($smarty, $type); // if resource is not recompiling and resource name is not dotted we can check the source cache - if ($smarty->resource_caching && !$resource->recompiled && !(isset($name[1]) && $name[0] == '.' && ($name[1] == '.' || $name[1] == '/'))) { + if (($smarty->resource_cache_mode & Smarty::RESOURCE_CACHE_ON) && !$resource->recompiled && !(isset($name[1]) && $name[0] == '.' && ($name[1] == '.' || $name[1] == '/'))) { $unique_resource = $resource->buildUniqueResourceName($smarty, $name); if (isset($smarty->source_objects[$unique_resource])) { return $smarty->source_objects[$unique_resource]; @@ -220,7 +220,7 @@ class Smarty_Template_Source Smarty_Internal_Extension_DefaultTemplateHandler::_getDefault($_template, $source); } // on recompiling resources we are done - if ($smarty->resource_caching && !$resource->recompiled) { + if (($smarty->resource_cache_mode & Smarty::RESOURCE_CACHE_ON) && !$resource->recompiled) { // may by we have already $unique_resource $is_relative = false; if (!isset($unique_resource)) {