yabx/cache 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

yabx/cache

最新稳定版本:0.0.2

Composer 安装命令:

composer require yabx/cache

包简介

Simple Cache Implementation

README 文档

README

  • CacheInterface (cache interface)
  • FileCache (file cache implementation)
  • RedisCache (Redis cache implementation)

Installation

composer req yabx/cache

Simple usage

<?php

use Yabx\Cache\FileCache;
use Yabx\Cache\RedisCache;

// FileCache
$cache = new FileCache(__DIR__ . '/cache');

// or RedisCache  
$redis = new Redis;
$redis->connect('localhost');
$cache = new RedisCache($redis, 'prefix:');

// Setting value (3600 seconds live period)
$cache->set('key', $value, 3600);

// Getting value by key
$value = $cache->get('key');

// Deleting value by key
$cache->delete('key');

Example

<?php

// ....

$key = 'calculated';

// Checking for cached item with $key
if(!$value = $cache->get($key)) {
    // Hardworking for calculate value
    $value = calc(....);
    $cache->set($key, $value, 3600);
}

// Displing value
echo $value;

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-10-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固