Skip to content

Commit

Permalink
Add runtime cache in one more place in Zend_Data
Browse files Browse the repository at this point in the history
Related OpenMage#918
  • Loading branch information
tmotyl committed Jun 3, 2020
1 parent a0b38dd commit 72fe736
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/Zend/Locale/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,8 @@ public static function getList($locale, $path, $value = false)
$val = urlencode($val);
$id = self::_filterCacheId('Zend_LocaleL_' . $locale . '_' . $path . '_' . $val);

// add runtime cache to avoid callng cache backend multiple times during one request
if ( isset(self::$_localCache[$id])) {
// add runtime cache to avoid calling cache backend multiple times during one request
if (isset(self::$_localCache[$id])) {
return self::$_localCache[$id];
}
if (!self::$_cacheDisabled && ($result = self::$_cache->load($id))) {
Expand Down Expand Up @@ -1000,6 +1000,11 @@ public static function getContent($locale, $path, $value = false)
}
$val = urlencode($val);
$id = self::_filterCacheId('Zend_LocaleC_' . $locale . '_' . $path . '_' . $val);

// add runtime cache to avoid calling cache backend multiple times during one request
if (isset(self::$_localCache[$id])) {
return self::$_localCache[$id];
}
if (!self::$_cacheDisabled && ($result = self::$_cache->load($id))) {
$result = unserialize($result);
self::$_localCache[$id] = $result;
Expand Down

0 comments on commit 72fe736

Please sign in to comment.