Skip to content

Commit 91d8296

Browse files
committed
[Config] Allow custom meta location in ConfigCache
1 parent 2ae2c17 commit 91d8296

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

components/config/caching.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,17 @@ the cache file itself. This ``.meta`` file contains the serialized resources,
5555
whose timestamps are used to determine if the cache is still fresh. When
5656
not in debug mode, the cache is considered to be "fresh" as soon as it exists,
5757
and therefore no ``.meta`` file will be generated.
58+
59+
You can explicitly define the absolute path to the meta file::
60+
61+
use Symfony\Component\Config\ConfigCache;
62+
use Symfony\Component\Config\Resource\FileResource;
63+
64+
$cachePath = __DIR__.'/cache/appUserMatcher.php';
65+
66+
// the third optional argument indicates the absolute path to the meta file
67+
$userMatcherCache = new ConfigCache($cachePath, true, '/my/absolute/path/to/cache.meta');
68+
69+
.. versionadded:: 7.1
70+
71+
The argument to customize the meta file path was introduced in Symfony 7.1.

0 commit comments

Comments
 (0)