This is a starting point to add a documentation of the whole set of APIs and
classes of Predis. The next step will be to actually improve and extend it.
The new string format for INFO replies has been postponed to a future version
of Redis, so we just moved the INFO class that handles them to the development
server profile.
Now Predis follows the same standard behaviour of PHP (method names are treated
case-insensitively) when invoking methods related to Redis commands, (i.e.
$client->info() or $client->INFO() makes no difference).
Commands in Redis are most time written in uppercase, Predis supports
only lowercase commands. This change converts all commands into lower-
case, so MiXeDcAsE and UPPERCASE commands can be created as well.
This makes it easier to use Predis in scripts and projects that do
not already include as PSR-0 autoloader.
Signed-off-by: Eric Naeseth <eric@thumbtack.com>
Now classes that extend Predis\Distribution\HashRing can override how the hash
of a node is retrieved in order to implement different kind of distribution
strategies while reusing the base algorithm.
By default the cURL extension does not trigger any error when fetching a
response with an HTTP code >= 400. Changing this behaviour is also useful to
intercept the 403 error generated when executing Redis commands disallowed
on Webdis by using ACLs.
The cURL extension is easily found already packaged for various Linux
distributions, it provides everything needed and it seems to have a lower
overhead compared to pecl_http.
With Webdis it is possible to define some access control rules to allow or
disallow certain commands and one of the possible configurations is based on
plain old HTTP authentication.
I could have rebased the previous branch with master, but since it was only a
single file and its history was basically meaningless I preferred to start
from scratch.
When PHP's fwrite() ends up writing only a part of $buffer over the network,
this method attempts to automatically write the rest of $buffer. Due to this
bug, the data being already sent to the server was not discarded from $buffer.
Usually fwrite() writes the whole $buffer in one go, but anyway this bug would
not have passed unnoticed since it results in malformed requests and Redis
would have surely returned a -ERR reply.
When a callback is specified, the client does not return a new instance
of Predis\PubSubContext but it invokes that callback on each message
received. The context can be aborted simply by returning FALSE from the
callback.