承接 jejd14/ccache 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

jejd14/ccache

Composer 安装命令:

composer require jejd14/ccache

包简介

A small class for caching information

关键字:

README 文档

README

Scrutinizer Code Quality Code Coverage Build Status License

CCache

About

A small class for chaching information

##Tech

PHP >= 5.4.0
Tested on Anax MVC >= 2.0.4

Introduction

Instantiate an object of CCache:

$newCCache = new \jejd14\ccache\CCache($dir);

Or instantiate an object of CCache as a shared service within the Anax framework:

$di->setShared('cache', function($dir) {
    $cache = new \jejd14\ccache\CCache($dir);
    return $cache;
});

Methods

  1. __construct ( $dir) - Constructor
  2. get ($key) - Get an item from the cache if its there.
  3. put ($key, $item) - Put an item to the cache.
  4. prune($key) - Prune a item from cache.
  5. pruneAll() - Prune all items from cache.

Calling of Methods

To properly use the methods listed above you can call it as follows (Assuming you've set the service as a shared service in your frontcontroller)

Inside a class that extends/implements/uses \Anax\DI\TInjectionAware:

$this->di->cache->put('file','hello');

In your frontcontroller:

$app->cache->put('file','hello');

To prune all items from cache:

$app->cache->pruneAll();

Composer

You can add ccache to your composer.json file like this.

"require": {
  "jejd14/ccache": "dev-master"
 }

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-05-09