villain/cache

Cache Component for PHP

Installs: 12

Dependents: 1

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/villain/cache

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

This package is auto-updated.

Last update: 2025-10-05 23:02:34 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'));