Skip to content
Snippets Groups Projects
Commit f54531da authored by Max Kellermann's avatar Max Kellermann Committed by Stefan Bürk
Browse files

[TASK] Eliminate double serialization in ApcuBackend

APCu can store arbitrary PHP data; it serializes all
values when they are stored, and it has a pluggable
serializer interface which can use serializers that
are better than serialize(), such as "igbinary",
see [1] and [2].

By not implementing TransientBackendInterface, the
ApcuBackend forces class VariableFrontend to serialize
all values into a string, but APCu serializes the
string again.

This adds TransientBackendInterface and removes the
is_string() check. Double serialization is eliminated
by this change.

Additionally, the unit tests are turned into
functionals, the backend is declared final, gets
some more type hints and uses the quicker xxh3 hash.

[1] https://www.php.net/manual/en/book.igbinary.php
[2] https://pecl.php.net/package/igbinary

Releases: main
Resolves: #99851
Change-Id: I8663deefd1ffeb249376119287191bcec9ef2420
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/77717


Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
parent 66d36252
Branches
Tags
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment