Skip to content

Commit 699a4a2

Browse files
committed
Merge branch '7.4' into 8.0
* 7.4: [HttpKernel] Add mention to the shared cache directory
2 parents 11d6bf4 + 16d282c commit 699a4a2

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

configuration/override_dir_structure.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,19 @@ named ``APP_CACHE_DIR`` whose value is the full path of the cache folder.
118118
its own cached configuration files, and so each needs its own directory to
119119
store those cache files.
120120

121+
In case you have multiple frontend servers using the same shared filesystem, you
122+
can make use of the :method:`Symfony\\Component\\HttpKernel\\Kernel::getShareDir` method to
123+
get a shared directory for cache and shared data. The shared directory can be set
124+
by overriding an environment variable named ``APP_SHARE_DIR`` whose value is the full
125+
path of the shared folder. This directory is also accessible as a container parameter
126+
named ``%kernel.share_dir%``.
127+
128+
.. versionadded:: 7.4
129+
130+
The ``Kernel::getShareDir()`` method, the ``%kernel.share_dir`` parameter and
131+
the support for the ``APP_SHARE_DIR`` environment variable were introduced
132+
in Symfony 7.4.
133+
121134
.. _override-logs-dir:
122135

123136
Override the Log Directory

reference/configuration/kernel.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,22 @@ servers support it, and you have to use a long-running web server like `FrankenP
333333
This parameter stores the value of
334334
:ref:`the framework.secret parameter <configuration-framework-secret>`.
335335

336+
``kernel.share_dir``
337+
--------------------
338+
339+
**type**: ``string`` **default**: ``$this->getCacheDir()``
340+
341+
This parameter stores the absolute path of the shared cache directory of your Symfony
342+
application. The default value is the current cache directory.
343+
344+
This value is also exposed via the :method:`Symfony\\Component\\HttpKernel\\Kernel::getShareDir`
345+
method of the kernel class, which you can override to return a different value.
346+
347+
.. versionadded:: 7.4
348+
349+
The ``Kernel::getShareDir()`` method and the ``%kernel.share_dir`` parameter
350+
were introduced in Symfony 7.4.
351+
336352
``kernel.trust_x_sendfile_type_header``
337353
---------------------------------------
338354

0 commit comments

Comments
 (0)