Simple Redis client in PHP
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 6 commits ahead of notmaintained:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE.txt
README.md
composer.json
redis.php

README.md

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.