class CatalogueCache implements ConfigCacheInterface

Decides whether a compiled catalogue still reflects the translations this instance has been given.

Symfony names a catalogue after its fallback locales alone, and outside debug mode considers it fresh if the file simply exists — so once written, nothing detects that the translations behind it changed. Enabling an extension on one instance leaves every other instance serving a catalogue that predates it, with no mtime, TTL or revision that would ever say otherwise. The revision recorded beside a catalogue is compared against the current one on every request for that locale. It is derived from what the instance can see for itself, so an instance that was never told anything still works out that its catalogue is stale and rebuilds it. Freshness is decided per locale, because Symfony compiles catalogues lazily per locale: a request for `de` never touches `en`. A locale nobody asks for therefore costs nothing, and rebuilds the moment it is first requested — where previously it would have stayed stale indefinitely. Registered resources are never asked whether they are fresh. Doing so would run third-party {\Symfony\Component\Config\Resource\SelfCheckingResourceInterface} implementations that have never executed outside debug mode, some of which resolve services and query the database on every request.

Methods

__construct(string $file, string $revision)

No description

string
getPath()

No description

bool
isFresh()

No description

void
write(string $content, array|null $metadata = null)

No description

Details

__construct(string $file, string $revision)

Parameters

string $file
string $revision

string getPath()

Return Value

string

bool isFresh()

Return Value

bool

void write(string $content, array|null $metadata = null)

Parameters

string $content
array|null $metadata

Return Value

void