Quick and easy data caching in the filesystem.
$ composer require chrisullyott/simple-cache
require 'vendor/autoload.php';
use ChrisUllyott\Cache;
$cache = new Cache('cache_id');
$cache->set("Some data");
echo $cache->get(); // "Some data"
$cache->clear();
<?php
require 'vendor/autoload.php';
use ChrisUllyott\Cache;
$cache = new Cache('my_key');
$data = $cache->get();
if (!$data) {
$data = my_api_request();
$cache->set($data);
}
print_r($data);
$ ./vendor/bin/phpunit --configuration=./tests/phpunit.xml