Skip to content

Commit 72fe736

Browse files
committed
Add runtime cache in one more place in Zend_Data
Related OpenMage#918
1 parent a0b38dd commit 72fe736

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/Zend/Locale/Data.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,8 @@ public static function getList($locale, $path, $value = false)
343343
$val = urlencode($val);
344344
$id = self::_filterCacheId('Zend_LocaleL_' . $locale . '_' . $path . '_' . $val);
345345

346-
// add runtime cache to avoid callng cache backend multiple times during one request
347-
if ( isset(self::$_localCache[$id])) {
346+
// add runtime cache to avoid calling cache backend multiple times during one request
347+
if (isset(self::$_localCache[$id])) {
348348
return self::$_localCache[$id];
349349
}
350350
if (!self::$_cacheDisabled && ($result = self::$_cache->load($id))) {
@@ -1000,6 +1000,11 @@ public static function getContent($locale, $path, $value = false)
10001000
}
10011001
$val = urlencode($val);
10021002
$id = self::_filterCacheId('Zend_LocaleC_' . $locale . '_' . $path . '_' . $val);
1003+
1004+
// add runtime cache to avoid calling cache backend multiple times during one request
1005+
if (isset(self::$_localCache[$id])) {
1006+
return self::$_localCache[$id];
1007+
}
10031008
if (!self::$_cacheDisabled && ($result = self::$_cache->load($id))) {
10041009
$result = unserialize($result);
10051010
self::$_localCache[$id] = $result;

0 commit comments

Comments
 (0)