get the memorycache factory from OCP\Server instead of a cache instance

this allows apps to specify a prefix to use
remotes/origin/ldap_group_count
Robin Appelman 11 years ago
parent 4d65a80892
commit be7837402d
  1. 11
      lib/private/server.php
  2. 17
      lib/public/cachefactory.php

@ -136,10 +136,9 @@ class Server extends SimpleContainer implements IServerContainer {
$this->registerService('UserCache', function($c) {
return new UserCache();
});
$this->registerService('MemCache', function ($c) {
$this->registerService('MemCacheFactory', function ($c) {
$instanceId = \OC_Util::getInstanceId();
$factory = new \OC\Memcache\Factory($instanceId);
return $factory->create();
return new \OC\Memcache\Factory($instanceId);
});
$this->registerService('ActivityManager', function($c) {
return new ActivityManager();
@ -303,10 +302,10 @@ class Server extends SimpleContainer implements IServerContainer {
/**
* Returns an ICache instance
*
* @return \OCP\ICache
* @return \OCP\CacheFactory
*/
function getMemCache() {
return $this->query('MemCache');
function getMemCacheFactory() {
return $this->query('MemCacheFactory');
}
/**

@ -0,0 +1,17 @@
<?php
/**
* Copyright (c) 2014 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 OCP;
interface CacheFactory{
/**
* @param string $prefix
* @return $return \OCP\ICache
*/
public function create($prefix = '');
}
Loading…
Cancel
Save