sandeepshetty / redis_protocol
Simple PHP client library for the Redis protocol (http://redis.io/topics/protocol)
dev-master
2012-08-07 20:51 UTC
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2024-05-11 12:18:56 UTC
README
Simple PHP client library for the Redis protocol.
Requirements
- PHP 5.3+
Getting Started
Download via Composer
Create a composer.json
file if you don't already have one in your projects root directory and require redis_protocol:
{
"require": {
"sandeepshetty/redis_protocol": "dev-master"
}
}
Install Composer:
$ curl -s http://getcomposer.org/installer | php
Run the install command:
$ php composer.phar install
This will download redis_protocol into the vendor/sandeepshetty/redis_protocol
directory.
To learn more about Composer visit http://getcomposer.org/
Description
callable redis_protocol\client( [string $host = '127.0.0.1' [, int $port = 6379]] )
The returned function accepts a Redis command as a string.
Usage
<?php require 'vendor/sandeepshetty/redis_protocol/client.php'; use sandeepshetty\redis_protocol; $redis = redis_protocol\client(); var_dump($redis('SET foo "bar baz"')); // bool(true) var_dump($redis('GET foo')); // string(7) "bar baz" $redis('QUIT'); ?>
TODO
Support for Pipelining and Clustering.