joelcox/codeigniter-redis — pull request #11 by tinkertim (2012-05-04 15:22:12+00:00)
Title: Develop

This patch fixes an issue in _encode_request(), which tokenizes a given request into the
Redis wire protocol by spaces. This is problematic if assigning a string value to a key
that contains spaces.

To get around this, we add a second argument to _encode_request() which accepts a string
or array, taking care of commands like mset, hmset and others. This value is passed
from the main magic __call() method, to command and ultimately to _encode_request()

Using the single overloaded method, clients can now talk to redis in the following manners:

set('foo', 'a string with lots of spaces')
mset($array)
hmset('hash_key', $array);
some_redis_command('some_ttl', 'some string or array')

Or, the traditional (breaks with spaces)

set('foo bar')

Signed off by: Tim Post (EZ Provider Networks, Inc)