Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a Predis documentation?

Tags:

php

redis

predis

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...

like image 546
x_maras Avatar asked Apr 10 '12 14:04

x_maras


People also ask

What is a predis?

Predis.ai is an AI/ML-based product that predicts an Instagram post's performance before it is posted, so influencers and brands improve their posts ex-ante, using the AI's suggestions. These suggestions include time/day of posting, caption length and image improvements.

What is Redis predis?

Predis is a Redis client written entirely in PHP and does not require any additional extensions: composer require predis/predis.


2 Answers

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.

like image 62
nrk Avatar answered Oct 13 '22 19:10

nrk


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/

like image 2
aowie1 Avatar answered Oct 13 '22 19:10

aowie1