Download the PHP package contenir/cache without Composer
On this page you can find all versions of the php package contenir/cache. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download contenir/cache
More information about contenir/cache
Files in contenir/cache
Package cache
Short Description Framework-agnostic page-cache control for Contenir CMS — admin writes a purge signal, Sites read it and flush.
License MIT
Informations about the package cache
contenir/cache
Framework-agnostic page-cache control for Contenir CMS.
The CMS lets an operator toggle page caching on or off, decide which request signals participate in cache-key generation (query/post/session/files/cookie), and exclude specific URL patterns. The consuming Site (Mezzio, Laminas MVC, anything else) reads those settings on every request and applies them in its caching layer.
This package provides the domain — an immutable state value plus a repository interface, with file-based and in-memory implementations. Framework-specific listeners come from sibling packages (e.g. contenir/cache-laminas-mvc).
Install
Add contenir/config if you intend to use Repository\FileRepository (admin-side writer). Sites that read state from the merged Laminas/Mezzio config — and use Repository\InMemoryRepository in tests — don't need it.
Usage
Reading state
Writing state (admin)
File format
FileRepository reads and writes a PHP file under the pagecache namespace, so the same file can be merged directly into a Laminas/Mezzio site config:
A missing or unreadable file resolves to disabled state with empty options and routes, so first-run consumers never serve cached content before the admin has explicitly opted in. Other top-level config keys (errors, maintenance, …) and operator-authored sibling options are preserved on save.
Testing
InMemoryRepository is shipped in src/ so consumers can use it in their own test suites: