phico/cache
Composer 安装命令:
composer require phico/cache
包简介
Lightweight cache server support for Phico
README 文档
README
Lightweight cache support for Phico
Installation
Using composer
composer require phico/cache
Config
Cache requires a specific config format for each driver
[
'use' => env('CACHE_USE', 'default'),
'drivers' => [
'file' => [
'path' => env('CACHE_FILESYSTEM_PATH', '/storage/cache'),
],
'redis' => [
'scheme' => env('CACHE_REDIS_SCHEME', 'tcp'),
'host' => env('CACHE_REDIS_HOST', '127.0.0.1'),
'port' => env('CACHE_REDIS_PORT', 6379),
],
],
];
Usage
Cache provides quick and simple access to cache servers such as Redis, KeyDB and Valkey.
$use = $config['use']; $cache = new Cache($config['drivers'][$use]); $cache->set('foo', 'bar'); $value = $cache->get('foo'); // $value = 'bar' $cache->delete('foo'); $exists = $cache->exists('foo'): // $exists = false
Issues
If you discover any bugs or issues with behaviour or performance please create an issue, and if you are able a pull request with a fix.
Please make sure to update tests as appropriate.
For major changes, please open an issue first to discuss what you would like to change.
License
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2024-08-06