Commit Graph

99 Commits

Author SHA1 Message Date
Anatol Belski 79efa8d791 fixes after the merge 2014-07-01 16:50:23 +02:00
Anatol Belski 4d2533706a Merge remote-tracking branch 'vostok4/master'
Conflicts:
	CREDITS
	README.markdown
	config.w32
	library.c
	library.h
	package.xml
	redis.c
	redis_array.c
	redis_array.h
	redis_array_impl.c
	redis_array_impl.h
	tests/TestRedis.php
2014-07-01 16:45:09 +02:00
Anatol Belski 6c377eee18 added redis array stuff to win part done some fixes to it 2014-07-01 12:19:01 +02:00
vostok4 566d673f83 Fix comments for C89 compatibility 2014-04-09 11:21:32 +02:00
vostok4 9c12c40a66 Merge nicolasff:b9a16b5ad5 in, fixing for Win32
Now we should be up to master with upstream for an easier merge.
2014-04-09 11:14:45 +02:00
michael-grunder c81a95413d Merge branch 'hotfix/ra_autorehash' into develop
Conflicts:
	redis_array.c
2014-03-11 09:14:26 -07:00
michael-grunder f72a3177a3 Fix autorehashing in RedisArray
This commit fixes auto rehashing in RedisArray as well as fixes
a couple of memory leaks found along the way

Addresses #442 and #294
2014-03-10 13:18:19 -07: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 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
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 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 7aae259ecb Fix argument order sent to ra_make_array 2013-08-11 11:50:38 -07:00
michael-grunder f97c8433d5 Integrating mobli's lazy connect and retry interval 2013-08-11 11:31:23 -07:00
michael-grunder 8443769dc3 Merge remote-tracking branch 'mobli/develop' into feature/mobli_ra_changes
Conflicts:
	redis_array.c
	redis_array_impl.c
	redis_array_impl.h
2013-08-11 11:29:29 -07:00
michael-grunder a80246122a Merge branch 'feature/ra_mset_intkeys' into develop 2013-08-11 09:13:04 -07:00
michael-grunder dcbeae7599 Persistent connections with RedisArray
Re-integrating the now old ra-performance branch into a git-flow
branch.  I could have merged it but this was easier with so few
changes
2013-08-11 08:54:59 -07:00
michael-grunder 641841012f Make sure RedisArray::mget returns an array
Add a check in mget to make sure that the forwarded call is
returning with an array, and not NULL or something else.

Addresses issue #350
2013-08-06 14:17:54 -07:00
michael-grunder 98bc9ecbeb Formatting 2013-07-31 21:50:00 -07:00
michael-grunder 0ce690c8fe Allow for LONG and STRING keys in MGET and MSET. We can't allow
for other types, as phpredis proper takes a key->value array and
PHP doesn't support other array key types.

Addresses #360
2013-07-31 21:20:22 -07:00
Nicolas Favre-Felix f9ef6efc7f Add FLUSHALL to RedisArray
GitHub issue #334
2013-05-02 19:59:27 +01:00
Nicolas Favre-Felix 5660e10c62 Add FLUSHDB to RedisArray
GitHub issue #334
2013-05-02 19:57:49 +01: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
Emmanuel Merali acd3245456 Added lazy_connect option to RedisArray
Added an option to let each RedisArray connection connect lazily to
their respective server. This is useful then working with a redis
cluster composed of many shards which are not necessarily in use all at
once.
2013-02-25 00:38:47 +02: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
Emmanuel Merali d4c7f64131 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]
2013-01-29 11:47:36 +02:00
Emmanuel Merali 9ba000c54c Revert "Retry delay - selectDB on array"
This reverts commit 3fb643211e.
2013-01-29 11:40:06 +02:00
Emmanuel Merali 3fb643211e Retry delay - selectDB on array
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.
2013-01-21 18:10:16 +02:00
Nicolas Favre-Felix 20f555eafb Copy zval in multi/exec/pipe forwarded array calls
* Addresses GitHub issue #262
* Tested successfully with code provided by bug reporter
* array-tests.php passes
2012-10-08 21:58:56 +01:00
Nicolas Favre-Felix 6dc3ad6cb3 Fix RedisArray::_rehash to support closures
* Add "f" parameter in _rehash()
* Call object with new method
* Add rehash test with closure
2012-09-10 00:29:44 +01:00
Remi Collet 83053eabc2 warning: variable 'redis_inst' set but not used (compiler can't check logic here) 2012-08-30 07:36:26 +02:00
Remi Collet e3b2a46f2b fix warning: variable 'redis_inst' set but not used [-Wunused-but-set-variable] 2012-08-30 07:29:27 +02:00
Remi Collet 007d558964 fix unused-variable warnings 2012-08-29 16:40:46 +02:00
michael-grunder 2b101e2332 Added a specific clause in the failure/failover logic for the TYPE command,
as it will return a LONG response of ZERO if the key is not found.  Given
that other commands can actually return zero and are not failures, the
specific check was needed.

Fixes issue #207
2012-06-23 10:02:57 -07:00
michael-grunder 889b2f2e9c RedisArray fixes
I created this branch to go through issues raised by @seansawyer regarding
RedisArray functionality.  The first commit addresses issue #205 (KEYS)
command.  More investigation is required for the two other issues raised.
2012-06-22 17:07:34 -07:00
Nicolas Favre-Felix 32e8d4143c More fixes for PHP 5.4 2012-03-12 07:05:30 +00:00
Nicolas Favre-Felix a5e53f1bbc Fixed compilation issues with Clang.
(GitHub issue #116).
2012-01-30 21:13:06 +00:00
Nicolas Favre-Felix 70371fa39d s/_specified/_instance 2011-12-13 21:37:19 +00:00
Emmanuel Merali 5bc6a4c842 Added retrieval of specific instance form Array
Added the possibility to retrieve a specific Redis instance from the
array. For instance:
$r = $ra->_specified($ra->_target($key));
2011-12-12 19:05:59 +02:00
Nicolas Favre-Felix 8f5783cb4c Reordered arguments to ra_index_multi(). 2011-12-11 22:15:58 +00:00
Emmanuel Merali 2f58629e0c External key distributor
Added possibility to specify a user land key distributor function.
2011-12-11 19:19:24 +02:00
Emmanuel Merali f0a2dc0ec3 Renamed crc32 to rcrc32
The function crc32 was not being called so I renamed it to make sure
that it's being called
2011-12-08 13:42:54 +02:00
Emmanuel Merali b408f7aa06 Allow use of pipeline in RedisArray 2011-12-08 01:52:21 +02:00
Nicolas Favre-Felix d4ad907ef6 Added missing autorehash option.
Fixes GitHub issue #85.
2011-11-27 20:01:20 +00:00
Nicolas Favre-Felix 7781557bb1 Added missing UNWATCH.
Possibly resolves GitHub issue #86 (TBC).
2011-11-27 19:57:39 +00:00
Nicolas Favre-Felix 1ce8bcc534 Added missing DISCARD in RedisArray mode.
Also added a unit test covering this feature.
This commit fixes GitHub issue #87.
2011-11-27 19:52:03 +00:00
Nicolas Favre-Felix ecf0e8eeb8 Fixed duplicate symbol (GitHub issue #50) 2011-09-20 19:47:26 +01:00
Nicolas Favre-Felix 62862cd920 Added missing index on MSET. 2011-09-13 23:23:45 +01:00
Nicolas Favre-Felix 38f2992576 Changed DEL to use index when available. 2011-09-13 22:59:14 +01:00
Nicolas Favre-Felix 50c86a1cba Fixed memory corruption issue 2011-09-13 21:23:14 +01:00
Nicolas Favre-Felix 1f5ebc15e1 Memory fixes. 2011-09-04 21:22:55 +01:00