Commit Graph

56 Commits

Author SHA1 Message Date
Pavlo Yatsukhnenko
e0a88b7bdf Issue #2106
Expose the transferred number of bytes
2022-10-24 09:18:19 +03:00
Pavlo Yatsukhnenko
d73f3f4b08 Issue #2106 2022-10-24 09:17:22 +03:00
Michael Grunder
e392dd88dd RedisCluster stub fixes (#2183)
RedisCluster stub fixes

I can now run RedisCluster unit tests within a PHP build tree build in
debug mode without any deprecation warnings or arginfo/zpp errors.
2022-10-12 13:16:43 -07:00
michael-grunder
74cf49f554 More redis.stub.php and PHP 8.2 deprecation fixes.
With this commit, I can now run the full `--class Redis` unit test suite
inside of a PHP8.2.x buiild tree and have them pass and not throw any
fatal zpp argument errors.
2022-10-11 12:51:30 -07:00
michael-grunder
54a084e51c Refactor FLUSHDB and update docs.
Fixes #2096
2022-10-10 23:04:17 -07:00
michael-grunder
239678a03b Implement CONFIG RESETSTAT
Rework the CONFIG command and add RESETSTAT variant.

Fixes #1673
2022-10-01 10:24:53 -07:00
michael-grunder
98fda1b870 Make sure we set an error for key based scans
See #1661
2022-09-28 23:18:53 -07:00
Pavlo Yatsukhnenko
687a5c7880 Issue #1943
Add lPos command.
2022-08-03 22:28:08 +03:00
Pavlo Yatsukhnenko
fe397371ef Issue #1894
Add Redis::hRandField command
2022-04-12 22:00:04 +03:00
Pavlo Yatsukhnenko
947a2d3897 Issue #1894 2022-04-11 21:57:12 +03:00
Pavlo Yatsukhnenko
b344649b6f [WIP] Issue #1894
Add geosearch and geosearchstore commands.
2021-12-28 21:17:19 +02:00
Pavlo Yatsukhnenko
ee550fb990 Issue #2009 2021-12-13 20:14:26 +02:00
Pavlo Yatsukhnenko
d5cf52cb8a [WIP] Issue #1894
Add Redis::zinter and Redis::zunion commands
2021-03-20 23:29:08 +02:00
michael-grunder
1a0ae97ef5 Fix PhpRedis session tests to soften timing issues
Rework the session locking unit tests to be less reliant on arbitrary
sleep calls which can be very troublesome when running in Travis and
especially when running in Travis under valgrind.

Additionally, skip multiple newly added Redis 6.2 commands that aren't
yet implemented in RedisCluster.
2021-03-10 18:59:54 -08:00
Michael Grunder
950e8de807 Issue.1847 cluster segfault (#1850)
Fix for #1847 when dealing with NULL multi bulk replies in RedisCluster.

Adds `Redis::OPT_NULL_MULTIBULK_AS_NULL` setting to have PhpRedis
treat NULL multi bulk replies as `NULL` instead of `[]`.

Co-authored-by: Alex Offshore <offshore@aopdg.ru>
2020-09-28 11:07:46 -07:00
Michael Grunder
a311cc4ec3 Support for Redis 6 ACLs (#1791)
Add support for Redis 6 ACLs in the `Redis`, `RedisCluster`, and `RedisArray` classes.

On a related note, it adds a mechanism for users to customize how we generate persistent connection IDs such that they can be grouped in different ways depending on the specific use case required (e.g. it would allow connections to be grouped by username, or by user-defined persistent_id, or both).
2020-06-24 17:00:01 -07:00
Pavlo Yatsukhnenko
890ee0e656 TravisCI: test tls connect 2020-06-05 09:40:53 +03:00
Pavlo Yatsukhnenko
e80600e244 Issue #548 (#1649)
Adds `Redis::SCAN_PREFIX` and `Redis::SCAN_NOPREFIX` as options to SCAN.

See #548
2020-05-18 18:11:40 -07:00
Michael Grunder
201a975999 Make unit test authentication configurable (#1748)
Right now cloning the repo and running unit tests will all fail if the
Redis/RedisCluster instances aren't configured with the password
'phpredis'.

This commit simply makes authentication during the tests optional via a
command-line argument.
2020-04-30 21:22:40 -07:00
Pavlo Yatsukhnenko
e37f38a39e requirepass 2020-03-30 13:32:27 +03:00
Pavlo Yatsukhnenko
dd66fceeb2 Update session.save_path in RedisClusterTest::sessionTest 2020-03-30 00:15:21 +03:00
michael-grunder
bf27e6e3db Merge 5.2.0 into develop 2020-03-02 11:00:53 -08:00
michael-grunder
7d47331bdb First attempt at adding valgrind to Travis 2019-07-17 22:00:27 -07:00
michael-grunder
6e49417068 Allow PING to take an optional argument.
Addresses #1563
2019-06-03 07:53:21 -07:00
michael-grunder
5cb30fb2a6 Adds OPT_REPLY_LITERAL for rawCommand and EVAL
Adds an option to process the actual strings in simple string replies as
opposed to translating them to `true`.  This only applies to
`rawCommand` and `eval` because as far as I know know vanilla Redis
command attaches any information besides `OK` to simple string replies.

Addresses #1550
2019-05-13 09:38:18 -07:00
michael-grunder
9440f05e19 Switch everything to new array syntax 2019-02-09 14:12:52 -08:00
Pavlo Yatsukhnenko
018ec177a7 Add testDiscard 2019-01-10 21:55:57 +02:00
Marius Meissner
d0cada2268 PHPREDIS-1354: Refactored tests to work also with Redis cluster 2018-06-06 09:55:50 +02:00
Pavlo Yatsukhnenko
300c72510c Merge branch 'session-locking' into develop
Conflicts:
	redis_session.c
	tests/RedisTest.php
2018-03-24 17:45:51 +02:00
michael-grunder
2828c2f187 Merge branch 'issue.1287' into develop 2018-01-25 10:59:40 -08:00
michael-grunder
84f1f28ba2 Implement SWAPDB command 2018-01-18 09:04:25 -08:00
michael-grunder
a0dc22220c Actually commit the cluster code to skip the exception test 2018-01-11 19:33:01 -08:00
Marius Meissner
abb862d2f5 PHPREDIS-37: Add locking functionality 2017-10-30 11:28:33 +01:00
michael-grunder
77aebadc73 Tests for doubling up on pipeline/multi calls 2017-08-14 15:06:57 -07:00
Alberto Fernández
058753e4c9 Fix Null Bulk String response parsing in cluster library (#1104)
* Failing test case when running LUA with bulk empty response
* Fix issue when parsing bulk array response from eval commands
* Added test for bulk LUA responses and changed condition
* Added multi tests and fixes in C code format
2017-02-09 14:56:34 +02:00
michael-grunder
6c1101f0e7 Test for calling connect multiple times on the same object 2017-01-02 17:54:01 -08:00
Pavlo Yatsukhnenko
a90bac2cff TravisCI: fix session test 2016-12-18 23:07:36 +02:00
Pavlo Yatsukhnenko
81d2cba557 TravisCI: session 2016-12-17 22:51:04 +02:00
michael-grunder
3a33700c28 Cluster geo commands and a generic so cluster and redis tests both work 2016-06-08 12:28:57 -07:00
michael-grunder
4336df3fee Fix bug in random key cluster test 2016-06-02 09:14:01 -07:00
michael-grunder
622709f311 Added a test for 'raw' commands 2015-05-07 18:12:52 -07:00
michael-grunder
ab8fa7dad7 Use a static variable for our nodemap file and only open it once
to avoid blowing file descriptors.
2015-05-07 15:52:55 -07:00
michael-grunder
ed7e10d621 Added cluster specific test for SCAN 2015-05-05 15:19:30 -07:00
michael-grunder
1725fccf40 Properly handle CLIENT variants :-) 2015-05-05 15:19:29 -07:00
michael-grunder
260852f562 Fix INFO command so it works in a MULTi EXEC block 2015-05-05 15:18:02 -07:00
michael-grunder
08ecec92a3 Unit test suite improvements and cluster failover test
* Added a test specifically for RedisCluster to test slave failover
  settings.
* Added an option to specifically disable colorization, as well as
  a mechanism to determine if the output is being piped, such that
  we can turn colorization off in that case as well.
2015-05-05 15:18:02 -07:00
michael-grunder
7ef7d07854 A few minor cluster and unit test fixes
* Fixed getLastError() to look at redisCluster->err, rather than flags
* Fixed serialization bug for zipstr multibulk processing
* Added specific RedisClusterTest tests for SCRIPT and EVALSHA commands

All unit tests passing now!  \o/
2015-05-05 15:16:50 -07:00
michael-grunder
7a106d51d6 Response handler fixes
* Fixed serialization for various multi-bulk responses
* Properly handle NULL BULK replies for variant replies
2015-05-05 15:16:50 -07:00
michael-grunder
469e8e9377 Various cluster fixes and Unit test updates
* Updated the unit test suite to print each unit test method name we're
  running as we do so, and also with fancy colors :-)
* Added functionality to handle failed transactions, where Redis will send
  us a multi bulk length of -1.  This can happen because of an EXECABORT
  error, or because a watched key was modified during the transaction
* Initialize serialized return value to NULL to avoid segfault
* use strtol not atoi in our long response handler, to handle large values
* Fixed our return value in multi responses
* Fiexed type() command as cluster doesn't still have the '+' prefix when
  checking for what TYPE returns
* Exists should return a BOOLEAN not 1/0
* Fixed sRandMember to work in the context of a MULTI block
* Use "LINDEX" not "LGET" as "LGET" isn't a valid Redis command
* Properly set our slot for the PFCOUNT command
* Many unit test changes such that Redis and RedisCluster are happy using
  mostly the same ones.
2015-05-05 15:16:49 -07:00
michael-grunder
9b68c33f7a More unit test cleanup and key consolidation for multiple key commands 2015-05-05 15:16:49 -07:00