Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Confusion possible if overriding private method.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Apr 26, 2016
1 parent 4c6869a commit eb5f974
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions core/src/plugins/cache.doctrine/ext/PydioApcuCache.php
Expand Up @@ -35,7 +35,7 @@ class PydioApcuCache extends \Doctrine\Common\Cache\ApcuCache implements Pattern
*
* @return string The namespaced id.
*/
private function getNamespacedId($id)
private function namespacedIdAsPattern($id)
{
return sprintf('%s\['.preg_quote($id, "/"), $this->internalNamespace);
}
Expand All @@ -46,11 +46,11 @@ private function getNamespacedId($id)
*/
public function deleteKeysStartingWith($pattern)
{
$pattern = '/^'.$this->getNamespacedId($pattern).'/';
$pattern = '/^'.$this->namespacedIdAsPattern($pattern).'/';
//SAMPLE /^pydio-unique-id_nodes_\[list\:\/\/1/
$iterator = new APCIterator('user', $pattern);
foreach ($iterator as $data) {
$res = $this->doDelete($data['key']);
$this->doDelete($data['key']);
}
}

Expand Down
4 changes: 2 additions & 2 deletions core/src/plugins/cache.doctrine/ext/PydioRedisCache.php
Expand Up @@ -47,7 +47,7 @@ public function setRedis($redis){
*
* @return string The namespaced id.
*/
private function getNamespacedId($id)
private function namespacedIdAsPattern($id)
{
// Escape redis MATCH special characters
$id = str_replace(array("?", "*", "[", "]", "^", "-"), array("\?", "\*", "\[", "\]", "\^", "\-"), $id);
Expand All @@ -61,7 +61,7 @@ private function getNamespacedId($id)
*/
public function deleteKeysStartingWith($pattern)
{
$pattern = $this->getNamespacedId($pattern);
$pattern = $this->namespacedIdAsPattern($pattern);
$it = NULL; /* Initialize our iterator to NULL */
$this->internalRedis->setOption(Redis::OPT_SCAN, Redis::SCAN_RETRY); /* retry when we get no keys back */
while($arr_keys = $this->internalRedis->scan($it, $pattern)) {
Expand Down

0 comments on commit eb5f974

Please sign in to comment.