Download the PHP package phy/cache-bundle without Composer
On this page you can find all versions of the php package phy/cache-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package cache-bundle
PHY/CacheBundle - Simple Symfony2 wrapper around the more common caches.
Simple enough to use cache wrapper for Symfony2. Right now supports APC, Local Disk, Memcache, and Memcached.
Install
To include this along with your Symfony2 project then you can just include this in your composer config:
And update composer accordingly.
Configuration
Here's an example of our services.yml, you don't really need to change this since values come from parameters.yml
Here's how you'd setup some common caches in your parameters.yml
Memcache
Disk
Apc
Redis
Usage
To call the cache inside your controller (or any container aware class) you just need to call it by its service name.
From there, you can start setting, getting, replacing, incrementing, decrementing, and so forth.
All methods available are almost 100% equal to \Memcache.
Command Line
There are several command line options to handle simple cache methods. All commands have an ability to overwrite the cache used with the --config option. If --config isn't set it will use the generic phy_cache otherwise you can pass along a config in a JSON string in this format:
Check current running stats (Needs some style and extra functionality)
And flushing your cache completely
Set something
Replace something
Get something
Delete something
Decrement something
About
Originally was using BerylliumCacheBundle by Kevin Boyd. Got the job done for the most part but I needed to compress some rather large aggregate results from MongoDB. Made a pull request to add the compression on and noticed certain other functions weren't quite implemented yet. Having already done a similar bundle for Cache (albeit not for Symfony2) figured I could just port that over and here we are.
Requirements
- PHP 5.3+
Testing
Tests will try and use all the different cache clients and if they aren't installed, or cannot connect to the desired cache file then those tests will be skipped. To test Disk caching, there needs to be a tmp directory that is writable which will be cleaner before and after a test run. To run all you need to do in the command line is:
Submitting bugs and feature requests
Please send bugs to me via GitHub
Author
John Mullanaphy - http://jo.mu/ That's it for now...
License
PHY/CacheBundle is licensed under the Open Software License (OSL 3.0) -
see the LICENSE
file for details