Skip to content

Latest commit

 

History

History
68 lines (40 loc) · 1.19 KB

README.md

File metadata and controls

68 lines (40 loc) · 1.19 KB

redis_protocol

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.