Skip to content

Commit f1c8808

Browse files
committed
[Cache] Igbinary extension is no longer used by default when available
1 parent 88b0205 commit f1c8808

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

components/cache.rst

+13-2
Original file line numberDiff line numberDiff line change
@@ -208,16 +208,27 @@ Symfony uses *marshallers* (classes which implement
208208
the cache items before storing them.
209209

210210
The :class:`Symfony\\Component\\Cache\\Marshaller\\DefaultMarshaller` uses PHP's
211-
``serialize()`` or ``igbinary_serialize()`` if the `Igbinary extension`_ is installed.
212-
There are other *marshallers* that can encrypt or compress the data before storing it::
211+
``serialize()`` function by default, but you can optionally use the ``igbinary_serialize()``
212+
function from the `Igbinary extension`_:
213213

214214
use Symfony\Component\Cache\Adapter\RedisAdapter;
215215
use Symfony\Component\Cache\DefaultMarshaller;
216216
use Symfony\Component\Cache\DeflateMarshaller;
217217

218218
$marshaller = new DeflateMarshaller(new DefaultMarshaller());
219+
// you can optionally use the Igbinary extension if you have it installed
220+
// $marshaller = new DeflateMarshaller(new DefaultMarshaller(useIgbinarySerialize: true));
221+
219222
$cache = new RedisAdapter(new \Redis(), 'namespace', 0, $marshaller);
220223

224+
There are other *marshallers* that can encrypt or compress the data before storing it.
225+
226+
.. versionadded:: 7.2
227+
228+
In Symfony versions prior to 7.2, the ``igbinary_serialize()`` function was
229+
used by default when the Igbinary extension was installed. Starting from
230+
Symfony 7.2, you have to enable Igbinary support explicitly.
231+
221232
Advanced Usage
222233
--------------
223234

0 commit comments

Comments
 (0)