Commit Graph

267 Commits

Author SHA1 Message Date
michael-grunder
eff6a91340 Enforce offset range limitations for GETBIT and SETBIT
Addresses #401
2013-11-13 15:00:13 -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
Soenke Ruempler
0f003bcb2d regression test for: setex properly handles long expire values 2013-10-04 10:34:22 -07:00
michael-grunder
b144743345 Rework the HMGET command to skip invalid keys
This relates to a previous hotfix for issue #379 where phpredis
would time out if you sent an array of empty values.  The reason
it was timing out is that the argument count being sent wasn't
reflecting any skipped items in the array (meaning redis was
waiting for the rest of the command).

I realized that the previous fix would still fail if you were to
send some valid values, with invalid (null, empty string, etc)
ones mixed in.

Presently, we're just skipping invalid items in the array but there
might be a case to issue a php_error_docref type warning when we
encounter them, so the user can know that it happened.

In addition, HMGET now uses a smart_str to build the command, which
means the time it takes to build the key will scale in a linear fashion
2013-09-05 15:08:30 -07:00
michael-grunder
a0e9b65d4c Add a unit test for the scenario described in #379 2013-09-03 21:17:38 -07:00
michael-grunder
60e3ba781e Merge branch 'feature/new_set_args' into develop 2013-08-31 14:09:58 -07:00
michael-grunder
bab2a192b7 Fix an erroneous unit test failure for TTL
When using the TTL command, Redis >= 2.8 will return -1 for a key
with no TTL and -2 for a key that doesn't exist.  This fixes the
unit tests so they don't expect this in versions < 2.8.
2013-08-30 21:11:02 -07:00
michael-grunder
7207aae8aa Add SLOWLOG command
Add support for the various slowlog commands you can execute
in Redis, including:

SLOWLOG GET [len]
SLOWLOG RESET
SLOWLOG LIST
2013-08-27 21:26:51 -07:00
Marlies Heijkoop
d01abbbd7d Added tests for zUnion and zInter with aggregate functions but without weights 2013-08-12 21:36:13 +02:00
michael-grunder
711f053b9f Redis >= 2.6.12 extended set options
Implement the new SET options as per the redis documentation:
http://redis.io/commands/set

You can now pass the new options (ex=>sec, px=>milisec, xx, nx) as
an array of options to the SET command and phpredis will handle them.

If you pass key, value, <long> phpredis will still redirect to SETEX
as it did before (to avoid breaking implementations).

Addresses #364
2013-08-02 23:31:27 -07:00
michael-grunder
1b624141c0 Update documentation and unit tests for TTL/PTTL
Addresses #358
2013-07-31 14:57:26 -07:00
michael-grunder
75ddd072a4 Add unit tests for -inf/inf/+inf WEIGHTS
Addresses issue #336
2013-05-09 11:55:43 -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
Nicolas Favre-Felix
a4784b4de7 Merge branch 'hotfix/issue-229' into develop 2013-02-17 16:32:08 +00:00
Nicolas Favre-Felix
5953e8fe13 Merge branch 'rnamiki-master' into hotfix/issue-229 2013-02-17 16:26:18 +00:00
Nicolas Favre-Felix
fb7c7a8d2e Merge branch 'hotfix/fix-broken-delete-test' into develop 2013-02-17 16:21:20 +00:00
Nicolas Favre-Felix
8b4ee3dda2 Fix broken test with unexpected result for delete 2013-02-17 16:20:44 +00:00
Nicolas Favre-Felix
48b3e6b8c5 Merge branch 'hotfix/ttl-response-type' into develop 2013-02-17 16:18:02 +00:00
Nicolas Favre-Felix
90bdf9e8fd Fix test for TTL return value
Resolves issue #302
2013-02-17 16:17:25 +00:00
Nicolas Favre-Felix
4231d70b66 Merge branch 'master' of https://github.com/rnamiki/phpredis into rnamiki-master 2013-02-17 16:07:39 +00:00
Nicolas
fde5a3c96c Merge branch 'hotfix/document_array_distributor' into develop 2013-02-17 13:34:02 +00:00
Nicolas
b6721c1292 Document and test custom key distribution function
Solves issue #299
2013-02-17 13:28:00 +00: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
55dd05356d Merge remote-tracking branch 'kotas/opt-read-timeout'
Conflicts:
	library.c
2013-02-11 12:42:49 -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
Pepijn Verlaan
93dae810ce Added failing test for brpoplpush command 2012-11-16 09:52:37 +01: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
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
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
Nicolas Favre-Felix
5855cfc2ca Add clearLastError 2012-09-09 22:09:27 +01:00
Nicolas Favre-Felix
6153477c4f Extend getLastError to all calls
Fixes GitHub issue #245.
2012-09-09 20:38:30 +01:00
Remi Collet
deca4fa30c add 'markTestSkipped' method to test suite, improves report 2012-09-01 09:49:11 +02:00
Remi Collet
a968d9ea79 SCRIPT / EVAL / TIME are new in 2.6.0 2012-08-31 16:20:42 +02:00
Remi Collet
36f5f76786 INFO COMMANDSTATS is new in 2.6.0 2012-08-31 16:14:35 +02:00
Remi Collet
5ee3c840cb INFO COMMANDSTATS is new in 2.6.0 2012-08-31 16:12:04 +02:00
Remi Collet
e839d248bb INCRBYFLOAT new in 2.6.0 2012-08-31 16:10:07 +02:00
Remi Collet
0ad8482727 manage test suite exit code 2012-08-31 16:05:29 +02:00
Remi Collet
2516eb22bb proposal for multi-version test suite ("All tests passed." with 2.6.0RC6) 2012-08-31 15:25:56 +02:00
Remi Collet
ac09cec134 fix php warning during tests 2012-08-30 09:06:42 +02:00
Remi Collet
d4bdb35c60 fix test report (backtrace index) 2012-08-30 09:04:24 +02:00
michael-grunder
8e433c4794 Merge branch 'php-numencode' 2012-08-16 12:40:48 -07:00
rnamiki
a65b609201 fixed bug different type command returns 2012-08-15 18:14:25 +09: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
a568029864 Actually remove the test for now 2012-07-06 10:19:49 -07:00
michael-grunder
a7122c3664 Remove test for now 2012-07-06 10:10:18 -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