Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/kernel/managers/cache_manager.php
Show First 20 Lines • Show All 794 Lines • ▼ Show 20 Line(s) | |||||
if ($increment) { | if ($increment) { | ||||
if (defined('DEBUG_MODE') && DEBUG_MODE && $this->Application->isDebugMode()) { | if (defined('DEBUG_MODE') && DEBUG_MODE && $this->Application->isDebugMode()) { | ||||
$this->Application->Debugger->appendHTML('Incrementing serial: <strong>' . $serial_name . '</strong>.'); | $this->Application->Debugger->appendHTML('Incrementing serial: <strong>' . $serial_name . '</strong>.'); | ||||
} | } | ||||
$this->setCache($serial_name, (int)$this->getCache($serial_name) + 1); | $this->setCache($serial_name, (int)$this->getCache($serial_name) + 1); | ||||
if (!defined('IS_INSTALL') || !IS_INSTALL) { | if (!defined('IS_INSTALL') || !IS_INSTALL) { | ||||
if ( $this->Application->isCachingType(CACHING_TYPE_MEMORY) ) { | |||||
$prefixes = $this->Application->getCache('cached_urls_unit_prefixes'); | |||||
} | |||||
else { | |||||
$prefixes = $this->Application->getDBCache('cached_urls_unit_prefixes'); | |||||
if ( $prefixes !== false ) { | |||||
$prefixes = unserialize($prefixes); | |||||
} | |||||
} | |||||
if ( !$prefixes ) { | |||||
$prefixes = array('c', 'lang', 'theme'); | |||||
} | |||||
if ( in_array($prefix, $prefixes) ) { | |||||
// delete cached mod-rewrite urls related to given prefix and id | // delete cached mod-rewrite urls related to given prefix and id | ||||
$delete_clause = isset($id) ? $prefix . ':' . $id : $prefix; | $delete_clause = isset($id) ? $prefix . ':' . $id : $prefix; | ||||
$sql = 'DELETE FROM ' . TABLE_PREFIX . 'CachedUrls | $sql = 'DELETE FROM ' . TABLE_PREFIX . 'CachedUrls | ||||
WHERE Prefixes LIKE ' . $this->Conn->qstr('%|' . $delete_clause . '|%'); | WHERE Prefixes LIKE ' . $this->Conn->qstr('%|' . $delete_clause . '|%'); | ||||
$this->Conn->Query($sql); | $this->Conn->Query($sql); | ||||
} | } | ||||
} | } | ||||
} | |||||
return $serial_name; | return $serial_name; | ||||
} | } | ||||
/** | /** | ||||
* Returns cached category informaton by given cache name. All given category | * Returns cached category informaton by given cache name. All given category | ||||
* information is recached, when at least one of 4 caches is missing. | * information is recached, when at least one of 4 caches is missing. | ||||
* | * | ||||
Show All 35 Lines |