19/07
2018
A super simple PHP caching layer.
A super simple PHP caching layer., (*1)
B3none - Developer / Maintainer, (*2)
composer require b3none/php-cache
, (*3)
The following is an extract from the example.php, (*4)
// We can choose to specify the cache dir in the constructor. $cacheClient = new \B3none\Cache\CacheClient('/tmp/B3none/cache'); $cacheId = "b3none"; if ($cacheClient->hasCache($cacheId) && $cacheClient->isFreshEnough($cacheId, 5)) { $cache = $cacheClient->getCache($cacheId); print_r($cache); } else { $dataToCache = [ 'b3none' => [ 'github' => 'https://github.com/b3none', 'steam' => 'https://steamcommunity.com/b3none' ] ]; $cacheClient->setCache($cacheId, $dataToCache); }