Blame view

sources/lib/private/memcache/apcu.php 631 Bytes
31b7f2792   Kload   Upgrade to ownclo...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  <?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, '/');
a293d369c   Kload   Update sources to...
15
  		$iter = new \APCIterator('user', '/^'.$ns.'/');
31b7f2792   Kload   Upgrade to ownclo...
16
17
18
19
20
21
22
23
24
25
26
27
28
  		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;
  		}
  	}
  }