Fix duplication of key group version in third-party modules

This commit is contained in:
Kijin Sung 2016-04-18 20:55:41 +09:00
parent 26c5a18a5b
commit ba9adb2f6e
2 changed files with 3 additions and 4 deletions

View file

@ -148,7 +148,7 @@ class CacheHandler extends Handler
*/ */
public function getGroupKey($keyGroupName, $key) public function getGroupKey($keyGroupName, $key)
{ {
return Rhymix\Framework\Cache::getRealKey($keyGroupName . ':' . $key, false); return $keyGroupName . ':' . $key;
} }
/** /**

View file

@ -298,16 +298,15 @@ class Cache
* Get the actual key used by Rhymix. * Get the actual key used by Rhymix.
* *
* @param string $key * @param string $key
* @param bool $add_prefix (optional)
* @return string * @return string
*/ */
public static function getRealKey($key, $add_prefix = true) public static function getRealKey($key)
{ {
if (preg_match('/^([^:]+):(.+)$/i', $key, $matches)) if (preg_match('/^([^:]+):(.+)$/i', $key, $matches))
{ {
$key = $matches[1] . '#' . self::getGroupVersion($matches[1]) . ':' . $matches[2]; $key = $matches[1] . '#' . self::getGroupVersion($matches[1]) . ':' . $matches[2];
} }
return ($add_prefix ? self::$_prefix : '') . $key; return self::$_prefix . $key;
} }
} }