8000 GitHub - mhanson01/cache: Caching component with multiple adapters
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

mhanson01/cache

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Orno\Cache

Build Status Latest Stable Version Total Downloads

//Memcached
$config = [
    'servers' => [
        ['127.0.0.1', 11211, 12], //server 1
        ['192.168.0.10', 11211, 20], //server 2
    ],
    'expiry' => 120; //number of seconds until the cache expires
    'expiry' => '5w 9d 12h 24m 55s', //expiry in time string
];
$memcached = new Orno\Cache\Adapter\MemcachedAdapter($config);
$cache = new Orno\Cache\Cache($memcached);

//a time string with a 5 hour expiry
$cache->set('key', 'value', '5h');
//or in seconds
$cache->set('key', 'value', 18000);

echo $cache->get('key');
$cache->delete('key');

//Apc
$apc = new Orno\Cache\Adapter\ApcAdapter();
$cache = new Orno\Cache\Cache($apc);

//a time string with a 5 hour expiry
$cache->set('key', 'value', '5h');
//or in seconds
$cache->set('key', 'value', 18000);

echo $cache->get('key');
$cache->delete('key');

Bitdeli Badge

About

Caching component with multiple adapters

Resources

License

Stars

Watchers

Forks

Packages

No packages published
0