Merge pull request #3887 from owncloud/apc_user_cache
The APC User Cache doesn't return the cache_list anymore * owncloud/apc_user_cache: Add ACPu memory cacheremotes/origin/stable6
commit
75e93d041d
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (c) 2012 Bart Visscher <bartv@thisnet.nl>
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later.
|
||||
* See the COPYING-README file.
|
||||
*/
|
||||
|
||||
namespace OC\Memcache;
|
||||
|
||||
class APCu extends APC {
|
||||
public function clear($prefix = '') {
|
||||
$ns = $this->getNamespace() . $prefix;
|
||||
$ns = preg_quote($ns, '/');
|
||||
$iter = new \APCIterator('/^'.$ns.'/');
|
||||
return apc_delete($iter);
|
||||
}
|
||||
|
||||
static public function isAvailable() {
|
||||
if (!extension_loaded('apcu')) {
|
||||
return false;
|
||||
} elseif (!ini_get('apc.enable_cli') && \OC::$CLI) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Copyright (c) 2013 Robin Appelman <icewind@owncloud.com>
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later.
|
||||
* See the COPYING-README file.
|
||||
*/
|
||||
|
||||
namespace Test\Memcache;
|
||||
|
||||
class APCu extends Cache {
|
||||
public function setUp() {
|
||||
if(!\OC\Memcache\APCu::isAvailable()) {
|
||||
$this->markTestSkipped('The APCu extension is not available.');
|
||||
return;
|
||||
}
|
||||
$this->instance=new \OC\Memcache\APCu(uniqid());
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue