Index: branches/5.1.x/core/kernel/processors/tag_processor.php =================================================================== diff -u -N -r13086 -r13168 --- branches/5.1.x/core/kernel/processors/tag_processor.php (.../tag_processor.php) (revision 13086) +++ branches/5.1.x/core/kernel/processors/tag_processor.php (.../tag_processor.php) (revision 13168) @@ -1,6 +1,6 @@ Application->Parser->TemplateName; - $k .= $prefix.'_'.$tag; - foreach (array('m_cat_id','m_cat_page','m_lang','m_theme') as $m_var) { - $params[$m_var] = $this->Application->GetVar($m_var); - } + // link tag to it's template + $reg_exp = '/^' . preg_quote(FULL_PATH, '/') . '/'; + $template_path = preg_replace($reg_exp, '', $this->Application->Parser->TempalteFullPath, 1); + $element = 'file=' . $template_path . ':' . $prefix . '_' . $tag . '_' . crc32( serialize($params) ); - ksort($params); - foreach ($params as $p => $v) { - $k .= "$p=$v&"; - } - - return md5($k); + return $this->Application->Parser->FormCacheKey($element); } function ProcessParsedTag($tag, $params, $prefix, $file='unknown', $line=0) @@ -71,11 +65,18 @@ $this->Application->Debugger->appendHTML('Processing PreParsed Tag '.$Method.' in '.$this->Prefix); } + list ($prefix_only, ) = explode('.', $prefix); + $this->Application->Parser->PrefixesInUse[$prefix_only] = 1; + $backup_prefix = $this->Prefix; $backup_special = $this->Special; - if ($this->Application->ConfigValue('SystemTagCache') && isset($params['cache_timeout'])) { - if ($res = $this->Application->CacheGet($this->FormCacheKey($tag, $params, $prefix))) { + if ($this->Application->Parser->CachingEnabled && array_key_exists('cache_timeout', $params)) { + // individual tag caching + $cache_key = $this->FormCacheKey($tag, $params, $prefix); + $res = $this->Application->Parser->getCache($cache_key); + + if ($res !== false) { return $res; } } @@ -94,9 +95,11 @@ $this->Special = $backup_special; $ret = $this->PostProcess($ret, $flag_values); - if ($this->Application->ConfigValue('SystemTagCache') && $flag_values['cache_timeout'] && isset($this->Application->Memcached)) { - $this->Application->CacheSet($this->FormCacheKey($tag, $original_params, $prefix), $ret, $flag_values['cache_timeout']); + + if ($this->Application->Parser->CachingEnabled && $flag_values['cache_timeout']) { + $this->Application->Parser->setCache($cache_key, $ret, (int)$flag_values['cache_timeout']); } + return $ret; } else {