juhara/zzzfile

ZzzCache 的文件存储实现

v1.0.3 2018-07-10 13:18 UTC

This package is not auto-updated.

Last update: 2024-09-14 08:15:29 UTC


README

基于文件的 ZzzCache 缓存存储实现

要求

安装

通过 composer 运行

$ composer require juhara/zzzfile

如何使用

<?php

use Juhara\ZzzCache\Cache;
use Juhara\ZzzCache\Storages\File;
use Juhara\ZzzCache\Helpers\ExpiryCalculator;
use Juhara\ZzzCache\Helpers\Md5Hash;

// create a file-based cache where all cache
// files is stored in directory name
// app/storages/cache with
// filename prefixed with string 'cache'
$cache = new Cache(
    new File(
        new Md5Hash(),
        'app/storages/cache/',
        'cache'
    ),
    new ExpiryCalculator()
);

贡献

如果您有任何改进或问题,请提交 PR。

谢谢。