villain/cache

Cache Component for PHP

v1.0.3 2021-12-05 14:32 UTC

This package is auto-updated.

Last update: 2024-05-05 19:59:53 UTC


README

PHP Cache Component

Install

  • composer command
composer require villain/cache

Example

MultiFile

$config = [
    'adapter' => 'MultiFileAdapter'
];

$cache = new Cache($config);
$cache->set('key', 'value');

File

$config = [
'dataFile' => __DIR__ . '/catch.txt'
];

$cache = new Cache($config);
$cache->set('key', 'value');

var_dump($cache->get('key'));

Array

$config = [];

$cache = new Cache($config);
$cache->set('key', 'value');

var_dump($cache->get('key'));