diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2015-06-16 11:00:18 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2015-06-16 11:00:18 +0200 |
commit | 7d8b728066987bd312b3225eff6cff67ca6a610a (patch) | |
tree | 6653104e2eff4511ed49636334496a7b6ea28901 /lib/private/memcache | |
parent | 60005bea1945537316115217db60397a1691ee86 (diff) | |
parent | 3b08b2658954b95932af8eec7cfaac17b1da7873 (diff) | |
download | nextcloud-server-7d8b728066987bd312b3225eff6cff67ca6a610a.tar.gz nextcloud-server-7d8b728066987bd312b3225eff6cff67ca6a610a.zip |
Merge pull request #16832 from owncloud/memcache-fail
Throw exception if memcache misconfigured or missing
Diffstat (limited to 'lib/private/memcache')
-rw-r--r-- | lib/private/memcache/factory.php | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/private/memcache/factory.php b/lib/private/memcache/factory.php index 5e3d857006c..320657a71ad 100644 --- a/lib/private/memcache/factory.php +++ b/lib/private/memcache/factory.php @@ -62,12 +62,25 @@ class Factory implements ICacheFactory { { $this->globalPrefix = $globalPrefix; - if (!($localCacheClass && $localCacheClass::isAvailable())) { + if (!$localCacheClass) { $localCacheClass = self::NULL_CACHE; } - if (!($distributedCacheClass && $distributedCacheClass::isAvailable())) { + if (!$distributedCacheClass) { $distributedCacheClass = $localCacheClass; } + + if (!$localCacheClass::isAvailable()) { + throw new \OC\HintException( + 'Missing memcache class ' . $localCacheClass . ' for local cache', + 'Is the matching PHP module installed and enabled ?' + ); + } + if (!$distributedCacheClass::isAvailable()) { + throw new \OC\HintException( + 'Missing memcache class ' . $distributedCacheClass . ' for distributed cache', + 'Is the matching PHP module installed and enabled ?' + ); + } if (!($lockingCacheClass && $lockingCacheClass::isAvailable())) { // dont fallback since the fallback might not be suitable for storing lock $lockingCacheClass = '\OC\Memcache\NullCache'; |