2017 © Pedro Peláez
 

library cache

cache component

image

flatphp/cache

cache component

  • Sunday, April 23, 2017
  • by fredyang
  • Repository
  • 1 Watchers
  • 1 Stars
  • 30 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Cache

Light cache component;, (*1)

relate: https://github.com/flatphp/memstore, (*2)

Install

composer require "flatphp/cache"

Init Config

use Flatphp\Memstore\Conn;
use Flatphp\Cache\Cache;

Conn::init(array(
    'memcache' => ['host' => '127.0.0.1', 'port' => 11211]
));

Cache::init(array(
    'expiration' => 3600, // the default expiration, 0 forever[default]
    'storage' => 'memcache',
));

// -------- OR --------------------

Cache::init(array(
    'expiration' => 3600, // the default expiration, 0 forever[default]
    'storage' => array(
        'driver' => 'redis',
    'host' => 'localhost',
    'port' => 6379
    )
));

Useage

use Flatphp\Cache\Cache;

Cache::set('test', 1, 60);
echo Cache::get('test');
Cache::delete('test');
Cache::flush();

Cache::increment('test', 2);
Cache::decrement('test', 2);

Cache::getData('test', function(){
    return 'hello';
});

The Versions

23/04 2017

dev-master

9999999-dev

cache component

  Sources   Download

MIT

The Requires

 

by Fred Yang

cache

23/04 2017

v2.0.1

2.0.1.0

cache component

  Sources   Download

MIT

The Requires

 

by Fred Yang

cache

14/04 2017

v2.0.0

2.0.0.0

cache component

  Sources   Download

MIT

The Requires

 

by Fred Yang

cache

12/04 2017

v1.0.0

1.0.0.0

cache component

  Sources   Download

MIT

The Requires

 

by Fred Yang

cache