Skip to content

Commit

Permalink
[BUGFIX] Properly set memcache/memcached in cache backend
Browse files Browse the repository at this point in the history
parent::__construct() of MemcachedBackend calls
setCompression() which determines compression based
on state of $this->usePeclModule. This property needs
to be set before parent::__construct() is called.

Resolves: #99495
Releases: main, 12.4, 11.5
Change-Id: Ibc6c3a2378c5187748b4394d440232600de193e2
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80387
Tested-by: Stefan B�rk <stefan@buerk.tech>
Reviewed-by: Stefan B�rk <stefan@buerk.tech>
Tested-by: core-ci <typo3@b13.com>
  • Loading branch information
tehplague authored and sbuerk committed Aug 4, 2023
1 parent ff2a788 commit 0647ab1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions typo3/sysext/core/Classes/Cache/Backend/MemcachedBackend.php
Expand Up @@ -99,16 +99,14 @@ public function __construct($context, array $options = [])
if (!extension_loaded('memcache') && !extension_loaded('memcached')) {
throw new Exception('The PHP extension "memcache" or "memcached" must be installed and loaded in order to use the Memcached backend.', 1213987706);
}

parent::__construct($context, $options);

if ($this->usedPeclModule === '') {
if (extension_loaded('memcache')) {
$this->usedPeclModule = 'memcache';
} elseif (extension_loaded('memcached')) {
$this->usedPeclModule = 'memcached';
}
}
parent::__construct($context, $options);
}

/**
Expand Down

0 comments on commit 0647ab1

Please sign in to comment.