Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Commits on Jul 7, 2015
  1. [tests] Fix base test case class to handle required Redis versions.

    This change is needed due to some internal changes in one of the
    latest minor releases of PHPUnit 4.x that essentially broke how we
    were checking for the required Redis version from method annotations.
  2. [tests] Relax checks on invalid expire time messages.

    Previously there was a bug in Redis that returned the wrong command
    in -ERR messages when passing an invalid expire time with SETEX and
    PSETEX. Now that the bug has been fixed and that travis-ci uses a an
    updated version of Redis, our test suite turned red.
Commits on Jul 28, 2014
  1. Move command "COMMAND" to the server profile for Redis 2.8.

    This command has been backported from the "unstable" branch of Redis
    to the "2.8" one, and it is available since 2.8.13.
Commits on Jul 21, 2014
  1. Fetch updated slots map from node indicated by -MOVED response.

    This optimization makes it possible to fetch the slots map directly
    from the server indicated by the -MOVED response eliminating the need
    to use a random node in the pool, which in turn could require Predis
    to open a new and useless connection.
  2. Fetch cluster slots from node upon first -MOVED response.

    This is a more sane default as it allows users to indicate only a few
    servers of the whole cluster composition, while it previously required
    a more complex configuration of the client using client options.
    This feature can be disabled using the "enableClusterNodes()" method.
Commits on Jul 18, 2014
  1. New command: COMMAND (Redis 3.0.0).

    The command returns the response as is, but it would probably be not a
    bad idea to parse it to restructure returned info using named arrays,
    making it easier to access single commands and their info.
    We will keep it as is for now, and investigate this change later.
Commits on Jul 17, 2014
  1. Switch to CLUSTER SLOTS instead of CLUSTER NODES for redis-cluster.

    CLUSTER SLOTS returns a structured response easier to handle compared
    to the bulk response of CLUSTER NODES which must be parsed making the
    whole thing more fragile.
    CLUSTER SLOTS has been added in Redis 3.0.0b7.
  2. Run php-cs against source code.

  3. Use same strategy for both client-side sharding and redis-cluster.

    This change is possible because, after a few changes in redis-cluster,
    our default cluster strategy used for client side sharding and the one
    used for redis-cluster turned out to be exactly the same, except for
    the hashing function used to calculate distribution.
    Actually some checks used to enforce correctness are redundant in the
    context of redis-cluster (e.g. the one used to make sure that keys in
    requests performing cross-keys operations will hash to the same slot,
    which is performed by the server) so we could also add a more dumb and
    permissive cluster strategy that relies on checks performed by Redis.
    The only difference between the client-side sharding strategy and the
    one used for redis-cluster, aside from the hash function, is in the
    rules used for extracting hash tags from keys since empty tags {} are
    considered valid by redis-cluster. In v1.0.0 the strategy used for our
    client-side sharding cluster will reflect this change, but we will not
    change it in v0.8 since it can be considered a breaking changes as it
    can potentially affect existing cluster deployments.
Commits on Jul 16, 2014
Commits on Jul 14, 2014
  1. Porperly handle -ERR instead of +QUEUED inside MULTI ... EXEC.

    Error responses such as -OOM or -ERR on invalid arguments in commands
    are returned immediatly instead of +QUEUED when using a transaction,
    which is a condition that had not been tested enough. This condition
    led to a bug in which Predis was not invalidating the transaction, so
    when trying to create a new transaction Redis returned a "-ERR MULTI
    calls can not be nested".
    This commit fixes #187.
Commits on Jun 9, 2014
  1. [tests] Use annotations to specify expected Redis server version.

    This change targets only method annotations and aims to make the body
    of tests more readable using the @requiresRedisVersion annotation.
    Tests using this annotation requires to be assigned the "connected"
    group of tests because they create a connection to the Redis instance
    specified in phpunit.xml to fetch its the version.
    This is a quick example of how this annotation can be used:
         * @group connected
         * @requiresRedisVersion >= 2.8.9
        public function testExecutedOnlyWithMatchingRedisVersion()
    Future improvements (currently not needed) include:
      * Same annotation working on a class-level (but still applied only
        to test methods with an explicitly assigned @group connected).
      * Ability to specify a version range.
  2. New command: ZREMRANGEBYLEX (Redis 2.8.9).

    Closes #177.
  3. New command: ZRANGEBYLEX (Redis 2.8.9).

    Closes #175.
  4. New command: ZLEXCOUNT (Redis 2.8.9).

    Closes #176.
Commits on Jun 3, 2014
  1. Fix parsing of the output of CLUSTER NODES to fetch slots map.

    There was an error in presence of slaves in the cluster configuration,
    see #165 for reference.
Commits on May 30, 2014
  1. Skip integration tests for HyperLogLog commands on Redis < 2.8.9.

    Caught this by running the test suite on TravisCI which still runs an
    older version of Redis 2.8. We should find a more decent way to handle
    differences in profiles when commands get added between patch releases
    of Redis, our custom skip method will do for now.
  2. New commands: PFADD, PFCOUNT, PFMERGE (Redis 2.8.9).

    Backported from the master branch.
    Many thanks to @rubensayshi for his initial commits on this in #163,
    but I had to start from scratch for the master branch first.
Commits on Mar 28, 2014
  1. @AlexeyKupershtokh
Commits on Mar 25, 2014
Commits on Feb 11, 2014
  1. Fix implementation for hash tags extraction from keys.

    We now fully comply with the specifications defined by Redis.
  2. [tests] Adapt for testing with HHVM.

  3. Add support for key hash tags in redis-cluster (Redis 3.0.0b1).

    Multi-keys operations are not allowed even when keys generate the same
    hash but this will probably be supported in later betas of Redis which
    means we will basically end up reusing the whole strategy used for
    client-side sharding.
Commits on Jan 25, 2014
  1. @thbourlove
Commits on Jan 8, 2014
  1. [tests] Use Predis\Autoload from include_path when not in repository.

    This is useful only for running the test suite after installing the
    PEAR package, see #126 for reference.
Commits on Dec 22, 2013
  1. Apply some more minor phpdoc fixes.

  2. Apply more phpdoc fixes.

    Backported from 6a577a0 (master).
  3. [tests] No need to reassign $exception.

    Backported from 728d9dc (master).
  4. Make Pipeline::executeCommand() return $this for fluent interface.

    Backported from 3befbb3 (master).
  5. Make PhpiredisConnection::getAddress() static and protected.

    This method is mostly an utility method which is the main reason for
    it bein static, but can be useful to have it available when extending
    this class.
    This change was inspired by b9b899e (master) even though the original
    commit is meant to fix an issue not affecting v0.8.
Something went wrong with that request. Please try again.