13

I was using phpredis and now I am also trying predis for my php applications, but I couldn't find a good documentation for the second one. There is a "How to use" in github, but I find it quite short. I checked the examples though and I noticed that they are using the Redis commands in "lower case" characters. I tried a few and it works, but I don't want to try them all to see if this is true...

j0k
  • 22,600
  • 28
  • 79
  • 90
x_maras
  • 2,177
  • 1
  • 25
  • 34
  • 1
    Here is a good overview on sitepoint: [An Introduction to Redis in PHP using Predis](http://www.sitepoint.com/an-introduction-to-redis-in-php-using-predis/) – j0k Feb 28 '14 at 08:18

2 Answers2

43

I'm the author of Predis and I must admit that the library is still lacking a bit in terms of documentation but unfortunately I can't find the right amount of free time to prepare a comprehensive set of docs for the wiki. I'm always looking forward to some contributions :-)

Just to answer your question, in recent versions of Predis (>= v0.7.0) methods that map to Redis commands are case insensitive which is also the standard behavior of PHP for method names. For example you can call SET using $client->set('foo', 'bar') or $client->SET('foo', 'bar') or even $client->sEt('foo', 'bar'). Older versions of the library (v0.5.x, v0.6.x) on the other hand used a case sensitive approach for Redis commands (lowercase only) due to how their names were treated inside of the __call() metamethod used by Predis.

See the paragraph How Predis implements abstraction of Redis commands? in this FAQ for further details about how Redis commands are implemented in Predis.

nrk
  • 878
  • 8
  • 10
  • 1
    That answers my question. Now I could simply use the redis command documentation for more information over the commands. Thank you for Predis! – x_maras Apr 11 '12 at 07:22
  • 7
    Just to post an update on the topic, we recently started working on documenting Predis. The project is proceeding nicely albeit slowly, the currently available bits can be found in the [documentation](https://github.com/nrk/predis/tree/documentation/doc) branch on the canonical repository. – nrk Mar 02 '13 at 16:48
2

This is a pretty old thread and I'm sure there are other public docs available... but I recently found some documentation here: http://squizzle.me/php/predis/doc/

aowie1
  • 836
  • 8
  • 21