$_backends
$_backends : array<mixed,\Doctrine\Common\Cache\CacheProvider>
A list of all backends created by _create_backend(). They will be automatically shut down when the module shuts down. They are indexed by their name.
This is the base class for the MidCOM cache modules. It provides a basic infrastructure for building your own caching service, providing hooks for initialization and shutdown.
It provides convenience methods to start up the cache module, for example for the creation of a cache backend instance. There is no specific initialization done during startup, to allow the modules to do their own magic during startup (it is difficult to generalize such stuff).
_on_initialize()
Startup handler, called during service start up at the start of the request.
You may, as it is required for the content cache, intercept requests. Terminate the requests with _midcom_stop_request() if you produce a complete output based on a previous request (page cache) of midcom_application::finish() if you produce regular output that might go into the content cache.
_create_backend(string $name, array $config) : \Doctrine\Common\Cache\CacheProvider
Creates an instance of the handler described by the configuration passed to the function.
The configuration array must include the configuration parameters driver and directory, as outlined in the midcom_services_cache_backend class documentation.
All backends will be collected in the $_backends array, indexed by their name.
Any duplicate instantiation will be intercepted, throwing a critical error.
string | $name | The name of the backend, must be unique throughout the system. |
array | $config | The configuration of the backend to create. It must contain the key 'driver', which indicates which backend to use. |
The new backend.