Skip to content

Document Kernel::getBuildDir() #14378

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions reference/configuration/kernel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,43 @@ method to return the right project directory::
}
}


Cache Directory
~~~~~~~~~~~~~~~

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

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

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

Build Directory
~~~~~~~~~~~~~~~

**type**: ``string`` **default**: ``$this->getCacheDir()``

.. versionadded:: 5.2

The build directory feature was introduced in Symfony 5.2.

This returns the absolute path of a build directory of your Symfony project. This
directory can be used to separate read-only cache (i.e. the compiled container)
from read-write cache (i.e. cache pools). Specify a non-default value when the
application is deployed in a read-only filesystem like a Docker container or AWS
Lambda.

This value is exposed via the ``kernel.build_dir`` configuration parameter and
the :method:`Symfony\\Component\\HttpKernel\\Kernel::getBuildDir` method. To
change this setting, override the ``getBuildDir()`` method to return the correct
build directory.


Log Directory
~~~~~~~~~~~~~

Expand Down