This is PSR-16 compatible cache library using php-apcu module

2.0.3 2019-01-18 11:06 UTC

This package is auto-updated.

Last update: 2024-03-18 22:25:18 UTC


Latest Stable Version Latest Unstable Version License Codacy Badge

php-apcu-cache (PSR-16)

This is PSR-16 compatible cache library using php-apcu module. It's provides one class ApcuCacheStorage which implements Psr\SimpleCache\CacheInterface and may be used in your code everywhere, where php cache is need.

About apcu

Php-apcu provides in-memory cache, which stores variables between requests. You can read more about it in this page.


You should create instance of ApcuCacheStorage and when you'll get access to its functionality

$cache = new SR\Cache\ApcuCacheStorage();

//  store variable with ttl
$success = $cache->set('key', $variable, 3600);

//  get variable
$variable = $cache->get('key');

//  'key' will be overwritten
$cache->set('key', $anotherVar, 3600);

//  deleting one cached variable and all of them

// dealing with multiple data
    'key' => 'value',
    'key1' => 'value1',

//  check if variable exists
$isVarCached = $cache->has('key');


Run composer test.


This component is under the MIT license. See the complete license in the LICENSE file.