next/cache

基于PSR16规范的缓存组件,支持File、Redis、Memcached和APC。

0.1.1 2024-01-14 02:58 UTC

This package is auto-updated.

Last update: 2024-09-24 11:08:12 UTC


README

Max

轻量 • 简单 • 快速

入门

符合PSR16的缓存组件,支持File、Memcached、Redis、Apcu驱动。在协程环境下需要自定义驱动。

安装

composer require next/cache

使用

<?php

use Next\Cache\Cache;

$cache = new \Next\Cache\Cache(new \Next\Cache\Driver\FileDriver('./runtime/cache'))
//设置缓存
$cache->set('stat', 12, 10);
//读取缓存
var_dump($cache->get('stat'));