Permalink
Browse files

Use APCUIterator if APCIterator not available - Should close #1235

  • Loading branch information...
1 parent 77d78b1 commit 9ca68c59da4324e9d40a98d16634981cba90ae8d @cdujeu cdujeu committed Oct 7, 2016
Showing with 8 additions and 1 deletion.
  1. +8 −1 core/src/plugins/cache.doctrine/src/PydioApcuCache.php
@@ -52,7 +52,14 @@ private function namespacedIdAsPattern($id) {
public function deleteKeysStartingWith($pattern) {
$pattern = '/^'.$this->namespacedIdAsPattern($pattern).'/';
//SAMPLE /^pydio-unique-id_nodes_\[list\:\/\/1/
- $iterator = new \APCIterator('user', $pattern);
+ if(class_exists("\\APCIterator")){
+ $iterator = new \APCIterator('user', $pattern);
+ }else if(class_exists("\\APCUIterator")){
+ $iterator = new \APCUIterator('user', $pattern);
+ }else{
+ error_log("Trying to delete cache entry using pattern, but could not find either APCIterator or APCUIterator");
+ return;
+ }
foreach ($iterator as $data) {
$this->doDelete($data['key']);
}

0 comments on commit 9ca68c5

Please sign in to comment.