summaryrefslogtreecommitdiffstats
path: root/lib/private/memcache/apcu.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/memcache/apcu.php')
-rw-r--r--lib/private/memcache/apcu.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/private/memcache/apcu.php b/lib/private/memcache/apcu.php
new file mode 100644
index 00000000000..ccc1aa6e562
--- /dev/null
+++ b/lib/private/memcache/apcu.php
@@ -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;
+ }
+ }
+}