Commit Graph

988 Commits

Author SHA1 Message Date
michael-grunder 893c15af67 Cleanup merge 2014-02-23 12:24:16 -08:00
Mike e3403e9588 fix for parsing ini value from string (atol should have been atof) 2014-02-23 11:51:14 -08:00
Mike 6f5e47cec3 add support for 'connect_timeout' option for redis arrays
Conflicts:
	redis_array.c
	redis_array_impl.c
	redis_array_impl.h
2014-02-23 11:50:34 -08:00
michael-grunder 2e2a84a99e Merge branch 'hotfix/mget_skip_empty' into develop 2014-02-21 07:40:43 -08:00
michael-grunder 2552b29aca Merge branch 'hotfix/mget_skip_empty' mget_skip_empty 2014-02-21 07:40:10 -08:00
michael-grunder 9eaf14756b Don't attempt MGET on nodes where no keys resolve
The MGET call in RedisArray was failing under circumstances where
none of the passed keys hashed into any given node in the ring.
What was happening is that RedisArray was passing through to the
phpredis MGET command an empty array, which was returning false.
This in turn caused RedisArray to abort the process and return
false as well.

This change updates RedisArray MGET such that if a given node
doesn't have any keys, we skip the call to it all together.

Addresses #435
Addresses #436
2014-02-21 06:12:32 -08:00
michael-grunder 79ccf9aec4 Merge branch 'hotfix/eval_timeout_segfault' into develop 2014-02-20 22:26:23 -08:00
michael-grunder 43b35a4737 Merge branch 'hotfix/eval_timeout_segfault' eval_timeout_segfault 2014-02-20 22:26:00 -08:00
michael-grunder d2832bfa85 We need to return immediately from our variant reply parsing
function if we get a protocol error, rather than just throwing
and exception and breaking execution of the loop.

Addresses #437
2014-02-20 15:48:15 -08:00
michael-grunder f200730fe9 _serialize method
This commit adds a utility method as a counterpart to the _unserialize
utility method, allowing users to manually serialize data themselves
before sending it to Redis.  This could be useful for calls going through
EVAL, as phpredis can't automatically serialize/unserialize in that case.

Addresses #431
2014-02-04 11:55:08 -08:00
michael-grunder 48ae8e52f6 Implement PUBSUB command
This commit implements the Redis PUBSUB command, a new command
available since Redis 2.8.0 and described here:
http://redis.io/commands/pubsub

Addresses #427
2014-01-21 14:50:34 -08:00
michael-grunder 1a89ec2ff4 Add Redis COPY and REPLACE flag support for Migrate command.
Addresses #426
2014-01-14 13:43:06 -08:00
michael-grunder 589072a649 Merge branch 'hotfix/incrbyfloat_docfix' into develop 2014-01-06 09:35:47 -08:00
michael-grunder 92782639b0 Merge branch 'hotfix/incrbyfloat_docfix' incrbyfloat_docfix 2014-01-06 09:35:16 -08:00
liaolliso2012 f92b74ba35 Update README.markdown
incrByFloat function in example returns wrong value
2014-01-06 09:34:53 -08:00
Mithun Satheesh 727b824924 Update README.markdown
fixed syntax error in set examples.
2014-01-04 12:32:28 -08:00
Mithun Satheesh 3f0dcd8692 Update README.markdown
fixed syntax error in set examples.
2013-12-31 09:22:00 -08:00
Mathias Verraes 8732d89be9 added homebrew installation instructions 2013-12-23 08:32:27 -08:00
Nicolas Favre-Felix a77439a7cf Minor documentation fixes 2013-12-14 21:00:06 +00:00
michael-grunder f39faf7dac Don't forget to prefix our keys. :) 2013-12-14 12:23:23 -08:00
michael-grunder 53560e0332 Merge branch 'feature/scan_commands' into develop 2013-12-14 11:17:13 -08:00
michael-grunder 84f3fb50b5 Another documentation fix :) 2013-12-14 11:01:51 -08:00
michael-grunder 2e4ff5711c Documentation fix 2013-12-14 11:00:37 -08:00
michael-grunder ab553893f9 SCAN and variants
This commit introduces support for the Redis SCAN, HSCAN, SSCAN,
and ZSCAN commands.

In the case of HSCAN, SSCAN, and ZSCAN, we take a key and iterator
as required arguments, and for SCAN just an iterator.  Matching
the Redis commands, each variant can optionally take a pattern
to match against and a count value which hints at Redis how many
keys to return at a time.

When scanning keys or members (especially with a large keyspace when
searching for a pattern), Redis will sometimes return an empty result
of keys/members.  PHPRedis can be set up to abstract this from the
caller by setting:

$redis->setOption(Redis::OPT_SCAN, Redis::SCAN_RETRY);

Which instructs PHPRedis to keep retrying the scan until members are
returned OR the iteration completes (Redis returns to us a zero iterator).

By default this option is set to Redis::SCAN_NORETRY, meaning that
empty results are possible, requiring an explicit check for FALSE in the
scanning loop, like so:

```php
$it = NULL;
while(($arr_keys = $redis->scan($it, "*pattern*"))!==FALSE) {
	print_r($arr_keys);
}
```
2013-12-14 10:51:03 -08:00
michael-grunder 77afbe3dac Implement WAIT command
This commit implements the new WAIT command which currently lives
in redis unstable, along with a unit test.

Also added myself to the README.markdown file, as well as a link to
"the twitter".
2013-12-07 14:08:18 -08:00
michael-grunder 014b905ac5 Merge branch 'hotfix/incrby_float_prefix' into develop
Fixes #408
2013-11-19 07:41:02 -08:00
michael-grunder e482f970ac Merge branch 'hotfix/incrby_float_prefix'
Fixes #408
incrby_float_prefix
2013-11-19 07:40:30 -08:00
michael-grunder 2108446ecb Don't free the key before we use it
Fixes #408
2013-11-19 07:40:02 -08:00
michael-grunder 11a9292d96 Merge branch 'hotfix/allow_null_set_options' into develop 2013-11-18 11:42:27 -08:00
michael-grunder 49dce3b372 Merge branch 'hotfix/allow_null_set_options' allow_null_set_options 2013-11-18 11:42:14 -08:00
michael-grunder 32837e06e9 Allow for NULL to be passed in our optional arguments and just
ignore it if it is (but still set the key).

Addresses #407
2013-11-18 11:41:19 -08:00
michael-grunder f73898de48 Merge branch 'hotfix/bitops_offset' into develop 2013-11-13 15:00:58 -08:00
michael-grunder 504724b416 Merge branch 'hotfix/bitops_offset' bitops_offset 2013-11-13 15:00:47 -08:00
michael-grunder eff6a91340 Enforce offset range limitations for GETBIT and SETBIT
Addresses #401
2013-11-13 15:00:13 -08:00
michael-grunder b103b5ea5a Merge branch 'hotfix/redis_array_pconnect' into develop 2013-11-13 11:53:47 -08:00
michael-grunder b3c6616a61 Merge branch 'hotfix/redis_array_pconnect' redis_array_pconnect 2013-11-13 11:53:16 -08:00
Nicolas Van Eenaeme 0fd41c2aef Fixed ra->pconnect parameter in ra_make_array
This parameter was ignored and caused pconnect not to work
2013-11-13 11:46:38 -08:00
michael-grunder dc5f40d0e8 Merge branch 'hotfix/srandmember_serialize' into develop 2013-11-13 11:23:45 -08:00
michael-grunder f3191cdc21 Merge branch 'hotfix/srandmember_serialize' srandmember_serialize 2013-11-13 11:23:34 -08:00
michael-grunder f3f361a427 Fix serializer support for SRANDMEMBER for both one member
and when the count argument is passed.

Addresses #391
2013-11-13 11:16:41 -08:00
vostok4 978fbcf6fc Further fixes for building on VC9 Win32, C89 compliance
Include win32/php_stdint.h on Win32 (fixes compilation on VC9)
Change C++ comments to C89 style (to adhere to PHP project)
2013-10-18 14:37:06 +02:00
vostok4 5655f0574e Last fix for win32 compiles
This fixes the rc command using <> characters which breaks it.
2013-10-16 11:39:51 +02:00
vostok4 b7e8b3b64e Fix compilation errors on Win32 with VC11
This brings the W32 compilation fixes done by @char101 up to date and
allows building of php_redis.dll with VC11 on Win32 (allows for a php5.5
version).
2013-10-10 13:07:01 +02:00
michael-grunder 9c5888b5a8 Merge branch 'hotfix/setex_long_expires' into develop 2013-10-04 10:38:53 -07:00
michael-grunder 00233a3f91 Merge branch 'hotfix/setex_long_expires'
Incorporate @zined and @s0enke commits to properly handle long timeout
values and not overrun our buffer.

Addresses #385
setex_long_expires
2013-10-04 10:37:45 -07:00
Soenke Ruempler 0f003bcb2d regression test for: setex properly handles long expire values 2013-10-04 10:34:22 -07:00
Deniz Adrian f3c0dd2b9f let setex properly handle long expire values
adjust the format string passed to redis_cmd_format_static() to
properly handle long int, in order to prevent integer overflows
resulting in negative expire times passed to redis.
2013-10-04 10:34:08 -07:00
michael-grunder 2cf59cc251 Merge branch 'hotfix/close_command' into develop 2013-09-14 11:58:52 -07:00
michael-grunder 853f86b1f2 Merge branch 'hotfix/close_command' close_command 2013-09-14 11:57:56 -07:00
michael-grunder 4a6c01bc1a Send a newline with the QUIT command
Addresses #381
2013-09-07 13:51:33 -07:00