Skip to content

Commit 88b081c

Browse files
committed
Provides a way to override cache and log folders from the ENV
1 parent 471b805 commit 88b081c

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

configuration/override_dir_structure.rst

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ at your project root directory.
4141
Override the Cache Directory
4242
----------------------------
4343

44-
You can change the default cache directory by overriding the ``getCacheDir()``
45-
method in the ``Kernel`` class of your application::
44+
Changing the cache directory can be achieved by overriding the
45+
``getCacheDir()`` method in the ``Kernel`` class of your application::
4646

4747
// src/Kernel.php
4848

@@ -61,6 +61,9 @@ In this code, ``$this->environment`` is the current environment (i.e. ``dev``).
6161
In this case you have changed the location of the cache directory to
6262
``var/{environment}/cache/``.
6363

64+
This can also be achieved using a predefined environment variable named
65+
``APP_CACHE_DIR``. Its value must be the full path of the cache folder.
66+
6467
.. caution::
6568

6669
You should keep the cache directory different for each environment,
@@ -73,9 +76,11 @@ In this case you have changed the location of the cache directory to
7376
Override the Log Directory
7477
--------------------------
7578

76-
Overriding the ``var/log/`` directory is the same as overriding the ``var/cache/``
77-
directory. The only difference is that you need to override the ``getLogDir()``
78-
method::
79+
Overriding the ``var/log/`` directory is almost the same as overriding the
80+
``var/cache/`` directory.
81+
82+
You can do it overriding the ``getLogDir()`` method in the ``Kernel`` class of
83+
your application::
7984

8085
// src/Kernel.php
8186

@@ -92,6 +97,8 @@ method::
9297

9398
Here you have changed the location of the directory to ``var/{environment}/log/``.
9499

100+
And you can also do it using the predefined ``APP_LOG_DIR`` environment variable.
101+
95102
.. _override-templates-dir:
96103

97104
Override the Templates Directory

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy