Skip to content

djiele/ext-php-memcached

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Memcached

This library is a native PHP emulation of memcached PHP extension. The MemcachedClient class implements all of the Memcached ASCII protocol (but not the meta commands yet) and the binary protocol with SASL authentication.

Note for windows users: this library makes use of few PHP extensions (igbinary, msgpack, fastlz, memcached_hashkit). Although these extensions are not mandatory, they should be used to reproduce the default configuration of the php_memcached extension.

PHP_Fastlz can be downloaded from here

PHP_Memcached_hashkit can be downloaded from here

Installation

You can install the package via composer:

composer require djiele/ext-php-memcached "dev-master"
Simple usage
require_once __DIR__'./vendor/autoload.php';
use Djiele\Memcached\Memcached;
$memc = new Memcached();
$memc->addServer('127.0.0.1', 11211, 80);
$memc->add('key', 'value', 3600);
$var = $memc->get('key', function(Memcached $m, $k, &$v) { $v = uniqid(); return true; }, Memcached::GET_EXTENDED), true);
var_dump($var);
Features

See the manual for functions references

__construct
add
addByKey
addServer
addServers
append
appendByKey
cas
casByKey
decrement
decrementByKey
delete
deleteByKey
deleteMulti
deleteMultiByKey
fetch
fetchAll
flush
get
getAllKeys
getByKey
getDelayed
getDelayedByKey
getMulti
getMultiByKey
getOption
getResultCode
getResultMessage
getServerByKey
getServerList
getStats
getVersion
increment
incrementByKey
isPersistent
isPristine
prepend
prependByKey
quit
replace
replaceByKey
resetServerList
set
setByKey
setCredentials
setMulti
setMultiByKey
setOption
setOptions
setSaslAuthData
touch
touchByKey

About

Emulation of memcached php extension

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages