定制 yzh52521/symfony-cache 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

yzh52521/symfony-cache

最新稳定版本:v1.0.2

Composer 安装命令:

composer require yzh52521/symfony-cache

包简介

description

README 文档

README

symfony cache for webman

安装

composer require yzh52521/symfony-cache

配置文件

config/cache.php

支持驱动

  • apc
  • array
  • file 本地缓存
  • redis 缓存
  • memcached 缓存
  • database 数据库缓存

示例

namespace app\controller;

use support\Request;
use yzh52521\SymfonyCache\Cache;

class UserController
{
    public function db(Request $request)
    {
        $key = 'test_key';
        Cache::set($key, rand());
        return response(Cache::get($key));
    }
   
}

访问多个缓存存储

$value = Cache::store('file')->get('foo');

Cache::store('redis')->set('bar', 'baz', 600); // 10 Minutes

从缓存中检索

$value = Cache::get('key');

$value = Cache::get('key', 'default');

检查是否存在

if (Cache::has('key')) {
    //
}

删除

Cache::delete('key');

统计信息

  • 总下载量: 119
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2023-03-14