定制 ark/filecache 二次开发

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

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

ark/filecache

最新稳定版本:v0.1.0

Composer 安装命令:

composer require ark/filecache

包简介

Cache with file system

README 文档

README

Cache with file system.

Why File Cache?

In cases you don't want to have other dependencies or don't want to waste your RAM.

Features

  • Compression with gzcompress
  • Expiration
  • Multi level cache directories

Installation

composer require ark/filecache

Usage

<?php
use Ark\Filecache\FileCache;

$cache = new FileCache([
    'root' => '/path/to/cache/root', // Cache root
    'ttl' => 0,                    // Time to live
    'compress' => false,             // Compress data with gzcompress or not
    'serialize' => 'json',          // How to serialize data: json, php, raw
]);

$cache->set('key1', 'value1');
$cache->get('key1');

// Set TTL and compression
$cache->set('key2', array('hello', 'world'), array(
    'ttl' => 10,
    'compress' => true
)); 

sleep(11);

$cache->get('key2');

$cache->delete('key1');

$cache->clear(); // clear all caches by removing the root path of the cache

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-03-22