Commit Graph

331 Commits

Author SHA1 Message Date
michael-grunder
4080dd9d0b Fix comment format 2013-04-28 11:39:34 -07:00
michael-grunder
3e6d5b60d6 Cutting a release for 2.2.3. Added myself as a maintainer
in the header files
2013-04-28 11:09:58 -07:00
michael-grunder
578bdf08cd Merge branch 'hotfix/tsrmls_cc' into develop 2013-03-28 07:58:47 -07:00
michael-grunder
411100da9e Don't duplicate TSRMLS_CC 2013-03-28 07:56:54 -07:00
michael-grunder
e914485313 Merge branch 'hotfix/inspection_methods' into develop
Conflicts:
	php_redis.h
	redis.c
2013-03-27 11:21:02 -07:00
michael-grunder
ef792320e7 Introspection methods
This commit adds methods to get information about the state
of our phpredis object, such as what host/port we are connected
to, our timeout, etc...

The following methods have been added:

getHost()
getPort()
getDBNum()
getTimeout()
getReadTimeout()
isConnected()
getPersistentID()
getAuth()

In addition, there is a small memory leak fix when a persistent id
was specifically passed to connect() (it wasn't beeing freed).

Addresses issue #320
2013-03-27 10:21:18 -07:00
michael-grunder
25a1593d73 Merge branch 'develop' of github.com:nicolasff/phpredis into develop 2013-03-16 11:55:09 -07:00
michael-grunder
c39ecd52f3 Alias eval and evalsha 2013-03-16 11:48:51 -07:00
Emmanuel Merali
6d3c9990a5 Merged changes from @mobli
New select DB command to RedisArray - Added retry delay on reconnect

Added the possibility to delay each reconnection attempt, including a
random factor to prevent several or many concurrent connections from
trying to reconnect at the same time.
Added the select command to RedisArray to select a DB on every
connections in one instruction.
Also, fixed a compiler warning:
redis_array_impl.c:1115:15: warning: incompatible pointer types
assigning to 'zval **' (aka 'struct _zval_struct **') from 'zval
**(*)[2]' [-Wincompatible-pointer-types]

Conflicts:
	common.h
2013-02-22 09:35:22 -08:00
michael-grunder
e1234f1772 Merge branch 'feature/client-commands' into develop 2013-02-16 17:58:55 -08:00
michael-grunder
9a5196ed2e CLIENT Commands
This commit adds support for the CLIENT commands (list, getname,
setname, kill).

You can call them like so:

$redis->client('list');
$redis->client('getname');
$redis->client('setname', $name);
$redis->client('kill', $ip_port);

Solves issue #300
2013-02-16 17:57:32 -08:00
michael-grunder
31174e8e77 Just removed a debug line 2013-02-15 18:01:11 -08:00
michael-grunder
55dd05356d Merge remote-tracking branch 'kotas/opt-read-timeout'
Conflicts:
	library.c
2013-02-11 12:42:49 -08:00
michael-grunder
85ee61d19b Add prefix support to SUBSCRIBE/PSUBSCRIBE
Now the Redis::OPT_PREFIX will apply to subscribe/psubscribe
channels and will be applied before searching for messages.
2013-02-04 14:45:54 -08:00
michael-grunder
242a16d50a Merge branch 'srandmember_count'
Conflicts:
	tests/TestRedis.php
2013-02-04 13:22:29 -08:00
michael-grunder
e1a5145ad2 Changed the way we build the HMSET command such that we don't
continue to destroy and reallocate the command buffer

Added a simply library routine to append to a command buffer
using a smart_str

Made the unit tests work even if you're not compiled with
igbinary

Addresses issue #287
2013-01-18 18:05:02 -08:00
michael-grunder
5cbe1cf6f9 Fix formatting issue, remove unneccisary variable 2012-10-25 14:49:29 -07:00
michael-grunder
51b96938bc SRANDMEMBER optional COUNT argument
Adds support for the new COUNT argument to SRANDMEMBER.  If called
without a count, we will still return a string response (with one
randome member from the set, or false on a failure/type error).

If the count argument is passed, we return instead an array up to
the number asked for, given how Redis will process this value.

http://redis.io/commands/srandmember
2012-10-25 14:19:04 -07:00
michael-grunder
70430fb4f1 Ignore OPT_PREFIX for a timeout argument
When arguments were passed in the form ($key1, $key2, ...) to BLPOP
or BRPOP with a prefix, the timeout value was also being prefixed
causing it to misbehave.

Now for these commands we ignore the prefix on our timeout argument

Fixes issue #158
2012-10-22 13:22:41 -07:00
kotas
3764a6cd80 add Redis::OPT_READ_TIMEOUT option for issue #70 2012-10-04 22:18:18 +09:00
Nicolas Favre-Felix
7dfac44c8f Add missing serializer in zInter args
Fixes GitHub issue #252
2012-09-21 18:05:15 +01:00
michael-grunder
b4735e578b Merge branch 'master' of github.com:nicolasff/phpredis 2012-09-10 08:25:52 -07:00
Nicolas Favre-Felix
5855cfc2ca Add clearLastError 2012-09-09 22:09:27 +01:00
michael-grunder
4c72cbc323 Support closures for SUBSCRIBE/PSUBSCRIBE
Change how we detect a callback such that we can use closures
in SUBSCRIBE/PSUBSCRIBE commands.
2012-09-09 14:05:33 -07:00
michael-grunder
d1b1216852 PSUBSCRIBE
Implemented PSUBSCRIBE/PUNSUBSCRIBE and changed the present
subscribe and unsubscribe functions into generic versions
that can handle both cases.
2012-09-09 08:13:44 -07:00
michael-grunder
9eb217c061 Move destruction of callback out of the loop
This fixes issue #244 where we were seeing a SIGSEGV upon the second
publish to a channel, given that the variable "z_fun" was freed
inside the loop, and then called again.
2012-09-07 18:17:47 -07:00
Nicolas Favre-Felix
6f7087fbfe Removed executable bit on source code 2012-09-02 19:05:29 +01:00
Nicolas Favre-Felix
9138299c0c Enable conditional compilation for igbinary option 2012-09-02 11:19:14 +01:00
Remi Collet
1cd7baa01e redis.c:3508:21: warning: 'p', 'cmd' may be used uninitialized in this function 2012-08-30 08:14:22 +02:00
Remi Collet
bad9073d20 redis.c:4300:33: warning: 'arr_weights_hash' may be used uninitialized in this function 2012-08-30 08:10:37 +02:00
Remi Collet
bdc5336566 redis.c:2388:26: warning: 'timeout' may be used uninitialized in this function 2012-08-30 08:08:35 +02:00
Remi Collet
2c907f2267 redis.c:5412:3: warning: 'callback_type', 'callback_ft_name_len', 'callback_ft_name' may be used uninitialized in this function 2012-08-30 08:07:05 +02:00
Remi Collet
31b38401dc redis.c:5413:23: warning: 'z_fun' may be used uninitialized in this function 2012-08-30 08:02:06 +02:00
Remi Collet
1defd423a5 redis.c:5414:23: warning: 'ce' may be used uninitialized in this function (please REVIEW this one) 2012-08-30 07:58:02 +02:00
Remi Collet
eccffe52ba redis.c:4650:23: warning: variable 'hval_len' set but not used 2012-08-30 07:50:30 +02:00
Remi Collet
fa282646e2 redis.c:4652:13: warning: variable 'type' set but not used 2012-08-30 07:48:59 +02:00
Remi Collet
fa9bfeb9f1 redis.c:2699:25: warning: variable 'type' set but not used 2012-08-30 07:46:32 +02:00
Remi Collet
518599f8e1 redis.c:2273:11: warning: variable 'object' set but not used 2012-08-30 07:45:10 +02:00
Remi Collet
297d83e107 redis.c:2394:7: warning: variable 'nb_keys' set but not used 2012-08-30 07:43:32 +02:00
Remi Collet
0d725ed8c1 redis.c:2350:17: warning: variable 'type' set but not used 2012-08-30 07:41:00 +02:00
Remi Collet
007d558964 fix unused-variable warnings 2012-08-29 16:40:46 +02:00
oylbin
97ad396c87 64bit compatibility problem
fix type problem of zend_parse_parameters in eval, evalsha, migrate
2012-08-20 01:37:53 +08:00
michael-grunder
8e433c4794 Merge branch 'php-numencode' 2012-08-16 12:40:48 -07:00
michael-grunder
691786bc7f Properly apply a prefix on sort(), sortAsc(), and sortDesc() methods with an
included unit test to make sure it's working properly.

This fixes issue #226
2012-08-08 16:09:57 -07:00
michael-grunder
0bd2e2cf37 Fix INCRBY/DECRBY for large values
Thanks to @maxixcom for discovering that we were using int values
for INCR(BY) and DECR(BY), which caused some issues with large
values.

Fixes issue #212
2012-07-06 09:56:37 -07:00
michael-grunder
83f3440b88 PHP 5.4 number encode fix 2012-07-02 12:56:10 -07:00
michael-grunder
f1231c98e2 TIME command 2012-06-05 09:04:10 -07:00
michael-grunder
f295c1c9d6 Allow integer keys for MSET 2012-06-04 23:58:01 -07:00
michael-grunder
21d6614215 Ensure that we have a string when adding k->v items. The value could be otherwise if it was unserialized (fixes issue #195) 2012-05-30 09:16:41 -07:00
michael-grunder
8b1a64b43c TSRMLS_CC 2012-05-29 12:29:17 -07:00