2017 © Pedro Peláez
 

library hoard

PHP caching done right

image

gilbitron/hoard

PHP caching done right

  • Thursday, January 8, 2015
  • by gilbitron
  • Repository
  • 0 Watchers
  • 1 Stars
  • 45 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Hoard

Build Status, (*1)

Hoard is a simple, extensible PHP caching library., (*2)

Install

Install via composer:, (*3)

{
    "require": {
        "gilbitron/hoard": "~0.1.0"
    }
}

Run composer install then use as normal:, (*4)

require 'vendor/autoload.php';
$cache = new Hoard\Hoard();

API

Hoard uses the conecpt of "drawers" (as in a chest of drawers) as drivers for caching., (*5)

$cache = new Hoard\Hoard($drawer = 'file', $options = [], $args = []);

Possible drawers (more to come):, (*6)

  • file

$options is an array of options passed to the chosen drawer. See Drawers section below., (*7)

$args: * encrypt_keys - Use encrypted keys (default: true) * encryption_function - Function to use for encrypting keys md5/sha1 (default: md5), (*8)


Determine if an item exists in the cache, (*9)

$cache->has($key);

Retrieve an item from the cache by key, (*10)

$cache->get($key, $default = null);

Retrieve an item from the cache and delete it, (*11)

$cache->pull($key, $default = null);

Store an item in the cache. $minutes can be an int or DateTime, (*12)

$cache->put($key, $value, $minutes);

Store an item in the cache if the key does not exist. $minutes can be an int or DateTime, (*13)

$cache->add($key, $value, $minutes);

Store an item in the cache indefinitely, (*14)

$cache->forever($key, $value);

Remove an item from the cache, (*15)

$cache->forget($key);

Remove all items from the cache, (*16)

$cache->flush();

Drawers

file

Basic FileSystem caching., (*17)

Options:, (*18)

  • cache_dir - Path to cache directory. Uses the system tmp dir if none provided.

Credits

Hoard was created by Gilbert Pellegrom from Dev7studios. Released under the MIT license., (*19)

The Versions

08/01 2015

dev-master

9999999-dev https://github.com/gilbitron/Hoard

PHP caching done right

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

cache caching

07/01 2015

0.1.1

0.1.1.0 https://github.com/gilbitron/Hoard

PHP caching done right

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

cache caching

07/01 2015

0.1.0

0.1.0.0 https://github.com/gilbitron/Hoard

PHP caching done right

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

cache caching