Project

General

Profile

Actions

Bug #99495

closed

Memcache Cache Backend fatal Error when using memcache module

Added by P Stern over 1 year ago. Updated 13 days ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Caching
Target version:
Start date:
2023-01-09
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.0
Tags:
cache
Complexity:
easy
Is Regression:
Sprint Focus:
On Location Sprint

Description

Note: There are 2 PHP-Modules for accessing memcache - [memcache](https://www.php.net/manual/en/book.memcache.php) and memcache*d*.

The documentation at https://docs.typo3.org/m/typo3/reference-coreapi/11.5/en-us/ApiOverview/CachingFramework/FrontendsBackends/Index.html#memcached-backend

says:

There are two PHP memcached implementations: "memcache" and "memcached". Currently, only memcache is supported by this backend.

When attempting to use the MemcachedBackend with the PHP memcache module (not memecached), everything (frontend, backend, console-command) dies with:

Uncaught TYPO3 Exception Class "Memcached" not found

This is because of the code on line #132 of typo3/sysext/core/Classes/Cache/Backend/MemcachedBackend.php :

$compressionFlag = $this->usedPeclModule === 'memcache' ? MEMCACHE_COMPRESSED : \Memcached::OPT_COMPRESSION;

which cannot be interpreted without Memcache*d* class existing (i.e. the memcache*d* module has been loaded).

1) MemcachedBackend only works with the Memcache*d* installed even though it appears to want to work with either Memcache or Memcache*d*

2) The documentation is not just out of date, but leads to installing the less advantages memcache module.

Actions #1

Updated by P Stern over 1 year ago

  • Subject changed from Memcache to Memcache Cache Backend fatal Error when using memcache module
  • Complexity set to easy
Actions #2

Updated by P Stern over 1 year ago

  • Description updated (diff)
Actions #3

Updated by P Stern over 1 year ago

  • Description updated (diff)
Actions #4

Updated by P Stern over 1 year ago

  • Target version set to next-patchlevel

The fix is a simple use of brackets in line #132 of typo3/sysext/core/Classes/Cache/Backend/MemcachedBackend.php

$compressionFlag = $this->usedPeclModule === 'memcache' ? MEMCACHE_COMPRESSED : (class_exists('Memcached') ? \Memcached::OPT_COMPRESSION : 0);
Actions #5

Updated by Benni Mack 12 months ago

  • Sprint Focus set to On Location Sprint
Actions #6

Updated by Gerrit Code Review 12 months ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80378

Actions #7

Updated by Gerrit Code Review 12 months ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80378

Actions #8

Updated by Gerrit Code Review 12 months ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80378

Actions #9

Updated by Gerrit Code Review 12 months ago

Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80387

Actions #10

Updated by Gerrit Code Review 12 months ago

Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80388

Actions #11

Updated by Christian Spoo 12 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #12

Updated by Benni Mack 13 days ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF