2017 © Pedro Peláez
 

library key-value-api

Simple key-value cache API to abstract the underlying key-value store.

image

pilsetnieks/key-value-api

Simple key-value cache API to abstract the underlying key-value store.

  • Thursday, September 15, 2016
  • by pilsetnieks
  • Repository
  • 1 Watchers
  • 2 Stars
  • 927 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 5 % Grown

The README.md

key-value-api

Simple key-value cache API to abstract the underlying key-value store. Currently implements APC and memcache, (*1)

Usage example

$KV = new kv(
    array('Enabled' => false),
    array('Enabled' => true, 'Servers' => $Servers)
);

// Object style
$KV['Value1'] = 'asdf';
echo $KV['Value1']; // Outputs "asdf"
echo '<hr />';

// Static class style
echo kv::get('Value1'); // Outputs "asdf";
echo '<hr />';
kv::set('Value1', 'qwerty');
echo kv::get('Value1'); // Outputs "qwerty";
echo '<hr />';
kv::clear_all();
echo kv::get('Value1'); // Outputs "";
echo '<hr />';
kv::set('TestNumber', 42);
echo $KV['TestNumber'];
echo '<hr />';
kv::inc('TestNumber', 2);
echo $KV['TestNumber'];

Servers for memcache can be specified in multiple ways:, (*2)

$Servers = [
    ['localhost', 11211],
    ['127.0.0.1']
];

$Servers = ['localhost:11211', '127.0.0.1'];

$Servers = 'localhost11211;127.0.0.1';

$KV = new kv(
    array('Enabled' => false),
    array('Enabled' => true, 'Servers' => $Servers)
);

The Versions

15/09 2016

dev-master

9999999-dev https://github.com/pilsetnieks/key-value-api

Simple key-value cache API to abstract the underlying key-value store.

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

cache memcache apc key-value

15/09 2016

0.3.1

0.3.1.0 https://github.com/pilsetnieks/key-value-api

Simple key-value cache API to abstract the underlying key-value store.

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

cache memcache apc key-value

11/03 2015

0.3.0

0.3.0.0 https://github.com/pilsetnieks/key-value-api

Simple key-value cache API to abstract the underlying key-value store.

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

cache memcache apc key-value