2017 © Pedro Peláez
 

library php-simple-redis-cache

image

dtkahl/php-simple-redis-cache

  • Sunday, March 19, 2017
  • by dtkahl
  • Repository
  • 1 Watchers
  • 0 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Latest Stable Version License Build Status, (*1)

PHP simple redis cache

This is a simple cache class for PHP using redis trough predis/predis., (*2)

Dependencies

  • PHP >= 5.6.0
  • a redis server

Installation

Install with Composer:, (*3)

composer require dtkahl/php-simple-redis-cache

Usage

Refer namespace:, (*4)

use Dtkahl\SimpleRedisCache;

Create new Cache instance:, (*5)

$cache = new Cache([
    "scheme" => "tcp",
    "host => "127.0.0.1",
    "port" => 6379
);

Methods

put($key, $value, $time = null)

Put item to cache. (time in seconds), (*6)

$cache->put('foo', 'bar', 60)

has($key)

Determinate if key exists in cache., (*7)

$cache->has('foo')

get($key, $default = null)

Return Item from cache or $default., (*8)

$cache->get('foo', 'default')

forget($key)

Remove item from cache., (*9)

$cache->forget('foo')

forever($key, $value)

Store item in cache forever., (*10)

$cache->forever('foo', 'bar')

remember($key, $callback, $time = null)

Return cache item if exists otherwise call $callback, cache the returned value and return it., (*11)

$cache->put('foo')

The Versions

19/03 2017

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

The Development Requires

19/03 2017

1.0.1

1.0.1.0

  Sources   Download

MIT

The Requires

 

The Development Requires

19/03 2017

1.0.0

1.0.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires