Skip to content

Commit

Permalink
Fix issue with clean when getPlatformPrefix is set
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Narloch committed Aug 18, 2016
1 parent 82ac607 commit 3aa94f5
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
25 changes: 25 additions & 0 deletions libraries/joomla/cache/storage/memcache.php
Expand Up @@ -92,6 +92,31 @@ protected function getConnection()
}
}

/**
* Get a cache_id string from an id/group pair
*
* @param string $id The cache data id
* @param string $group The cache data group
*
* @return string The cache_id string
*
* @since 11.1
*/
protected function _getCacheId($id, $group)
{
$prefix = JCache::getPlatformPrefix();
$length = strlen($prefix);
$cache_id = parent::_getCacheId($id, $group);

if ($length)
{
// Memcache use suffix instead of prefix
$cache_id = substr($cache_id, $length) . strrev($prefix);
}

return $cache_id;
}

/**
* Get cached data by ID and group
*
Expand Down
25 changes: 25 additions & 0 deletions libraries/joomla/cache/storage/memcached.php
Expand Up @@ -112,6 +112,31 @@ protected function getConnection()
}
}

/**
* Get a cache_id string from an id/group pair
*
* @param string $id The cache data id
* @param string $group The cache data group
*
* @return string The cache_id string
*
* @since 11.1
*/
protected function _getCacheId($id, $group)
{
$prefix = JCache::getPlatformPrefix();
$length = strlen($prefix);
$cache_id = parent::_getCacheId($id, $group);

if ($length)
{
// Memcached use suffix instead of prefix
$cache_id = substr($cache_id, $length) . strrev($prefix);
}

return $cache_id;
}

/**
* Get cached data by ID and group
*
Expand Down

0 comments on commit 3aa94f5

Please sign in to comment.