Download the PHP package mesavolt/simple-cache-bundle without Composer
On this page you can find all versions of the php package mesavolt/simple-cache-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mesavolt/simple-cache-bundle
More information about mesavolt/simple-cache-bundle
Files in mesavolt/simple-cache-bundle
Package simple-cache-bundle
Short Description Symfony integration for mesavolt/simple-cache
License MIT
Informations about the package simple-cache-bundle
Mesavolt/SimpleCacheBundle
Integrate mesavolt/simple-cache
into your Symfony app.
By default, it writes the cache to disk in the cache directory of Symfony (%kernel.cache_dir%
)
and uses an empty namespace, but both these options can be configured.
Installation
Applications that use Symfony Flex
Open a command console, enter your project directory and execute:
That's it. Flex automagically enables the bundle for you. Go to the Configuration section of this README to see how you can customize the bundle's behavior.
Applications that don't use Symfony Flex
Step 1: Download the Bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Step 2: Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles
in the app/AppKernel.php
file of your project:
Configuration
The following options are available to customize the behavior of the bundle's cache service :
Option name | Default value | Role |
---|---|---|
simple_cache.cache_dir | %kernel.cache_dir% |
Where the cache is written to disk |
simple_cache.namespaces | simple-cache |
Default cache namespace |
Applications that don't use Symfony Flex
Create config/services/simple_cache.yaml
and tweak its content :
Applications that don't use Symfony Flex
Add this to your app/config/config.yml
file and tweak the options :
Usage
To retrieve a Mesavolt\SimpleCache
instance, you can:
- inject the cache attached to the first namespace from the
namespaces
option by type-hintingMesavolt\SimpleCache
- get the
mesavolt.simple_cache.default
ormesavolt.simple_cache.specific
services from the container, - inject the
Mesavolt\SimpleCacheBundle\SimpleCachePool
service and get a cache by its namespace with thegetCache($namespace)
method