2017 © Pedro Peláez
 

library ccache

A small class for caching information

image

jejd14/ccache

A small class for caching information

  • Sunday, May 10, 2015
  • by JesperJohnsson
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • HTML
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Scrutinizer Code Quality Code Coverage Build Status License, (*1)

CCache

About

A small class for chaching information, (*2)

Tech

PHP >= 5.4.0
Tested on Anax MVC >= 2.0.4

Introduction

Instantiate an object of CCache:, (*3)

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

Or instantiate an object of CCache as a shared service within the Anax framework:, (*4)

$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), (*5)

Inside a class that extends/implements/uses \Anax\DI\TInjectionAware:, (*6)

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

In your frontcontroller:, (*7)

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

To prune all items from cache:, (*8)

$app->cache->pruneAll();

Composer

You can add ccache to your composer.json file like this., (*9)

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

License

MIT, (*10)

The Versions

10/05 2015

dev-master

9999999-dev

A small class for caching information

  Sources   Download

MIT

The Requires

  • php >=5.4

 

by Jesper Johnsson

caching