aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorblizzz <blizzz@arthur-schiwon.de>2021-05-27 17:56:11 +0200
committerGitHub <noreply@github.com>2021-05-27 17:56:11 +0200
commit6f063c2ee9cf73cfce1aed829367b0eef92f720d (patch)
treeb5e90418f700cdf9b5eacce533057d66c444e623 /lib/private
parent54f8d48c620f7b7464a04597f8cd1bbe79795004 (diff)
parent0f949eaeb187c308c0b2d63a3db2ad11c16ec452 (diff)
downloadnextcloud-server-6f063c2ee9cf73cfce1aed829367b0eef92f720d.tar.gz
nextcloud-server-6f063c2ee9cf73cfce1aed829367b0eef92f720d.zip
Merge pull request #25770 from nextcloud/fix/25742/cli-cache-backend-recursion
Don't allow executing cli if cache backend is unavailable
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Memcache/Factory.php32
1 files changed, 6 insertions, 26 deletions
diff --git a/lib/private/Memcache/Factory.php b/lib/private/Memcache/Factory.php
index 17ee2a58e04..83a05e20a59 100644
--- a/lib/private/Memcache/Factory.php
+++ b/lib/private/Memcache/Factory.php
@@ -86,34 +86,14 @@ class Factory implements ICacheFactory {
$missingCacheMessage = 'Memcache {class} not available for {use} cache';
$missingCacheHint = 'Is the matching PHP module installed and enabled?';
if (!class_exists($localCacheClass) || !$localCacheClass::isAvailable()) {
- if (\OC::$CLI && !defined('PHPUNIT_RUN')) {
- // CLI should not hard-fail on broken memcache
- $this->logger->info($missingCacheMessage, [
- 'class' => $localCacheClass,
- 'use' => 'local',
- 'app' => 'cli'
- ]);
- $localCacheClass = self::NULL_CACHE;
- } else {
- throw new \OC\HintException(strtr($missingCacheMessage, [
- '{class}' => $localCacheClass, '{use}' => 'local'
- ]), $missingCacheHint);
- }
+ throw new \OC\HintException(strtr($missingCacheMessage, [
+ '{class}' => $localCacheClass, '{use}' => 'local'
+ ]), $missingCacheHint);
}
if (!class_exists($distributedCacheClass) || !$distributedCacheClass::isAvailable()) {
- if (\OC::$CLI && !defined('PHPUNIT_RUN')) {
- // CLI should not hard-fail on broken memcache
- $this->logger->info($missingCacheMessage, [
- 'class' => $distributedCacheClass,
- 'use' => 'distributed',
- 'app' => 'cli'
- ]);
- $distributedCacheClass = self::NULL_CACHE;
- } else {
- throw new \OC\HintException(strtr($missingCacheMessage, [
- '{class}' => $distributedCacheClass, '{use}' => 'distributed'
- ]), $missingCacheHint);
- }
+ throw new \OC\HintException(strtr($missingCacheMessage, [
+ '{class}' => $distributedCacheClass, '{use}' => 'distributed'
+ ]), $missingCacheHint);
}
if (!($lockingCacheClass && class_exists($distributedCacheClass) && $lockingCacheClass::isAvailable())) {
// don't fallback since the fallback might not be suitable for storing lock