Skip to content

Commit f714e4e

Browse files
authored
[!!!][TASK] Remove FreezableBackendInterface (#6008)
Replace the manually handled table with api directive Resolves: TYPO3-Documentation/Changelog-To-Doc#1295 Releases: main
1 parent ba676d3 commit f714e4e

File tree

5 files changed

+234
-59
lines changed

5 files changed

+234
-59
lines changed

Documentation/ApiOverview/CachingFramework/FrontendsBackends/Index.rst

Lines changed: 18 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -146,76 +146,35 @@ Backend API
146146
===========
147147

148148
All backends must implement at least interface :code:`TYPO3\CMS\Core\Cache\Backend\BackendInterface`.
149-
All operations on a specific cache must be done with these methods. There are several further interfaces that can be
150-
implemented by backends to declare additional capabilities. Usually, extension code should not handle cache backend operations
151-
directly, but should use the frontend object instead.
152-
153-
.. t3-field-list-table::
154-
:header-rows: 1
155149

156-
- :Method,30: Method
157-
:Description,70: Description
150+
.. versionchanged:: 14.0
151+
The :php-short:`\TYPO3\CMS\Core\Cache\Backend\FreezableBackendInterface`
152+
has been removed. See `Breaking: #107310 - Remove FreezableBackendInterface <https://docs.typo3.org/permalink/changelog:breaking-107310-1755533400>`_.
158153

159-
- :Method:
160-
setCache
161-
:Description:
162-
Reference to the frontend which uses the backend. This method is mostly used internally.
154+
.. _caching_backend-api-BackendInterface:
163155

164-
- :Method:
165-
set
166-
:Description:
167-
Save data in the cache.
168-
169-
- :Method:
170-
get
171-
:Description:
172-
Load data from the cache.
173-
174-
- :Method:
175-
has
176-
:Description:
177-
Checks if a cache entry with the specified identifier exists.
178-
179-
- :Method:
180-
remove
181-
:Description:
182-
Remove a cache entry with the specified identifier.
156+
BackendInterface
157+
----------------
183158

184-
- :Method:
185-
flush
186-
:Description:
187-
Remove all cache entries.
159+
.. include:: /CodeSnippets/Manual/Cache/BackendInterface.rst.txt
188160

189-
- :Method:
190-
collectGarbage
191-
:Description:
192-
Does garbage collection.
161+
All operations on a specific cache must be done with these methods. There are several further interfaces that can be
162+
implemented by backends to declare additional capabilities. Usually, extension code should not handle cache backend operations
163+
directly, but should use the frontend object instead.
193164

194-
- :Method:
195-
flushByTag
196-
:Description:
197-
**TaggableBackendInterface only** Removes all cache entries which are tagged by the specified tag.
165+
.. _caching_backend-api-TaggableBackendInterface:
198166

199-
- :Method:
200-
findIdentifiersByTag
201-
:Description:
202-
**TaggableBackendInterface only** Finds and returns all cache entry identifiers which are tagged by the specified tag.
167+
TaggableBackendInterface
168+
------------------------
203169

204-
- :Method:
205-
requireOnce
206-
:Description:
207-
**PhpCapableBackendInterface only** Loads PHP code from the cache and require_onces it right away.
170+
.. include:: /CodeSnippets/Manual/Cache/TaggableBackendInterface.rst.txt
208171

209-
- :Method:
210-
freeze
211-
:Description:
212-
**FreezableBackendInterface only** Freezes this cache backend.
172+
.. _caching_backend-api-PhpCapableBackendInterface:
213173

214-
- :Method:
215-
isFrozen
216-
:Description:
217-
**FreezableBackendInterface only** Tells if this backend is frozen.
174+
PhpCapableBackendInterface
175+
--------------------------
218176

177+
.. include:: /CodeSnippets/Manual/Cache/PhpCapableBackendInterface.rst.txt
219178

220179
.. _caching-backend-options:
221180

Documentation/CodeSnippets/Config/Api/Cache.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,22 @@
77
'targetFileName' => 'CodeSnippets/Manual/Cache/CacheDataCollector.rst.txt',
88
'withCode' => false,
99
],
10+
[
11+
'action' => 'createPhpClassDocs',
12+
'class' => \TYPO3\CMS\Core\Cache\Backend\BackendInterface::class,
13+
'targetFileName' => 'CodeSnippets/Manual/Cache/BackendInterface.rst.txt',
14+
'withCode' => false,
15+
],
16+
[
17+
'action' => 'createPhpClassDocs',
18+
'class' => \TYPO3\CMS\Core\Cache\Backend\PhpCapableBackendInterface::class,
19+
'targetFileName' => 'CodeSnippets/Manual/Cache/PhpCapableBackendInterface.rst.txt',
20+
'withCode' => false,
21+
],
22+
[
23+
'action' => 'createPhpClassDocs',
24+
'class' => \TYPO3\CMS\Core\Cache\Backend\TaggableBackendInterface::class,
25+
'targetFileName' => 'CodeSnippets/Manual/Cache/TaggableBackendInterface.rst.txt',
26+
'withCode' => false,
27+
],
1028
];
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
.. Generated by https://github.com/TYPO3-Documentation/t3docs-codesnippets
2+
.. php:namespace:: TYPO3\CMS\Core\Cache\Backend
3+
4+
.. php:interface:: BackendInterface
5+
6+
A contract for a Cache Backend
7+
8+
.. php:method:: setCache(\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $cache)
9+
10+
Sets a reference to the cache frontend which uses this backend
11+
12+
:param $cache: The frontend for this backend
13+
14+
.. php:method:: set(?string $entryIdentifier, ?string $data, array $tags = [], ?int $lifetime = NULL)
15+
16+
Saves data in the cache.
17+
18+
:param $entryIdentifier: An identifier for this specific cache entry
19+
:param $data: The data to be stored
20+
:param $tags: Tags to associate with this cache entry. If the backend does not support tags, this option can be ignored., default: []
21+
:param $lifetime: Lifetime of this cache entry in seconds. If NULL is specified, the default lifetime is used. "0" means unlimited lifetime., default: NULL
22+
23+
.. php:method:: get(?string $entryIdentifier)
24+
:returns: `mixed`
25+
26+
Loads data from the cache.
27+
28+
:param $entryIdentifier: An identifier which describes the cache entry to load
29+
:Return description: The cache entry's content as a string or FALSE if the cache entry could not be loaded
30+
31+
.. php:method:: has(?string $entryIdentifier)
32+
:returns: `bool`
33+
34+
Checks if a cache entry with the specified identifier exists.
35+
36+
:param $entryIdentifier: An identifier specifying the cache entry
37+
:Return description: TRUE if such an entry exists, FALSE if not
38+
39+
.. php:method:: remove(?string $entryIdentifier)
40+
:returns: `bool`
41+
42+
Removes all cache entries matching the specified identifier.
43+
44+
Usually this only affects one entry but if - for what reason ever -
45+
old entries for the identifier still exist, they are removed as well.
46+
47+
:param $entryIdentifier: Specifies the cache entry to remove
48+
:Return description: TRUE if (at least) an entry could be removed or FALSE if no entry was found
49+
50+
.. php:method:: flush()
51+
52+
Removes all cache entries of this cache.
53+
54+
.. php:method:: collectGarbage()
55+
56+
Does garbage collection
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
.. Generated by https://github.com/TYPO3-Documentation/t3docs-codesnippets
2+
.. php:namespace:: TYPO3\CMS\Core\Cache\Backend
3+
4+
.. php:interface:: PhpCapableBackendInterface
5+
6+
A contract for a cache backend which is capable of storing, retrieving and
7+
including PHP source code.
8+
9+
.. php:method:: requireOnce(?string $entryIdentifier)
10+
:returns: `mixed`
11+
12+
Loads PHP code from the cache and require_onces it right away.
13+
14+
:param $entryIdentifier: An identifier which describes the cache entry to load
15+
:Return description: Potential return value from the include operation
16+
17+
.. php:method:: setCache(\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $cache)
18+
19+
Sets a reference to the cache frontend which uses this backend
20+
21+
:param $cache: The frontend for this backend
22+
23+
.. php:method:: set(?string $entryIdentifier, ?string $data, array $tags = [], ?int $lifetime = NULL)
24+
25+
Saves data in the cache.
26+
27+
:param $entryIdentifier: An identifier for this specific cache entry
28+
:param $data: The data to be stored
29+
:param $tags: Tags to associate with this cache entry. If the backend does not support tags, this option can be ignored., default: []
30+
:param $lifetime: Lifetime of this cache entry in seconds. If NULL is specified, the default lifetime is used. "0" means unlimited lifetime., default: NULL
31+
32+
.. php:method:: get(?string $entryIdentifier)
33+
:returns: `mixed`
34+
35+
Loads data from the cache.
36+
37+
:param $entryIdentifier: An identifier which describes the cache entry to load
38+
:Return description: The cache entry's content as a string or FALSE if the cache entry could not be loaded
39+
40+
.. php:method:: has(?string $entryIdentifier)
41+
:returns: `bool`
42+
43+
Checks if a cache entry with the specified identifier exists.
44+
45+
:param $entryIdentifier: An identifier specifying the cache entry
46+
:Return description: TRUE if such an entry exists, FALSE if not
47+
48+
.. php:method:: remove(?string $entryIdentifier)
49+
:returns: `bool`
50+
51+
Removes all cache entries matching the specified identifier.
52+
53+
Usually this only affects one entry but if - for what reason ever -
54+
old entries for the identifier still exist, they are removed as well.
55+
56+
:param $entryIdentifier: Specifies the cache entry to remove
57+
:Return description: TRUE if (at least) an entry could be removed or FALSE if no entry was found
58+
59+
.. php:method:: flush()
60+
61+
Removes all cache entries of this cache.
62+
63+
.. php:method:: collectGarbage()
64+
65+
Does garbage collection
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
.. Generated by https://github.com/TYPO3-Documentation/t3docs-codesnippets
2+
.. php:namespace:: TYPO3\CMS\Core\Cache\Backend
3+
4+
.. php:interface:: TaggableBackendInterface
5+
6+
A contract for a cache backend which supports tagging.
7+
8+
.. php:method:: flushByTag(?string $tag)
9+
10+
Removes all cache entries of this cache which are tagged by the specified tag.
11+
12+
:param $tag: The tag the entries must have
13+
14+
.. php:method:: flushByTags(array $tags)
15+
16+
Removes all cache entries of this cache which are tagged by any of the specified tags.
17+
18+
:param $tags: List of tags
19+
20+
.. php:method:: findIdentifiersByTag(?string $tag)
21+
:returns: `array`
22+
23+
Finds and returns all cache entry identifiers which are tagged by the
24+
specified tag
25+
26+
:param $tag: The tag to search for
27+
:Return description: An array with identifiers of all matching entries. An empty array if no entries matched
28+
29+
.. php:method:: setCache(\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $cache)
30+
31+
Sets a reference to the cache frontend which uses this backend
32+
33+
:param $cache: The frontend for this backend
34+
35+
.. php:method:: set(?string $entryIdentifier, ?string $data, array $tags = [], ?int $lifetime = NULL)
36+
37+
Saves data in the cache.
38+
39+
:param $entryIdentifier: An identifier for this specific cache entry
40+
:param $data: The data to be stored
41+
:param $tags: Tags to associate with this cache entry. If the backend does not support tags, this option can be ignored., default: []
42+
:param $lifetime: Lifetime of this cache entry in seconds. If NULL is specified, the default lifetime is used. "0" means unlimited lifetime., default: NULL
43+
44+
.. php:method:: get(?string $entryIdentifier)
45+
:returns: `mixed`
46+
47+
Loads data from the cache.
48+
49+
:param $entryIdentifier: An identifier which describes the cache entry to load
50+
:Return description: The cache entry's content as a string or FALSE if the cache entry could not be loaded
51+
52+
.. php:method:: has(?string $entryIdentifier)
53+
:returns: `bool`
54+
55+
Checks if a cache entry with the specified identifier exists.
56+
57+
:param $entryIdentifier: An identifier specifying the cache entry
58+
:Return description: TRUE if such an entry exists, FALSE if not
59+
60+
.. php:method:: remove(?string $entryIdentifier)
61+
:returns: `bool`
62+
63+
Removes all cache entries matching the specified identifier.
64+
65+
Usually this only affects one entry but if - for what reason ever -
66+
old entries for the identifier still exist, they are removed as well.
67+
68+
:param $entryIdentifier: Specifies the cache entry to remove
69+
:Return description: TRUE if (at least) an entry could be removed or FALSE if no entry was found
70+
71+
.. php:method:: flush()
72+
73+
Removes all cache entries of this cache.
74+
75+
.. php:method:: collectGarbage()
76+
77+
Does garbage collection

0 commit comments

Comments
 (0)