Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/kernel/nparser/nparser.php
Show First 20 Lines • Show All 964 Lines • ▼ Show 20 Line(s) | |||||
if (preg_match('/^\[DE_MARK:(.*?)\]$/', substr($ret, -11), $regs)) { | if (preg_match('/^\[DE_MARK:(.*?)\]$/', substr($ret, -11), $regs)) { | ||||
$this->DataExists = $regs[1] ? true : false; | $this->DataExists = $regs[1] ? true : false; | ||||
$ret = substr($ret, 0, -11); | $ret = substr($ret, 0, -11); | ||||
} | } | ||||
return $ret; | return $ret; | ||||
} | } | ||||
function setCache($name, $value, $expiration = 0) | function setCache($name, $value, $expiration = null) | ||||
{ | { | ||||
if (!$this->CachingEnabled) { | if (!$this->CachingEnabled) { | ||||
return false; | return false; | ||||
} | } | ||||
// Don't allow creating a non-expiring caches from a template. | |||||
if ( (int)$expiration <= 0 ) { | |||||
$expiration = null; | |||||
} | |||||
// remeber DataExists in cache, because after cache will be restored | // remeber DataExists in cache, because after cache will be restored | ||||
// it will not be available naturally (no tags, that set it will be called) | // it will not be available naturally (no tags, that set it will be called) | ||||
$value .= '[DE_MARK:' . (int)$this->DataExists . ']'; | $value .= '[DE_MARK:' . (int)$this->DataExists . ']'; | ||||
return $this->Application->setCache($name, $value, $expiration); | return $this->Application->setCache($name, $value, $expiration); | ||||
} | } | ||||
function FormCacheKey($element, $key_string = '') | function FormCacheKey($element, $key_string = '') | ||||
▲ Show 20 Lines • Show All 261 Lines • Show Last 20 Lines |