wruczek/php-file-cache 问题修复 & 功能扩展

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

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

wruczek/php-file-cache

最新稳定版本:0.0.5

Composer 安装命令:

composer require wruczek/php-file-cache

包简介

Light, simple and standalone PHP in-file caching class

README 文档

README

This project is not in active development. Issues remain with cache files sometimes being saved with invalid data and unable to be read (see: issue #3 and #4). The API is confusing and a rewrite would be necessary (for example renaming "retrive" function to "get", "store" to "set" etc.).

A community fork has been created, with authors planning on continuing the devlopment.

Check out a maintaned community fork: https://github.com/flightphp/PHP-File-Cache

PHP-File-Cache Latest Stable Version Latest Unstable Version License

Light, simple and standalone PHP in-file caching class

Advantages

  • Light, standalone and simple
  • All code in one file - no pointless drivers.
  • Secure - every generated cache file have a php header with die, making direct access impossible even if someone knows the path and your server is not configured properly
  • Well documented and tested
  • Handles concurrency correctly via flock
  • Supports PHP 5.4.0 - 7.1+
  • Free under a MIT license

Requirements and Installation

You need PHP 5.4.0+ for usage and PHP 5.6+ for development (PHPUnit)

Require with composer:
composer require wruczek/php-file-cache

Usage

<?php
use Wruczek\PhpFileCache\PhpFileCache;
require_once __DIR__ . "/vendor/autoload.php";

$cache = new PhpFileCache();

$data = $cache->refreshIfExpired("simple-cache-test", function () {
    return date("H:i:s"); // return data to be cached
}, 10);

echo "Latest cache save: $data";

See examples for more

统计信息

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

GitHub 信息

  • Stars: 41
  • Watchers: 7
  • Forks: 11
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-11-26