Skip to content

Commit f8449f5

Browse files
Nyholmjaviereguiluz
authored andcommitted
Document Kernel::getBuildDir()
1 parent 707580e commit f8449f5

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

reference/configuration/kernel.rst

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,20 +84,43 @@ method to return the right project directory::
8484
}
8585
}
8686

87+
8788
Cache Directory
8889
~~~~~~~~~~~~~~~
8990

9091
**type**: ``string`` **default**: ``$this->getProjectDir()/var/cache/$this->environment``
9192

9293
This returns the absolute path of the cache directory of your Symfony project.
9394
It's calculated automatically based on the current
94-
:ref:`environment <configuration-environments>`.
95+
:ref:`environment <configuration-environments>`. Data might be written to this path
96+
at runtime.
9597

9698
This value is exposed via the ``kernel.cache_dir`` configuration parameter and
9799
the :method:`Symfony\\Component\\HttpKernel\\Kernel::getCacheDir` method. To
98-
change this setting, override the ``getCacheDir()`` method to return the right
100+
change this setting, override the ``getCacheDir()`` method to return the correct
99101
cache directory.
100102

103+
Build Directory
104+
~~~~~~~~~~~~~~~
105+
106+
**type**: ``string`` **default**: ``$this->getCacheDir()``
107+
108+
.. versionadded:: 5.2
109+
110+
The build directory feature was introduced in Symfony 5.2.
111+
112+
This returns the absolute path of a build directory of your Symfony project. This
113+
directory can be used to separate read-only cache (i.e. the compiled container)
114+
from read-write cache (i.e. cache pools). Specify a non-default value when the
115+
application is deployed in a read-only filesystem like a Docker container or AWS
116+
Lambda.
117+
118+
This value is exposed via the ``kernel.build_dir`` configuration parameter and
119+
the :method:`Symfony\\Component\\HttpKernel\\Kernel::getBuildDir` method. To
120+
change this setting, override the ``getBuildDir()`` method to return the correct
121+
build directory.
122+
123+
101124
Log Directory
102125
~~~~~~~~~~~~~
103126

0 commit comments

Comments
 (0)