Changeset View
Changeset View
Standalone View
Standalone View
core/kernel/managers/cache_manager.php
Show First 20 Lines • Show All 793 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) { | ||||
Lint: CodingStandard.WhiteSpace.ControlStructureSpacing.SpaceBeforeCloseBrace: Expected 1 spaces before "if" closing bracket; 0 found | |||||
Expected 1 spaces after "if" opening bracket; 0 found Lint: CodingStandard.WhiteSpace.ControlStructureSpacing.SpacingAfterOpenBrace: Expected 1 spaces after "if" opening bracket; 0 found | |||||
if ( $this->Application->isCachingType(CACHING_TYPE_MEMORY) ) { | |||||
$prefixes = $this->Application->getCache('cached_urls_unit_prefixes'); | |||||
} | |||||
else { | |||||
$prefixes = $this->Application->getDBCache('cached_urls_unit_prefixes'); | |||||
Not Done ReplyUse construct similar to one from \kUnitConfigReader::includeConfigFiles method (getting part) to use database cache, when memory cache isn't available. When memory cache is disabled, then cache of urls from non-default units (e.g. links and products) won't ever be removed. alex: Use construct similar to one from `\kUnitConfigReader::includeConfigFiles` method (getting… | |||||
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 | ||||
Inline comments must start with a capital letter Lint: CodingStandard.Commenting.InlineComment.NotCapital: Inline comments must start with a capital letter | |||||
Inline comments must end in full-stops, exclamation marks, or question marks Lint: CodingStandard.Commenting.InlineComment.InvalidEndChar: Inline comments must end in full-stops, exclamation marks, or question marks | |||||
$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 |
Expected 1 spaces before "if" closing bracket; 0 found