From ff24554e76c6ccf7cdb4b5abd82fddaa8d82816c Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Thu, 11 Jun 2015 00:34:03 +0200 Subject: Null -> NullCache --- lib/private/memcache/null.php | 65 -------------------------------------- lib/private/memcache/nullcache.php | 65 ++++++++++++++++++++++++++++++++++++++ lib/private/server.php | 4 +-- 3 files changed, 66 insertions(+), 68 deletions(-) delete mode 100644 lib/private/memcache/null.php create mode 100644 lib/private/memcache/nullcache.php (limited to 'lib') diff --git a/lib/private/memcache/null.php b/lib/private/memcache/null.php deleted file mode 100644 index 982f7edc80f..00000000000 --- a/lib/private/memcache/null.php +++ /dev/null @@ -1,65 +0,0 @@ - - * @author Robin McCorkell - * - * @copyright Copyright (c) 2015, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see - * - */ - -namespace OC\Memcache; - -class Null extends Cache implements \OCP\IMemcache { - public function get($key) { - return null; - } - - public function set($key, $value, $ttl = 0) { - return true; - } - - public function hasKey($key) { - return false; - } - - public function remove($key) { - return true; - } - - public function add($key, $value, $ttl = 0) { - return true; - } - - public function inc($key, $step = 1) { - return true; - } - - public function dec($key, $step = 1) { - return true; - } - - public function cas($key, $old, $new) { - return true; - } - - public function clear($prefix = '') { - return true; - } - - static public function isAvailable() { - return true; - } -} diff --git a/lib/private/memcache/nullcache.php b/lib/private/memcache/nullcache.php new file mode 100644 index 00000000000..77eadba4eba --- /dev/null +++ b/lib/private/memcache/nullcache.php @@ -0,0 +1,65 @@ + + * @author Robin McCorkell + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see + * + */ + +namespace OC\Memcache; + +class NullCache extends Cache implements \OCP\IMemcache { + public function get($key) { + return null; + } + + public function set($key, $value, $ttl = 0) { + return true; + } + + public function hasKey($key) { + return false; + } + + public function remove($key) { + return true; + } + + public function add($key, $value, $ttl = 0) { + return true; + } + + public function inc($key, $step = 1) { + return true; + } + + public function dec($key, $step = 1) { + return true; + } + + public function cas($key, $old, $new) { + return true; + } + + public function clear($prefix = '') { + return true; + } + + static public function isAvailable() { + return true; + } +} diff --git a/lib/private/server.php b/lib/private/server.php index 8113080977f..6e4f1517c12 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -46,7 +46,6 @@ use OC\Lock\MemcacheLockingProvider; use OC\Lock\NoopLockingProvider; use OC\Mail\Mailer; use OC\Memcache\ArrayCache; -use OC\Memcache\Null as NullCache; use OC\Http\Client\ClientService; use OC\Security\CertificateManager; use OC\Files\Node\Root; @@ -57,7 +56,6 @@ use OC\Security\SecureRandom; use OC\Diagnostics\NullEventLogger; use OC\Security\TrustedDomainHelper; use OCP\IServerContainer; -use OCP\ISession; use OC\Tagging\TagMapper; /** @@ -429,7 +427,7 @@ class Server extends SimpleContainer implements IServerContainer { /** @var \OC\Memcache\Factory $memcacheFactory */ $memcacheFactory = $c->getMemCacheFactory(); $memcache = $memcacheFactory->createLocking('lock'); - if (!($memcache instanceof \OC\Memcache\Null)) { + if (!($memcache instanceof \OC\Memcache\NullCache)) { return new MemcacheLockingProvider($memcache); } } -- cgit v1.2.3