Skip to content

Commit 530601d

Browse files
committed
Merge branch '4.4' into 5.1
* 4.4: Add warning on Docker integration Fix: Add line breaks Fix: Typo [Cache] Adds mention of using FileSystemTagAwareAdatpter
2 parents 13cb125 + 9769f6d commit 530601d

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

components/cache/adapters/filesystem_adapter.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,22 @@ and cache root path as constructor parameters::
5555
:ref:`pruning of expired cache items <component-cache-cache-pool-prune>` by
5656
calling its ``prune()`` method.
5757

58+
59+
.. _filesystem-tag-aware-adapter:
60+
61+
Working with Tags
62+
-----------------
63+
64+
In order to use tag-based invalidation, you can wrap your adapter in
65+
:class:`Symfony\\Component\\Cache\\Adapter\\TagAwareAdapter`, but it's often
66+
more interesting to use the dedicated :class:`Symfony\\Component\\Cache\\Adapter\\FilesystemTagAwareAdapter`.
67+
Since tag invalidation logic is implemented using links on filesystem, this
68+
adapter offers better read performance when using tag-based invalidation::
69+
70+
use Symfony\Component\Cache\Adapter\FilesystemTagAwareAdapter;
71+
72+
$cache = new FilesystemTagAwareAdapter();
73+
74+
5875
.. _`tmpfs`: https://wiki.archlinux.org/index.php/tmpfs
5976
.. _`RAM disk solutions`: https://en.wikipedia.org/wiki/List_of_RAM_drive_software

components/cache/cache_invalidation.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ method.
6161
.. note::
6262

6363
When using a Redis backend, consider using :ref:`RedisTagAwareAdapter <redis-tag-aware-adapter>`
64-
which is optimized for this purpose.
64+
which is optimized for this purpose. When using filesystem, likewise consider to use
65+
:ref:`FilesystemTagAwareAdapter <filesystem-tag-aware-adapter>`.
6566

6667
The :class:`Symfony\\Component\\Cache\\Adapter\\TagAwareAdapter` class implements
6768
instantaneous invalidation (time complexity is ``O(N)`` where ``N`` is the number

setup/symfony_server.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,16 @@ its location, same as for ``docker-compose``:
378378
If you have more than one Docker Compose file, you can provide them all
379379
separated by ``:`` as explained in the `Docker compose CLI env var reference`_.
380380

381+
.. caution::
382+
383+
When using Symfony binary with ``php bin/console`` (``symfony console ...``)
384+
the binay will **always** use environment variables detected via Docker and will
385+
ignore local environment variables.
386+
For example if you set up a different database name in your ``.env.test`` file
387+
(``DATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/test``) and if you run
388+
``symfony console doctrine:database:drop --force --env=test`` the command will drop the database
389+
defined in your Docker configuration and not the "test" one.
390+
381391
SymfonyCloud Integration
382392
------------------------
383393

0 commit comments

Comments
 (0)