Skip to content

Commit

Permalink
Merge pull request #45242 from nextcloud/check-memcache-memcached
Browse files Browse the repository at this point in the history
fix(setupCheck): Only warn when memcache present w/o memcached
  • Loading branch information
kesselb authored May 13, 2024
2 parents 2d40dae + c0e395c commit 99f89bb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions apps/settings/lib/SetupChecks/MemcacheConfigured.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,16 @@ public function run(): SetupResult {
$memcacheLocalClass = $this->config->getSystemValue('memcache.local', null);
$caches = array_filter([$memcacheDistributedClass,$memcacheLockingClass,$memcacheLocalClass]);
if (in_array(\OC\Memcache\Memcached::class, array_map(fn (string $class) => ltrim($class, '\\'), $caches))) {
if (extension_loaded('memcache')) {
// wrong PHP module is installed
if (extension_loaded('memcache') && !extension_loaded('memcached')) {
return SetupResult::warning(
$this->l10n->t('Memcached is configured as distributed cache, but the wrong PHP module "memcache" is installed. \\OC\\Memcache\\Memcached only supports "memcached" and not "memcache".'),
'https://code.google.com/p/memcached/wiki/PHPClientComparison'
$this->l10n->t('Memcached is configured as distributed cache, but the wrong PHP module ("memcache") is installed. Please install the PHP module "memcached".')
);
}
// required PHP module is missing
if (!extension_loaded('memcached')) {
return SetupResult::warning(
$this->l10n->t('Memcached is configured as distributed cache, but the PHP module "memcached" is not installed.')
$this->l10n->t('Memcached is configured as distributed cache, but the PHP module "memcached" is not installed. Please install the PHP module "memcached".')
);
}
}
Expand Down

0 comments on commit 99f89bb

Please sign in to comment.