i80586/rcache 问题修复 & 功能扩展

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

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

i80586/rcache

Composer 安装命令:

composer require i80586/rcache

包简介

Simple caching library

README 文档

README

Build Status Total Downloads

Simple PHP library for caching data in files and memory

Installing via Composer

The recommended way to install RCache is through Composer.

# Install Composer
curl -sS https://getcomposer.org/installer | php

Next, add following string into the composer.json file:

{
    ...
    "require" : {
        ...
         "i80586/rcache": "dev-master"
        ...
    }
    ...
}

Now you can update composer packages via

composer update

After installing, you need to require Composer's autoloader:

require 'vendor/autoload.php';

Examples

File cache (manually cache)

use RCache\Cache;
use RCache\FileCache;

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

// save data in cache
$cache->set('country', [
		'city' => 'Baku',
		'country' => 'Azerbaijan'
	], 3600);

// get cache by identifier
$country = $cache->get('country');

// remove cache
$cache->drop('country');

File cache (content cache)

use RCache\Cache;
use RCache\FileCache;

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

...other HTML content...
<?php if ($cache->start('fragment-caching', 3600)) { ?>

    ...content to be cached...

<?php $cache->end(); } ?>
...other HTML content...

Memory cache (manually cache)

use RCache\Cache;
use RCache\MemCache;

$cache = new Cache(new MemCache());

// save data in cache
$cache->set('country', [
		'city' => 'Baku',
		'country' => 'Azerbaijan'
	], 3600);

// get cache by identifier
$country = $cache->get('country');

// remove cache
$cache->drop('country');

Memory cache (content cache)

use RCache\Cache;
use RCache\MemCache;

$cache = new Cache(new MemCache());

...other HTML content...
<?php if ($cache->start('fragment-caching', 3600)) { ?>

    ...content to be cached...

<?php $cache->end(); } ?>
...other HTML content...

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2014-10-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固