private function runAnwcache($sReturn) { //warning, this (recursive) regexp is dangerous for human brains :D $sPattern = '#<' . self::TAG_ANWCACHE . '([^<]*)>((?:[^<]|<(?!/?' . self::TAG_ANWCACHE . ')|(?R))+)</' . self::TAG_ANWCACHE . '>#si'; //are cache-blocks enabled ? if ($this->bCachingEnabled && AnwComponent::globalCfgCacheBlocksEnabled()) { //execute cache-blocks: //if cache is found, it will just return the cached value //if not, it will recursively call runDynamicTransformations() on content to be cached, and then cache it $sReturn = preg_replace_callback($sPattern, array($this, 'cbk_anwcache'), $sReturn); } else { //strip out cache-blocks tags $sReturn = preg_replace($sPattern, '$2', $sReturn); } return $sReturn; }