b3none/php-cache

There is no license information available for the latest version (1.1.0) of this package.

A super simple PHP caching layer.

1.1.0 2018-07-19 09:37 UTC

This package is auto-updated.

Last update: 2024-04-05 00:51:21 UTC


README

A super simple PHP caching layer.

Author

B3none - Developer / Maintainer

Installation

composer require b3none/php-cache

Example

The following is an extract from the example.php

// 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);
}