Skip to content

Commit

Permalink
feature symfony#19543 [Config] Allow custom meta location in ConfigCa…
Browse files Browse the repository at this point in the history
…che (alamirault)

This PR was merged into the 7.1 branch.

Discussion
----------

[Config] Allow custom meta location in ConfigCache

Fix symfony#19540 and symfony#19496

Commits
-------

91d8296 [Config] Allow custom meta location in ConfigCache
  • Loading branch information
OskarStark committed Feb 12, 2024
2 parents 2ae2c17 + 91d8296 commit 9804422
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions components/config/caching.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,17 @@ the cache file itself. This ``.meta`` file contains the serialized resources,
whose timestamps are used to determine if the cache is still fresh. When
not in debug mode, the cache is considered to be "fresh" as soon as it exists,
and therefore no ``.meta`` file will be generated.

You can explicitly define the absolute path to the meta file::

use Symfony\Component\Config\ConfigCache;
use Symfony\Component\Config\Resource\FileResource;

$cachePath = __DIR__.'/cache/appUserMatcher.php';

// the third optional argument indicates the absolute path to the meta file
$userMatcherCache = new ConfigCache($cachePath, true, '/my/absolute/path/to/cache.meta');

.. versionadded:: 7.1

The argument to customize the meta file path was introduced in Symfony 7.1.

0 comments on commit 9804422

Please sign in to comment.