Skip to content

phpish/redis

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

phpish/redis

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 phpish/redis:

{
	"require": {
		"phpish/redis": "dev-master"
	}
}

Install Composer:

$ curl -s http://getcomposer.org/installer | php

Run the install command:

$ php composer.phar install

This will download phpish/redis into the vendor/phpish/redis directory.

To learn more about Composer visit http://getcomposer.org/

Description

callable client( [string $host = '127.0.0.1' [, int $port = 6379]] )

The returned function accepts a Redis command as a string.

Usage

<?php

	require 'vendor/phpish/redis/redis.php';
	use phpish\redis;


	$redis = redis\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.