Skip to content

Commit bca05bc

Browse files
committed
Merge with upstream
2 parents fc0d10b + da0cd3f commit bca05bc

20 files changed

+12358
-10159
lines changed

README.markdown

+2,224-1,749
Large diffs are not rendered by default.

arrays.markdown

+5
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ By default and in order to be compatible with other libraries, phpredis will try
7171
For instance, the keys “{user:1}:name” and “{user:1}:email” will be stored on the same server as only “user:1” will be hashed. You can provide a custom function name in your redis array with the "function" option; this function will be called every time a key needs to be hashed. It should take a string and return a string.
7272

7373

74+
## Custom key distribution function
75+
In order to control the distribution of keys by hand, you can provide a custom function or closure that returns the server number, which is the index in the array of servers that you created the RedisArray object with.
76+
77+
For instance, instanciate a RedisArray object with `new RedisArray(array("us-host", "uk-host", "de-host"), array("distributor" => "dist"));` and write a function called "dist" that will return `2` for all the keys that should end up on the "de-host" server.
78+
7479
## Migrating keys
7580

7681
When a node is added or removed from a ring, RedisArray instances must be instanciated with a “previous” list of nodes. A single call to `$ra->_rehash()` causes all the keys to be redistributed according to the new list of nodes. Passing a callback function to `_rehash()` makes it possible to track the progress of that operation: the function is called with a node name and a number of keys that will be examined, e.g. `_rehash(function ($host, $count){ ... });`.

common.h

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "php.h"
22
#include "php_ini.h"
3+
#include <ext/standard/php_smart_str.h>
34

45
#ifndef REDIS_COMMON_H
56
#define REDIS_COMMON_H
@@ -40,6 +41,7 @@ typedef enum _REDIS_REPLY_TYPE {
4041
/* options */
4142
#define REDIS_OPT_SERIALIZER 1
4243
#define REDIS_OPT_PREFIX 2
44+
#define REDIS_OPT_READ_TIMEOUT 3
4345

4446
/* serializers */
4547
#define REDIS_SERIALIZER_NONE 0
@@ -161,7 +163,10 @@ typedef struct {
161163
php_stream *stream;
162164
char *host;
163165
short port;
166+
char *auth;
164167
double timeout;
168+
double read_timeout;
169+
long retry_interval;
165170
int failed;
166171
int status;
167172
int persistent;

config.m4

+2
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@ dnl Check for igbinary
4949
AC_MSG_RESULT([enabled])
5050
AC_DEFINE(HAVE_REDIS_IGBINARY,1,[Whether redis igbinary serializer is enabled])
5151
IGBINARY_INCLUDES="-I$igbinary_inc_path"
52+
IGBINARY_EXT_DIR="$igbinary_inc_path/ext"
5253
ifdef([PHP_ADD_EXTENSION_DEP],
5354
[
5455
PHP_ADD_EXTENSION_DEP(redis, igbinary)
5556
])
57+
PHP_ADD_INCLUDE($IGBINARY_EXT_DIR)
5658
else
5759
IGBINARY_INCLUDES=""
5860
AC_MSG_RESULT([disabled])

debian.control

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: phpredis
2-
Version: 1.0
2+
Version: 2.2.2
33
Section: web
44
Priority: optional
55
Architecture: all

debian/changelog

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
php5-redis (2.2.2-1) unstable; urgency=low
2+
3+
* Non-maintainer upload.
4+
* Updating version from upstream
5+
6+
-- Rémi Paulmier <remi.paulmier@gmail.com> Fri, 02 Nov 2012 10:30:28 +0100
7+
18
php5-redis (2.1.3-1) unstable; urgency=low
29

310
* Non-maintainer upload.

debian/control

+3
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ Package: php5-redis
1010
Architecture: any
1111
Depends: ${shlibs:Depends}, ${misc:Depends}, ${php5:Depends}
1212
Recommends: php5
13+
Provides: php5-redis
14+
Conflicts: phpredis
15+
Replaces: phpredis
1316
Description: Redis C extension for PHP5.

0 commit comments

Comments
 (0)