O2Cache
, (*1)
O2Cache is an Open Source Cache Management Driver Library.
Wrappers around some of the most popular cache storage engine.
All but file-based caching require specific server requirements, and a Fatal Exception will be thrown if server requirements are not met.
Another amazing product from , released under MIT License., (*2)
O2Cache is build for working more powerfull with O2System Framework, but also can be used for integrated with others as standalone version with limited features., (*3)
O2Cache not just created on the fly but also store the tables information schema into database, it will become very useful in the future., (*4)
O2Cache is insipired by [CodeIgniter][10] Cache Driver, so O2Cache is has also functionality similar with them, but a little bit different at the syntax., (*5)
Installation
The best way to install O2Cache is to use Composer, (*6)
composer require o2system/o2cache:'dev-master'
Usage
use O2System\Cache;
// Without Fallback Driver
$cache = new Cache(['driver' => 'redis']);
// With Fallback Driver
$cache = new Cache(array(
'storage' => ['driver' => 'redis'],
'fallback' => ['driver' => 'files']
));
// 5 Minutes Redis Cache
if( ! $foo = $cache->get('foo') )
{
echo 'Saving to the cache!<br />';
$foo = 'foobar!';
// Save into the cache for 5 minutes
$cache->save('foo', $foo, 300);
}
// Static Redis Cache
if( ! $forever = $cache->get('forever') )
{
echo 'Saving to the cache!<br />';
$forever = 'static cache';
// Save into the cache forever
$cache->save('forever', $forever, FALSE);
}
More details at the Wiki., (*7)
Ideas and Suggestions
Please kindly mail us at developer@o2system.in., (*8)
Bugs and Issues
Please kindly submit your issues at Github so we can track all the issues along development., (*9)
System Requirements
Credits
, (*10)