Compare commits

...

988 Commits

Author SHA1 Message Date
Till Krüss 7d86f7afb3 Prepare 3.0 release (#1533) 2025-05-02 16:18:59 -07:00
Vladyslav Vildanov aa72649e43 8.0-RC2 testing (#1531) 2025-04-29 08:25:18 -07:00
Till Krüss b5c942b2a1 bump to rc1 2025-04-17 08:51:06 -07:00
Till Krüss 5368c27dfb add changelog linter 2025-04-15 09:21:47 -07:00
Till Krüss 312b0393f2 Update changelog 2025-04-14 10:04:01 -07:00
Till Krüss e838799113 Update CHANGELOG.md 2025-04-14 10:01:59 -07:00
vladvildanov 665c98175f Merge branch 'vv-changelog-update' of github.com:predis/predis into vv-changelog-update 2025-04-14 19:25:31 +03:00
vladvildanov c4b066f5f3 Merge branch 'main' of github.com:predis/predis into vv-changelog-update 2025-04-14 19:23:45 +03:00
vladvildanov 502002534f Update breaking changes 2025-04-14 19:21:09 +03:00
Till Krüss fc4d17512c Update CHANGELOG.md 2025-04-14 09:15:47 -07:00
Vladyslav Vildanov 39a6d7e3c4 Merge branch 'main' into vv-changelog-update 2025-04-14 19:01:44 +03:00
vladvildanov fd4d2f1f20 Update CHANGELOG.md 2025-04-14 18:56:39 +03:00
Till Krüss bcee31d564 Merge pull request #1527 from predis/vv-readme-8.0-support 2025-04-14 08:51:03 -07:00
vladvildanov cff5386b37 Update README.md (Redis 8.0 support) 2025-04-14 18:39:59 +03:00
Till Krüss 341e1eef05 Sync main with v2.x 2025-04-14 08:32:36 -07:00
vladvildanov 9a4f9d1ae2 Fixed static analys issue 2025-04-01 11:02:08 +03:00
vladvildanov ebcf7809ea Removed empty files 2025-04-01 10:56:51 +03:00
vladvildanov 325aa70758 Fixed test 2025-03-31 13:02:30 +03:00
vladvildanov 90fa2c5409 Codestyle fixes 2025-03-31 12:51:57 +03:00
vladvildanov df2b385ece Added timeout for test 2025-03-31 12:50:07 +03:00
vladvildanov f560bea523 Fixed broken test 2025-03-31 12:43:37 +03:00
vladvildanov cf6f5e40db Marked test ask skipped 2025-03-31 12:39:28 +03:00
vladvildanov 28c76afac0 Removed testing against 6.2 2025-03-31 12:36:45 +03:00
vladvildanov 3aefebef92 Removed newline 2025-03-31 12:25:40 +03:00
vladvildanov 95ac0a1aa4 Added Valkey to wordlist 2025-03-31 12:23:40 +03:00
vladvildanov 99918b98bd Revert docker removal 2025-03-31 12:21:26 +03:00
Vladyslav Vildanov 9458c0d10e Merge branch 'main' into vv-main-2.x-sync 2025-03-31 12:17:20 +03:00
vladvildanov bf526cc129 Codestyle fixes 2025-03-31 12:14:37 +03:00
vladvildanov 8bc9a4d432 Merge branch 'v2.x' of github.com:predis/predis into vv-main-2.x-sync 2025-03-31 11:36:25 +03:00
Vladyslav Vildanov 52e9f6d106 Remove deprecated Triggers & Functions support (#1524)
* Removed deprecated Triggers & Functions support

* Codestyle fixes
2025-03-28 16:10:01 +02:00
Till Krüss fdd52d0284 Tag v2.4.0-RC1 (#1523) 2025-03-24 10:07:15 -07:00
Vladyslav Vildanov 48a861053e Added new hash-field expiration commands (#1520)
* Added new hash-field expiration commands

* Changed argument default value

* Marked test as skipped

* Removed version restriction

* Updated CHANGELOG.md
2025-03-24 17:50:12 +02:00
messikiller 7bf1f6eb29 optimize redis cluster slotmap with compact slot range object (#1493)
Co-authored-by: heqiming <heqiming@kingsoft.com>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
2025-03-19 09:24:53 -07:00
Vladyslav Vildanov 067b051900 Added missing FT._LIST and BITFIELD_RO commands (#1521)
* Added missing FT._LIST and BITFIELD_RO commands

* Codestyle fixes
2025-03-19 09:57:52 +02:00
Till Krüss df4a318b80 remove performance rambling from FAQ 2025-03-18 12:50:00 -07:00
Vladyslav Vildanov 73e6a03fd8 Added support for transactions in OSS Cluster (#1497)
* Added support for transactions in OSS Cluster

* Updated test cases

* Updated version restriction

* Updated server version restriction

* Added test skip for Relay

* Added test case for Relay

* Set transaction slot to null in case of failed transaction

* Restrict usage of transaction commands outside of transaction context

* Added handling for Relay responses

* Reverted changes

* Removed unsupported command

* Added dummy arguments

* Codestyle fixes

* Added additional test coverage

* Added CHANGELOG and README entries

* Added missing PR reference

* Missing word

* Fixed README
2025-03-07 10:31:02 +02:00
Vladyslav Vildanov 86e6804c80 fix(stream): Removed resource disconnection on GC (#1519)
* fix(stream): Removed resource disconnection on GC

* Added disconnect for persistent conenctions tests
2025-03-07 10:30:42 +02:00
Vladyslav Vildanov a904a3a273 Backport #1517 (#1518)
* Backport #1517

* Added versions restrictions

* Removed Relay for cluster with coverage

* Added phpcov package
2025-03-05 19:29:38 +02:00
Vladyslav Vildanov b32511926d Enable stack and cluster tests on 3 latest API versions (#1517)
* Enable stack and cluster tests on 3 latest API versions

* Changed type to string

* Fixed stack tests run against Redis 8.0

* Marked tests as incompatible with 8.0

* Marked more tests as incompatible

* Marked test as incompatible qwith 8.0

* Enable stack and cluster tests for certain PHP versions

* Restrict test to version Redis > 6.2

* Fixed version

* Override stack port for coverage test case

* Added test case for FT.EXPLAIN with dialect 2

* Added additional argument

* Added test cases for new INT8 and UINT8 vectors
2025-03-03 10:31:59 +02:00
Vladyslav Vildanov 494148c373 Changed default DIALECT to 2 (#1516)
* Changed default dialect to 2

* Added fix for deserialized commands

* Exclude test from Redis < 7.4

* Codestyle fixes

* Updated version restriction

* Updated version restrictions

* Fixed version restriction

* Updated restriction for PHP version to > 7.3

* Added deserealize test cases
2025-02-27 12:29:21 +02:00
Vladyslav Vildanov 7b1558abfa Backport #1510, #1513 (#1514) 2025-02-25 09:13:40 -08:00
Vladyslav Vildanov 8b240d15a5 Backport #1512 (#1515)
* Backport #1512
* Removed outdated test
2025-02-25 09:12:10 -08:00
Vladyslav Vildanov 02e2a7e1cc Added test coverage for compatibility with Redis 8.0 (#1513)
* Added testing with 8.0

* Removed old service

* Moved checkout stage above image

* Changed service name

* Override config options for Redis < 7

* Exported to github env

* Print major version output

* Added double quotes

* Test fixes

* Merge cluster and standalone infrastructure

* Removed separate cluster job and merge together with standalone

* Merge stack tests into main test job

* Fixed annotation condition

* tweaks

* Moved docker-compose.yml to root folder

* Added compose file to expected

* fixed in v0.10.1

* move docker file

* Added -all profile in docker-compose

* Removed redis official image, reduce test matrix, moved docker-compose.yml

* Revert docker-compose moving

* Added test coverage to verify compatibility with 8.0

* Mark tests as relay-incompatible

* Codestyle fix

* Marked as relay-incompatible

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2025-02-24 09:22:45 -08:00
Vladyslav Vildanov 09e88b6fd0 fix: Bug with single persistent connection to the same resource (#1512)
* fix: Bug with single persistent connection to the same resource

* Fixed tests

* Additional test fix

* Codestyle fixes
2025-02-24 09:51:55 +02:00
Vladyslav Vildanov 9a22450a65 Added testing with 8.0 (#1510)
* Added testing with 8.0

* Removed old service

* Moved checkout stage above image

* Changed service name

* Override config options for Redis < 7

* Exported to github env

* Print major version output

* Added double quotes

* Test fixes

* Merge cluster and standalone infrastructure

* Removed separate cluster job and merge together with standalone

* Merge stack tests into main test job

* Fixed annotation condition

* tweaks

* Moved docker-compose.yml to root folder

* Added compose file to expected

* fixed in v0.10.1

* move docker file

* Added -all profile in docker-compose

* Removed redis official image, reduce test matrix, moved docker-compose.yml

* Revert docker-compose moving

* test php 8.0 and redis 4.0

* Revert changes related to official image

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2025-02-20 17:47:05 +02:00
zxin ac933cc548 Fix eval_ro cluster support (#1449) 2025-02-13 09:40:23 -08:00
Stephan 355faa099f ClientInterface: update watch command accepting string and string[] (#1476) 2025-02-13 09:39:51 -08:00
Radu Neacsu 549889b198 Mark GEOSEARCH as read-only to ensure execution on replica instead of… (#1481) 2025-02-13 09:39:19 -08:00
Denny Septian Panggabean d1c657aac5 refactor: use parallel on PHP-CS-Fixer (#1489) 2025-02-13 09:06:51 -08:00
Jan Nedbal b196809d3a Prevent named arguments runtime failure (#1509) 2025-02-12 09:13:01 -08:00
Till Krüss 52489ea703 Update CHANGELOG.md 2025-01-22 09:26:10 -08:00
Till Krüss ba66e22c92 bump year to 2025 2025-01-22 09:24:26 -08:00
Nicolas Chapleau 37aa6fb515 PHP 8.4.0 compatibility with call to stream_context_set_option (#1503)
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2025-01-22 09:08:12 -08:00
Till Krüss deed24c418 update year 2025-01-20 09:52:18 -08:00
Till Krüss 93895d02b6 Update composer.json 2025-01-16 08:48:12 -08:00
asafpamzn 275606843e Update composer.json 2025-01-16 08:48:12 -08:00
asafpamzn 976c9daa4f Update composer.json 2025-01-16 08:48:12 -08:00
Till Krüss 205ae75bd8 Update README.md 2025-01-16 08:48:12 -08:00
asafpamzn a5f46d0913 Update README.md to include that the client is compatible with Valkey
Added documentation clarifying that predis is compatible with Valkey. This information could be really helpful for developers using Valkey in their projects, saving them time and ensuring they are confident in their choice of predis.
2025-01-16 08:48:12 -08:00
vladvildanov 974379bd05 Added relay-resp3 annotations 2025-01-14 09:41:14 -08:00
vladvildanov 8fb212c91b Updated test cases 2025-01-14 09:41:14 -08:00
vladvildanov 24ddf95ba2 Updated stack to test against stable version 2025-01-14 09:41:14 -08:00
vladvildanov 2b901872da Reverted merge reports 2025-01-14 09:41:14 -08:00
vladvildanov 0c561b087d Codestyle fixes 2025-01-14 09:41:14 -08:00
vladvildanov 08c9563d0b Marked tests as Relay incompatible 2025-01-14 09:41:14 -08:00
vladvildanov e160b316dd Fixed Relay tests 2025-01-14 09:41:14 -08:00
vladvildanov 7aa41544b2 Marked tests as relay incompatible 2025-01-14 09:41:14 -08:00
vladvildanov d6ff81a22c Updated cluster infrastructure files 2025-01-14 09:41:14 -08:00
vladvildanov b2511a40cf Changed GH action 2025-01-14 09:41:14 -08:00
Jiří Bok c83ffa43d8 Make Relay work with Redis cluster (#1397) 2025-01-14 09:41:14 -08:00
Till Krüss b36c2f928f Update .editorconfig (#1494) 2024-11-25 09:58:29 -08:00
Vladyslav Vildanov bf6e97e7fb Fixed broken search test (#1492) 2024-11-22 07:54:01 -08:00
Till Krüss da40e1253c bump dev version [skip ci] 2024-11-21 12:14:32 -08:00
Till Krüss bac46bfdb7 Prepare v2.3.0 (#1491)
* mark as redis 7.4 compatible
* run more tests on 8.4
* add 2.3.0 changelog
* don't skip errors
2024-11-21 12:00:02 -08:00
Till Krüss 7631d317fd update year 2024-11-21 11:37:10 -08:00
Vladyslav Vildanov aaec13d074 Added support for INDEXMISSING and INDEXEMPTY arguments (#1464)
* Added support for INDEXMISSING and INDEXEMPTY arguments

* Added version restriction for test

* Codestyle fixes

* Updated test case to remove DIALECT 5

* Updated another test case

* Added correct versions restriction

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2024-11-21 10:19:51 -08:00
Vladyslav Vildanov 52bdcf0c1f Added test case for enhanced exact matching (#1466)
* Added test case for enhanced exact matching

* Added version restriction for test

* Updated test case to use Tag Field instead

* Codestyle fix

* Added edge to stack matrix

* Updated test case to switch DIALECT

* Updated version restriction
2024-11-21 10:00:34 -08:00
Vladyslav Vildanov 1726db0f47 Codestyle updates (#1485) 2024-10-22 09:16:07 -07:00
Vladyslav Vildanov 8fbd34c6b3 Added support for hash field expiration commands (#1456)
* Added support for hash field expiration commands

* Added support for HSETF, HGETF commands

* Removed non-printable ASCII chars from docs

* Removed more non-printable ASCII

* Fixed code style issues

* Extended codespell ignore words list

* Added FIELDS argument, fixes related to comments

* Codestyle fixes

* Fixed typo

* Removed HSETF, HGETF commands

* Added 7.4-rc1 to test matrix

* Fixed test with new response types

* Updated tests against 7.4-rc2 image
2024-10-15 10:01:39 -07:00
Christian Flothmann 0a92618fa1 keep key and value when filtering SET arguments (#1471) 2024-07-11 09:46:52 +03:00
Vladyslav Vildanov d8bb9ac46e Added support for new IGNORE filter (#1458)
* Added support for new IGNORE filter

* Fixed arguments to be mandatory

* Added more test cases

* Codestyle fixes

* Added missing test case

* Updated test cases

* Added additional timeout after index creation

* Fixed broken test and removed non-related functionality

* Fixed tests version requirements

* Updated error message
2024-07-11 09:35:52 +03:00
Vladyslav Vildanov 274e0c17cd Fixed bug with null arguments in SET command (#1470) 2024-07-09 14:10:58 +03:00
Vladyslav Vildanov c27dafa40d [2.x] Added Redis 7.4 commands interface changes (#1459)
* [2.x] Added Redis 7.4 commands interface changes

* Removed RESP3 test case

* Added 7.4-rc1 to test matrix

* Added 7.4.0-rc1 to stack matrix

* Added version restriction for test

* Updated stack image to edge
2024-07-05 16:36:58 +03:00
Vladyslav Vildanov 8c2aac4f66 Added GEOSHAPE field and test polygon search (#1467)
* Added GEOSHAPE field and test polygon search

* Added version restriction for test

* Added edge to stack amtrix

* Added same values assertion

* Codestyle changes
2024-07-05 16:16:16 +03:00
Alexander Mohorev 5d22ed775a Fix prefix for SMISMEMBER (#1468) 2024-07-02 12:41:07 -07:00
Vladyslav Vildanov c5fdfc81ef Added tests case with FLOAT16 and BFLOAT16 vectors (#1465)
* Added tests case with FLOAT16 and BFLOAT16 vectors

* Added version restriction for test

* Updated version restrictions
2024-06-28 11:18:07 -07:00
Markus Reinhold cbef71090b Fix prefixes for LMOVE and BLMOVE (#1455)
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2024-05-02 08:55:20 -07:00
mahshidhp 4dc72458e8 Fix prefix for GEOSEARCH (#1453) 2024-04-30 12:29:30 -07:00
Christian Flothmann e83b393e09 explicitly mark nullable parameters as nullable (#1448)
* explicitly mark nullable parameters as nullable
* add job to run tests with PHP 8.4
2024-04-30 12:14:13 -07:00
Vladyslav Vildanov 8e66c20dc0 Added Redis 7.4 commands interface changes (#1452)
* Added Redis 7.4 commands interface changes

* Fixed test case

* Updated redis version for RESP3 tests
2024-04-15 18:32:52 +03:00
Till Krüss ed90750c1f fix prefixes for ZPOPMIN, ZPOPMAX and ZMSCORE (#1451) 2024-04-10 18:07:03 -07:00
Vladyslav Vildanov c83ee6a809 Implemented PSR-7 compatible stream abstraction (#1450)
* Implemented PSR-7 compatible stream abstraction

* Added missing coverage, fixing static analysis issues

* Fixed return type

* Added missing throws statements

* Added ignore lines
2024-04-10 12:52:53 +03:00
Vladyslav Vildanov 40d72d716d Improved pipeline abstractions (#1438)
* Added pipelining for on-connection commands

* Added server version condition for tests

* Fixed static analysis and codestyle errors

* Improved handshake session

* Updated HELLO retry logic

* Changed incorrect variable

* Added return statement

* Added more test coverage, codestyle fixes

* Improved pipelining abstractions

* Fixed unit tests

* Fixed typo

* Fixed another typo

* Fixed another typo

* Updated deserializeCommand signature

* Codestyle fixes

* Codestyle fixes

* Changed pipelined sequence

* Removed redundant method

* Fixed classname
2024-03-07 15:38:04 +02:00
René Højbjerg Larsen 45b18eb2e0 Filter out available slaves based on master-link-status flag (#1440) 2024-03-06 08:19:48 -08:00
Vladyslav Vildanov 8b464f2a60 Improved connection handshake session (#1431)
* Added pipelining for on-connection commands

* Added server version condition for tests

* Fixed static analysis and codestyle errors

* Improved handshake session

* Updated HELLO retry logic

* Changed incorrect variable

* Added return statement

* Added more test coverage, codestyle fixes
2024-03-04 09:18:46 +02:00
Vladyslav Vildanov 4b28ab1c74 Codestyle changes (#1437) 2024-02-23 10:18:22 +02:00
Till Krüss cf28b2a997 tag 3.0.0-alpha1 2024-01-19 08:57:22 -08:00
Vladyslav Vildanov 5f70cb1abc Removed NULL assignement for username parameter (#1429)
* Removed NULL assignement for username parameter

* Updated unit test

* More codestyle fixes

* Codestyle fixes
2024-01-15 11:57:18 +02:00
Till Krüss da634d8943 Update CHANGELOG.md 2024-01-02 10:14:35 -08:00
Till Krüss 72ad9846ed Merge pull request #1425 from vladvildanov/v3.x-into-main
Merge v3.x into main
2024-01-02 09:59:47 -08:00
vladvildanov e47abfeaf2 Merge v3.x into main 2024-01-02 10:08:27 +02:00
vladvildanov d75772ba89 Merge branch 'main' of github.com:vladvildanov/predis 2024-01-02 10:00:01 +02:00
Vladyslav Vildanov f31c13334f Merge branch 'predis:main' into main 2024-01-02 09:59:01 +02:00
vladvildanov 351d912cf6 Merge branch 'main' of github.com:predis/predis 2024-01-02 09:57:11 +02:00
vladvildanov 5cbaa19df9 Merge branch 'main' of github.com:vladvildanov/predis 2024-01-02 09:56:53 +02:00
Till Krüss 98f4d81995 remove 3.x release date 2023-12-28 10:37:50 -08:00
Vladyslav Vildanov d56e32715b Improved Relay integration (#1423)
* Fixed Relay objects structure (#1419)
* Added OSS cluster tests (#1421)

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-12-28 10:17:04 -08:00
Vladyslav Vildanov 87b0d2fa15 Merge test reports (#1424) 2023-12-27 13:33:52 -08:00
Vladyslav Vildanov b02c33149b Added permissions for release-drafter action (#1418) 2023-11-16 12:00:35 +02:00
Vladyslav Vildanov d1a1596d14 Enable CI on 3.x branch (#1417) 2023-11-16 11:51:43 +02:00
Vladyslav Vildanov da763471cd Updated RESP3 docs (#1415)
* Added redis_url specification, updated release-drafter workflow

* Updated release-drafter
2023-11-16 11:44:20 +02:00
Chayim 0e269098a1 [3.0] release drafter with commitish (#1416)
* spellcheck

* spelling

* fix bad commit

* spelling

* updating version of spellcheck action

* release drafter for 3

* Extended wordlist

---------

Co-authored-by: vladvildanov <divinez122@outlook.com>
2023-11-16 11:38:57 +02:00
Vladyslav Vildanov eabd1151c5 Added 3.0 changelog and documentation update (#1393) 2023-11-14 14:40:26 +02:00
Vladyslav Vildanov 662fdb99b3 Added support for redis gears trigger function commands (#1348)
* Added support for redis gears trigger function commands

* Exclude gears tests from relay connection tests

* Codestyle fixes

* Added missing test coverage

* Updated method description

* Use redis-stack:edge image istead of separate container

* Updated RESP3 modules responses

* Removed redundant constants

* Added additional timeout to make sure that index was created

* Marked test as relay-incompatible

* Mark tests as relay-incompatible

* Mark tests as relay-incompatible

* Increase timeout after index creation

* Added support for trigger functions command run against OSS cluster

* Mark gears cluster tests with appropriate annotation

* Marked with cluster annotation

* Codestyle fixes

* Removed refresh cluster on connection, moved to refresh manually in tests

* Removed redundant test

* Updated README, added comments with README references

* Revert "Marked test as relay-incompatible"

This reverts commit d888968b7b.

* Revert changes

* Revert "Mark tests as relay-incompatible"

This reverts commit 7d34370c6b.

* Revert "Updated RESP3 modules responses"

This reverts commit 5cf122ad71.

* Removed latest image

* Updated RESP3 modules responses (#4)

* Marked tests as relay-incompatible (#3)

* Marked test as relay-incompatible

* Mark tests as relay-incompatible

* Mark tests as relay-incompatible

* Changed tests group for RESP3 not supported tests

* Fixed broken tests

* Removed redundant test

* Marked test as relay-incompatible

* Codestyle fixes

* Updated CHANGELOG.md

* Updated CHANGELOG.md

* Revert php-cs-fixer style changes

---------

Co-authored-by: Chayim <chayim@users.noreply.github.com>
2023-11-01 18:09:09 +02:00
Till Krüss d44f07339a Run tests under PHP 8.3 (#1396) 2023-10-25 10:08:55 -07:00
Till Krüss a9d18b182c tweak fixer rules 2023-10-24 09:17:43 -07:00
Tobias Bengtsson 5c8b19ebaa Fix operator precedence (#1405)
&& binds tighter than ?? so a parentheses is needed for desired result
2023-09-26 09:11:00 -07:00
Stephan 577bd39872 ClientInterface: using set with NX flag can return null (#1394)
Calling `$client->set('key', '1', 'EX', 7200, 'NX')` for a key that is already set will return null instead of Status
2023-09-14 09:44:52 -07:00
Jiří Bok 6372661dbf Make Relay work with Redis cluster (#1397) 2023-09-13 09:59:50 -07:00
Till Krüss 4846e2ab94 back to dev version 2023-09-13 09:55:14 -07:00
Sergei Predvoditelev 92b284967e Fix cmsincrby method annotation in ClientInterface (#1333) 2023-09-13 09:50:19 -07:00
Till Krüss 08d5298080 fix typos 2023-09-13 09:49:11 -07:00
Igor Malinovskiy d88153b63e Add 7.2 to supported Redis versions (#1367) 2023-09-13 09:47:35 -07:00
Till Krüss b1d3255ed9 tag v2.2.2 2023-09-13 09:42:03 -07:00
Till Krüss cbf394b882 Disable CLIENT SETINFO calls by default (#1399)
Add `client_info` parameter
2023-09-13 09:35:49 -07:00
Till Krüss c6bf644872 bump dev version 2023-09-13 09:34:52 -07:00
Vladyslav Vildanov 16bdd83d23 Added EXPIRETIME command to KeyPrefixProcessor (#1369)
* Added EXPIRETIME command to KeyPrefixProcessor

* Fixed test responses for Redis 7.2

* Marked test as relay-incompatible
2023-08-25 14:27:24 -07:00
Vladyslav Vildanov 912af82bfd Added support for CLUSTER container command (#1360)
* Added support for CLUSTER container command

* Codestyle fixes
2023-08-17 09:34:01 +03:00
Vladyslav Vildanov 2d74db1bde Changes related to Redis 7.2 image update (#1366)
* Added new assertion, fixed RESP3 JSON responses and versions

* Removed expectations for error messages

* Changed tests group for RESP3 not supported tests

* Removed 3.x test case

* Added missing test decorators

* Fixed typo

* Removed redisgraph module upload, as not a part of a redis-stack anymore
2023-08-16 08:18:45 -07:00
Till Krüss c5ee202179 bump version (#1365)
* bump version

* Update Client.php
2023-08-15 16:06:03 -07:00
Till Krüss 5f2b410a74 Update CHANGELOG.md (#1364)
* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md
2023-08-15 16:01:46 -07:00
Vladyslav Vildanov f6cf2afe47 Updated CHANGELOG.md (#1363)
* Updated CHANGELOG.md

* Added quotes to CHANGELOG.md

* Codestyle fix
2023-08-15 08:43:46 -07:00
Vladyslav Vildanov 311cd2b79e Added support for WAITAOF command (#1357)
* Added support for WAITAOF command

* Added call to parent setUp method
2023-08-14 09:18:19 +03:00
Vladyslav Vildanov ffd31cfdef Added missing redis-stack commands to KeyPrefix processor (#1358) 2023-08-10 18:57:16 +03:00
Vladyslav Vildanov 1b2fd527ed Added support for Redis 7.0 arguments (#1359) 2023-08-10 18:57:00 +03:00
Till Krüss 2ae9af625c Revert "[3.x] Spellcheck as part of CI (#1354)" (#1362)
This reverts commit 12d0e015ff.
2023-08-09 09:21:22 -07:00
Chayim 12d0e015ff [3.x] Spellcheck as part of CI (#1354)
* spellcheck

* spelling

* fix bad commit

* spelling

* updating version of spellcheck action
2023-08-08 10:58:08 +03:00
Vladyslav Vildanov 4172d2265f Client set name and version on connection (#1347)
* Added client metadata on server connection

* Added try...catch around server exception to supress CLIENT command errors

* Added exclusion for Relay connection
2023-08-03 09:04:04 +03:00
Vladyslav Vildanov a3311d6869 2.2.1 version changes (#1349) 2023-08-03 09:03:21 +03:00
Vladyslav Vildanov af236dc50a Client set lib and version on connection (#1351)
* Added client metadata on server connection

* Added try...catch around server exception to supress CLIENT command errors

* Added exclusion for Relay connection

* Changed array index
2023-08-02 09:42:01 +03:00
Vladyslav Vildanov d8da27ba02 Added support for XINFO commands (#1331)
* Codestyle changes related to php-cs-fixer update (#1311)

* Codestyle changes

* Added missing type-hints

* Added GETDEL command to KeyPrefixProcessor (#1306)

* Added GETDEL command to KeyPrefixProcessor

* Added test coverage

* Codestyle fixes

* Added timeout after FT.CREATE call

* Added support for JSON.MERGE command (#1304)

* Added support for JSON.MSET command (#1307)

* Fixed subcommand test bug (#1313)

* Update CHANGELOG.md

* Update CHANGELOG.md

* Added support for XGROUP container commands

* Fixed bug with incorrect multiple words processing (#1325)

* Fixed bug with incorrect multiple words processing

* Convert subcommand string to lower case

* Update SubcommandStrategyResolver.php

* Added test coverage

* Codestyle fixes

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Added split words handling

* Fixed command id to be lowercase

* Fixed test decorator

* Added support for XINFO commands

* Changed decorator to corresponding version

* Updated tests to match server response

* Updated test decorators

* Added relay-incompatible decorator

* Updated return type

* Added support for FUNCTION DUMP, FUNCTION FLUSH, FUNCTION RESTORE commands (#1332)

* Remove empty file

* Added missing interface methods

* Removed nullable type

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
Co-authored-by: Chayim <chayim@users.noreply.github.com>
2023-07-27 10:06:47 +03:00
Vladyslav Vildanov 292bc432a6 Added support for XAUTOCLAIM command (#1328)
* Codestyle changes related to php-cs-fixer update (#1311)

* Codestyle changes

* Added missing type-hints

* Added GETDEL command to KeyPrefixProcessor (#1306)

* Added GETDEL command to KeyPrefixProcessor

* Added test coverage

* Codestyle fixes

* Added timeout after FT.CREATE call

* Added support for JSON.MERGE command (#1304)

* Added support for JSON.MSET command (#1307)

* Fixed subcommand test bug (#1313)

* Update CHANGELOG.md

* Update CHANGELOG.md

* Added support for XGROUP container commands

* Added support for XREADGROUP command

* Fixed bug with incorrect multiple words processing (#1325)

* Fixed bug with incorrect multiple words processing

* Convert subcommand string to lower case

* Update SubcommandStrategyResolver.php

* Added test coverage

* Codestyle fixes

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Added split words handling

* Fixed command id to be lowercase

* Fixed test decorator

* Marked test as realy incompatible

* Added support for XAUTOCLAIM command

* Changed test decorator to run agains >= 7.0.0

* Remove old files

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-07-27 09:28:43 +03:00
Vladyslav Vildanov b18c56e510 Added support for XREADGROUP command (#1327)
* Codestyle changes related to php-cs-fixer update (#1311)

* Codestyle changes

* Added missing type-hints

* Added GETDEL command to KeyPrefixProcessor (#1306)

* Added GETDEL command to KeyPrefixProcessor

* Added test coverage

* Codestyle fixes

* Added timeout after FT.CREATE call

* Added support for JSON.MERGE command (#1304)

* Added support for JSON.MSET command (#1307)

* Fixed subcommand test bug (#1313)

* Update CHANGELOG.md

* Update CHANGELOG.md

* Added support for XGROUP container commands

* Added support for XREADGROUP command

* Fixed bug with incorrect multiple words processing (#1325)

* Fixed bug with incorrect multiple words processing

* Convert subcommand string to lower case

* Update SubcommandStrategyResolver.php

* Added test coverage

* Codestyle fixes

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Added split words handling

* Fixed command id to be lowercase

* Fixed test decorator

* Marked test as realy incompatible

* Added support for FUNCTION DUMP, FUNCTION FLUSH, FUNCTION RESTORE commands (#1332)

* Added test case with multiple streams

* Removed old files

* Move back missing tests

* Removed blank space

* Added method signature

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-07-26 16:50:56 +03:00
Vladyslav Vildanov a5cc48d85f Added support for new container command approach of NO-EVICT subcommand (#1346) 2023-07-26 16:33:20 +03:00
Vladyslav Vildanov e60030770e Added support for XGROUP container commands (#1324)
* Codestyle changes related to php-cs-fixer update (#1311)

* Codestyle changes

* Added missing type-hints

* Added GETDEL command to KeyPrefixProcessor (#1306)

* Added GETDEL command to KeyPrefixProcessor

* Added test coverage

* Codestyle fixes

* Added timeout after FT.CREATE call

* Added support for JSON.MERGE command (#1304)

* Added support for JSON.MSET command (#1307)

* Fixed subcommand test bug (#1313)

* Update CHANGELOG.md

* Update CHANGELOG.md

* Added support for XGROUP container commands

* Fixed bug with incorrect multiple words processing (#1325)

* Fixed bug with incorrect multiple words processing

* Convert subcommand string to lower case

* Update SubcommandStrategyResolver.php

* Added test coverage

* Codestyle fixes

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Added split words handling

* Fixed command id to be lowercase

* Fixed test decorator

* Added support for FUNCTION DUMP, FUNCTION FLUSH, FUNCTION RESTORE commands (#1332)

* Added support for CLIENT NO-EVICT command (#1335)

* Added support for FUNCTION KILL, FUNCTION LIST, FUNCTION STATS commands (#1334)

* Added support for FUNCTION KILL, FUNCTION LIST, FUNCTION STATS commands

* Marked tests as relay-incompatible

* Removed old tests

* Removed old tests

* Move back missing test

* Removed blank space

* Removed old test

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-07-26 16:10:53 +03:00
Vladyslav Vildanov 7225b0af34 Moved code from strategies to command (#1345) 2023-07-26 15:32:39 +03:00
Vladyslav Vildanov 9318232e8d Merge main into 3.x (#1342)
* Changed command arguments (#1330)

* Re-implement CLIENT command as container command (#1337)

* Resolve merge conflicts

* Merge 2.x into main (#1341)

* Codestyle changes related to php-cs-fixer update (#1311)

* Codestyle changes

* Added missing type-hints

* Added GETDEL command to KeyPrefixProcessor (#1306)

* Added GETDEL command to KeyPrefixProcessor

* Added test coverage

* Codestyle fixes

* Added timeout after FT.CREATE call

* Added support for JSON.MERGE command (#1304)

* Added support for JSON.MSET command (#1307)

* Fixed subcommand test bug (#1313)

* Update CHANGELOG.md

* Update CHANGELOG.md

* Fixed bug with incorrect multiple words processing (#1325)

* Fixed bug with incorrect multiple words processing

* Convert subcommand string to lower case

* Update SubcommandStrategyResolver.php

* Added test coverage

* Codestyle fixes

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Added support for FUNCTION DUMP, FUNCTION FLUSH, FUNCTION RESTORE commands (#1332)

* Added support for CLIENT NO-EVICT command (#1335)

* Added support for FUNCTION KILL, FUNCTION LIST, FUNCTION STATS commands (#1334)

* Added support for FUNCTION KILL, FUNCTION LIST, FUNCTION STATS commands

* Marked tests as relay-incompatible

* Added support for tests running against redis cluster (#1236)

* Added support for tests running against redis cluster

* Test coverage

* Added comment about master nodes

* Codestyle fix

* Revert changes

* Revert DBNUM

* Added cluster endpoints to relay tests env configuration

* Exclude cluster tests from relay tests environment

* Removed TODO comment

* Changed cluster image version to unstable

* Updated configuration to match unstable cluster

* Fixed path

* Updated cluster CI configuration

* Removed redundant flag

* Removed backslash

* Updated file path

* Updated file path variable

* Added docker cluster initialization as additional step

* Run cluster tests as separate workflow

* Codestyle fixes

* Updated exported files

* Added additional timeout so cluster image could be settled

* Added support for different cluster image, use docker compose for cluster tests CI

* Remove unused flag

* Removed variable from volume path

* Added sleep timeout to allow docker setup after running

* Added timeout before tests run

* Updated linter settings

* Include indent changes for.sh files

* Added missing coverage

* Revert expected files and mark docker folder as exclusion

* Specify folder itself as excluded

* Moved cluster tests as separate job in tests.yml

* Updated name to contain cluster word

---------

Co-authored-by: Chayim <chayim@users.noreply.github.com>

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
Co-authored-by: Chayim <chayim@users.noreply.github.com>

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
Co-authored-by: Chayim <chayim@users.noreply.github.com>
2023-07-25 10:34:02 +03:00
Vladyslav Vildanov ac37f5b7e5 Merge 2.x into main (#1341)
* Codestyle changes related to php-cs-fixer update (#1311)

* Codestyle changes

* Added missing type-hints

* Added GETDEL command to KeyPrefixProcessor (#1306)

* Added GETDEL command to KeyPrefixProcessor

* Added test coverage

* Codestyle fixes

* Added timeout after FT.CREATE call

* Added support for JSON.MERGE command (#1304)

* Added support for JSON.MSET command (#1307)

* Fixed subcommand test bug (#1313)

* Update CHANGELOG.md

* Update CHANGELOG.md

* Fixed bug with incorrect multiple words processing (#1325)

* Fixed bug with incorrect multiple words processing

* Convert subcommand string to lower case

* Update SubcommandStrategyResolver.php

* Added test coverage

* Codestyle fixes

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Added support for FUNCTION DUMP, FUNCTION FLUSH, FUNCTION RESTORE commands (#1332)

* Added support for CLIENT NO-EVICT command (#1335)

* Added support for FUNCTION KILL, FUNCTION LIST, FUNCTION STATS commands (#1334)

* Added support for FUNCTION KILL, FUNCTION LIST, FUNCTION STATS commands

* Marked tests as relay-incompatible

* Added support for tests running against redis cluster (#1236)

* Added support for tests running against redis cluster

* Test coverage

* Added comment about master nodes

* Codestyle fix

* Revert changes

* Revert DBNUM

* Added cluster endpoints to relay tests env configuration

* Exclude cluster tests from relay tests environment

* Removed TODO comment

* Changed cluster image version to unstable

* Updated configuration to match unstable cluster

* Fixed path

* Updated cluster CI configuration

* Removed redundant flag

* Removed backslash

* Updated file path

* Updated file path variable

* Added docker cluster initialization as additional step

* Run cluster tests as separate workflow

* Codestyle fixes

* Updated exported files

* Added additional timeout so cluster image could be settled

* Added support for different cluster image, use docker compose for cluster tests CI

* Remove unused flag

* Removed variable from volume path

* Added sleep timeout to allow docker setup after running

* Added timeout before tests run

* Updated linter settings

* Include indent changes for.sh files

* Added missing coverage

* Revert expected files and mark docker folder as exclusion

* Specify folder itself as excluded

* Moved cluster tests as separate job in tests.yml

* Updated name to contain cluster word

---------

Co-authored-by: Chayim <chayim@users.noreply.github.com>

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
Co-authored-by: Chayim <chayim@users.noreply.github.com>
2023-07-25 10:20:24 +03:00
Vladyslav Vildanov 4195f137ef RESP3 commands integration tests and response handling (#1300)
* Added ACL RESP3 integration tests

* Added RESP3 commands integration tests and response handling

* Fixed required server versions

* Added more integration tests for RESP3 responses

* Move static strings to constants

* Codestyle fixes

* Codestyle fixes

* Change non-existing key name

* Change non-existing key name

* Added RESP3 test coverage for JSON module

* Added new assertion, fixed RESP3 JSON responses and versions

* Added feature tests on timeseries module RESP3 responses

* Updated version decorators

* Added feature tests on bloom filter module RESP3 responses

* Added feature tests on search module RESP3 responses

* Mark tests as relay-incompatible

* Added feature tests on cms, cuckoo filters RESP3 responses

* Revert changes

* Increased time intervals to avoid test failures

* Added feature tests on tdigest, topk filters RESP3 responses

* Updated test case responses

* Codestyle fix
2023-07-24 12:16:27 +03:00
Vladyslav Vildanov df14e11c3a Added support for tests running against redis cluster (#1236)
* Added support for tests running against redis cluster

* Test coverage

* Added comment about master nodes

* Codestyle fix

* Revert changes

* Revert DBNUM

* Added cluster endpoints to relay tests env configuration

* Exclude cluster tests from relay tests environment

* Removed TODO comment

* Changed cluster image version to unstable

* Updated configuration to match unstable cluster

* Fixed path

* Updated cluster CI configuration

* Removed redundant flag

* Removed backslash

* Updated file path

* Updated file path variable

* Added docker cluster initialization as additional step

* Run cluster tests as separate workflow

* Codestyle fixes

* Updated exported files

* Added additional timeout so cluster image could be settled

* Added support for different cluster image, use docker compose for cluster tests CI

* Remove unused flag

* Removed variable from volume path

* Added sleep timeout to allow docker setup after running

* Added timeout before tests run

* Updated linter settings

* Include indent changes for.sh files

* Added missing coverage

* Revert expected files and mark docker folder as exclusion

* Specify folder itself as excluded

* Moved cluster tests as separate job in tests.yml

* Updated name to contain cluster word

---------

Co-authored-by: Chayim <chayim@users.noreply.github.com>
2023-07-24 10:21:43 +03:00
Vladyslav Vildanov 021238f58b Added support for sharded pub/sub consumer (#1303)
* Added support for sharded pub/sub consumer

* Removed query parameter

* Fix typo

* Codestyle fixes

* Added support for sharded pub/sub against DispatcherLoop

* Updated sharded consumer example to subscribe on differend shard channels

* Added test coverage

* Removed cluster condition for pub/sub

* Codestyle fixes

* Changed socket read interface, added parameters as dependency to cluster connection

* Added for interface consistency

* Updated method description

* Updated method description

* Removed redundant exception

* Codestyle fix

* Updated README

* Mark tests as relay-incompatible

* Mark tests as relay-incompatible

* Mark tests as relay-incompatible

* Moved sharded pub/sub functionality to new consumer

* Codestyle fixes

* Resolve context depends on connection type

* Codestyle fixes
2023-07-19 16:28:14 +03:00
Vladyslav Vildanov 00e87640a7 Re-implement CLIENT command as container command (#1337) 2023-07-19 10:23:28 +03:00
Vladyslav Vildanov 7c2e8e01d8 Added support for FUNCTION KILL, FUNCTION LIST, FUNCTION STATS commands (#1334)
* Added support for FUNCTION KILL, FUNCTION LIST, FUNCTION STATS commands

* Marked tests as relay-incompatible
2023-07-12 09:58:00 +03:00
Vladyslav Vildanov 0b6ab4dea4 Added support for CLIENT NO-EVICT command (#1335) 2023-07-12 09:57:42 +03:00
Vladyslav Vildanov e8daf1abaf Changed command arguments (#1330) 2023-07-03 12:59:54 +03:00
Vladyslav Vildanov dd64569e06 Added support for FUNCTION DUMP, FUNCTION FLUSH, FUNCTION RESTORE commands (#1332) 2023-07-03 10:41:32 +03:00
Vladyslav Vildanov 6a1a2c4734 Push notifications support (#1316)
* Added new push notifications consumer

* Added push notifications dispatcher loop, intoduced consumer and dispatcher interfaces

* Static analysis fixes

* Codestyle fix

* Codestyle fixes

* Moved RelayConsumer in appropriate directory, fixed access modifiers
2023-06-29 16:18:04 +03:00
Vladyslav Vildanov 90da582efc Fixed bug with incorrect multiple words processing (#1325)
* Fixed bug with incorrect multiple words processing

* Convert subcommand string to lower case

* Update SubcommandStrategyResolver.php

* Added test coverage

* Codestyle fixes

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-06-21 12:00:58 +03:00
Till Krüss 732abc88a2 Update CHANGELOG.md 2023-06-14 13:42:52 +03:00
Till Krüss 33b70b971a Update CHANGELOG.md 2023-06-14 13:37:31 +03:00
vladvildanov 7069e17e68 Removed merge artifacts 2023-06-13 14:07:16 +03:00
vladvildanov f239e989fe Resolve merge conflicts 2023-06-13 14:05:29 +03:00
Vladyslav Vildanov 85306b9ed7 Resolve merge conflcits 2023-06-13 13:47:16 +03:00
Vladyslav Vildanov e831a3ef34 2.x main sync (#1317)
* Added support for Redis JSON module commands, added JSON.SET and JSON.GET commands (#868)

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* add Redis stack tests

* don't run tests twice

* use

* Update stack.yml

* Rename workflows

* Added version 6.x to workflow

* Removed exception thrown to avoid version bug

* Resolve conflicts within tests.yml

* Codestyle fixes

* Removew trailing whitespaces

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Added support for Bloom Filters module, added support for BF.ADD, BF.EXISTS commands (#874)

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Added support for BF.ADD and BF.EXISTS commands

* Fixed bug with incorrect tests skip

* Changed module name according to original naming

* Revert some old changes

* Fixed misspelling

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Added support for Cuckoo Filter, added CF.ADD and CF.EXISTS commands (#907)

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Added support for BF.ADD and BF.EXISTS commands

* Fixed bug with incorrect tests skip

* Changed module name according to original naming

* Added support for CF.ADD and CF.EXISTS commands

* Removed old files

* Revert old changes

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Extended Bloom filters by implementing BF.INFO command (#886)

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Added support for BF.ADD and BF.EXISTS commands

* Added support for BF.INFO command

* Fixed arguments data provider

* Fixed bug with incorrect tests skip

* Added command description

* Removed unused import

* Removed old directory

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Extend Bloom filters by imlplementing BFMADD and BFMEXISTS commands (#887)

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Added support for BF.ADD and BF.EXISTS commands

* Fixed bug with incorrect tests skip

* Added support for BF.MADD and BF.MEXISTS commands

* Removed old file

* Revert changes

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Extended Bloom Filters by implementing BF.RESERVE command (#888)

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Added support for BF.ADD and BF.EXISTS commands

* Added support for BF.INFO command

* Fixed arguments data provider

* Fixed bug with incorrect tests skip

* Added support for BF.RESERVE command

* Added command description

* Codestyle fixes

* Added missing test

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Extended Bloom Filter by implementing BF.SCANDUMP command (#889)

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Added support for BF.ADD and BF.EXISTS commands

* Fixed bug with incorrect tests skip

* Added support for BF.SCANDUMP command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Extended Bloom Filters by implementing BF.LOADCHUNK command (#890)

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Added support for BF.ADD and BF.EXISTS commands

* Fixed bug with incorrect tests skip

* Added support for BF.SCANDUMP command

* Added support for BF.LOADCHUNK command

* Codestyle fixes

* Sort alphabetical

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Extended Bloom Filter support by implementing BF.INSERT command (#891)

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Added support for BF.ADD and BF.EXISTS commands

* Added support for BF.INFO command

* Fixed arguments data provider

* Fixed bug with incorrect tests skip

* Added support for BF.RESERVE command

* Added command description

* Added support for BF.INSERT command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Extended Redis JSON support by implementing JSON.MGET (#892)

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.MGET command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Extended RedisJson support by implementing JSON.DEL command (#909)

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.DEL command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Extended RedisJson support by implementing JSON.OBJKEYS command (#911)

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Add support for JSON.OBJKEYS command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Extended RedisJson support by implementing JSON.OBJLEN command (#913)

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.OBJLEN command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Extended RedisJson support by implementing JSON.STRAPPEND command (#915)

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.STRAPPEND command

* Codestyle fix

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Extended RedisJson support by implementing JSON.STRLEN command (#917)

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.STRLEN command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Extended RedisJson support by implementing JSON.NUMINCRBY command (#919)

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.NUMINCRBY command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Extended RedisJson support by implementing JSON.ARRAPPEND command (#924)

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.ARRAPPEND command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Extended RedisJson support by implementing JSON.ARRINDEX command (#927)

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.ARRINDEX command

* Codestyle fies

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Extended RedisJson support by implementing JSON.ARRINSERT command (#929)

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.ARRINSERT command

* Revert changes

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Extended RedisJson support by implementing JSON.ARRLEN command (#931)

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Add support for JSON.ARRLEN command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Extended RedisJson support by implementing JSON.ARRPOP command (#933)

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.ARRPOP command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Extended RedisJson support by implementing JSON.ARRTRIM command (#936)

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.ARRTRIM command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Extended RedisJson support by implementing JSON.CLEAR command (#1004)

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.CLEAR command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Extended RedisJson support by implementing JSON.RESP command (#1006)

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.RESP command

* Removed debugger

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Extended RedisJson support by implementing JSON.TOGGLE command (#1008)

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.TOGGLE command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Extended RedisJson support by implementing JSON.TYPE command (#1010)

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.TYPE command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Extending RedisJson support by implementing JSON.FORGET command (#1012)

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.FORGET command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Add Support for CF.ADDNX (#1048)

* add support for CF.ADDNX

* fix key name

* fix wrong command

* Added support for CF.COUNT command (#1052)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Support CF.MEXISTS Command (#1081)

* add support for CF.ADDNX

* fix key name

* fix wrong command

* Support CF.MEXISTS Command

* fix test

* Add more assertions

* Added support for CF.INFO command (#1082)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added support for CF.DEL command (#1080)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Extended BloomFilters support by implementing CF.INSERT command (#1083)

* Added support for CF.INSERT command

* Override argument position offset value to default one

* Codestyle fixes

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Extended CuckooFilters support by implementing CF.RESERVE command (#1086)

* Added support for CF.RESERVE command

* Codestyle fixes

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added support for CF.LOADCHUNK, CF.SCANDUMP commands (#1085)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added support for CF.INSERTNX command (#1087)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added support for Count-Min Sketch with base commands CMS.INITBYDIM, CMS.INFO (#1088)

* Added support for Count-Min Sketches submodule, added support for CMS.INITBYDIM adn CMS.INFO commands

* Codestyle fixes

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Extended Count-Min Sketch support by implementing CMS.INITBYPROB command (#1090)

* Added support for CMS.INITBYPROB command

* Codestyle fixes

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Extended Count-Min Sketch support by implementing CMS.INCRBY and CMS.QUERY commands (#1091)

* Added support for CMS.INCRBY and CMS.QUERY commands

* Codestyle fixes

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Extended Count-Min Sketch support by implementing CMS.MERGE command (#1092)

* Added support for CMS.MERGE command

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added support for TDigest sketch, added TDIGEST.CREATE, TDIGEST.INFO commands (#1093)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Extended TDigest Sketch support by implementing TDIGEST.ADD command (#1094)

* Added support for TDIGEST.ADD command

* Codestyle fixes

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added support for TDIGEST.BYRANK command (#1096)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Extended TDigest support by implementing TDIGEST.BYREVRANK command (#1097)

* Added support for TDIGEST.BYREVRANK command

* Codestyle fixes

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added support for TDIGEST.CDF command (#1098)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Extended support by implementing TDIGEST.MAX command (#1099)

* Added support for TDIGEST.MAX command

* Codestyle fixes

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Extended support by implementing TDIGEST.MIN command  (#1100)

* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Support TDIGEST.MIN

* Add support for TDIGEST.RANK command (#1103)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Extended TDigest support by implementing TDIGEST.RESET command (#1104)

* Added support for TDIGEST.RESET command

* Codestyle fixes

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Extended support by implementing TDIGEST.QUANTILE command (#1101)

* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Support TDIGEST.QUANTILE

* fix returned value

* fix test

* fix linter error

* add not exsist key test

* fixes after review

* fix linter problem

* Add support for TDIGEST.REVRANK command (#1105)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added support for TDIGEST.TRIMMED_MEAN command (#1106)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added support for TOPK.RESERVE, TOPK.INFO commands (#1107)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added commands support (#1108)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added support for TOPK.INCRBY command (#1109)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added support for TOPK.QUERY command (#1110)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added support for TDIGEST.MERGE command (#1102)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: shacharPash <93581407+shacharPash@users.noreply.github.com>

* Codestyle fixes

* Changed return annotation

* Sync branch with 2.x (#1169)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Revert "Sync branch with 2.x (#1169)" (#1170)

This reverts commit bc5f07daf9.

* Sync branch with 2.x (#1171)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Container commands naming fixes (#1172)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Changed container commands names into uppercase

* Changed container commands names into uppercase

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Added support for RediSearch, implemented FT.CREATE command (#1143)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* add support for CF.ADDNX

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* fix key name

* fix wrong command

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Pulling changes

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Fixed vector field, removed default assignments, fixed tests

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Codestyle fixes

* Changed return annotation

* Separate common and create interfaces

* Codestyle fixes

* Revert changes

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Extended RediSearch support by implementing FT.SEARCH command (#1145)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* add support for CF.ADDNX

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* fix key name

* fix wrong command

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Pulling changes

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Added support for search command arguments, implemented FT.SEARCH command

* Fixed vector field, removed default assignments, fixed tests

* Tests fixes

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Merge conflicts

* Codestyle fixes

* Changed return annotation

* Separate common and create interfaces

* Codestyle fixes

* Changed search arguments to condiional

* Codestyle fixes

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Extended RediSearch support by implementing FT.INFO command (#1148)

* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Added support for FT.INFO command

* Codestyle fixes

* Fixed vector field, removed default assignments, fixed tests

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Extended RediSearch support by implementing FT.ALIASADD command (#1150)

* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Added support for FT.ALIASADD command

* Fixed expected exception message

* Fixed vector field, removed default assignments, fixed tests

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Extended RediSearch support by implementing FT.ALIASDEL command (#1151)

* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Added support for FT.ALIASADD command

* Fixed expected exception message

* Fixed vector field, removed default assignments, fixed tests

* Added support for FT.ALIASDEL command

* Codestyle fixes

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Extended RediSearch support by implementing FT.ALIASUPDATE command (#1152)

* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Added support for FT.ALIASADD command

* Fixed expected exception message

* Fixed vector field, removed default assignments, fixed tests

* Added support for FT.ALIASUPDATE command

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Extended RediSearch support by implementing FT.DICTADD command (#1155)

* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Fixed vector field, removed default assignments, fixed tests

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Added support for FT.DICTADD command

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Extended RediSearch support by implementing FT.DICTDEL support (#1156)

* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Fixed vector field, removed default assignments, fixed tests

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Added support for FT.DICTADD command

* Added support for FT.DICTDEL command

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Extended RediSearch support by implementing FT.DICTDUMP command (#1157)

* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Fixed vector field, removed default assignments, fixed tests

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Added support for FT.DICTADD command

* Added support for FT.DICTDUMP command

* Codestyle fixes

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Extended RediSearch support by implementing FT.DROPINDEX command (#1158)

* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Fixed vector field, removed default assignments, fixed tests

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Added support for FT.DROPINDEX command

* Changed arguments handling

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added Redis stack test group for Redis stack tests (#1178)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Marked redis stack tests with appropriate annotation

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Extended RediSearch support by implementing FT.PROFILE command (#1161)

* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Added support for search command arguments, implemented FT.SEARCH command

* Fixed vector field, removed default assignments, fixed tests

* Tests fixes

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Merge conflicts

* Added support for FT.PROFILE command

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Extended RediSearch support by implementing FT.SPELLCHECK command (#1162)

* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Fixed vector field, removed default assignments, fixed tests

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Added support for FT.DICTADD command

* Added support for FT.SPELLCHECK command

* Added test group, fixed description

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Extended RediSearch support by implementing FT.SYNUPDATE command (#1164)

* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Fixed vector field, removed default assignments, fixed tests

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Added support for FT.SYNUPDATE command

* Added command description

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Extended RediSearch support by implementing FT.SYNDUMP command (#1165)

* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Fixed vector field, removed default assignments, fixed tests

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Added support for FT.SYNUPDATE command

* Added support for FT.SYNDUMP command

* Fixed order number

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Extended RediSearch support by implementing FT.TAGVALS command (#1166)

* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Fixed vector field, removed default assignments, fixed tests

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Added support for FT.TAGVALS command

* Added example

* Fixed tests

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Extended RediSearch support by implementing FT.ALTER command (#1153)

* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Fixed vector field, removed default assignments, fixed tests

* Added support for FT.ALTER command

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Added example, changed command arguments interface

* Updated example

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Extended RediSearch by implementing FT.SUGADD command (#1167)

* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Added support for search command arguments, implemented FT.SEARCH command

* Fixed vector field, removed default assignments, fixed tests

* Tests fixes

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Merge conflicts

* Added support for FT.SUGADD command

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Extended RediSearch support by implementing FT.CONFIG SET and FT.CONFIG GET commands (#1173)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* add support for CF.ADDNX

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* fix key name

* fix wrong command

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Pulling changes

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Fixed vector field, removed default assignments, fixed tests

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Codestyle fixes

* Changed return annotation

* Separate common and create interfaces

* Codestyle fixes

* Added support for FT.CONFIG SET, FT.CONFIG GET commands

* Revert changes

* Added examples

* Added test group

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Extended RediSearch support by implementing FT.CONFIG HELP command (#1174)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* add support for CF.ADDNX

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* fix key name

* fix wrong command

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Pulling changes

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Fixed vector field, removed default assignments, fixed tests

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Codestyle fixes

* Changed return annotation

* Separate common and create interfaces

* Codestyle fixes

* Added support for FT.CONFIG SET, FT.CONFIG GET commands

* Revert changes

* Added support for FT.CONFIG HELP command

* Revert interface changes for bitcount command

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Extended Json support by implementing JSON.DEBUG command (#1182)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for JSON.DEBUG command

* Codestyle fixes

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Extended RediSearch support by implementing FT.SUGDEL command (#1183)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for FT.SUGDEL command

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Extended RediSearch support by implementing FT.SUGGET command (#1185)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for FT.SUGGET command, added examples for suggestion API usage

* Include SUGGET command files to codespell ignore

* Added file extension

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Extended RediSearch support by implementing FT.SUGLEN command (#1186)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for FT.SUGLEN command

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Unbreak RedisFactory interface (#1190)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Unbreak RedisFactory interface

* Fixed tests to be more generic and less dependant on json module

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Low-level implementation for FT.CREATE command (#1187)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Implemented low-level solution with builder under the hood

* Renamed variable

* Codestyle fixes

* New Schema implementation

* Removed deprecated payload_field argument

* Changed command argument name to more meaningful

* Added arguments default values according to documentation

* Changed letter to capital

* Changed arguments inteface, using builder directly

* Removed unused interface

* Fix misspelling error

* Fixed tests, remove old Schema object

* Removed SchemaTest

* Removed broken references

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
Co-authored-by: Chayim <chayim@users.noreply.github.com>

* Extended RediSearch support by implementing FT.AGGREGATE command (#1176)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for FT.AGGREGATE command

* Added command usage example

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Extended RediSearch support by implementing FT.EXPLAIN command (#1159)

* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Added support for search command arguments, implemented FT.SEARCH command

* Fixed vector field, removed default assignments, fixed tests

* Tests fixes

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Merge conflicts

* Added support for FT.EXPLAIN command

* Added FTEXPLAIN_Test to ignored file for eclint

* Codestyle fixes

* Fixed tests, added separate .editorconfig file

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Extended TimeSeries support by implementing TS.CREATE command (#1197)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for Time Series commands, TSCREATE command

* Fixed param annotation

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Extended TimeSeries support by implementing TS.ADD command (#1198)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for Time Series commands, TSCREATE command

* Fixed param annotation

* Added support for TS.ADD command

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* assert resource type before calling fclose on it (#1199)

* Extended TimeSeries support by implementing TS.GET command (#1218)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.GET command

* Codestyle fixes

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Extended TimeSeries support by implementing TS.DEL command (#1219)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.GET command

* Codestyle fixes

* Added support for TS.DEL command

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Extended TimeSeries support by implementing TS.ALTER command (#1220)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.ALTER command

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Extended TimeSeries support by implementing TS.INCRBY command (#1222)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.INCRBY commands

* Fixed return type

* Removed part of string to avoid spelling CI breaking

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Extended TimeSeries support by implementing TS.DECRBY command (#1223)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.DECRBY command

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Extended TimeSeries support by implementing TS.MADD command (#1224)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.MADD command

* Fixed exception message

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Extended TimeSeries support by implementing TS.MGET command (#1225)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.MGET command

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Added alias option for Vector field (#1221)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added alias option for Vector field

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Extended TimeSeries support by implementing TS.INFO command (#1228)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.INFO command

* Rename method to be more consistent

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Extended TimeSeries support by implementing TS.QUERYINDEX command (#1229)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.QUERYINDEX command

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Extended TimeSeries by implementing TS.RANGE command (#1231)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.RANGE command

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Extended TimeSeries by implementing TS.REVRANGE command (#1232)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.RANGE command

* Added support for TS.REVRANGE command

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Extended RediSearch support by implementing TS.CREATERULE command (#1226)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.CREATERULE command

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Extended TimeSeries support by implementing TS.DELETERULE command (#1227)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.CREATERULE command

* Added support for TS.DELETERULE command

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Extended TimeSeries support by implementing TS.MRANGE command (#1233)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.MRANGE command

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Extended TimeSeries support by implementing TS.MREVRANGE command (#1234)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.MRANGE command

* Added support for TS.MREVRANGE command

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Extended RediSearch support by implementing FT.CURSOR READ, DEL commands (#1196)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for FT.CURSOR READ, DEL commands

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>

* Codestyle fix

* Changed idx name for different index types

* Resolve merge conflicts between v2.x and main (#1247)

* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Add option for disabling reads to slaves in replication topologies (#1168)

* Add option for disabling reads to slaves in replication topologies

(cherry picked from commit e132c312a9)

* remove empty line

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* match `MasterSlaveReplication` (#1175)

* match `MasterSlaveReplication`

also the name of this method 😬

* Update SentinelReplication.php

* Added CODEOWNERS file (#1181)

* Added CODEOWNERS file

* Update CODEOWNERS

* Applied whole Redis commands path as @vladvildanov codeowner

* Set @predis/team as Redis commands codeowners

* Update CODEOWNERS

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Deprecate webdis and phpiredis (#1179)

* Deprecate webdis and phpiredis

* remove space

* tag v2.1.2

* Extended core support by implementing FCALL_RO command (#1191)

* typo

* Extended core support by implementing ACL SETUSER, GETUSER, DRYRUN (#1193)

* Added support for ACL GETUSER, SETUSER, DRYRUN commands

* Change test to support Redis > 6.0.0

* Removed selectors check

* Add missing stream key prefixes (#1230)

* Added missing stream key prefixes

* Tested stream command key prefixing

* Codestyle fix

* Changed idx name for different index types

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
Co-authored-by: David Bomba <turbo124@gmail.com>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
Co-authored-by: Jess Archer <jess@jessarcher.com>

* Resolve merge conflicts

* Revert changes

* Codestyle fixes

* Codestyle changes related to php-cs-fixer update (#1311)

* Codestyle changes

* Added missing type-hints

* Added GETDEL command to KeyPrefixProcessor (#1306)

* Added GETDEL command to KeyPrefixProcessor

* Added test coverage

* Codestyle fixes

* Added timeout after FT.CREATE call

* Codestyle changes

* Added support for JSON.MERGE command (#1304)

* Added support for JSON.MSET command (#1307)

* Fixed subcommand test bug (#1313)

* Removed old implementation

* Added types, removed redundant codespell configuration

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
Co-authored-by: shacharPash <93581407+shacharPash@users.noreply.github.com>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Chayim <chayim@users.noreply.github.com>
Co-authored-by: Patrick Jahn <33724206+p-jahn@users.noreply.github.com>
Co-authored-by: David Bomba <turbo124@gmail.com>
Co-authored-by: Jess Archer <jess@jessarcher.com>
2023-06-13 12:41:44 +03:00
Vladyslav Vildanov e46d56c45c Fixed subcommand test bug (#1313) 2023-06-08 11:33:25 -04:00
Vladyslav Vildanov c57a6744bb Added support for JSON.MSET command (#1307) 2023-06-08 17:35:04 +03:00
Vladyslav Vildanov df83c94bb3 Added support for JSON.MERGE command (#1304) 2023-06-08 12:16:14 +03:00
Vladyslav Vildanov fd356ce22c Codestyle changes 2023-06-08 11:55:49 +03:00
Vladyslav Vildanov ac046daac9 Resolve conflicts 2023-06-08 11:51:41 +03:00
Vladyslav Vildanov a711ef96e2 Added GETDEL command to KeyPrefixProcessor (#1306)
* Added GETDEL command to KeyPrefixProcessor

* Added test coverage

* Codestyle fixes

* Added timeout after FT.CREATE call
2023-06-08 11:32:05 +03:00
Vladyslav Vildanov 3c322fc4e3 Codestyle changes related to php-cs-fixer update (#1311)
* Codestyle changes

* Added missing type-hints
2023-06-07 17:05:36 +03:00
Vladyslav Vildanov 41a79f5b49 Added ACL RESP3 integration tests (#1299) 2023-05-19 08:47:45 +03:00
Vladyslav Vildanov 9b7963be8a Add RESP3 response handle (#1298)
* Add RESP3 response handle

* Fix replication connection to return parameters of any connection role

* Removed expectations on unstable error messages

* Codestyle fixes
2023-05-18 11:04:32 +03:00
Vladyslav Vildanov 55f6980594 Added RESP3 Parser strategy (#1294)
* Added RESP3 Parser strategy

* Fixed error messages
2023-05-17 13:13:31 +03:00
Vladyslav Vildanov 0a6f9e7b70 Moved parsing functionality into separate instances (#1293)
* Moved parsing functionality into separate instances

* Fixed code style errors
2023-05-15 15:40:01 +03:00
Till Krüss 6fbbb8973f Remove Webdis and phpiredis (#1291)
* remove webdis and phpiredis

* update changelog

* add pr number
2023-05-09 11:11:22 -07:00
Till Krüss b8f80aa5f2 Merge v2.2.0 into main 2023-05-09 10:56:06 -07:00
Till Krüss f28d4074fe bump dev version 2023-05-09 10:53:21 -07:00
Till Krüss f97ec4b6b9 Merge branch 'main' into fix-type-main 2023-05-09 10:52:19 -07:00
Till Krüss 95c23fb94d tag 2.2.0-RC1 2023-05-09 10:45:20 -07:00
Till Krüss 946c4b7bd7 [v2.x] Relay support (#1263) 2023-05-09 10:39:00 -07:00
Vladyslav Vildanov d18e20c98f Added RESP3 protocol option, establish RESP3 connection (#1267)
* Added RESP3 protocol option, establish RESP3 connection

* Removed method from the interface
2023-05-05 11:52:11 +03:00
Vladyslav Vildanov 538c65946d Added timeout to prevent search before create (#1269) 2023-05-03 11:00:31 -07:00
Till Krüss e8ea05dafe spacing 2023-04-19 13:52:53 -07:00
Nicolas Grekas bf2075a176 Add missing @return annotations (#1265)
* Add missing `@return` annotations

* formatting

* formatting

* Update ProcessorChain.php

* Update Handler.php

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-04-19 13:51:42 -07:00
Till Krüss d2cd99492d don't export bin 2023-04-13 09:51:16 -07:00
Vladyslav Vildanov e9431f788d Added support for PrefixableCommandInterface (#1262)
* Added support for PrefixableCommandInterface

* Codestyle fixes
2023-04-13 09:05:33 -07:00
Vladyslav Vildanov 971e47672d Added Redis stack support (JSON, Search, TimeSeries, Bloom) (#1253) 2023-04-11 08:09:14 -07:00
Till Krüss f9b755ece9 changes [skip ci] 2023-04-05 08:33:26 -07:00
Vladyslav Vildanov a11f2b12e9 Codestyle fixes 2023-04-03 15:42:09 +03:00
Vladyslav Vildanov 7e59426947 Revert changes 2023-04-03 15:38:42 +03:00
Vladyslav Vildanov 0dd3a293ac Resolve merge conflicts 2023-04-03 15:36:15 +03:00
Vladyslav Vildanov 74d1d1949c Merge branch 'main' of https://github.com/predis/predis 2023-04-03 15:35:52 +03:00
Vladyslav Vildanov af347182c3 Resolve merge conflicts between v2.x and main (#1247)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Add option for disabling reads to slaves in replication topologies (#1168)

* Add option for disabling reads to slaves in replication topologies

(cherry picked from commit e132c312a9)

* remove empty line

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* match `MasterSlaveReplication` (#1175)

* match `MasterSlaveReplication`

also the name of this method 😬

* Update SentinelReplication.php

* Added CODEOWNERS file (#1181)

* Added CODEOWNERS file

* Update CODEOWNERS

* Applied whole Redis commands path as @vladvildanov codeowner

* Set @predis/team as Redis commands codeowners

* Update CODEOWNERS

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Deprecate webdis and phpiredis (#1179)

* Deprecate webdis and phpiredis

* remove space

* tag v2.1.2

* Extended core support by implementing FCALL_RO command (#1191)

* typo

* Extended core support by implementing ACL SETUSER, GETUSER, DRYRUN (#1193)

* Added support for ACL GETUSER, SETUSER, DRYRUN commands

* Change test to support Redis > 6.0.0

* Removed selectors check

* Add missing stream key prefixes (#1230)

* Added missing stream key prefixes

* Tested stream command key prefixing

* Codestyle fix

* Changed idx name for different index types

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
Co-authored-by: David Bomba <turbo124@gmail.com>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
Co-authored-by: Jess Archer <jess@jessarcher.com>
2023-04-03 15:11:51 +03:00
Vladyslav Vildanov 66fbe46cf5 Changed idx name for different index types 2023-04-03 12:32:59 +03:00
Vladyslav Vildanov 14aaa8dcc1 Codestyle fix 2023-04-03 12:23:28 +03:00
Vladyslav Vildanov d59b4dece5 Resolve merge conflicts 2023-04-03 12:18:58 +03:00
Vladyslav Vildanov 3b24c24585 Merge branch 'main' of https://github.com/predis/predis 2023-04-03 12:10:21 +03:00
Vladyslav Vildanov c838a95f97 Extended RediSearch support by implementing FT.CURSOR READ, DEL commands (#1196)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for FT.CURSOR READ, DEL commands

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-03-30 10:23:11 +03:00
Vladyslav Vildanov 03d8cad2a9 Extended TimeSeries support by implementing TS.MREVRANGE command (#1234)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.MRANGE command

* Added support for TS.MREVRANGE command

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-03-30 10:03:11 +03:00
Vladyslav Vildanov 88977fd381 Extended TimeSeries support by implementing TS.MRANGE command (#1233)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.MRANGE command

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-03-30 09:56:58 +03:00
Jess Archer 98d4f80263 Add missing stream key prefixes (#1230)
* Added missing stream key prefixes

* Tested stream command key prefixing
2023-03-29 07:03:45 -07:00
Vladyslav Vildanov df29591e2f Extended TimeSeries support by implementing TS.DELETERULE command (#1227)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.CREATERULE command

* Added support for TS.DELETERULE command

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-03-29 10:39:25 +03:00
Vladyslav Vildanov 4bcb599fc2 Extended RediSearch support by implementing TS.CREATERULE command (#1226)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.CREATERULE command

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-03-29 10:39:10 +03:00
Vladyslav Vildanov e65360b98f Merge branch 'main' of https://github.com/predis/predis 2023-03-28 17:00:49 +03:00
Vladyslav Vildanov 4d5bdace66 Extended TimeSeries by implementing TS.REVRANGE command (#1232)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.RANGE command

* Added support for TS.REVRANGE command

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-03-28 16:59:08 +03:00
Vladyslav Vildanov dcd188d4dd Extended TimeSeries by implementing TS.RANGE command (#1231)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.RANGE command

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-03-28 16:52:00 +03:00
Vladyslav Vildanov 302b6933c6 Extended TimeSeries support by implementing TS.QUERYINDEX command (#1229)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.QUERYINDEX command

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-03-28 16:46:13 +03:00
Vladyslav Vildanov 69ba5d77aa Extended TimeSeries support by implementing TS.INFO command (#1228)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.INFO command

* Rename method to be more consistent

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-03-28 16:45:19 +03:00
Vladyslav Vildanov d16e3b9931 Merge branch 'main' of https://github.com/predis/predis 2023-03-27 17:07:03 +03:00
Vladyslav Vildanov 55ce9cd2f4 Added alias option for Vector field (#1221)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added alias option for Vector field

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-03-27 17:01:55 +03:00
Vladyslav Vildanov af0cb8d729 Merge branch 'main' of https://github.com/predis/predis 2023-03-27 11:31:18 +03:00
Vladyslav Vildanov c61af25f8a Extended TimeSeries support by implementing TS.MGET command (#1225)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.MGET command

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-03-27 11:25:23 +03:00
Vladyslav Vildanov 2fbb7ffdfd Extended TimeSeries support by implementing TS.MADD command (#1224)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.MADD command

* Fixed exception message

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-03-24 16:44:44 +02:00
Vladyslav Vildanov b41672ad0b Extended TimeSeries support by implementing TS.DECRBY command (#1223)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.DECRBY command

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-03-24 15:59:50 +02:00
Vladyslav Vildanov f50bc0646c Merge branch 'main' of https://github.com/predis/predis 2023-03-24 14:38:48 +02:00
Vladyslav Vildanov 68cafac5ad Extended TimeSeries support by implementing TS.INCRBY command (#1222)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.INCRBY commands

* Fixed return type

* Removed part of string to avoid spelling CI breaking

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-03-24 14:36:08 +02:00
Vladyslav Vildanov cb72217888 Merge branch 'main' of https://github.com/predis/predis 2023-03-24 12:57:02 +02:00
Vladyslav Vildanov a151571cd5 Extended TimeSeries support by implementing TS.ALTER command (#1220)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.ALTER command

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-03-24 12:27:35 +02:00
Vladyslav Vildanov 7758bd8ca8 Extended TimeSeries support by implementing TS.DEL command (#1219)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.GET command

* Codestyle fixes

* Added support for TS.DEL command

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-03-24 12:18:50 +02:00
Vladyslav Vildanov 8c4591a3d3 Extended TimeSeries support by implementing TS.GET command (#1218)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for TS.GET command

* Codestyle fixes

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-03-24 12:13:55 +02:00
Vladyslav Vildanov 07f061ea25 Merge branch 'main' of https://github.com/predis/predis 2023-03-24 11:54:24 +02:00
Patrick Jahn 1bd5043ba2 assert resource type before calling fclose on it (#1199) 2023-03-23 19:31:57 +01:00
Vladyslav Vildanov e3cebce136 Merge branch 'main' of https://github.com/predis/predis 2023-03-23 14:42:57 +02:00
Vladyslav Vildanov 08e252a580 Extended TimeSeries support by implementing TS.ADD command (#1198)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for Time Series commands, TSCREATE command

* Fixed param annotation

* Added support for TS.ADD command

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-03-23 09:55:14 +02:00
Vladyslav Vildanov c88d8ebce3 Extended TimeSeries support by implementing TS.CREATE command (#1197)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for Time Series commands, TSCREATE command

* Fixed param annotation

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-03-23 09:41:35 +02:00
Vladyslav Vildanov 0e019cc08d Extended core support by implementing ACL SETUSER, GETUSER, DRYRUN (#1193)
* Added support for ACL GETUSER, SETUSER, DRYRUN commands

* Change test to support Redis > 6.0.0

* Removed selectors check
2023-03-15 14:57:12 +02:00
Vladyslav Vildanov 6f5a834fbf Merge branch 'main' of https://github.com/predis/predis 2023-03-15 10:28:24 +02:00
Vladyslav Vildanov 4fefb9bb76 Extended RediSearch support by implementing FT.EXPLAIN command (#1159)
* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Added support for search command arguments, implemented FT.SEARCH command

* Fixed vector field, removed default assignments, fixed tests

* Tests fixes

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Merge conflicts

* Added support for FT.EXPLAIN command

* Added FTEXPLAIN_Test to ignored file for eclint

* Codestyle fixes

* Fixed tests, added separate .editorconfig file

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-03-15 10:13:38 +02:00
Vladyslav Vildanov bc42b3bcc5 Extended RediSearch support by implementing FT.AGGREGATE command (#1176)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for FT.AGGREGATE command

* Added command usage example

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-03-14 12:41:54 +02:00
Vladyslav Vildanov 684bb34cf2 Low-level implementation for FT.CREATE command (#1187)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Implemented low-level solution with builder under the hood

* Renamed variable

* Codestyle fixes

* New Schema implementation

* Removed deprecated payload_field argument

* Changed command argument name to more meaningful

* Added arguments default values according to documentation

* Changed letter to capital

* Changed arguments inteface, using builder directly

* Removed unused interface

* Fix misspelling error

* Fixed tests, remove old Schema object

* Removed SchemaTest

* Removed broken references

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
Co-authored-by: Chayim <chayim@users.noreply.github.com>
2023-03-14 10:31:38 +02:00
Vladyslav Vildanov c6fb3a8091 Merge branch 'main' of https://github.com/predis/predis 2023-03-14 10:11:07 +02:00
Till Krüss b898172009 typo 2023-03-12 09:22:07 -07:00
Vladyslav Vildanov f68543af37 Extended core support by implementing FCALL_RO command (#1191) 2023-03-12 08:52:20 -07:00
Vladyslav Vildanov 3a921190a1 Unbreak RedisFactory interface (#1190)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Unbreak RedisFactory interface

* Fixed tests to be more generic and less dependant on json module

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-03-07 17:04:30 +02:00
Vladyslav Vildanov 6c73393923 Merge branch 'main' of https://github.com/predis/predis 2023-03-06 12:02:39 +02:00
Till Krüss a77a43913a tag v2.1.2 2023-03-02 10:32:04 -08:00
Vladyslav Vildanov 00a8e5cd61 Extended RediSearch support by implementing FT.SUGLEN command (#1186)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for FT.SUGLEN command

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-03-01 13:19:19 +02:00
Vladyslav Vildanov ba1b0d41a3 Merge branch 'main' of https://github.com/predis/predis 2023-03-01 13:01:17 +02:00
Vladyslav Vildanov 5a9f62ef78 Extended RediSearch support by implementing FT.SUGGET command (#1185)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for FT.SUGGET command, added examples for suggestion API usage

* Include SUGGET command files to codespell ignore

* Added file extension

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-03-01 12:57:01 +02:00
Vladyslav Vildanov 340c0f5417 Merge branch 'main' of https://github.com/predis/predis 2023-03-01 10:02:57 +02:00
Till Krüss fea402743f Deprecate webdis and phpiredis (#1179)
* Deprecate webdis and phpiredis

* remove space
2023-02-28 13:09:56 -08:00
Vladyslav Vildanov 84844acb93 Added CODEOWNERS file (#1181)
* Added CODEOWNERS file

* Update CODEOWNERS

* Applied whole Redis commands path as @vladvildanov codeowner

* Set @predis/team as Redis commands codeowners

* Update CODEOWNERS

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-02-28 13:07:06 -08:00
Vladyslav Vildanov 4b63d39c55 Extended RediSearch support by implementing FT.SUGDEL command (#1183)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for FT.SUGDEL command

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-02-28 17:15:16 +02:00
Vladyslav Vildanov 8ba0389bcf Merge branch 'main' of https://github.com/predis/predis 2023-02-28 16:38:12 +02:00
Vladyslav Vildanov a93e1e5a99 Extended Json support by implementing JSON.DEBUG command (#1182)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Added support for JSON.DEBUG command

* Codestyle fixes

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-02-28 16:36:46 +02:00
Vladyslav Vildanov df7d11e7a9 Merge branch 'main' of https://github.com/predis/predis 2023-02-28 12:05:13 +02:00
Vladyslav Vildanov de8147a0d3 Extended RediSearch support by implementing FT.CONFIG HELP command (#1174)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* add support for CF.ADDNX

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* fix key name

* fix wrong command

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Pulling changes

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Fixed vector field, removed default assignments, fixed tests

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Codestyle fixes

* Changed return annotation

* Separate common and create interfaces

* Codestyle fixes

* Added support for FT.CONFIG SET, FT.CONFIG GET commands

* Revert changes

* Added support for FT.CONFIG HELP command

* Revert interface changes for bitcount command

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-02-28 12:02:37 +02:00
Vladyslav Vildanov a9de0bba0e Extended RediSearch support by implementing FT.CONFIG SET and FT.CONFIG GET commands (#1173)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* add support for CF.ADDNX

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* fix key name

* fix wrong command

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Pulling changes

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Fixed vector field, removed default assignments, fixed tests

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Codestyle fixes

* Changed return annotation

* Separate common and create interfaces

* Codestyle fixes

* Added support for FT.CONFIG SET, FT.CONFIG GET commands

* Revert changes

* Added examples

* Added test group

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-02-28 11:48:21 +02:00
Vladyslav Vildanov 36793cf5a9 Extended RediSearch by implementing FT.SUGADD command (#1167)
* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Added support for search command arguments, implemented FT.SEARCH command

* Fixed vector field, removed default assignments, fixed tests

* Tests fixes

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Merge conflicts

* Added support for FT.SUGADD command

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-28 11:43:32 +02:00
Vladyslav Vildanov 0dfcff47c1 Extended RediSearch support by implementing FT.ALTER command (#1153)
* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Fixed vector field, removed default assignments, fixed tests

* Added support for FT.ALTER command

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Added example, changed command arguments interface

* Updated example

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-28 11:13:09 +02:00
Vladyslav Vildanov 1f4ccbb4fb Extended RediSearch support by implementing FT.TAGVALS command (#1166)
* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Fixed vector field, removed default assignments, fixed tests

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Added support for FT.TAGVALS command

* Added example

* Fixed tests

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-27 16:21:36 +02:00
Vladyslav Vildanov f4db2e7de3 Extended RediSearch support by implementing FT.SYNDUMP command (#1165)
* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Fixed vector field, removed default assignments, fixed tests

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Added support for FT.SYNUPDATE command

* Added support for FT.SYNDUMP command

* Fixed order number

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-27 15:01:57 +02:00
Vladyslav Vildanov a0d571d7db Extended RediSearch support by implementing FT.SYNUPDATE command (#1164)
* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Fixed vector field, removed default assignments, fixed tests

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Added support for FT.SYNUPDATE command

* Added command description

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-27 14:38:23 +02:00
Vladyslav Vildanov b56a85c6a6 Extended RediSearch support by implementing FT.SPELLCHECK command (#1162)
* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Fixed vector field, removed default assignments, fixed tests

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Added support for FT.DICTADD command

* Added support for FT.SPELLCHECK command

* Added test group, fixed description

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-27 12:19:23 +02:00
Vladyslav Vildanov c51e4adf4e Extended RediSearch support by implementing FT.PROFILE command (#1161)
* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Added support for search command arguments, implemented FT.SEARCH command

* Fixed vector field, removed default assignments, fixed tests

* Tests fixes

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Merge conflicts

* Added support for FT.PROFILE command

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-27 11:54:10 +02:00
Vladyslav Vildanov 9ba625f19e Merge branch 'main' of https://github.com/predis/predis 2023-02-24 11:50:59 +02:00
Vladyslav Vildanov f4f7b3c013 Added Redis stack test group for Redis stack tests (#1178)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Marked redis stack tests with appropriate annotation

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-02-24 11:49:19 +02:00
Vladyslav Vildanov 4ef07e7982 Merge branch 'main' of https://github.com/predis/predis 2023-02-24 09:35:10 +02:00
Vladyslav Vildanov 4d71c7011a Extended RediSearch support by implementing FT.DROPINDEX command (#1158)
* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Fixed vector field, removed default assignments, fixed tests

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Added support for FT.DROPINDEX command

* Changed arguments handling

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-23 15:45:02 +02:00
Vladyslav Vildanov 736370c0bc Extended RediSearch support by implementing FT.DICTDUMP command (#1157)
* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Fixed vector field, removed default assignments, fixed tests

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Added support for FT.DICTADD command

* Added support for FT.DICTDUMP command

* Codestyle fixes

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-23 15:00:37 +02:00
Vladyslav Vildanov 1684469302 Extended RediSearch support by implementing FT.DICTDEL support (#1156)
* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Fixed vector field, removed default assignments, fixed tests

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Added support for FT.DICTADD command

* Added support for FT.DICTDEL command

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-23 14:33:41 +02:00
Vladyslav Vildanov 47d0da845a Extended RediSearch support by implementing FT.DICTADD command (#1155)
* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Fixed vector field, removed default assignments, fixed tests

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Added support for FT.DICTADD command

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-23 14:22:53 +02:00
Vladyslav Vildanov 4ffe53b6b3 Merge branch 'main' of github.com:vladvildanov/predis 2023-02-22 13:18:51 +02:00
Vladyslav Vildanov eb26d7b2cf Merge branch 'predis:main' into main 2023-02-22 13:18:39 +02:00
Vladyslav Vildanov cae136d21a Merge branch 'main' of https://github.com/predis/predis 2023-02-22 11:10:52 +02:00
Vladyslav Vildanov 329f8f8d4d Extended RediSearch support by implementing FT.ALIASUPDATE command (#1152)
* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Added support for FT.ALIASADD command

* Fixed expected exception message

* Fixed vector field, removed default assignments, fixed tests

* Added support for FT.ALIASUPDATE command

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-22 10:51:19 +02:00
Vladyslav Vildanov fcf1c8c59a Extended RediSearch support by implementing FT.ALIASDEL command (#1151)
* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Added support for FT.ALIASADD command

* Fixed expected exception message

* Fixed vector field, removed default assignments, fixed tests

* Added support for FT.ALIASDEL command

* Codestyle fixes

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-22 10:42:28 +02:00
Vladyslav Vildanov 2b129776d8 Extended RediSearch support by implementing FT.ALIASADD command (#1150)
* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Added support for FT.ALIASADD command

* Fixed expected exception message

* Fixed vector field, removed default assignments, fixed tests

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-22 10:31:19 +02:00
Vladyslav Vildanov ee7ed2f727 Extended RediSearch support by implementing FT.INFO command (#1148)
* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Added support for FT.INFO command

* Codestyle fixes

* Fixed vector field, removed default assignments, fixed tests

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-22 10:20:14 +02:00
Till Krüss 26c625230f match MasterSlaveReplication (#1175)
* match `MasterSlaveReplication`

also the name of this method 😬

* Update SentinelReplication.php
2023-02-21 08:30:43 -08:00
David Bomba 8ef75ba6b2 Add option for disabling reads to slaves in replication topologies (#1168)
* Add option for disabling reads to slaves in replication topologies

(cherry picked from commit e132c312a9)

* remove empty line

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-02-21 08:15:58 -08:00
Vladyslav Vildanov 7eb87c935c Extended RediSearch support by implementing FT.SEARCH command (#1145)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* add support for CF.ADDNX

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* fix key name

* fix wrong command

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Pulling changes

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Added support for search command arguments, implemented FT.SEARCH command

* Fixed vector field, removed default assignments, fixed tests

* Tests fixes

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Merge conflicts

* Codestyle fixes

* Changed return annotation

* Separate common and create interfaces

* Codestyle fixes

* Changed search arguments to condiional

* Codestyle fixes

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-02-21 18:10:55 +02:00
Vladyslav Vildanov 3caa973214 Added support for RediSearch, implemented FT.CREATE command (#1143)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* add support for CF.ADDNX

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* fix key name

* fix wrong command

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Pulling changes

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Added support for FT.CREATE command

* Fixed tests to choose correct DB

* Added test coverage

* Revert changes for missing commands

* Added data types enums, added methods default assignments

* Fixed vector field, removed default assignments, fixed tests

* Added constants enum for Sortable argument, renamed arguments object

* Codestyle fixes

* Rename test class

* Codestyle fixes

* Changed return annotation

* Separate common and create interfaces

* Codestyle fixes

* Revert changes

---------

Co-authored-by: shacharPash <shachar.pashchur@redis.com>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-02-21 17:55:58 +02:00
Vladyslav Vildanov cac3956df5 Container commands naming fixes (#1172)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

* Changed container commands names into uppercase

* Changed container commands names into uppercase

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-02-21 12:07:12 +02:00
Vladyslav Vildanov a9c8da1384 Merge branch 'main' of github.com:vladvildanov/predis 2023-02-21 10:45:37 +02:00
Vladyslav Vildanov 758d86a0fb Merge branch 'main' of https://github.com/predis/predis 2023-02-21 10:45:06 +02:00
Vladyslav Vildanov ff9aa2f56d Sync branch with 2.x (#1171)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-02-21 10:38:56 +02:00
Vladyslav Vildanov 8e46efe0c3 Merge branch 'predis:main' into main 2023-02-21 10:34:10 +02:00
Vladyslav Vildanov f9f0d4af2c Revert "Sync branch with 2.x (#1169)" (#1170)
This reverts commit bc5f07daf9.
2023-02-21 10:33:31 +02:00
Vladyslav Vildanov bc5f07daf9 Sync branch with 2.x (#1169)
* Added support for new arguments for BITPOS, BITCOUNT commands (#1045)

* Added support for new arguments for EXPIRE, EXPIREAT commands (#1046)

* Extended core support by implementing SORT_RO command (#1044)

* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* fix deprecated call

* Added support for container commands (#1049)

* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Added stream commands to KeyPrefixProcessor (#1051)

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>

* Fix return type of ReplicationInterface::getSlaves (#1111)

* Codestyle fixes

* Changed return annotation

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <till@kruss.io>
Co-authored-by: Stephan <glaubinix@users.noreply.github.com>
2023-02-21 10:26:50 +02:00
Vladyslav Vildanov 9164b36029 Changed return annotation 2023-02-21 10:24:16 +02:00
Vladyslav Vildanov 83e85f3257 Codestyle fixes 2023-02-21 10:20:56 +02:00
Vladyslav Vildanov 28a037e821 Resolve merge conflicts 2023-02-21 10:16:47 +02:00
Stephan 8a5ced5251 Fix return type of ReplicationInterface::getSlaves (#1111) 2023-02-08 07:26:27 -08:00
Vladyslav Vildanov 02fadf8da2 Added support for TDIGEST.MERGE command (#1102)
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: shacharPash <93581407+shacharPash@users.noreply.github.com>
2023-02-08 15:31:00 +02:00
Vladyslav Vildanov 3d5ecc8637 Added support for TOPK.QUERY command (#1110)
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-08 14:04:53 +02:00
Vladyslav Vildanov 4d00f244d8 Added support for TOPK.INCRBY command (#1109)
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-08 13:03:26 +02:00
Vladyslav Vildanov 13e687a1fa Added commands support (#1108)
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-08 10:24:36 +02:00
Vladyslav Vildanov 12673ef50a Added support for TOPK.RESERVE, TOPK.INFO commands (#1107)
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-07 17:45:34 +02:00
Vladyslav Vildanov 89dd528235 Added support for TDIGEST.TRIMMED_MEAN command (#1106)
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-07 16:03:10 +02:00
Vladyslav Vildanov 55e2f74447 Add support for TDIGEST.REVRANK command (#1105)
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-07 15:10:19 +02:00
shacharPash 23356ceb8e Extended support by implementing TDIGEST.QUANTILE command (#1101)
* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Support TDIGEST.QUANTILE

* fix returned value

* fix test

* fix linter error

* add not exsist key test

* fixes after review

* fix linter problem
2023-02-07 13:37:44 +02:00
Vladyslav Vildanov 699d023280 Extended TDigest support by implementing TDIGEST.RESET command (#1104)
* Added support for TDIGEST.RESET command

* Codestyle fixes

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-07 10:50:31 +02:00
Vladyslav Vildanov b38a9f6441 Add support for TDIGEST.RANK command (#1103)
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-07 09:55:37 +02:00
shacharPash 251f60435b Extended support by implementing TDIGEST.MIN command (#1100)
* add support for CF.ADDNX

* fix key name

* fix wrong command

* Pulling changes

* Support TDIGEST.MIN
2023-02-06 14:48:39 +02:00
Vladyslav Vildanov 8b673b56f0 Extended support by implementing TDIGEST.MAX command (#1099)
* Added support for TDIGEST.MAX command

* Codestyle fixes

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-06 12:30:57 +02:00
Vladyslav Vildanov 555065eb2f Added support for TDIGEST.CDF command (#1098)
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-06 11:36:50 +02:00
Vladyslav Vildanov 359cd9d813 Extended TDigest support by implementing TDIGEST.BYREVRANK command (#1097)
* Added support for TDIGEST.BYREVRANK command

* Codestyle fixes

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-06 11:06:23 +02:00
Vladyslav Vildanov 1313a1b4c2 Added support for TDIGEST.BYRANK command (#1096)
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-06 10:09:18 +02:00
Vladyslav Vildanov cf539f9ea7 Extended TDigest Sketch support by implementing TDIGEST.ADD command (#1094)
* Added support for TDIGEST.ADD command

* Codestyle fixes

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-03 16:52:46 +02:00
Vladyslav Vildanov 43ecf3f4fb Added support for TDigest sketch, added TDIGEST.CREATE, TDIGEST.INFO commands (#1093)
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-03 12:13:42 +02:00
Vladyslav Vildanov 1661903cba Extended Count-Min Sketch support by implementing CMS.MERGE command (#1092)
* Added support for CMS.MERGE command

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-02 16:08:26 +02:00
Vladyslav Vildanov acc1dd0cb8 Extended Count-Min Sketch support by implementing CMS.INCRBY and CMS.QUERY commands (#1091)
* Added support for CMS.INCRBY and CMS.QUERY commands

* Codestyle fixes

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-02 14:54:12 +02:00
Vladyslav Vildanov e831c71cc6 Extended Count-Min Sketch support by implementing CMS.INITBYPROB command (#1090)
* Added support for CMS.INITBYPROB command

* Codestyle fixes

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-02 14:50:39 +02:00
Vladyslav Vildanov 5304ad95e8 Added support for Count-Min Sketch with base commands CMS.INITBYDIM, CMS.INFO (#1088)
* Added support for Count-Min Sketches submodule, added support for CMS.INITBYDIM adn CMS.INFO commands

* Codestyle fixes

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-02 11:20:48 +02:00
Vladyslav Vildanov d04f06a2a3 Added support for CF.INSERTNX command (#1087)
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-01 14:55:23 +02:00
Vladyslav Vildanov ac8e021c57 Added support for CF.LOADCHUNK, CF.SCANDUMP commands (#1085)
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-01 13:51:45 +02:00
Vladyslav Vildanov 7eb464a0dd Extended CuckooFilters support by implementing CF.RESERVE command (#1086)
* Added support for CF.RESERVE command

* Codestyle fixes

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-01 13:46:37 +02:00
Vladyslav Vildanov 1b8a3cd28c Extended BloomFilters support by implementing CF.INSERT command (#1083)
* Added support for CF.INSERT command

* Override argument position offset value to default one

* Codestyle fixes

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-01 12:04:18 +02:00
Vladyslav Vildanov 4284409c7b Added support for CF.DEL command (#1080)
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-02-01 09:14:50 +02:00
Vladyslav Vildanov 29350952d0 Added stream commands to KeyPrefixProcessor (#1051)
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-01-31 08:50:14 -08:00
Vladyslav Vildanov 98222f47b0 Added support for container commands (#1049)
* Added support for container commands FUNCTION LOAD, FUNCTION DELETE and FCALL

* Changed ContainerInterface and AbstractContainer

* Re-implement logic of abstract methods

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-01-31 08:48:48 -08:00
Vladyslav Vildanov 92d4306dc4 Added support for CF.INFO command (#1082)
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-01-31 16:12:18 +02:00
shacharPash 00248ea3db Support CF.MEXISTS Command (#1081)
* add support for CF.ADDNX

* fix key name

* fix wrong command

* Support CF.MEXISTS Command

* fix test

* Add more assertions
2023-01-31 16:02:30 +02:00
Vladyslav Vildanov eb4c5c349d Added support for CF.COUNT command (#1052)
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-01-31 14:31:54 +02:00
shacharPash 0bdfcddcc1 Add Support for CF.ADDNX (#1048)
* add support for CF.ADDNX

* fix key name

* fix wrong command
2023-01-31 13:25:48 +02:00
Till Krüss 38e955bc26 fix deprecated call 2023-01-29 11:58:46 -08:00
Vladyslav Vildanov db65e5ebd3 Extended core support by implementing SORT_RO command (#1044)
* Added support for SORT_RO command

* Codestyle fixes

* Added command description

---------

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-01-29 11:38:30 -08:00
Vladyslav Vildanov c57fe5e2b2 Extending RedisJson support by implementing JSON.FORGET command (#1012)
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.FORGET command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-26 17:40:28 +02:00
Vladyslav Vildanov 76b685a11c Extended RedisJson support by implementing JSON.TYPE command (#1010)
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.TYPE command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-26 17:34:15 +02:00
Vladyslav Vildanov fbd52c26e1 Extended RedisJson support by implementing JSON.TOGGLE command (#1008)
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.TOGGLE command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-26 17:28:47 +02:00
Vladyslav Vildanov e29ee802d6 Extended RedisJson support by implementing JSON.RESP command (#1006)
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.RESP command

* Removed debugger

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-26 17:19:11 +02:00
Vladyslav Vildanov 9a7490e3af Extended RedisJson support by implementing JSON.CLEAR command (#1004)
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.CLEAR command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-26 17:12:05 +02:00
Vladyslav Vildanov c72fda22e1 Extended RedisJson support by implementing JSON.ARRTRIM command (#936)
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.ARRTRIM command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-26 17:04:05 +02:00
Vladyslav Vildanov 653d62ab40 Extended RedisJson support by implementing JSON.ARRPOP command (#933)
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.ARRPOP command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-26 16:42:12 +02:00
Vladyslav Vildanov eed7fe6a76 Extended RedisJson support by implementing JSON.ARRLEN command (#931)
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Add support for JSON.ARRLEN command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-26 16:35:47 +02:00
Vladyslav Vildanov 34f40663ea Extended RedisJson support by implementing JSON.ARRINSERT command (#929)
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.ARRINSERT command

* Revert changes

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-26 16:27:24 +02:00
Vladyslav Vildanov 1467c5bac0 Extended RedisJson support by implementing JSON.ARRINDEX command (#927)
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.ARRINDEX command

* Codestyle fies

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-26 16:17:47 +02:00
Vladyslav Vildanov b9b312d94a Extended RedisJson support by implementing JSON.ARRAPPEND command (#924)
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.ARRAPPEND command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-26 16:10:02 +02:00
Vladyslav Vildanov 1ee196134e Extended RedisJson support by implementing JSON.NUMINCRBY command (#919)
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.NUMINCRBY command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-26 15:57:23 +02:00
Vladyslav Vildanov 7ca3a05598 Extended RedisJson support by implementing JSON.STRLEN command (#917)
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.STRLEN command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-26 15:50:11 +02:00
Vladyslav Vildanov 3abde58f60 Extended RedisJson support by implementing JSON.STRAPPEND command (#915)
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.STRAPPEND command

* Codestyle fix

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-26 15:44:03 +02:00
Vladyslav Vildanov e486f8a7e1 Extended RedisJson support by implementing JSON.OBJLEN command (#913)
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.OBJLEN command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-26 15:34:59 +02:00
Vladyslav Vildanov 729598e37b Extended RedisJson support by implementing JSON.OBJKEYS command (#911)
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Add support for JSON.OBJKEYS command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-26 15:25:33 +02:00
Vladyslav Vildanov f126f0b567 Extended RedisJson support by implementing JSON.DEL command (#909)
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.DEL command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-26 15:17:47 +02:00
Vladyslav Vildanov 9bedabebd5 Extended Redis JSON support by implementing JSON.MGET (#892)
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* Added support for JSON.MGET command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-26 15:09:48 +02:00
Vladyslav Vildanov 5707784900 Extended Bloom Filter support by implementing BF.INSERT command (#891)
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Added support for BF.ADD and BF.EXISTS commands

* Added support for BF.INFO command

* Fixed arguments data provider

* Fixed bug with incorrect tests skip

* Added support for BF.RESERVE command

* Added command description

* Added support for BF.INSERT command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-26 15:01:56 +02:00
Vladyslav Vildanov e20ebaf8fb Extended Bloom Filters by implementing BF.LOADCHUNK command (#890)
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Added support for BF.ADD and BF.EXISTS commands

* Fixed bug with incorrect tests skip

* Added support for BF.SCANDUMP command

* Added support for BF.LOADCHUNK command

* Codestyle fixes

* Sort alphabetical

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-26 14:52:49 +02:00
Vladyslav Vildanov 87ef63e9da Extended Bloom Filter by implementing BF.SCANDUMP command (#889)
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Added support for BF.ADD and BF.EXISTS commands

* Fixed bug with incorrect tests skip

* Added support for BF.SCANDUMP command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-26 14:41:14 +02:00
Vladyslav Vildanov 549b4414c4 Extended Bloom Filters by implementing BF.RESERVE command (#888)
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Added support for BF.ADD and BF.EXISTS commands

* Added support for BF.INFO command

* Fixed arguments data provider

* Fixed bug with incorrect tests skip

* Added support for BF.RESERVE command

* Added command description

* Codestyle fixes

* Added missing test

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-26 14:25:10 +02:00
Vladyslav Vildanov f82bee9a81 Extend Bloom filters by imlplementing BFMADD and BFMEXISTS commands (#887)
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Added support for BF.ADD and BF.EXISTS commands

* Fixed bug with incorrect tests skip

* Added support for BF.MADD and BF.MEXISTS commands

* Removed old file

* Revert changes

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-26 11:19:31 +02:00
Vladyslav Vildanov 1170d09ac5 Extended Bloom filters by implementing BF.INFO command (#886)
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Added support for BF.ADD and BF.EXISTS commands

* Added support for BF.INFO command

* Fixed arguments data provider

* Fixed bug with incorrect tests skip

* Added command description

* Removed unused import

* Removed old directory

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-26 10:40:20 +02:00
Vladyslav Vildanov ca498b67a1 Added support for Cuckoo Filter, added CF.ADD and CF.EXISTS commands (#907)
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Added support for BF.ADD and BF.EXISTS commands

* Fixed bug with incorrect tests skip

* Changed module name according to original naming

* Added support for CF.ADD and CF.EXISTS commands

* Removed old files

* Revert old changes

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-25 18:48:14 +02:00
Vladyslav Vildanov 50e005bfe3 Added support for new arguments for EXPIRE, EXPIREAT commands (#1046) 2023-01-25 08:00:23 -08:00
Vladyslav Vildanov c541617333 Added support for new arguments for BITPOS, BITCOUNT commands (#1045) 2023-01-25 07:59:44 -08:00
Vladyslav Vildanov 7b7e93a53f Added support for Bloom Filters module, added support for BF.ADD, BF.EXISTS commands (#874)
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Added support for BF.ADD and BF.EXISTS commands

* Fixed bug with incorrect tests skip

* Changed module name according to original naming

* Revert some old changes

* Fixed misspelling

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-25 17:37:21 +02:00
Vladyslav Vildanov f8797aaa29 Added support for Redis JSON module commands, added JSON.SET and JSON.GET commands (#868)
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object

* Fixed test, added dependecies

* Added resolved command to commands array

* Used aggregation approach for modules

* Added decorator to check Redis JSON module version

* Added support for JSON.SET and JSON.GET commands

* Added separate workflow for redis-stack tests

* Changed docker imange name to correct one

* Fixed indentation

* Added test coverage for JSON.GET command

* Changed module version resolving using annotations mapping

* Re-written CommandResolver test

* Update ClientInterface.php

* Changes to CI, readme, removed unused modules from configuration

* Fixed build badge URL

* Refactored annotation check to be generic for each module

* Fixed bug with incorrect tests skip

* Fixed naming issue with nxXx argument

* Removed redundant trait

* Fixed NxXxArgument test

* add Redis stack tests

* don't run tests twice

* use

* Update stack.yml

* Rename workflows

* Added version 6.x to workflow

* Removed exception thrown to avoid version bug

* Resolve conflicts within tests.yml

* Codestyle fixes

* Removew trailing whitespaces

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-25 14:51:22 +02:00
Till Krüss 0a8e0c2f96 remove CONTRIBUTING file 2023-01-21 17:20:25 -08:00
Till Krüss 793de36822 Update README.md 2023-01-21 17:17:25 -08:00
Till Krüss fa13640ddd try another format 2023-01-21 17:05:13 -08:00
Viktor Szépe 5331d943fe Upgrade static analysis to PHPStan level 2 (#1043)
* Upgrade static analysis to PHPStan level 2

* Fix CS and CI

* Fix coverage path

* Start debugging

* Stop debugging
2023-01-21 17:03:53 -08:00
Viktor Szépe 74d5ad22dd Add Coverage badge to README (#1042) 2023-01-21 15:59:53 -08:00
Till Krüss a04bcb94fc try different license format 2023-01-21 14:10:06 -08:00
Till Krüss 9f77e5178f fix license header 2023-01-21 14:08:25 -08:00
Viktor Szépe ac259bdb6f Add complete CI (#1036)
* Add complete CI

* Fix CI

* Fix spelling

* Fix indentation

* Fix CI

* Fix CI

* Revert disabling unit tests

* Add coverage driver to CI

* Start coverage debugging

* Fix debugging
ignored, and an empty message aborts the commit.

* Stop debugging

* Move TODO-s from source to GitHub issues

* Ignore too long lines in certain files

* Revert requiring php-parallel-lint/php-parallel-lint

* formatting

* try shorter formatting

* formatting

* fix syntax

* try two paths?

* Update .editorconfig

Co-authored-by: Viktor Szépe <viktor@szepe.net>

* indentation

* make it a group

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-21 13:22:13 -08:00
Till Krüss 6e45ca5154 Create README.md 2023-01-21 13:17:31 -08:00
Viktor Szépe c201af5ad3 Fix PHPStan level 2 problems (#1025)
* Fix almost all PHPStan level 2 problems

* Fix master loop and remove empty line

* Fix variadic functions

* Fix CS

* Disable xdebug in CI and improve a condition

* Fix CI fix
2023-01-20 14:20:53 -08:00
Vladyslav Vildanov 1c6c5feb3a Extended core support by implementing EVALSHA_RO command (#1034) 2023-01-20 11:15:39 -08:00
Vladyslav Vildanov a8c5794b8a Added support for LCS command (#1035) 2023-01-20 11:14:50 -08:00
Vladyslav Vildanov ccc2860ad2 Added support for EVAL_RO command (#1032) 2023-01-20 11:13:46 -08:00
Till Krüss 1cd78095e6 drop phpcs version to 3.3 for php 7.2 support 2023-01-19 09:49:27 -08:00
Till Krüss f6f4830b3c tweak composer config 2023-01-19 09:28:33 -08:00
Vladyslav Vildanov e3ad353125 Extended Sets support by implementing SINTERCARD command (#1027)
* Added support for SINTERCARD command

* Codestyle fixes, added support for php-cs-fixer

* Moved php-cs-fixer dependency to dev

* Removed trailed comma

* Added support for php 7.2

* update scripts

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-19 09:17:15 -08:00
Vladyslav Vildanov e00d1a0bd3 Added support for EXPIRETIME command (#1029)
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-01-19 09:15:20 -08:00
Vladyslav Vildanov 64604de751 Added support for PEXPIRETIME command (#1031)
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-01-19 09:14:55 -08:00
Viktor Szépe 20dcb4bb73 Fix LICENSE file (#1026)
GitHub has problems with it
`curl "https://api.github.com/repos/predis/predis" -H "Accept: application/vnd.github.drax-preview+json" -s | jq '.license'`
2023-01-18 16:03:08 -08:00
Fran Moreno 3daf75508d Add phpstan level 0 (#1022)
* Remove unused arguments

* Fix return types

* Removed unused parameter and argument

* Add phpstan job

* merge files

* Delete phpstan-baseline.neon

* Delete static-analysis.yml

* merge workflows

* Update composer.json

* format yaml

* install composer reps

* fix yaml

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-18 13:33:51 -08:00
Till Krüss 7a4b3d1d0f Update .editorconfig 2023-01-18 13:27:04 -08:00
Till Krüss 3cf958580a Update .editorconfig 2023-01-18 13:26:53 -08:00
Fran Moreno d6dc6e51e1 Add CS job (#1024)
* Add CS job

* Apply PHP71Migration ruleset
2023-01-18 10:02:26 -08:00
Till Krüss 113145f306 more code formatting 2023-01-17 15:08:18 -08:00
Till Krüss 47a7cbc862 unify code formatting 2023-01-17 15:08:18 -08:00
Till Krüss 3c8a811ca3 update examples 2023-01-17 15:08:18 -08:00
Till Krüss f4bd6d44b1 update cs-fixer config 2023-01-17 15:08:18 -08:00
Till Krüss 6b6179ee44 don’t run tests twice 2023-01-17 15:08:18 -08:00
Till Krüss 82791e55e1 format tests 2023-01-17 15:08:18 -08:00
Till Krüss ea7698e12f use single quotes 2023-01-17 15:08:18 -08:00
Till Krüss af2e5cc553 order imports 2023-01-17 15:08:18 -08:00
Till Krüss b1009f46ac unify spacing 2023-01-17 15:08:18 -08:00
Till Krüss a09da4f3b0 trailing multiline commas 2023-01-17 15:08:18 -08:00
Till Krüss 06c00ac43f import global namespace 2023-01-17 15:08:18 -08:00
Till Krüss f3deda22cd no @link tags 2023-01-17 15:08:18 -08:00
Till Krüss c412594217 align phpdoc vertically 2023-01-17 15:08:18 -08:00
Till Krüss cc40219268 use short array syntax 2023-01-17 15:08:18 -08:00
Till Krüss 31b65f614b Remove @author tags 2023-01-17 13:41:35 -08:00
Till Krüss c9babb1984 update copyright comments 2023-01-17 13:41:35 -08:00
Till Krüss c2af9427c5 update MIT license template 2023-01-17 13:41:35 -08:00
Till Krüss c5b60884e8 tag v2.1.1 2023-01-17 12:57:35 -08:00
Till Krüss 836ab07d40 Fix support options array in ZINTERSTORE and ZUNIONSTORE (#1018)
* support old options array

* fix zinterstore as well

* single override
2023-01-17 12:50:15 -08:00
Fran Moreno 2bfc8a9316 Fix Client template (#1017) 2023-01-17 12:48:39 -08:00
Till Krüss d21576669d remove phpiredis suggestion 2023-01-17 09:42:23 -08:00
Till Krüss 65fe24e346 bump version 2023-01-17 09:42:15 -08:00
Till Krüss fbf270156f tweak workflow formatting 2023-01-16 15:33:05 -08:00
Till Krüss 24630fbd5b tag 2.1.0 2023-01-16 15:21:30 -08:00
Till Krüss bded73f516 tweak release draft template [skip ci] 2023-01-16 15:21:19 -08:00
Till Krüss 6a3f4a4c08 Update release-drafter-config.yml 2023-01-16 15:12:32 -08:00
Vladyslav Vildanov 47896f1be7 Extended core support by implementing BLMPOP command (#1015)
* Added support for LMPOP command

* Added support for BLMPOP command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-01-16 08:46:59 -08:00
erikn69 586b039289 Fix builds badge (#1014) 2023-01-16 08:45:19 -08:00
Vladyslav Vildanov d1acca607e Added support for LMPOP command (#1013)
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2023-01-16 08:45:04 -08:00
Vladyslav Vildanov 721c829042 Extended server functionality by implementing FAILOVER command (#875)
* Added arrayable arguments classes

* Updated count trait to accept additional modifier argument

* Added new With traits, moved into separate directory

* Added traits for geo command arguments resolving

* Remove BaseWith trait, not working with traits nesting

* Added AscDesc trait

* Rename AscDesc traint into Sorting

* Fixed trait keyword

* Removed unnecessary traits

* Updated count trait to handle default argument value

* Fixed With traits offset check condition

* Added GeoFrom, GeoBy traits

* Fixes for Count and Sorting traits

* Fixed variable names in with traits

* [WIP] Added GEOSEARCH command support, without test coverage

* Changed functionality to support only lower case units (Redis 6.0 support)

* Changed namespace for WITHSCORES trait

* Added more test coverage, added response parsing

* Added test coverage for tratis

* Added support for FAILOVER command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2022-12-29 12:19:17 -08:00
Vladyslav Vildanov b8cc7c643a Extended Key Space support by implementing COPY command (#866)
* Added support for COPY command

* Revert getCLient signature changes, used createClient instead

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2022-12-29 12:18:08 -08:00
Vladyslav Vildanov b47aa7ad3a Extended Geospatial support by implementing GEOSEARCHSTORE command (#873)
* Added arrayable arguments classes

* Updated count trait to accept additional modifier argument

* Added new With traits, moved into separate directory

* Added traits for geo command arguments resolving

* Remove BaseWith trait, not working with traits nesting

* Added AscDesc trait

* Rename AscDesc traint into Sorting

* Fixed trait keyword

* Removed unnecessary traits

* Updated count trait to handle default argument value

* Fixed With traits offset check condition

* Added GeoFrom, GeoBy traits

* Fixes for Count and Sorting traits

* Fixed variable names in with traits

* [WIP] Added GEOSEARCH command support, without test coverage

* Changed functionality to support only lower case units (Redis 6.0 support)

* Changed namespace for WITHSCORES trait

* Added more test coverage, added response parsing

* Added support for GEOSEARCHSTORE command

* Added test coverage for tratis

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Chayim <chayim@users.noreply.github.com>
2022-12-29 12:16:51 -08:00
Vladyslav Vildanov bb65b31580 Extend Geospatial support by implementing GEOSEARCH command (#867)
* Added arrayable arguments classes

* Updated count trait to accept additional modifier argument

* Added new With traits, moved into separate directory

* Added traits for geo command arguments resolving

* Remove BaseWith trait, not working with traits nesting

* Added AscDesc trait

* Rename AscDesc traint into Sorting

* Fixed trait keyword

* Removed unnecessary traits

* Updated count trait to handle default argument value

* Fixed With traits offset check condition

* Added GeoFrom, GeoBy traits

* Fixes for Count and Sorting traits

* Fixed variable names in with traits

* [WIP] Added GEOSEARCH command support, without test coverage

* Changed functionality to support only lower case units (Redis 6.0 support)

* Changed namespace for WITHSCORES trait

* Added more test coverage, added response parsing

* Added test coverage for tratis

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Chayim <chayim@users.noreply.github.com>
2022-12-28 09:10:03 -08:00
Vladyslav Vildanov e540ca062b Added support for SISMEMBER command (#871)
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2022-12-23 11:18:50 -08:00
Vladyslav Vildanov 9c543ef5b1 Added support for HRANDFIELD command (#870)
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2022-12-23 11:18:33 -08:00
Vladyslav Vildanov 83fb0020a1 Added support for GETEX command (#872)
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2022-12-23 11:17:24 -08:00
Vladyslav Vildanov 4a77aea9ef Added support for GETDEL command (#869)
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2022-12-20 09:32:58 -08:00
Vladyslav Vildanov 72bc11eb63 Extended Sorted Set support by adding ZINTER command (#859)
* Refactored zinterstore, zunionstore commands and command traits

* Merge conflicts resolve, update cluster strategy test with new arguments

* Updated assertion in case if command executed faster then duration minimal threshold

* Added support for ZINTER command

* Added command link and description

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2022-12-14 08:54:30 -08:00
Vladyslav Vildanov f26fd899f9 Extend Sorted Set support by implementing BZPOPMAX command (#864)
* Refactored zinterstore, zunionstore commands and command traits

* Merge conflicts resolve, update cluster strategy test with new arguments

* Updated assertion in case if command executed faster then duration minimal threshold

* Updated Keys trait to handle cases when no numkeys modifier needed

* Added support for BZPOPMIN command

* Added command link and description

* Added support for BZPOPMAX command

* Added absract command to fix inheritance chain

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2022-12-13 10:26:47 -08:00
Vladyslav Vildanov 65447807ed Extended Sorted Set support by adding ZUNION command (#860)
* Refactored zinterstore, zunionstore commands and command traits

* Merge conflicts resolve, update cluster strategy test with new arguments

* Updated assertion in case if command executed faster then duration minimal threshold

* Added support for ZUNION command

* Added command link and description

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2022-12-13 08:41:56 -08:00
Vladyslav Vildanov 5418cd5813 Extended Sorted Set support by adding BLMOVE command (#865)
* Added support for LMOVE command

* Added support for BLMOVE command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2022-12-13 08:38:35 -08:00
Vladyslav Vildanov bc5892e260 Extended Sorted Set support by adding BZPOPMIN command (#862)
* Refactored zinterstore, zunionstore commands and command traits

* Merge conflicts resolve, update cluster strategy test with new arguments

* Updated assertion in case if command executed faster then duration minimal threshold

* Updated Keys trait to handle cases when no numkeys modifier needed

* Added support for BZPOPMIN command

* Added command link and description

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2022-12-12 08:38:26 -08:00
Vladyslav Vildanov 7c0cc7bdbe Extended Sorted Set support by adding ZINTERCARD command (#861)
* Refactored zinterstore, zunionstore commands and command traits

* Merge conflicts resolve, update cluster strategy test with new arguments

* Updated assertion in case if command executed faster then duration minimal threshold

* Updated Limit trait to handle integer values

* Updated Limit trait to return previous arguments if limit argument isn't set

* Added support for ZINTERCARD command

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2022-12-12 08:38:06 -08:00
Vladyslav Vildanov 87ecd7bde2 Added support for LMOVE command (#863)
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2022-12-12 08:37:28 -08:00
Vladyslav Vildanov f9e77a0562 Refactored ZUNIONSTORE, ZINTERSTORE, removed Numkeys trait, improved Withscores response parsing (#858) 2022-12-09 07:37:22 -08:00
Vladyslav Vildanov d2b05ff58a Added mixin annotations for traits (#835)
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2022-12-07 09:19:04 -08:00
Chayim e24ecbbf90 Fixing the release drafter, to honour the main branch (#857) 2022-12-07 12:08:16 +02:00
Vladyslav Vildanov 9f3bdd5616 Extend Sorted Set support by implementing ZRANGESTORE command (#829)
* Added support for ZRANGESTORE command

* Added missing test coverage, added new filter method

* Added test coverage for new traits

* Updated offset for unexpected value tests

* Added missing offset

* Removed version annotation for inconsistency

* Update ZDIFF.php

* Update ZRANGESTORE.php

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2022-12-06 08:40:06 -08:00
Chayim 57a24413c2 Adding the release drafter for release management (#811) 2022-12-05 09:25:47 -08:00
Vladyslav Vildanov 0e6126ba9d Added support for BZMPOP command (#833) 2022-12-05 08:33:43 -08:00
Vladyslav Vildanov 7904fed6da Added support for ZMPOP command (#831)
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2022-12-01 12:10:20 -08:00
Vladyslav Vildanov cfd6f030bc Extend Sorted Set support by implementing ZDIFFSTORE command (#828)
* Added support for ZDIFF, added new WITHSCORE trait

* Added trait to resolve numkeys argument

* Added trait for unpacking keys array

* Added static binding for Numkeys trait

* Added ZDIFFSTORE command support

* Changed access modifier type to more strict

* Removed version annotation for inconsistency

* Update ZDIFFSTORE.php

Co-authored-by: Vladislav <vladislav@Admins-MacBook-Pro.local>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2022-11-30 13:23:08 -08:00
Vladyslav Vildanov 35d18d739a Added response parser for WithScore trait (#830)
* Added response parser for WithScore trait

* Added test coverage for new method

Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2022-11-30 13:20:56 -08:00
Vladyslav Vildanov 573c54ac4c Extend Sorted Set support by implementing ZDIFF command (#826)
* Added support for ZDIFF, added new WITHSCORE trait

* Added trait to resolve numkeys argument

* Added trait for unpacking keys array

* Added static binding for Numkeys trait

* Changed access modifier type to more strict

Co-authored-by: Vladislav <vladislav@Admins-MacBook-Pro.local>
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
2022-11-28 13:16:30 -08:00
Vladyslav Vildanov 169604bf74 Extend Sorted Set support by implementing ZRANDMEMBER command (#825)
* Added support for ZRANDMEMBER, added test coverage

* Changed key to more specific on exception testing

Co-authored-by: Vladislav <vladislav@Admins-MacBook-Pro.local>
2022-11-21 08:37:04 -08:00
vladvildanov 94bd54b2af Extend Sorted Set support by implementing ZMSCORE (#823) 2022-11-17 07:48:16 -08:00
Josh England bdebad7d62 added annotations to suppress PHP 8.1 return type deprecation warning… (#810)
* added annotations to suppress PHP 8.1 return type deprecation warning for `IteratorAggregate::toIterator()`

* move import

Co-authored-by: Josh England <joshua.england@trinet.com>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2022-11-02 17:07:32 -07:00
Till Krüss 1a411d2ad7 back to dev version 2022-10-11 09:57:28 -07:00
Till Krüss 1400689df8 switch to actions/checkout@v3 [skip ci] 2022-10-11 09:56:57 -07:00
Till Krüss ff59f74581 bump version 2022-10-11 09:52:29 -07:00
Mehmet Tolga Avcioglu 1a0eb7ee85 sentinel default to no password when replica authentication is used (#807)
* set default nopass if password is not provided

* remove debug output

* added tests for noauth sentinel

* Update SentinelReplication.php

Co-authored-by: Mehmet Tolga Avcioglu <mehmet.avcioglu@pusula.net.tr>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2022-10-06 08:14:47 -07:00
Tobias Bengtsson bb6c1a7b6d Add partial support for Stream commands (#804)
Adds support for the following commands not related to groups/consumers:
XADD, XDEL, XLEN, XRANGE, XREVRANGE, XTRIM.
2022-09-27 09:39:17 -07:00
streamingsystems 42c33a406f Check if socket is resource before reading (#802) 2022-09-18 15:01:02 -07:00
Stefano Borghi 7ad74217c2 check resource before writing, w/ test (#800) 2022-09-16 17:03:13 -07:00
Alexandru Pătrănescu 72d7675563 improve PHP 8.2 support (#797)
* use static::class . '::<method>' instead of 'static::method'

* extract concatenation so it can be improved easier at a later point

one improvement at some point could be to replace static::class . '::<method>' with static::<method>(...) in PHP 8.1+

Co-authored-by: Alexandru Patranescu <alexandru.patranescu@payu.com>
2022-09-08 11:25:37 -07:00
Till Krüss 8b5fa92856 mention php version [no ci] 2022-09-06 07:34:14 -07:00
Till Krüss 076a62e3d3 bump version to 2.0.2 2022-09-06 07:32:44 -07:00
Dries Vints 85dc1752b7 PHP 8.2 Support (#796) 2022-09-06 07:13:46 -07:00
Till Krüss 7683215023 bump tag to v2.0.1 2022-09-04 14:57:36 -07:00
Till Krüss dd4ddf6504 Update CHANGELOG.md 2022-08-03 11:53:59 -07:00
Till Krüss 6468e6cc2e Update CHANGELOG.md 2022-08-03 11:51:22 -07:00
digital2real 12f6d30502 Add retry logic to support temporary redis cluster failure (#788)
* Add retry logic to support temporary redis cluster failure

* formatting

* Use exponential backoff retries.
$minRetryAfter cant be changed if needed with RedisCluster::setMinRetryAfter

* fix formating

* (hotfix) formaing + import import  \Predis\Response\Error and \Predis\Connection\ConnectionException

* Update RedisCluster.php

* formatting

* tweaks

* Update RedisCluster.php

* Update RedisCluster.php

* Update RedisCluster.php

* Update unit tests regarding renaming of "retryInterval"

* spacing

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2022-08-03 11:49:56 -07:00
Linc a602fc7425 Fix sentinel reconnect issue on long-running PHP processes (#784)
* Fix no sentinel server available for autodiscovery on Swoole

* Fix errors in PHPUnit 9.5

the reason: https://github.com/sebastianbergmann/phpunit/commit/68582043e149039cfa3596b42ed35753dcf54fb2?fbclid=IwAR1qy1jFNFeJ3hUt5k7XAflqyCTUTWZhEqVSeizkybVHUEqXjBZ1gJM739U

* add restart sentinel test
2022-07-12 09:44:28 -07:00
John Paul E. Balandan, CPA 4ec74cc5fe Declare $parameters property of Predis\Connection\Parameters (#781) 2022-06-29 07:58:14 -07:00
BrightQi 78fd4cb998 bugfix for srem type to accept array #779 (#780)
* bugfix for srem  type to accept array #779

* add test to test SREM accept members as array type #779
2022-06-28 08:23:35 -07:00
Tomáš Fedor 2a8dd6a7f1 Add array as possible return type to spop (#774)
* Add array as possible return type to spop

* Update ClientInterface.php

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2022-06-14 19:59:10 -07:00
Jayin Taung 7d7b3416a8 Add example for installing predis by Composer (#772)
* Add example for installing predis by Composer

* Update README.md

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2022-06-13 07:54:46 -07:00
Till Krüss 99c253733d tweak changelog format 2022-06-08 06:14:56 -07:00
Till Krüss 69bb8fa082 bump version to v2.0.0 stable 2022-06-08 06:11:35 -07:00
Josias Montag e5221fa13b Allow PubSub / MultiExec with Replication 2022-05-28 08:18:01 -07:00
Till Krüss 15244c9642 cleanup readme 2022-05-26 12:01:30 -07:00
Till Krüss 4cc119a03c tag 2.0.0-beta.1 2022-05-26 11:48:12 -07:00
Till Krüss 619890f715 fix test 2022-05-26 11:45:35 -07:00
Till Krüss b060d43157 port changes from v1.1 branch 2022-05-26 11:29:45 -07:00
Till Krüss a5ab2bce6b truncate changelog 2022-05-26 11:12:41 -07:00
Hubert Lenoir 89f20dc968 add TOUCH command (#767) 2022-05-23 08:46:48 -07:00
Michal Lulco 6af5394a89 Added ZPOPMIN and ZPOPMAX (#758)
* Added ZPOPMIN and ZPOPMAX

* Added ZPOPMIN and ZPOPMAX

* Applied patch
2022-05-16 08:00:06 -07:00
Zaher Ghaibeh c508086b0e remove redundant variables (#765) 2022-05-15 09:51:28 -07:00
Zaher Ghaibeh 3c01ccc94c Testing code against Redis 7 (#764)
* redis 7 init

fix typo

add the new returns

* having a full sentence for the exception message
2022-05-12 12:23:51 -07:00
Jordi Boggiano e382bedb27 Update method tags (#762) 2022-05-12 09:13:06 -07:00
Zaher Ghaibeh a2449da7c8 PHP 8.1 tests (#760)
* - init 8.1 tests
- adding `#[\ReturnTypeWillChange]`
- Fix deprecation message: strlen(): Passing null to parameter #1 ($string) of type string is deprecated
- null is not allowed
- cleanup
- default values should be same type

* Mirror `v1.1` fixes for these files

* add null as type too since we also accept null as default value

Signed-off-by: Zaher Ghaibeh <zaher@zaher.dev>

* revert back to assertNull

* Update CHANGELOG

* Update CHANGELOG.md

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2022-05-07 08:03:53 -07:00
♚ PH⑦ de Soria™♛ b3a5bdf940 Remove invalid input for actions/cache (#737)
https://github.com/actions/cache/blob/main/examples.md#php---composer
2022-01-14 08:22:59 -08:00
Georges.L 4c1aada5ae Updated set, setex, setexp type hint (#710) 2021-09-08 09:05:55 -07:00
Mehdi Baaboura 54775a0295 Update LICENSE (#704) 2021-07-19 09:27:37 -07:00
Ruslan Bekenev 367bd72a0b Test optional count argument for LPOP (#700)
First added in Redis 6.2
2021-06-09 09:46:24 -07:00
Till Krüss 1d7ccb64ab Merge pull request #670 from charescape/patch-1
Update README.md
2021-04-04 10:33:08 -07:00
Till Krüss e29ae9065f some spacing 2021-04-04 10:31:53 -07:00
Till Krüss 64fc7774c6 stick to PHPUnit 9.4.* for now
`getAnnotations()` was removed in 9.5:

https://github.com/sebastianbergmann/phpunit/commit/68582043e149039cfa3596b42ed35753dcf54fb2
2021-04-04 10:31:45 -07:00
Till Krüss 554c36b329 Merge pull request #688 from open-source-contributions/improve_assertions
Improve PHPUnit assertions
2021-04-04 10:20:39 -07:00
Till Krüss be9d477564 fix for Redis 6 error message 2021-04-04 10:16:44 -07:00
Till Krüss 0e4e8f41cc fix 2021-04-04 10:14:13 -07:00
Till Krüss aa0c30809b fix test when using Redis 6 2021-04-04 10:11:29 -07:00
Peter 20f8faee6f Improve PHPUnit assertions 2021-04-04 23:30:14 +08:00
Till Krüss aa436263f8 Merge pull request #684 from andrew-demb/patch-2
CommandInterface::parseResponse() can accept array and null argument
2021-03-09 08:43:59 -08:00
Till Krüss 3c8856b05a Merge pull request #683 from andrew-demb/patch-1
Status::get() always return self
2021-03-09 08:43:39 -08:00
Andrii Dembitskyi d935f6e5c2 CommandInterface::parseResponse() can accept array and null argument 2021-03-09 07:15:08 -05:00
Andrii Dembitskyi 87fcc69e7a Status::get() always return self 2021-03-09 07:09:15 -05:00
charescape 407ddeca92 Update README.md 2020-11-12 11:39:48 +08:00
Till Krüss 338ba6d73d Merge pull request #665 from danwall/patch-1
Fix typo
2020-09-26 19:08:13 -07:00
Dan Wall 25db9bfec5 Fix typo 2020-09-26 11:52:44 +10:00
Daniele Alessandri 0e9aeee90f Fix PhpiredisSocketConnection for PHP 8.
Removed is_resource() check as socket_create() now returns an object.
2020-09-20 15:29:16 +02:00
Daniele Alessandri f07f8d01fe Where the heck did my beloved flat-style for badges go? 2020-09-10 21:51:36 +02:00
Daniele Alessandri f133a3660c Various updates to options class and interface. 2020-09-10 21:23:45 +02:00
Daniele Alessandri fa44ff0846 Improve code used for client initialization.
Also provide a more detailed description of methods in phpdocs.
2020-09-10 21:23:10 +02:00
Daniele Alessandri 985343a992 Merge remote-tracking branch 'github/pr/656' into main
Local branch v2.0-clientoptions-aggregateconnections
2020-09-10 21:19:52 +02:00
Daniele Alessandri d954e9f43f Merge branch 'v1.1' into main 2020-09-10 21:16:58 +02:00
Daniele Alessandri 9e5371f5ce Back to development.
[ci skip]
2020-09-10 15:40:46 +02:00
Daniele Alessandri 8ca99f91e4 Update CHANGELOG and bump VERSION (v1.1.5) 2020-09-10 15:35:23 +02:00
Qusonann c778843b0d Fix zrevrangebyscore pipeline annotation
[ci skip]
2020-09-09 23:42:03 +02:00
Daniele Alessandri b3b81fce9f Merge remote-tracking branch 'github/pr/657' into main 2020-09-09 23:39:18 +02:00
Qusonann ccc2ea24cb Fix zrevrangebyscore pipeline annotation 2020-09-08 21:23:35 +03:00
Daniele Alessandri dca201291c Fix CHANGELOG for broken Markdown rendering.
[ci skip]
2020-09-05 16:50:25 +02:00
Daniele Alessandri 2e76410e65 Support password-based authentication for sentinel instances.
Password-based authentication for sentinels has been added in Redis 5.
Predis was actively ignoring any "password" parameter for sentinels when
creating connections to them to avoid issues when this parameter is set
in the default "parameters" array passed via client options, as they are
applied to **every** connection created by Predis (see #346).

We need to find a better way to specify a common password for sentinels
to be handled in a different way than the ones for Redis nodes. For now
each sentinel node protected by password must have an explicit password
set in its parameters list even if this password, by design, is the same
for all sentinels. Since we cannot use default "parameters" as explained
above but we still need to pass a common value for all sentinels an idea
could be using a dedicated client option like we did with "service", but
we will see later.

In this commit we also explicitly reset any "username" parameter as it
would trigger an `AUTH $username $password` but sentinels do not support
ACL authentication.

Fixes #594.
2020-09-05 16:25:06 +02:00
Daniele Alessandri ca468b785c Throw exception on FALSE passed to "replication" option.
While "replication" do accept values evaluating to TRUE, the same cannot
be said for values evaluating to FALSE. TRUE is used to tell the client
that we want replication handled using the default backend for unmanaged
replication setups. For using redis-sentinel the "sentinel" string value
must be passed.

Setting "replication" to FALSE led to a failure (and a PHP warning) on
client initialization because this condition was not handled properly.
Being able to do so would not make sense anyway: when the client does
not need to be set up to rely on replication, users simply have to omit
the option. Furthermore, users must always specify either "replication"
or "cluster" and not both with one of them set to FALSE.

Unfortunately options for aggregate connections in Predis v1.1 are a bit
of a mess, they did not scale well with the addition of new features and
are also quite inconsistent (e.g. "cluster" does not accept TRUE).

This has been largely fixed in Predis v2.0-dev but required implementing
a few breaking changes. It also means that this change does not need to
be ported to the main branch.

Addresses #381 using a different approach.
2020-09-05 14:18:30 +02:00
Daniele Alessandri b1ea4374d4 [tests] Fix the very few remaining warnings emitted by test suite.
Basically assertMatchesRegularExpression() replaces assertRegExp() which
has been deprecated since PHPUnit 9.1 and will be removed in PHPUnit 10,
unfortunately we still depend on PHPUnit 8.4 to support PHP 7.2 and this
version does not have assertMatchesRegularExpression() so we implemented
it in our base testcase class with a fallback to the old assertRegExp()
when tests are executed on older versions of PHPUnit.
2020-09-04 21:00:46 +02:00
Daniele Alessandri 4a7fb55058 [tests] Add utility method to skip tests on CI environment.
We still have disabled all PUB/SUB related tests on CI for now, until we
understand why they fail at random.

Backported from main branch (ref. 5133706, f723f67, eb8a89e)
2020-09-04 18:42:38 +02:00
Daniele Alessandri fdf663ebba Fix WebdisConnection with IPv4 hosts.
Apparently something changed since last time in cURL internals and now
an IPv4 wrapped by square brackets (which are used for IPv6 addresses)
returns a malformed request error.

m
2020-09-04 18:06:36 +02:00
Daniele Alessandri 880ad09cad Restore broken change from a few years ago.
After this change there was no check to prevent the user from using SSL
with PhpiredisStreamConnection (it does not work due to the fact that
internally is uses stream_socket_recvfrom()).

Pretty obvious phpiredis was not installed on my system when I made that
change or the test suite would have caught the wrong behaviour (like it
just happened now that I build it from scratch).
2020-09-04 18:05:26 +02:00
Daniele Alessandri e5f44c33a2 No need for socket_import_stream() to set TCP_NODELAY since PHP 7.1. 2020-09-04 17:56:19 +02:00
Daniele Alessandri 67487528eb Fix WebdisConnection with IPv4 hosts.
Apparently something changed since last time in cURL internals and now
an IPv4 wrapped by square brackets (which are used for IPv6 addresses)
returns a malformed request error.
2020-09-04 17:53:16 +02:00
Daniele Alessandri ac543999ef Restore broken change from a few years ago.
After this change there was no check to prevent the user from using SSL
with PhpiredisStreamConnection (it does not work due to the fact that
internally is uses stream_socket_recvfrom()).

Pretty obvious phpiredis was not installed on my system when I made that
change or the test suite would have caught the wrong behaviour (like it
just happened now that I build it from scratch).
2020-09-04 17:19:57 +02:00
Daniele Alessandri bffa1d020b [tests] Just a lone leftover... 2020-09-04 13:54:51 +02:00
Daniele Alessandri 9e48aef4b0 [tests] Adapt after changes in aggregate connection initialization.
See commit dd5d665 for the above mentioned changes.

Tests for Option\Aggregate, Option\Replication and Option\Cluster should
be refactored because code is a bit too repetitive and a bunch of tests
are shared among them (replication and cluster options extend aggregate
and share the same logic after all).
2020-09-03 15:12:34 +02:00
Daniele Alessandri dd5d665156 Dramatically improve aggregate connections initialization.
This is a complete overhaul of how aggregate connections are created and
initialized, now everything is self-contained in our usual 3 supported
client options: "aggregate", "cluster" and "replication".

The usage of callables acting as connection initializerss is now more
consistent through the various options. When the callable is invoked it
receives 3 arguments (the original set of connection parameters passed
by reference, the options container, the current option) and must return
an instance of Predis\Connection\AggregateConnectionInterface otherwise
an InvalidArgumentException is thrown.

When using "cluster" and "replication" the returned aggregate connection
is automatically populated by adding the list of nodes in $parameters,
on the other hand "aggregate" skips this automatism so it is up to the
user. In any case the user-supplied callable receives $parameters as a
reference, setting $parameters to NULL inside the body of the callable
makes the client skip automatic aggregation regardless of the option in
use.

In addition to this the actual procedure of adding nodes to an aggregate
connection has been moved directly into the respective options instead
of being spread between the client (which instead should just pass a set
of parameters and get back a fully-configured aggregate connection) and
the connection factory (and the scope of a connection factory is only to
create new connetion instances to single Redis servers).
2020-09-03 12:43:15 +02:00
Daniele Alessandri efbe80222e Merge remote-tracking branch 'github/pr/655' into main
Local branch v2.0-commandfactory-raw
2020-09-03 12:41:00 +02:00
Daniele Alessandri eb8a89ee7a [tests] Skip integration tests for DispatcherLoop on CI.
Same reason as of PubSub/Consumer, still need to investigate the random
failures. Anyone can help?
2020-09-03 12:33:12 +02:00
Daniele Alessandri f723f67c3f [tests] Use new utility method to skip PUB/SUB tests on CI. 2020-09-03 12:32:38 +02:00
Daniele Alessandri 5133706c36 [tests] Add utility method to skip tests on CI environment. 2020-09-03 12:31:53 +02:00
Daniele Alessandri ae1befb740 Merge remote-tracking branch 'github/pr/654' into main
Local branch v2.0-testsuite-improvements
2020-09-03 12:10:47 +02:00
Daniele Alessandri 0fdca9e805 Remove check for PHP <= 5.4 from Predis\Session\Handler. 2020-09-01 20:39:34 +02:00
Daniele Alessandri eabbd100c9 No need to check for PHP >= 7.0 anymore for persistent SSL.
Leaving assertParameters() for now but in general we should review how
connection backends are initialized to simplify things and remove some
protected methods, at least from base classes.
2020-09-01 20:21:11 +02:00
Daniele Alessandri 1285951243 Predis\Command\RawCommand is now a final class.
The behaviour of a raw command should not ever be overridden by users,
so this change is actually to enforce consistency through the library.
For the most part, raw commands are used internally by Predis to handle
management commands such as CLUSTER SLOTS, ROLE, etc...
2020-09-01 14:45:39 +02:00
Daniele Alessandri 6d6c970ae2 [tests] Replace deprecated TestCase::at().
The "at" matcher will be removed in PHPUnit 10 but it is not a bad thing
after all because it was cumbersome and error-prone.

Took the opportunity to improve some tests while converting them.
2020-09-01 14:03:19 +02:00
Daniele Alessandri c6f2ce4b83 [tests] Replace generic MockObject::will() with specialized methods. 2020-09-01 14:03:19 +02:00
Daniele Alessandri 36c9bb047e [tests] Start improving test suite.
- Make use of more typehints for function parameters
- Make use of typehints for function return values
- Use @var where needed to give proper hints to IDEs and avoid warnings
- Replace MockObject::setMethods() with addMethods() and onlyMethods()
- Rewording of some phpdocs
2020-09-01 13:58:14 +02:00
Daniele Alessandri 5eccc65d42 Fix handling of username when using "redis://".
The username is now correctly retrieved from the userinfo fragment of
the URI when using the "redis" scheme and a "username:password" pair is
present. Values retrieved from the userinfo fragment always override the
ones specified in `username` and `password` if those fields are present
in the query string.
2020-09-01 11:40:30 +02:00
Daniele Alessandri f225c55a01 Back to development.
[ci skip]
2020-08-31 12:39:52 +02:00
Daniele Alessandri c2ede30394 Merge remote-tracking branch 'github/pr/653' into main
Local branch v2.0-connections-phpiredisconfig
2020-08-31 10:54:40 +02:00
Daniele Alessandri c2c1812b87 Merge remote-tracking branch 'github/pr/651' into main
Local branch v2.0-commandfactory-reworkinterface
2020-08-31 10:54:19 +02:00
Daniele Alessandri 743be10f6e Merge remote-tracking branch 'github/pr/650' into main
Local branch v2.0-parameters-filterempty
2020-08-31 10:53:43 +02:00
Daniele Alessandri 7b86a7b54d Merge branch 'v1.1' into main 2020-08-30 23:40:36 +02:00
Daniele Alessandri dc067b3dac Extend "commands" option to support Predis\Command\RawFactory.
The option handler has been extended to accept descriptive string values
in order to create and configure an appropriate command factory.

Accepted string values are:

- "predis" creates the usual command factory
- "raw" creates a raw command factory
- "default" is simply an alias of "predis"
2020-08-30 15:24:12 +02:00
Daniele Alessandri 30a065ad86 Implement Predis\Command\RawFactory.
Any command ID will produce a command instance even for unknown commands
not implemented by Redis (the server will return a -ERR error response).

When using this factory the client does not process arguments before
sending commands to Redis and server responses are not further processed
before being returned to the caller.
2020-08-30 15:01:43 +02:00
Daniele Alessandri 8be2418f01 Update CHANGELOG and bump VERSION (v1.1.4) 2020-08-30 00:15:08 +02:00
Daniele Alessandri b9ebe8a376 [tests] Fix mistype in TODO comments.
... and yay for copypasting it too!
2020-08-30 23:26:42 +02:00
Daniele Alessandri e2d26926d2 Update README. 2020-08-30 21:33:14 +02:00
Daniele Alessandri 309248042f Update .gitignore
Removing annoying .phpunit.result.cache left around when switching back
and forth branches from main to v1.1 for development.
2020-08-30 10:38:47 +02:00
Daniele Alessandri 87452e62d0 Fix authentication to support ACL with Redis 6.0.
When passing both "username" and "password" to connection parameters the
client now uses the extended AUTH command to support ACL authentication
with Redis 6.0.

The plain old authentication method is still supported like usual simply
by passing only "password" to connection parameters.
2020-08-29 14:11:55 +02:00
Daniele Alessandri 31baa9b241 Do not push AUTH and SELECT on empty "password" and "database".
NULL or zero-length string values passed to "password" and "database" in
the connection parameters list do not trigger spurious AUTH and SELECT
commands anymore when connecting to Redis.

Fixes #436.
2020-08-29 13:39:12 +02:00
Daniele Alessandri bd68b55456 Merge remote-tracking branch 'github/pr/649' into main 2020-08-29 11:42:38 +02:00
Daniele Alessandri cc2a7657db Rework Predis\Command\FactoryInterface and related classes.
We have renamed most methods to drop the "command" suffix as it is quite
redundant. Due to this change and thanks to variadic methods introduced
with PHP 5.6 we took the opportunity to replace both "supportsCommand()"
and "supportsCommands()" with a single new method "supports()".

Added more stringent typehints for method arguments and typehints for
return values now that we do not need to support anything below PHP 7.2.
Also moved from using array() to [] in source code of class involved.
2020-08-28 14:23:12 +02:00
Daniele Alessandri 5348c4025e Merge remote-tracking branch 'github/pr/648' into main 2020-08-28 10:28:17 +02:00
Daniele Alessandri 6f942400a1 [tests] Skip integration tests for PUB/SUB consumer on CI.
Changes backported from the main branch (ref. 04d5c10, 5afadb5).

This is just a temporary solution, we will revert this change as soon as
the actual cause for the spurious failures is identified.
2020-08-27 17:44:23 +02:00
Daniele Alessandri 5afadb560f [tests] Skip testPubSubAgainstRedisServer on CI environments.
See 04d5c10.
2020-08-27 17:38:38 +02:00
Daniele Alessandri e58d5fceef Add "redis" scheme in configuration for phpiredis.
Forgot about it! While "redis" is perceived simply as an alias for "tcp"
it must be explicitly mapped in the connection factory.
2020-08-27 16:38:38 +02:00
Daniele Alessandri 56d704f5dd Add "default" as accepted string for "connections".
Using "default" returns a connection factory instance with the default
configuration. Basically it is no different than omitting "connections"
in the client options array but it can be useful when applications want
to automatically configure Predis to use phpiredis when it is loaded:

$client = new Predis\Client('tcp://127.0.0.1', [
  'connections' =>
      extension_loaded('phpiredis')
        ? 'phpiredis'
        : 'default'
]);

This is in response to ISSUE #397.
2020-08-27 15:59:14 +02:00
Daniele Alessandri 2c732c46c8 Make configuration easier for phpiredis based connections.
The "connections" client option now accepts certain string values that
are mapped to specific and most used configurations for the connection
factory. This is used to make it easier to configure Predis to load our
phpiredis-based connection backends without having to manually pass a
map of URI schemes and fully-qualified class names.

  - "phpiredis-stream" maps `tcp` and `unix` to the connection backend
    based on PHP streams (Predis\Connection\PhpiredisStreamConnection).
  - "phpiredis-socket" maps `tcp` and `unix` to the connection backend
    based on ext-socket (Predis\Connection\PhpiredisStreamConnection).
  - `phpiredis` is simply an alias of `phpiredis-stream`.

An InvalidArgumentException is thrown on unsupported string values.
2020-08-27 15:09:35 +02:00
Daniele Alessandri accb030eb5 [tests] Minor adjustments for callable connection initalizers. 2020-08-26 00:57:03 +02:00
Daniele Alessandri 04d5c10193 [tests] Skip testPubSubAgainstRedisServerBlocking on CI environments.
NOTE: this specific test fails at random without any apparent reason
when executed on our CI environments and these failures are not tied
to a particular version of PHP or Redis. It is most likely some weird
timing issue on busy systems as it is really rare to get it triggered
locally. The chances it is a bug in the library are pretty low so for
now we just mark this test skipped on our CI environments (but still
enabled for local test runs) and "debug" this issue using a separate
branch to avoid having spurious failures on main development branches
which is utterly annoying.

We will restore this test on CI environments as soon as we understand
what is the reason behind its random failures.
2020-08-25 17:52:19 +02:00
Daniele Alessandri 4e605ea233 Revert "[tests] Try fixing random failures in one test of PUB/SUB abstraction."
Whoops, wrong test :)

This reverts commit 5c2b31c566.
2020-08-25 17:47:23 +02:00
Daniele Alessandri 5c2b31c566 [tests] Try fixing random failures in one test of PUB/SUB abstraction.
These failures are random and rarely reproducible on a local development
environment but sometimes they affect the success of a test run and it's
annoying. I think it is just a weird timing issue on busy hosts so let's
try with a couple of simple usleep() after SUBSCRIBE and PUBLISH and see
if anything changes in the next few test runs.
2020-08-25 17:16:19 +02:00
Daniele Alessandri 030e8a080c Remove references to Phar from README.
We have removed the utility script for building phar archives out of the
repository, but if you still need to build a phar archive for Predis you
should still be able to use "./bin/create-phar" from the v1.1 branch.
2020-08-25 16:38:04 +02:00
Daniele Alessandri 15eadb3426 Merge branch 'v1.1' into main 2020-08-25 16:07:06 +02:00
Daniele Alessandri 5e220a0b57 Update CHANGELOG. 2020-08-25 15:57:51 +02:00
Daniele Alessandri 0eb2633348 Merge remote-tracking branch 'github/pr/554' into v1.1 2020-08-25 15:42:13 +02:00
Daniele Alessandri b014d5de5a Filter NULL and zero-length string values for parameters.
Having NULL values or zero-length strings for connection parameters does
not make much sense and actually it proved to be an issue with certain
parameters like "password" where an empty string would trigger an AUTH
command with an empty password (and obviously Redis was not happy with
that). The main offenders were a few libraries and frameworks that kept
passing empty values for parameters such as "database" and "password"
even when users left them unconfigured. This fix should make things more
robust and avoid such occurrences in the future.

Related to PR #436 (rejected).
2020-08-25 12:20:53 +02:00
Daniele Alessandri 78041126fc Merge remote-tracking branch 'github/pr/646' into main 2020-08-24 22:43:21 +02:00
Daniele Alessandri 7113e31954 Merge branch 'v2.0-merge-into-main' into main 2020-08-24 22:41:44 +02:00
Daniele Alessandri 6441f34ec5 Merge branch 'v1.1' into main 2020-08-24 22:36:38 +02:00
Daniele Alessandri cbbd6bba88 Update CHANGELOG.
[ci skip]
2020-08-24 22:33:48 +02:00
Daniele Alessandri 3702f24efc Fix more @method tags in interfaces. 2020-08-24 22:27:21 +02:00
Daniele Alessandri 82fefe057b Merge remote-tracking branch 'github/pr/456' into v1.1-annotations 2020-08-24 21:56:13 +02:00
Daniele Alessandri 42336537dc Merge remote-tracking branch 'github/pr/497' into v1.1 2020-08-24 17:10:28 +02:00
Daniele Alessandri 802abac55e Fix pear builder script to generate UTF-8 encoded package.xml.
Fixes issue #531.

[ci skip]
2020-08-24 16:20:06 +02:00
Daniele Alessandri 61e75816ce Apply few changes in .gitattributes file.
Remove .github from directories exported in our release packages and fix
to ignore .php_cs.dist (the actual file commited) instead of .php_cs.

[ci skip]
2020-08-24 14:04:10 +02:00
Daniele Alessandri 0ffaa864e1 Apply few changes in .gitattributes file.
Remove .github from directories exported in our release packages and fix
to ignore .php_cs.dist (the actual file commited) instead of .php_cs.

This also reverts commit 7489690 (slipped into main after merging v1.1),
we do not need it since there is no patching going on for PHPUnit after
our target version was bumped to ^8.0 || ^9.0 on main.
2020-08-24 14:00:05 +02:00
Daniele Alessandri c662ec7b2a Merge branch 'v1.1' into main 2020-08-24 12:03:34 +02:00
Daniele Alessandri 17f0c08cb6 [tests] Fix expected response for COMMAND INFO (Redis >= 6.0).
Starting with Redis 6.0 and the introduction of Access Control Lists,
COMMAND INFO returns an additional array for each specified command in
the request with a list of the ACL categories associated to a command.
2020-08-24 11:45:20 +02:00
Daniele Alessandri 2b8af1eef2 Update CHANGELOG. 2020-08-23 18:38:07 +02:00
Daniele Alessandri c5f2b441b4 Merge branch 'github/pr/545' into v1.1 2020-08-23 18:11:49 +02:00
GITSRC 2440a61cba Fix HashRing to use method defined by HashGeneratorInterface. 2020-08-23 18:09:09 +02:00
Daniele Alessandri 7100884201 Update CHANGELOG. 2020-08-23 17:48:38 +02:00
Daniele Alessandri 2a932d7292 Merge remote-tracking branch 'github/pr/556' into v1.1 2020-08-23 17:47:26 +02:00
Daniele Alessandri 0a6306b73e Back to development. 2020-08-23 17:46:12 +02:00
Peter Gribanov 4363345f7c iterate not iterable connections #552 2020-08-23 15:00:22 +03:00
Daniele Alessandri f06a41cfdc Change method to undefine commands in factory.
The previous implementation was not good because we were exposing in the
public API an internal implementation detail of the base factory class,
furthermore it made Predis\Command\Factory::define() confusing. Having a
separate method to undefine commands in the factory is self-explanatory.

We also changed `Predis\Configuration\Option\Commands` accordingly when
a dictionary of $commandID => $classCommand is passed to the "commands"
client option and $classCommand is NULL.

A few minor changes (mostly cosmetic or documentation) were applied too.

From feedback to PR #644.
2020-08-21 14:30:52 +02:00
Daniele Alessandri 5a7548bc81 Remove useless argument in Predis\Client::getClientBy().
There was no real meaning to have a callback here, for the most part it
was just a leftover of a previous approach implemented with ee7104d and
quickly superseded by the current approach that simply returns the new
client instance instead of using callbacks.

From feedback to #644.
2020-08-21 14:00:13 +02:00
Daniele Alessandri d4bcf912f4 [tests] Drop TODO and implement type check in utility method.
From feedback to PR #644.
2020-08-21 11:20:24 +02:00
Daniele Alessandri a772f0b16b [tests] Drop now useless method.
From feedback to PR #644.
2020-08-21 11:20:07 +02:00
Anatoly Pashin 44cf08e691 Fix PHPUnit installation on PHP 8 2020-08-20 17:53:34 +10:00
Till Krüss 2ce537d75e bump version to v1.1.3 2020-08-18 14:00:59 -07:00
Till Krüss 7489690306 include patch files in exports just to be safe
See #642
2020-08-18 13:55:36 -07:00
Till Krüss 371b481f12 Merge pull request #641 from heithemmoumni/patch-1
use present for copyright range
2020-08-18 08:30:48 -07:00
Till Krüss d5106c9f00 Update LICENSE
Co-authored-by: Anatoly Pashin <anatoly.pashin@gmail.com>
2020-08-18 08:30:33 -07:00
Daniele Alessandri 4b2b35202a [tests] Restore new message for failed assertion. 2020-08-18 16:12:45 +02:00
Daniele Alessandri c26909699b Merge remote-tracking branch 'github/pr/639' into main 2020-08-18 16:03:10 +02:00
moumni 593920085e use present for copyright range 2020-08-17 20:58:03 +01:00
Daniele Alessandri 592dd91454 Fix class name for OBJECT command.
Starting with PHP 7.2 "object" is a reserved word and cannot be used as
a name for classes, interfaces or traits.
2020-08-17 18:32:14 +02:00
Daniele Alessandri 33f5a0ec8c Merge branch 'stale-master' into main 2020-08-17 17:43:13 +02:00
Raza Mehdi 36a02cf807 Fix test. 2020-08-16 04:31:52 +05:00
Raza Mehdi d6ee18bf21 Merge remote-tracking branch 'github/main' into main 2020-08-16 02:04:16 +05:00
Raza Mehdi 5edf443141 Fix tests. 2020-08-16 01:59:41 +05:00
Till Krüss bf777f3529 Merge pull request #626 from predis/remove-pear
Remove PEAR/PHAR
2020-08-14 10:40:13 -07:00
Till Krüss 390adfb3b8 Merge branch 'main' into remove-pear 2020-08-14 10:39:52 -07:00
Till Krüss 25b6b824b4 update badges 2020-08-14 10:35:25 -07:00
Till Krüss d4a170d890 drop Travis 2020-08-14 10:27:07 -07:00
Till Krüss 71b2119436 bump version 2020-08-14 10:15:57 -07:00
Till Krüss 7376902b20 update org references 2020-08-14 10:11:49 -07:00
Till Krüss 7636d55e10 rename github org 2020-08-14 10:10:01 -07:00
Till Krüss 80191d6487 Merge pull request #634 from srmkliveforks/main
Setup Github Actions Workflows
2020-08-14 10:02:37 -07:00
Raza Mehdi 882d59001f Use PHPUnit 9. 2020-08-14 21:59:48 +05:00
Raza Mehdi f01a0cf5d0 Use specific php version. 2020-08-14 21:53:25 +05:00
Raza Mehdi 7d753f236a Move redis versions into matrix. 2020-08-14 18:36:08 +05:00
Raza Mehdi 7b1924528b Add Badge. 2020-08-14 17:51:06 +05:00
Raza Mehdi 9b355d1766 Use Redis 4 to 6. 2020-08-14 17:40:41 +05:00
Raza Mehdi 787d68f1c4 Set Github actions 2020-08-14 15:55:18 +05:00
Till Krüss ffadffb71c Merge pull request #628 from b1rdex/patch-1
Test on Redis 3-6
2020-08-13 08:45:29 -07:00
Till Krüss b637be9e4a ignore phpunit cache 2020-08-13 08:42:32 -07:00
Till Krüss 64937f725b get phpunit running 2020-08-13 08:41:43 -07:00
Till Krüss 44f98e6635 Merge pull request #631 from b1rdex/patch-2
Fix php version requirement
2020-08-13 08:08:26 -07:00
Anatoly Pashin 1eeef0e5d7 Change the php version constraint 2020-08-13 19:19:12 +10:00
Anatoly Pashin 5b4de508ba Fix php version requirement 2020-08-13 16:22:22 +10:00
Till Krüss c30c60d6f9 trigger travis
Travis CI wasn't set up during the move the `predishq`.
2020-08-12 19:56:40 -07:00
Anatoly Pashin 96e286aaf7 Test on Redis 3-6 2020-08-13 12:47:29 +10:00
Till Krüss 4edfda0669 remove single file script 2020-08-12 12:29:48 -07:00
Till Krüss 36e7cb487d remove patch files 2020-08-12 12:13:09 -07:00
Till Krüss 6cd919c43c remove pear stuff 2020-08-12 12:10:19 -07:00
Till Krüss 3104874887 Merge remote-tracking branch 'origin/v1.1' into main 2020-08-12 12:00:41 -07:00
Till Krüss a6bd25412e remove gitter badge 2020-08-12 12:00:08 -07:00
Till Krüss 3a3a7fb349 use correct php 8 id 2020-08-12 11:57:53 -07:00
Till Krüss 3d68a59505 remove hhvm badge
# Conflicts:
#	README.md
2020-08-12 11:57:52 -07:00
Till Krüss c380b434b0 readme tweaks
# Conflicts:
#	README.md
2020-08-12 11:57:31 -07:00
Till Krüss ca6daea582 add code of conduct 2020-08-12 11:55:34 -07:00
Till Krüss c85434bbbb bump phpunit from 4 to 8
# Conflicts:
#	composer.json
2020-08-12 11:55:33 -07:00
Till Krüss fa73623c75 drop php 7.1 and older; add php 8
# Conflicts:
#	.travis.yml
2020-08-12 11:54:28 -07:00
Till Krüss 60cc950a58 remove Predis\Async from readme 2020-08-12 11:53:52 -07:00
Till Krüss db82dd9f23 format psr-4 2020-08-12 11:53:12 -07:00
Till Krüss 1bc08d9bcc add funding to composer.json; update authors 2020-08-12 11:50:57 -07:00
Till Krüss 11e4bb44d0 more reference updates to predishq 2020-08-12 11:50:07 -07:00
Till Krüss cddb849812 remove gitter 2020-08-12 11:49:42 -07:00
Till Krüss f2298dd186 update references to predishq 2020-08-12 11:49:37 -07:00
Till Krüss bceda1d8e6 Merge pull request #625 from AhmedRaafat14/add-php8-support
Support PHP 8.0 in v1.1.x
2020-08-12 08:42:08 -07:00
Till Krüss 9f87c849c5 Update .travis.yml 2020-08-12 08:41:50 -07:00
Ahmed Raafat 1382146b03 Add php 8.0 (nightly) to the lines that is allowed to faoil (allow_failures) 2020-08-12 12:22:42 +02:00
Ahmed Raafat cbc08aa5e7 Add php 8.0 to travis 2020-08-12 11:45:43 +02:00
Till Krüss de9cd905bb Update issue templates 2020-08-11 12:05:47 -07:00
Till Krüss 6dd55d7f96 move cweagans/composer-patches as dev dep 2020-08-11 11:08:18 -07:00
Till Krüss 82eb18c6c3 bump version to 1.1.2 2020-08-11 10:28:15 -07:00
Till Krüss ac6b813ba9 Merge pull request #616 from nrk/support-php-74
Support PHP 7.4 in v1.1.x
2020-08-11 09:48:35 -07:00
Till Krüss 6482956d96 patch tests
Taken from: https://github.com/yiisoft/yii/pull/4306 by @samdark
2020-08-11 09:41:04 -07:00
Till Krüss cf15dd9857 add 7.4 to travis matrix 2020-08-11 08:55:49 -07:00
Till Krüss 597c61a098 fix out of range exception test 2020-08-11 08:43:17 -07:00
Till Krüss 9aa99349b1 Merge pull request #574 from matthewbaggett/v1.1-travis-fixup
V1.1 travis fixup
2020-08-11 08:30:12 -07:00
Till Krüss b6f60f0d72 add funding 2020-08-10 17:02:18 -07:00
Till Krüss 10235d62dc adjust error message regex 2020-08-10 13:48:17 -07:00
Till Krüss ec2b1eacd2 Merge pull request #614 from nrk/revert-611-patch-2
Revert "Bring travis config up to date"
2020-08-10 13:31:37 -07:00
Till Krüss 9c3605ab33 Merge pull request #613 from nrk/revert-610-patch-1
Revert "Add more build targets"
2020-08-10 13:31:20 -07:00
Till Krüss 55e6094954 Revert "Bring travis config up to date" 2020-08-10 13:31:03 -07:00
Till Krüss 15314b726b Revert "Add more build targets" 2020-08-10 13:30:45 -07:00
Till Krüss 292604edbf fix HHVM lowercase issue
Fatal error: Uncaught Error: Keyword __HALT_COMPILER must be written in lowercase
2020-08-10 13:02:49 -07:00
Till Krüss fc8f9f5604 Merge pull request #585 from gladx/v1.1
Fix test error exception for SELECT command
2020-08-10 12:41:25 -07:00
Till Krüss 77132e6c6b Merge pull request #589 from funivan/patch-1
Fix wiki link
2020-08-10 12:40:46 -07:00
Till Krüss a7571ef0c7 Merge pull request #583 from Miljan9602/v1.1
Fixed wrong annotation for spop method.
2020-08-10 12:40:27 -07:00
Till Krüss 4901408b08 Merge pull request #611 from hannesvdvreken/patch-2
Bring travis config up to date
2020-08-10 12:29:13 -07:00
Till Krüss dd3897b755 Merge pull request #610 from hannesvdvreken/patch-1
Add more build targets
2020-08-10 12:28:53 -07:00
Hannes Van De Vreken 6e7dbe05fb Bring travis config up to date 2020-07-29 03:33:50 +02:00
Hannes Van De Vreken f0f9d68a8e Add more build targets 2020-07-29 03:18:56 +02:00
Ivan Shcherbak bb6f1ee0e3 Fix wiki link 2019-11-25 14:23:35 +02:00
Ali Yousefi ffcc4bba8c Fix test error exception for SELECT command 2019-10-06 22:10:17 +03:30
Miljan Rakita 83359dff9a Fixed wrong annotation for spop method.
Spop method has return annotation string, but it returns array.
2019-09-10 19:26:00 +02:00
Matthew Baggett 710b4f901b Apparently 5.4 and 5.5 aren't available outside of trusty? 2019-08-09 11:54:35 +02:00
Matthew Baggett f3e46683b9 Sometimes, timing-related tests (read: KeyExpireAtTest::testCanExpireKeys) can fail but then succeed on a retry. So lets automate that retry. 2019-08-09 11:07:43 +02:00
Matthew Baggett 945e05819b Rejig. 2019-08-09 10:54:47 +02:00
Matthew Baggett a64b7354e1 Travis fixup 2019-08-09 10:37:19 +02:00
Mark Fettig 39ff616e86 update sort command to be a write operation 2019-03-18 12:10:26 -04:00
Geoffrey Hoffman 738ec0c50f Correcting the return type hint for BRPOPLPUSH method 2018-04-10 18:09:42 -07:00
Teoh Han Hui 1828222e27 Add null return value to PHPDoc 2017-08-14 19:36:11 +08:00
Daniele Alessandri 111d100ee3 Make examples scripts executable only via CLI.
This is meant as a basic layer of protection for those cases where the whole
Predis repository is cloned into a path which is publicly exposed by the web
server.

Closes #408
2017-07-12 16:39:17 +02:00
Daniele Alessandri 893215a1d4 Push same changes of #446 to Predis\ClientContextInterface.
This also adds a couple of missing changes into the original PR.
2017-07-12 15:34:57 +02:00
Daniele Alessandri f5d8b9fe2d Merge remote-tracking branch 'github/pr/446' into v1.1 2017-07-12 15:24:15 +02:00
Daniele Alessandri 722b513cea Upgrade .php_cs configuration file for php-cs-fixer 2.x 2017-07-12 15:22:58 +02:00
Daniele Alessandri 62774c6cc5 Merge remote-tracking branch 'github/pr/442' into v1.1 2017-07-12 13:37:06 +02:00
Daniele Alessandri 8aa2ded5b0 Merge remote-tracking branch 'github/pr/445' into v1.1 2017-07-12 13:36:17 +02:00
Daniele Alessandri 795c3e41b0 Merge remote-tracking branch 'github/pr/434' into v1.1 2017-07-12 13:31:24 +02:00
Daniele Alessandri 59e616b124 Remove broken badge.
Looks like hhvm.h4cc.de is dead.

[ci skip]
2017-07-12 13:30:52 +02:00
Daniele Alessandri 157f658f0b Fix iterators abstractions for HSCAN and ZSCAN when using PHP 7.2.
Closes #488.
2017-07-12 11:59:35 +02:00
Daniele Alessandri 343afd312a Fix wrong CRC16 calculated on integer value.
Closes #450.
2017-07-12 11:29:25 +02:00
Daniele Alessandri d77b77bbd9 Merge remote-tracking branch 'github/pr/443' into v1.1 2017-07-12 10:59:41 +02:00
gitomato 34b678192f Add string type to $keys argument
Reveals the ability to use a string for $keys argument.
2017-06-29 10:25:14 +02:00
Jorrit Schippers 4de246cfee Correct link to GitHub releases page 2017-06-27 09:35:15 +02:00
Anatoly Pashin 6fd6933580 Create .travis.yml 2017-06-11 00:28:43 +10:00
Anatoly Pashin c7b38abe71 use trusty dist 2017-06-09 18:05:11 +10:00
Anatoly Pashin 574ef78f86 fix typehint 2017-06-09 17:57:00 +10:00
Andrii Volin 1ebabaf8f8 fix typo in tests/README.md 2017-05-01 17:12:25 +03:00
Fabien Villepinte 3acf867cac Fix PHPDoc of \Predis\Connection\Aggregate\SentinelReplication::assertConnectionRole() 2016-11-22 15:33:03 +01:00
Daniele Alessandri 98ec0cc27e Merge remote-tracking branch 'github/pr/376' into v1.1
[ci skip]
2016-11-22 15:32:30 +01:00
orvice 9b7897b2da fix typo 2016-11-22 15:31:43 +01:00
Daniele Alessandri caf8a46cbb Merge remote-tracking branch 'github/pr/373' into v1.1
[ci skip]
2016-11-22 15:30:42 +01:00
Remi Collet ce2cbfd929 fix test for ArgumentCountError exception with PHP 7.1 2016-11-17 18:13:12 +01:00
Remi Collet 0b3af06e6b enable 7.1 on travis 2016-11-17 18:13:00 +01:00
Daniele Alessandri 944a16d7c0 Merge remote-tracking branch 'github/pr/393' into v1.1 2016-11-17 17:55:23 +01:00
Remi Collet d1290dfde0 fix test for ArgumentCountError exception with PHP 7.1 2016-11-17 15:24:54 +01:00
Remi Collet 9489d9e5aa enable 7.1 on travis 2016-11-17 15:12:24 +01:00
Fabien Villepinte 94ccb2cc3b Fix PHPDoc of \Predis\Connection\Aggregate\SentinelReplication::assertConnectionRole() 2016-09-14 17:20:55 +02:00
orvice 6c848db2a0 fix typo 2016-08-19 16:48:00 +08:00
Daniele Alessandri ea28d82681 More updates to README to reflect changes in parameters handling.
[ci skip]
2016-06-21 10:51:35 +02:00
Daniele Alessandri bb81f67a0f Update README to reflect changes in parameters handling.
[ci skip]
2016-06-20 18:14:00 +02:00
Daniele Alessandri a4d63e2510 [tests] Fix preassigned slots in slotmap tests. 2016-06-18 21:54:01 +02:00
Daniele Alessandri 89840412d5 [tests] Fix preassigned slots in cluster tests. 2016-06-18 21:53:49 +02:00
Daniele Alessandri 6ab10b2b70 [tests] Fix preassigned slots in cluster tests. 2016-06-18 21:51:10 +02:00
Daniele Alessandri 2d4377fc81 Back to development. 2016-06-18 21:37:42 +02:00
Daniele Alessandri 67c0fb8eb1 Separate id and alias in predis cluster (client-side sharding).
This change does not affect distribution but simply separates the two
concepts of connection ID (ip:port pair) and alias (value set via the
"alias" connection parameter), the method getConnectionByAlias() has
been added to reflect this change.

The method getConnectionBySlot() has also been added.
2016-06-18 17:12:20 +02:00
Daniele Alessandri 0a7ddf7bba Fix spacing in phpdocs. 2016-06-18 15:52:15 +02:00
Daniele Alessandri 184d583895 Implement the concept of role for connections.
When using replication backends, now the role of a connection is not
defined by its alias but by the new connection parameter "role" that
can be set to "master", "slave" and (for redis-sentinel) "sentinel".

This also led to a redesign of how connections can be retrieved from
replication backends: the method getConnectionById() now retrieves a
connection only by its ID (ip:port pair), to get a connection by its
alias there is the new method getConnectionByAlias(). This method is
not supported by the redis-sentinel backend due to its dynamic nature
(connections are retrieved and initialized at runtime from sentinels)
but it is still possible to get a single connection from the pool by
using its ID. It is also possible to retrive a connection by its role
using the method getConnectionByRole().

NOTE: the "role" parameter is an hint for the internals of aggregate
connection backends so it is still possible that the actual role of
a connection changes during the execution of a script (e.g. a slave
gets promoted to the role of master): in this case the parameters of
that connection will not be changed as they are immutable, but the
method getConnectionByRole() will return the appropriate connection.

Predis\Client::getClientBy() has been updated with the addition of
"role" and "alias" as supported selectors.
2016-06-18 15:32:53 +02:00
Daniele Alessandri 69e40dab2b Extract slot map logic to separate class.
In addition to that, the methods askSlotsMap() and buildSlotsMap() of
the redis-cluster connection backend have been renamed respectively
to askSlotMap() and buildSlotMap().
2016-06-17 22:18:38 +02:00
Daniele Alessandri 028992cf1b Remove useless method. 2016-06-17 14:13:02 +02:00
Daniele Alessandri 8de97ffe1a Fix snippet for replication in README.
[ci skip]
2016-06-17 13:58:08 +02:00
Daniele Alessandri d38cf2788b Update CHANGELOG. 2016-06-17 12:38:56 +02:00
Daniele Alessandri 0b226ff1d5 [tests] Missing test case for redis-cluster strategy. 2016-06-17 12:32:32 +02:00
Daniele Alessandri e38df19fac Implement "crc16" client option for redis-cluster.
By default Predis chooses automatically which hash generator to use:
if a suitable version of ext-phpiredis is loaded (that is, a version
that implements the phpiredis_utils_crc16() function) it uses the new
Predis\Cluster\Hash\PhpiredisCRC16 generator, otherwise it falls back
to the usual pure-PHP Predis\Cluster\Hash\CRC16 generator.
2016-06-17 12:32:29 +02:00
Daniele Alessandri 509a330bca Implement CRC16 hash generator based on ext-phpiredis.
Generating the hash of a string of 10 bytes is 10 times faster than
the equivalent pure-PHP implementation of CRC16 (PHP 7.0.7).

This generator requires a version of phpiredis that implements the
function "phpiredis_utils_crc16()".
2016-06-17 12:32:29 +02:00
Daniele Alessandri 0c4a90d809 Update CHANGELOG.
[ci skip]
2016-06-16 19:14:41 +02:00
Daniele Alessandri f0210e3888 Update CHANGELOG and bump VERSION. 2016-06-16 18:22:20 +02:00
Daniele Alessandri b3b35a9ae2 Remove Predis\Client::getConnectionById(). 2016-06-16 16:10:46 +02:00
Daniele Alessandri 7bb2192294 Replace Predis\Client::on() with getClientBy().
This method improves the previous one, which worked only by picking a
connection by ID, allowing users to specify a selector type among the
following ones: "id", "key", "slot", "command". These selectors are
expanded internally to methods, invoked against the connection object
in use by the client, that follow the getConnectionByXXX() convention
already in use through the library:

  id      => getConnectionById()
  key     => getConnectionByKey()
  slot    => getConnectionBySlot()
  command => getConnectionByCommand()

The underlying connection does not necessarily need to implement the
aggregate connection interface as the client relies on a duck-typing
approach by using method_exists().
2016-06-16 16:10:42 +02:00
Daniele Alessandri 53b2cc340a Apply same fix of 8437fbc to ClientContextInterface. 2016-06-16 10:53:23 +02:00
Felix Sandström 99f1e3290e Correcting the PHPDocs 2016-06-16 10:53:23 +02:00
Daniele Alessandri 5e88200ed6 Merge branch 'github/pr/344' into v1.1 2016-06-16 10:47:45 +02:00
Daniele Alessandri aed1a7bdf1 Apply same fix of 8437fbc to ClientContextInterface. 2016-06-16 10:47:01 +02:00
Daniele Alessandri 9d8adee1b1 Rename to getConnectionByCommand($command). 2016-06-16 10:39:44 +02:00
Daniele Alessandri a70971549e Fix GC issues with closures for phpiredis reader handlers.
The following code, despite not being something you would do in real
world scenarios, eventually ended up generating an exception for "Too
many open files".

  for ($i = 0; $i < 10000; $i++) {
    $client = new Predis\Client();
    $client->connect();
  }

The reason was that the destructor for the connection was not invoked
by PHP as expected when the client instance went out of scope, so the
underlying stream resource were not being properly released.
Even without an actual "connect()" operation, the memory usage of PHP
kept growing until exhausting the configured value of max memory.

The source of the issue is related to the use of closures as handlers
for the phpiredis reader resource, to be more precise it seems to be
some kind of circular reference memory leak. Apparently PHP does not
like the fact that a closure, automatically bound to "$this" starting
with PHP 5.4, is stored in the reader resource which in turn is kept
referenced by "$this". This ends up the refcount not going down thus
the GC does not collect those connection objects going out of scope.
This is confirmed by the fact that this issue is not triggered when
using PHP 5.3 where the ZE does not automatically bind closures to
"$this", unless you capture "$this" with the "use()" directive (and
the usual "$that = $this" trick).

Using a static assignement instead of simply returning new closures
in "getStatusHandler()" and "getErrorHandler()" is kind of an hack
that seems to be working fine, the added value of this solution is
that we do not have to break the internal API of the three connection
backends based on ext-phpiredis.

This commit fixes #345.
2016-06-14 21:27:42 +02:00
Daniele Alessandri 2290042680 Fix GC issues with closures for phpiredis reader handlers.
The following code, despite not being something you would do in real
world scenarios, eventually ended up generating an exception for "Too
many open files".

  for ($i = 0; $i < 10000; $i++) {
    $client = new Predis\Client();
    $client->connect();
  }

The reason was that the destructor for the connection was not invoked
by PHP as expected when the client instance went out of scope, so the
underlying stream resource were not being properly released.
Even without an actual "connect()" operation, the memory usage of PHP
kept growing until exhausting the configured value of max memory.

The source of the issue is related to the use of closures as handlers
for the phpiredis reader resource, to be more precise it seems to be
some kind of circular reference memory leak. Apparently PHP does not
like the fact that a closure, automatically bound to "$this" starting
with PHP 5.4, is stored in the reader resource which in turn is kept
referenced by "$this". This ends up the refcount not going down thus
the GC does not collect those connection objects going out of scope.
This is confirmed by the fact that this issue is not triggered when
using PHP 5.3 where the ZE does not automatically bind closures to
"$this", unless you capture "$this" with the "use()" directive (and
the usual "$that = $this" trick).

Using a static assignement instead of simply returning new closures
in "getStatusHandler()" and "getErrorHandler()" is kind of an hack
that seems to be working fine, the added value of this solution is
that we do not have to break the internal API of the three connection
backends based on ext-phpiredis.

This commit fixes #345.
2016-06-14 21:25:14 +02:00
Daniele Alessandri 295e9175ad Update CHANGELOG.
[ci skip]
2016-06-14 18:21:36 +02:00
Pascal Hofmann d92f31dc66 Don't send AUTH and/or SELECT command after connecting to sentinels 2016-06-14 17:20:08 +02:00
Daniele Alessandri e88ffc767d Merge remote-tracking branch 'github/pr/346' 2016-06-14 17:19:32 +02:00
Pascal Hofmann ce8b3fb683 Don't send AUTH and/or SELECT command after connecting to sentinels 2016-06-14 16:38:59 +02:00
Felix Sandström 8437fbc84f Correcting the PHPDocs 2016-06-14 10:02:47 +02:00
Daniele Alessandri e0b4b2c20a [tests] Add test for Predis\Cluster\Hash\CRC16. 2016-06-13 18:58:02 +02:00
Daniele Alessandri 4d58928efd [tests] Add test for Predis\Cluster\Hash\CRC16. 2016-06-13 18:57:06 +02:00
Daniele Alessandri 2640062803 Use master for connect() when sentinel reports no slaves.
Fixes #342.
2016-06-13 16:32:45 +02:00
Daniele Alessandri a523cf7731 Use master for connect() when sentinel reports no slaves.
Fixes #342.
2016-06-13 15:51:23 +02:00
orvice 1811288009 fix typos
possibile -> possible
indentify -> identify
publis ->  publish
2016-06-13 15:22:31 +02:00
Daniele Alessandri 1ad0effb0a Merge remote-tracking branch 'github/pr/343' 2016-06-13 15:21:26 +02:00
Daniele Alessandri 0607d84d0c Back to development. 2016-06-13 15:20:48 +02:00
orvice a1ee7b68ef fix typos
possibile -> possible
indentify -> identify
publis ->  publish
2016-06-12 16:27:14 +08:00
Daniele Alessandri fa643ac20c Apply CS fixes. 2016-06-10 11:12:26 +02:00
Daniele Alessandri eb1e686ff9 [tests] Change indentation of mock method expectations. 2016-06-10 11:08:26 +02:00
Daniele Alessandri f02f3b6d37 [tests] Improve code coverage.
There is still some work to improve coverage in other classes though.
2016-06-09 16:41:19 +02:00
Daniele Alessandri d72a1b5550 Do not extend EVALSHA for ScriptCommand class. 2016-06-09 14:02:22 +02:00
Daniele Alessandri 8b466d05df Get string of basic connection parameters from parameters class. 2016-06-08 18:36:35 +02:00
Daniele Alessandri b553c6b9d0 Pass dispatcher loop instance to callback.
This should not break existing code but allows users to retrieve more
easily the current dispatcher loop instance without resorting to some
tricks (like relying on the "use()" directive with closures).
2016-06-08 12:12:31 +02:00
Daniele Alessandri c10479e238 Remove executeCommandOnNodes() from predis cluster backend.
It is still possible to achieve the same simply by iterating over the
connection or, even better, over the client instance.
2016-06-08 12:01:54 +02:00
Daniele Alessandri 228ccaebe3 Use static instead of self. 2016-06-07 21:01:59 +02:00
Daniele Alessandri 82c256422a Fix failure on PHP 5.3.
Also use get_called_class() where possible.
2016-06-07 20:42:08 +02:00
Daniele Alessandri ee7104d2e5 Replace "getClientFor()" with "on()" in Client.
This new method acts exactly like "getClientFor()" by returning a new
client instance for the specified node unless a callback is passed as
the second argument, in this case the callback is invoked and the new
client instance is passed to it. The value returned by the callback
is used as the return value of the "on()" method.
2016-06-07 20:00:11 +02:00
Daniele Alessandri 7c4c4ae58a Change methods of replication connection interface.
Promoted the "switchToMaster()" and "switchToSlave()" methods to be
part of the replication connection interface and demoted the method
"switchTo($connection)".
2016-06-07 18:50:11 +02:00
Daniele Alessandri 185e31e080 Make some fields of Predis\Client private. 2016-06-07 18:22:57 +02:00
Daniele Alessandri 64b3a4805c Apply CS fixes. 2016-06-07 15:23:32 +02:00
Daniele Alessandri 5b4e942112 Add notice about dangers of using master branch. 2016-06-07 15:23:32 +02:00
Daniele Alessandri b2547fc7f4 [tests] Ignore code coverage for Predis\Autoloader. 2016-06-07 15:23:32 +02:00
Daniele Alessandri d34bdd38c3 Reorganize and improve client options.
All option classes have been moved in the Predis\Configuration\Option
namespace and some have been optimized to have less impact on client
initialization timings.

Furthermore the accepted values for some options have been changed,
this is the complete list of accepted values:

- _aggregate_: callable returning an aggregate connection.
- cluster: string value ("predis", "redis"), callable returning an
  aggregate connection.
- replication: string value ("predis", "sentinel"), callable returning
  an aggregate connection.
- commands: command factory, named array mapping command IDs to PHP
  classes, callable returning a command factory or a named array.
- connections: connection factory, callable returning a connection
  factory, named array mapping connection schemes to PHP classes.
- _prefix_: string value, command processor, callable.
- _exceptions_: boolean value.

Note that the cluster and replication options now return a closure
acting as initializer instead of an aggregate connection.
2016-06-07 15:23:32 +02:00
Daniele Alessandri 1028599ac5 Split Predis\Connection\Aggregate namespace.
Now we have two namespaces for cluster and replication backends:

  - Predis\Connection\Cluster
  - Predis\Connection\Replication
2016-06-07 15:23:32 +02:00
Daniele Alessandri 822f02b8eb Implement new logic to load command classes.
By default Predis now uses a convention-over-configuration approach
by looking for a command class in the Predis\Command\Redis namespace
if it is not already defined in the commands class map.

This change allow us to decrease the time needed to load Predis on
each request since we removed 99% of the mappings in the commands
class map. Classes defined in the internal class map still take the
precedence over this mechanism, so users can still define their own
command classes to handle each command.
2016-06-07 15:23:28 +02:00
Daniele Alessandri 4b47639f9e Rename command classes using command ID as name.
Some notable exceptions are EVAL and ECHO because having these names
as class names would raise a syntax error.
2016-06-04 20:54:41 +02:00
Daniele Alessandri e4872af747 Modify ctor signature of Predis\Command\RawCommand. 2016-06-04 20:54:36 +02:00
Daniele Alessandri c1d34f022f Drop useless method from base command class. 2016-06-04 15:57:12 +02:00
Daniele Alessandri 62b421f20e Switch from server profiles to commands factory.
This change reduces some unnecessary complexity in the library, Redis
commands do not change much after all. Developers can still implement
their own commands factory, inject new commands or override existing
ones. The "profile" client options has been renamed to "commands" and
it accepts instances of Predis\Command\FactoryInterface.

The test suite checks at runtime the version of the running instance
of Redis for integration tests to adapt itself automatically.
2016-06-04 15:36:21 +02:00
Daniele Alessandri 6e3f301588 Move commands classes in Predis\Command\Redis. 2016-06-04 15:36:16 +02:00
Daniele Alessandri 3dccd6bf87 Back to development.
The master branch now hosts the development of Predis v2.0.0-dev.
2016-06-02 09:10:25 +02:00
Daniele Alessandri 0e17edbefb Update CHANGELOG and bump VERSION. 2016-06-02 00:06:21 +02:00
Daniele Alessandri 81c0a8f051 Ensure big ints are not truncated on 32 bits PHP.
We check if the string value is different than the casted int value,
if so it means that the integer is beyond PHP_INT_MAX or PHP_INT_MIN
and we simply return the string value. This is also useful on Windows
builds of PHP since the maximum integer size (prior to PHP 7.0) is 32
bits even for 64 bit builds.
2016-06-01 23:49:23 +02:00
Daniele Alessandri 1065edc8d1 Apply last round of CS fixes. 2016-06-01 22:31:06 +02:00
Daniele Alessandri 843ad23ea7 [tests] Move utility method into base test class. 2016-06-01 22:27:36 +02:00
Daniele Alessandri e386f5c732 Update README.
[ci skip]
2016-06-01 22:20:58 +02:00
Daniele Alessandri a06063d2e6 Update CHANGELOG.
[ci skip]
2016-06-01 21:59:28 +02:00
Daniele Alessandri d58929e5a5 Update README.
Let's try using Gitter...

[ci skip]
2016-06-01 20:59:25 +02:00
Daniele Alessandri ecab7e4642 Implement IteratorAggregate interface for Client.
Now it is possible to iterate over traversable aggregate connections
and get a key/value pair of $connectionId => $clientInstance for each
node.
2016-06-01 12:33:20 +02:00
Daniele Alessandri a22fc17800 Update CHANGELOG.
[ci skip]
2016-05-30 17:45:08 +02:00
Daniele Alessandri 7a50b02c36 [tests] Do not allow failures for HHVM on Travis CI. 2016-05-30 17:09:15 +02:00
Daniele Alessandri f6bf2b5977 [tests] Troubles with HHVM <= 3.6.6 and float timeouts.
HHVM is still being used by Travis CI but this bug makes the build to
take 14 minutes to complete, which is unacceptable.
2016-05-30 17:09:02 +02:00
Daniele Alessandri 5850029f89 Update README.
[ci skip]
2016-05-28 20:28:18 +02:00
Daniele Alessandri f64bd83f9d Update README.
[ci skip]
2016-05-28 20:27:10 +02:00
Daniele Alessandri 922e56b480 Iterate only over connections mapped in slots map.
Iterating over Predis\Connection\Aggregate\RedisCluster returns all
the connections currently mapped in the slots map instead of just the
ones initialized in the pool.

When the slots map is retrieved from Redis (which by default is done
automatically) this allows to iterate over all of the current master
nodes of the cluster. When the underlying use of "CLUSTER SLOTS" is
disabled the iteration returns only connections with a slots range
associated in their parameters or initialized by `-MOVED` responses
to make the behaviour of the iteration consistent between the two
modes of operation.
2016-05-28 17:58:38 +02:00
Daniele Alessandri 5a0dfc3602 Fix parameters overriding for sentinels.
Different fix than PR #339 but thanks @phofmann-trust for spotting.
2016-05-28 15:53:23 +02:00
Daniele Alessandri 39a6e18d71 Update README of test directory.
[ci skip]
2016-05-27 22:03:32 +02:00
Daniele Alessandri a19de6356c Update README.
[ci skip]
2016-05-27 21:31:54 +02:00
Daniele Alessandri 2d01a27e17 Fix fetching slots map from unreachable nodes.
When various nodes in the configuration are unreachable while trying
to send a command, we should attempt to contact a reachable node to
fetch an updated slots map up to $retryLimit times or until there are
no more servers in the pool before giving up.

It is possible that the slots map fetched from Redis contains stale
data and points to a dead server, this happens when the nodes still
have to agree that a master server is down before promoting a slave
to the role of master. In this case no further attempts to execute
the command are performed and an exception is thrown.

This still needs some more testing and will delay v1.0.4 a few days
past its scheduled release.
2016-05-27 14:30:07 +02:00
Daniele Alessandri ad7b8b08cb Run php-cs-fixer. 2016-05-26 09:54:09 +02:00
Daniele Alessandri 0ebfc0e7d2 Update README.
[ci skip]
2016-05-25 21:33:07 +02:00
Daniele Alessandri 9303029c13 Discard slave even when flag is "o_down". 2016-05-25 16:03:12 +02:00
Daniele Alessandri 0477499418 Fix ROLE expectation for read commands with no slaves.
This commit fixes #337.
2016-05-25 15:56:33 +02:00
Daniele Alessandri 9398a793a5 Bump default server profile to Redis 3.2. 2016-05-25 11:25:12 +02:00
Daniele Alessandri 0dff761a61 Merge branch 'v1.1-commands-redis-3.2' 2016-05-24 23:17:33 +02:00
Daniele Alessandri 02ed5a2f4e Update SPOP's @method signature in phpdoc.
SPOP accepts the optional "count" argument since Redis 3.2.
2016-05-24 23:16:00 +02:00
Daniele Alessandri 51932d82e8 Add new command: GEORADIUSBYMEMBER (Redis 3.2.0). 2016-05-24 22:35:27 +02:00
Daniele Alessandri 00000fde4e Add new command: GEORADIUS (Redis 3.2.0). 2016-05-24 22:30:06 +02:00
Daniele Alessandri aeb9b7ccae Check that STORE key in SORT ends up in same slot. 2016-05-24 22:08:41 +02:00
Daniele Alessandri 4273a2a8b6 Improve detection of STORE in SORT command arguments. 2016-05-24 21:38:16 +02:00
Daniele Alessandri b2284d015f Add new command: GEODIST (Redis 3.2.0). 2016-05-24 17:09:35 +02:00
Daniele Alessandri c4e0044269 Add new command: GEOPOS (Redis 3.2.0). 2016-05-24 17:09:33 +02:00
Daniele Alessandri 0b6b3b2558 Add new command: GEOHASH (Redis 3.2.0). 2016-05-24 16:00:08 +02:00
Daniele Alessandri 7ef9619f5c Add new command: GEOADD (Redis 3.2.0). 2016-05-24 16:00:06 +02:00
Daniele Alessandri 3362e474b6 Add new command: BITFIELD (Redis 3.2.0). 2016-05-24 16:00:04 +02:00
Daniele Alessandri 7b3f6e1db5 [tests] Add missing test for key prefix in HSTRLEN. 2016-05-24 15:11:49 +02:00
Daniele Alessandri 1536b2aa82 Add missing @method tag for HSTRLEN in phpdocs.
[ci skip]
2016-05-24 12:27:30 +02:00
Daniele Alessandri 1ab65da368 [tests] Missing @requiresRedisVersion for HSTRLEN. 2016-05-24 11:51:04 +02:00
Daniele Alessandri b11fb84282 Update description in package.ini. 2016-05-24 10:27:57 +02:00
Daniele Alessandri da009e59dd [tests] Test count argument for SPOP in Redis 3.2. 2016-05-23 15:53:30 +02:00
Daniele Alessandri 763acd232d Add new server profile for Redis 3.2 (new stable). 2016-05-23 12:43:00 +02:00
Daniele Alessandri 75a8253ee4 Apply minor grammar fix in comment.
[ci skip]
2016-05-23 12:09:43 +02:00
Daniele Alessandri 9368d98ac3 Update phpunit.xml.* 2016-05-22 20:21:58 +02:00
Daniele Alessandri 8f514fe893 Update description in composer.json. 2016-05-22 20:05:58 +02:00
Daniele Alessandri 6964f060b3 Fix README.
[ci skip]
2016-05-22 15:33:21 +02:00
Daniele Alessandri c125c218ae Apply fix to README for grammar slip.
[ci skip]
2016-05-22 15:10:37 +02:00
Daniele Alessandri 1f3a010681 Update CHANGELOG.
[ci skip]
2016-05-22 15:07:01 +02:00
Daniele Alessandri 49f6b46942 Update and improve README.
[ci skip]
2016-05-22 15:06:56 +02:00
Daniele Alessandri c1795de1f3 Fix README.
[ci skip]
2016-05-21 17:12:20 +02:00
Daniele Alessandri 528cd090d8 Update README.
Improved the section about replication by rewriting some parts of it
and adding details about redis-sentinel.

[ci skip]
2016-05-21 17:05:14 +02:00
Daniele Alessandri 5b3a5bbef9 Run php-cs-fixer. 2016-05-21 15:46:58 +02:00
Daniele Alessandri 349a70a08a Merge branch 'v1.1-sentinel'
This merge resolves #131.
2016-05-21 15:30:22 +02:00
Daniele Alessandri c1de65c4ee Swap params order in redis-sentinel constructor. 2016-05-21 15:23:24 +02:00
Daniele Alessandri ecbdaa1951 Update CHANGELOG.
[ci skip]
2016-05-20 22:33:29 +02:00
Daniele Alessandri 05209e6e7d Switch to next slave on -LOADING error response.
This prevents an early failure of the command execution on the client
when one slave gets back online but is still loading the dataset from
disk (when this happens, Redis returns the -LOADING error response).

This commit fixes #280.
2016-05-20 21:59:40 +02:00
Daniele Alessandri 803a5cfd5b Remove old references about HHVM being unstable. 2016-05-20 20:34:03 +02:00
Daniele Alessandri faaf853cbe [tests] Rename old branch for exclusion.
[ci skip]
2016-05-20 20:14:44 +02:00
Daniele Alessandri 257791edcf Update badges in CHANGELOG.
[ci skip]
2016-05-20 18:34:54 +02:00
Daniele Alessandri d0cc7a5947 Try again on connection failure to node in cluster.
When the connection to a node in the cluster fails in the attempt to
execute a command, Predis now removes the failed connection from the
cluster pool and contacts a random node to ask for a fresh slots map
and tries to execute the command once again.

When the cluster is configured to have each master replicated to one
or more slaves, one the slaves is automatically promoted to the role
of master by redis-cluster with this change being reflected in the
output of CLUSTER SLOTS, so the next execution should run just fine.

Our current approach is relatively naive as CLUSTER SLOTS is executed
against a random master node, meaning that the client must open a new
connection and execute one more roundtrip only to fetch the new slots
map. For now it is enough, it is still better than having the client
fail when you actually have somes slaves in your redis-cluster setup,
but one improvement could consist in caching the list of slaves for
each master returned in the response of CLUSTER SLOTS so that when a
connection fails the client can try to guess which connection should
use for the next attempt.

This commit closes #173, closes #215, and closes #314.
2016-05-20 13:17:06 +02:00
Daniele Alessandri 5adafb352c Evict connection from slots cache when removed. 2016-05-20 11:43:06 +02:00
Daniele Alessandri d6d307696a [tests] Add tests for redis-sentinel connection. 2016-05-19 22:15:55 +02:00
Daniele Alessandri f3999660fe Fix bug during assertion of connection role.
ROLE was not being sent to master when still disconnected and with an
empty slaves pool preventing the client from checking the actual role
of the server upon connect().
2016-05-19 19:06:49 +02:00
Daniele Alessandri 18e846c2ad Fix bug trying to switch to an unknown connection. 2016-05-19 17:42:51 +02:00
Daniele Alessandri 7e4800010a Add minor comment for clarity. 2016-05-19 15:59:21 +02:00
Daniele Alessandri 6b5181b030 Do not wipe server list when removing connection. 2016-05-19 12:58:07 +02:00
Daniele Alessandri 01483234c7 [tests] Fix assertion.
PHPUnit_Util_Type::export() has been removed a while ago...
2016-05-19 11:43:39 +02:00
Daniele Alessandri cdadb796ad Bump min. version of PHPUnit (require-dev). 2016-05-19 11:43:29 +02:00
Daniele Alessandri 354e5e26da Improve handling of slots mapping via parameters.
When using redis-cluster it is now also possible to pass one slot or
non-contiguous ranges of slots via connection parameters in order to
improve the ability to pre-configure the slots map on the client.

Here is an example:

  $parameters = [
    'tcp://10.0.0.1:6379?slots=0-5460,5500-5600,11000',
    'tcp://10.0.0.2:6379?slots=5461-5499,5600-10921',
    'tcp://10.0.0.3:6379?slots=10922-10999,11001-16383',
  ];

This commit fixes #312 (props to @kenotr0n for the original PR).
2016-05-18 15:04:37 +02:00
Daniele Alessandri d55826f35c [tests] Fix tests from previous commit.
They did work, but I am not exactly sure why. Also added a missing
test for Predis\Connection\CompositeStreamConnection.
2016-05-17 20:06:30 +02:00
Daniele Alessandri 26d7147646 Update CHANGELOG. 2016-05-17 19:47:25 +02:00
Daniele Alessandri 973e8592e3 Throw when command sent in connect() returns error.
Common failures are the use of SELECT with a database index outside
the bound of the configured number of databases in redis.conf or the
use of a wrong password for authentication with AUTH.

This resolves #322.
2016-05-17 19:15:21 +02:00
Daniele Alessandri f696ed125e Update CHANGELOG. 2016-05-17 15:31:59 +02:00
Daniele Alessandri 9f6759ca1c Implement discovery in basic replication.
Now the client can discover the whole replication configuration by
asking to one of the servers (master has the precedence) using the
INFO REPLICATION command. This is obviously a best-effort fallback
and there is no strong guarantee about reliability and efficiency.

By enabling auto-discovery, the client automates this process when
the execution of a command fails because one of the target servers
is unreachable. The replication connection requires an instance of
connection factory associated to it in order to be able to create
new connections on the fly.

It is possible to enable the auto-discovery procedure easily via
client options:

  $client = new Predis\Client($servers, [
    'replication' => true,
    'autodiscovery' => true,
  ]);
2016-05-17 14:24:52 +02:00
Daniele Alessandri 89a1e236ce Use custom ID when adding connection with no alias. 2016-05-16 17:28:13 +02:00
Daniele Alessandri 97dfba1e98 Remove useless use directive. 2016-05-16 16:57:24 +02:00
Daniele Alessandri be8ac3e205 Handle error responses returned by redis-sentinel.
Fixes #289.
2016-05-16 16:50:28 +02:00
Daniele Alessandri a933a13087 [tests] Fix wrong method in mock. 2016-05-16 15:38:29 +02:00
Daniele Alessandri ce3d42b9cf Fix CHANGELOG.
[ci skip]
2016-05-15 22:03:34 +02:00
Daniele Alessandri 629329ac76 Fix failing test.
This was exactly what I meant with the @todo annotation, too bad I
forgot to temporarily adjust the test accordingly.
2016-05-15 21:54:00 +02:00
Daniele Alessandri a95860ce00 Bump year in LICENSE. 2016-05-15 21:38:50 +02:00
Daniele Alessandri 51e8d6c46e Update CHANGELOG. 2016-05-15 21:38:21 +02:00
Daniele Alessandri 126998631b Merge branch 'replication-improvements' 2016-05-15 21:37:35 +02:00
Daniele Alessandri d7f3b8c9d2 Update CHANGELOG. 2016-05-15 21:36:31 +02:00
Daniele Alessandri c9366212d0 Add methods to switch to master or random slave. 2016-05-15 21:27:43 +02:00
Daniele Alessandri 5b76b41fda Use master for connect() on empty slaves pool.
Internally the replication class uses this order to pick which server
it should connect to: current connection, one of the slaves, master.

If there is at least 1 slave, connect() will not fail even if master
is undefined. If there are no slaves, connect() will pick master. If
there are no connections registered for replication, connect() will
fail immediatly.
2016-05-15 20:53:09 +02:00
Daniele Alessandri b491dff126 Send read-only commands on next slave on failure.
If no other slave is available try again on master as last resort
before giving up and throwing an exception.
2016-05-15 20:53:06 +02:00
Daniele Alessandri 774b4014d9 Use master for read requests on empty slaves pool.
This is the last resort in case all of the slaves are unreachable.
2016-05-15 17:20:58 +02:00
Daniele Alessandri 00c5d7de19 Apply minor styling fix. 2016-05-15 17:09:43 +02:00
Daniele Alessandri e3412c4a1b Move member variable initialization. 2016-05-15 16:56:50 +02:00
Daniele Alessandri 44ebf5a5e4 Prevent warnings picking slave from empty pool. 2016-05-15 16:54:57 +02:00
Daniele Alessandri 0c99f9ef28 Disconnect before eventually throwing exception. 2016-05-15 15:56:16 +02:00
Daniele Alessandri 6e0743a29a Change method signature. 2016-05-15 15:53:14 +02:00
Daniele Alessandri b047e8b6a1 Rewrite the connection class for redis-sentinel.
Now we do not extend Predis\Connection\Aggregate\MasterSlaveReplication
anymore in order to obtain a more coherent implementation with the logic
of redis-sentinel and apply more optimizations by avoiding useless round
trips with sentinel servers.
2016-05-14 10:39:39 +02:00
Daniele Alessandri 7be83a1fd6 Merge remote-tracking branch 'github/pr/332' 2016-05-13 16:59:33 +02:00
Daniele Alessandri 367ed2c11c [tests] Remove deprecated phpunit directive. 2016-05-13 16:35:10 +02:00
Daniele Alessandri f0b3014cb4 Merge remote-tracking branch 'github/pr/333' 2016-05-13 16:32:48 +02:00
Daniele Alessandri a816adf6e7 Set default parameters via client options.
This is mostly useful when configuring the client to use redis-cluster
or redis-sentinel in order to set a common password for authentication
or database. In these kind of configurations it is impossible to pass
them via connection parameters as connections are created dinamically
by the client depending on the server response.
2016-05-13 14:56:40 +02:00
Ante Braovic 7cb20f5a0c updated .gitignore 2016-05-12 16:38:46 +02:00
Ante Braovic 62c547601c added zrevrangebylex in the list of available methods 2016-05-12 16:27:17 +02:00
Daniele Alessandri f8b3f18abf Implement ROLE for proper redis-sentinel support.
Once the client discovers the address of the master or a slave instance,
it must connect to that node and issue a ROLE command to verify that its
role still matches what the client got from the sentinel server.
2016-05-11 10:52:09 +02:00
Daniele Alessandri 0ec9f3351f Cap the number of retries on connection failure.
I think it is better to have a default limit to the number of attempts
when trying to send a command after a connection failure, I am just not
sure if 20 is a good value but we can adjust it later.
2016-05-10 17:36:30 +02:00
Daniele Alessandri 622e6c6ba2 Apply fixes on error responses from sentinel.
Fixes manually picked from @djagya's fork, thanks for spotting!
2016-05-10 17:09:37 +02:00
Daniele Alessandri bc212ad2b0 Update phpdoc. 2016-05-10 15:29:17 +02:00
Daniele Alessandri e896d89fa8 Merge remote-tracking branch 'github/pr/306' into v1.1-sentinel 2016-05-10 15:19:21 +02:00
Daniele Alessandri e851aaa21d Automatically assign aliases to slave connections. 2016-05-10 14:55:30 +02:00
Daniele Alessandri 7664f1f29b Improve client configuration for redis-sentinel.
Predis\Client now requires a list of connection parameters pointing to
sentinel instances and mandatory options "replication" and "service" set
respectively to "sentinel" and the chosen name for the master instance.

  $sentinels = ['tcp://127.0.0.1:5381', 'tcp://127.0.0.1:5382'];
  $options   = ['replication' => 'sentinel', 'service' => 'mymaster'];
  $client    = new Predis\Client($sentinels, $options);

Despite being nice and clean on the outside I am not really fond of the
code being used internally to make this kind of configuration possible.
Improvements in this respect would require a few breaking changes (not
even an option for a minor release) so things will change for the good
with Predis 2.0.
2016-05-10 14:19:05 +02:00
Daniele Alessandri 104e42cfe0 [tests] Fix test executed on current Redis unstable. 2016-05-10 10:58:46 +02:00
Daniele Alessandri b6a14cda04 [tests] Fix test executed on current Redis unstable. 2016-05-10 10:51:43 +02:00
Daniele Alessandri e61cb4e4f2 [tests] Fix wrong @group annotation 2016-05-09 17:49:12 +02:00
Daniele Alessandri 1349666494 Update CHANGELOG.
[ci skip]
2016-05-08 18:56:25 +02:00
Daniele Alessandri a0487ec5f4 Prevent failures serializing commands with "holes" in arguments array.
This could be triggered when passing an array with "holes" to variadic commands.
Connection classes based on the protocol serialized exposed by phpiredis were
not affected by this bug.

Fixes #316.
2016-05-08 18:43:50 +02:00
Remi Collet 57a7d5d3e6 fix tests, list of allowed commands have changed (redis 3.0.6) 2016-05-08 16:52:05 +02:00
Alexander Cheprasov 8235228acd Update ClientInterface.php 2016-05-08 16:46:27 +02:00
John Maguire 3ceaa39a3c Update useClusterNodes() docs to indicate default 2016-05-08 15:21:11 +02:00
Daniele Alessandri 0baad16064 Fix bug in HSCAN-based iterator when hash have integer fields.
When iterating a hash containing integer fields our iterator abstraction
based on HSCAN was always returning "0" as a field name after the first
$field => $value pair due to a wrong assumption on how the PHP function
array_shift() (which is used internally to advance to the next pair in
our buffered response to HSCAN) works.

The ZSCAN-based iterator had this very same bug which was already fixed
in 24e19a9 so I am not sure how this one went unnoticed until now.
2016-05-08 15:16:05 +02:00
Ante Lucic 939c0821dd add docblocks to MasterSlaveReplication 2016-05-05 14:22:32 +02:00
Chris Butler eb154cd43d Replace automatic retry yes/no with a retry limit 2016-01-27 12:35:46 +00:00
Daniele Alessandri d8da74adac Update documents. 2015-08-16 20:25:42 +02:00
Daniele Alessandri fda293b573 Add example of replication configuration using redis-sentinel. 2015-08-16 20:25:42 +02:00
Daniele Alessandri 24fb72a732 Implement ability to fetch an updated list of sentinels from active sentinel.
This can be optionally done automatically but is disabled by default, just use
SentinelReplication::setUpdateSentinels() accordingly to enable the automatic
fetching of an updated list of sentinels.
2015-08-16 20:25:42 +02:00
Daniele Alessandri 8d15503d6c Implement transparent auto-retry of commands upon server failure.
By default, when the current server dies while executing a command Predis asks
for a new configuration to one of the sentinels and re-issues the same command.

This behavior can be disabled calling SentinelReplication::setAutomaticRetry().
2015-08-16 20:25:39 +02:00
Daniele Alessandri 587fbbc446 Specify a timeout for the connect() operation to sentinel servers.
This value should be reasonably low so that the client can fallback to the next
sentinel if the connect() operation is taking too much and slowing things down.

When the connection parameters of sentinels contain a "timeout" parameter, its
value takes the precedence over the default sentinels timeout.
2015-08-16 16:28:21 +02:00
Daniele Alessandri 370d4e72c2 Add initial support for redis-sentinel.
This is a first implementation that is based on the work of @vmattila but some
more changes and missing bits are required in order to be considered complete.

To leverage redis-sentinel the client must be configured using the "aggregate"
option instead of the usual "replication" option, thought this may change for
the release of Predis v1.1.0 (it __will__ change for Predis v2.0.0 but this is
a whole different matter). This is a configuration example:

  use Predis\Connection\Aggregate\SentinelReplication;

  $sentinels = [
    'tcp://127.0.0.1:5381',
    'tcp://127.0.0.1:5382',
    'tcp://127.0.0.1:5383',
  ];

  $client = new Predis\Client($sentinels, [
    'service' => 'nrk-master',
    'aggregate' => function() {
      return function ($sentinels, $options) {
        $service = $option->service;
        $connections = $options->connections;

        return new SentinelReplication($sentinels, $service, $connections);
      };
    },
  ]);

The missing bits right now are:

  - A more solid handling of failures when querying sentinels.
  - When the connection fails while executing a command on one of the servers,
    we should query again a sentinel and then re-issue the command accordingly.
2015-08-16 16:28:13 +02:00
Daniele Alessandri 6bc1a38123 Fix wrong link in phpdoc.
Fixes #270.

[ci skip]
2015-07-30 20:51:15 +02:00
Daniele Alessandri f7d7cd59c4 Update CHANGELOG with release details of v1.0.3.
[ci skip]
2015-07-30 20:38:21 +02:00
Daniele Alessandri d46de81d91 Fix severe regression on HHVM.
Apparently HHVM is more strict than PHP in stream_socket_client() and does not
like at all IPv4 addresses and hostnames eclosed in square brackets. Note that
it is not that weird as square brackets are mandatory only when IPv6 addresses
are embedded in URI strings, so it is more like a weird incompatiblity of HHVM
with the behaviour of the standard PHP interpreter. The connect() attempt fails
but not due to the server being unavailable or some connectivity issue.

The important lesson is: never rely on undocumented behaviours especially when
targeting different runtimes, and do not forget to run the test suite on every
platform right before release like I unfortunately did.
2015-07-30 20:22:37 +02:00
Daniele Alessandri f4b6c578be Update CHANGELOG with release details of v1.0.2.
[ci skip]
2015-07-30 11:21:36 +02:00
Daniele Alessandri 2fc0e56a09 Preserve remainder of path in URI after database (redis scheme). 2015-07-30 11:11:30 +02:00
Daniele Alessandri 8106c8b00a Use PHP_VERSION_ID constant. 2015-07-30 10:57:20 +02:00
Daniele Alessandri b8bfd1405d Update README.
[ci skip]
2015-07-30 10:50:14 +02:00
Daniele Alessandri a7ee80702c Implement full support for IPv6.
Using IPv6 with Predis was basically impossible due to various inconsistencies
and bugs through the library, now it is supported by all the connection classes.

Following the standard for IPv6 literal addresses in URI strings, the IP literal
must be enclosed within square brackets when passing the parameters as a string:

  $parameters = 'tcp://[2001:db8:0:f101::1]:6379';

See https://tools.ietf.org/html/rfc3986#section-3.2.2 for further details.

This commit also fixes #239 making redis-cluster usable with nodes using IPv6.
2015-07-29 23:01:55 +02:00
Daniele Alessandri 0eaa1d929d Reduce unneeded code duplication in URI parsing. 2015-07-29 17:00:12 +02:00
Daniele Alessandri a26390915d Strip brackets from host when parsing embedded IPv6 address.
I don't know why PHP's parse_url() does not do that, it does not make
sense when the IP is by itself so maybe it is a bug?
2015-07-29 16:44:11 +02:00
Daniele Alessandri 24c0f846c7 Use static:: for invoking static methods in key prefix processor.
This trivial change makes it possible to use overridden static methods
when extending Predis\Command\Processor\KeyPrefixProcessor. PHP always
invokes the static methods of a parent class when using self:: even if
the extended classes override them.
2015-07-29 12:28:44 +02:00
Daniele Alessandri f43433baf1 Add new command: HSTRLEN (Redis 3.2.0).
Also bump the unstable profile version to 3.2.
2015-07-29 11:50:20 +02:00
Daniele Alessandri 3dfe62a5b5 Change format required for URI strings when using "unix" scheme.
Instead of using "unix://" you should just use "unix:":

  $old = 'unix:///path/to/redis.sock';
  $new = 'unix:/path/to/redis.sock';

The old format should be considered obsolete and will not be supported
starting from the next major release of Predis.
Meh
2015-07-28 11:23:33 +02:00
Daniele Alessandri ebb72377bb Implement TLS/SSL-encrypted connections.
This is handy for accessing remote Redis instances over a secure SSL connection
which is currently a popular option or even requirement with many cloud hosting
environments.

In order to configure the client to use an SSL-encrypted connection the scheme
in the connection parameters must be either "tsl" or "rediss" and a set of SSL
options (see http://php.net/manual/en/context.ssl.php) must be provided via the
"ssl" parameter as a named array.

The following example (which does not necessarily represent an example of good
practices!) illustrates how to set the "ssl" parameter using a named array and
the equivalent URI string:

  // Parameters as named array
  $parameters = [
    'scheme' => 'tls',
    'host'   => '127.0.0.1',
    'ssl'    => [
        'cafile'            => '/home/adaniele/redis.pem',
        'verify_peer_name'  => false,
    ],
  ];

  // Parameters as URI string
  $parameters = 'tls://127.0.0.1?ssl[cafile]=redis.pem&ssl[verify_peer_name]=1';

Support for SSL is currently limited to the Predis\Connection\StreamConnection
backend but we intend to investigate if it is possible to extend this feature
to Predis\Connection\PhpiredisStreamConnection in the future.

Be aware that using encrypted connections may lead to a performance degradation
especially in the connect() operation due to the overhead of the TLS handshake.
Unfortunately there is no real way to reuse SSL sessions from userland, aside
from enabling persistent connections, but this will work only on PHP >= 7.0.0
because previous versions of PHP do not provide enough info about a stream from
get_stream_meta_data().

NOTE: Redis does not have built-in support for SSL-encrypted connections, but if
you want to expose it to public networks you may want to rely on "stunnel".
2015-07-27 19:16:20 +02:00
Daniele Alessandri cb91ad1aee Rephrase latest entries of the CHANGELOG.
[ci skip]
2015-07-26 22:34:20 +02:00
Daniele Alessandri 5172555009 Rephrase some parts of the README.
[ci skip]
2015-07-26 22:28:58 +02:00
Daniele Alessandri 4dea992cd2 [tests] Fix typo. 2015-07-25 21:58:52 +02:00
Daniele Alessandri 80af1af459 [tests] Require pcntl extension to run blocking PubSub\Consumer test. 2015-07-25 21:56:36 +02:00
Daniele Alessandri abf2ce0bd1 [tests] Exlude persistent connections tests under PHP 5.3.
The get_resource_type() function does not differentiate between normal streams
and persistent streams, so we cannot really test this case.
2015-07-25 21:52:55 +02:00
Daniele Alessandri c7cae66a97 [tests] Improve code-reuse in tests for the Predis\Connection namespace. 2015-07-25 21:32:36 +02:00
Daniele Alessandri 4f30ac6370 Run php-cs-fixer. 2015-07-25 19:13:05 +02:00
Daniele Alessandri 1c8eb7ff6b [tests] Share common test among connection classes. 2015-07-25 19:13:01 +02:00
Daniele Alessandri cb09a7a2b5 [tests] Use @requires annotation. 2015-07-25 18:37:11 +02:00
Daniele Alessandri d69d6c726d Remove Connection\Aggregate\RedisCluster::setDefaultParameters().
The redis-cluster connection relies on a client-initialized connection factory,
so use Connection\Factory::setDefaultParameters() to set the default parameters
that must be applied to new nodes discovered through -MOVED or -ASK responses.
2015-07-25 18:37:11 +02:00
Daniele Alessandri 2b0c8fbb26 Remove "timeout" as a default parameter in Connection\Parameters.
Falling back to a default timeout values should be done by the connection class
as it is an implementation detail that may vary depending on the backend.
2015-07-25 18:37:11 +02:00
Daniele Alessandri 55aab86800 Add support for default connection parameters in Connection\Factory.
These parameters augment the set of user-supplied parameters when creating a new
connection, but they do not override specific parameters when already defined.

An example of self-contained configuration using client options:

  $client = new Predis\Client('tcp://127.0.0.1', [
    'parameters' => [
      'timeout' => 10,
    ],
    'connections' => function ($options) {
      $factory = $options->getDefault('connections');
      $factory->setDefaultParameters($options->parameters);

      return $factory;
    },
  ]);

This change will be useful for both redis-cluster and redis-sentinel as it makes
it easy to apply shared parameters such as a common password for authentication
when the server returns one ore more new nodes from response (think of -MOVED).
2015-07-25 18:37:11 +02:00
Daniele Alessandri 6cce9eb35c Run php-cs-fixer. 2015-07-25 18:37:10 +02:00
Daniele Alessandri 8277afc7a8 Use "persistent" with non-bool strings to open different persistent connections.
stream_socket_client() has the undocumented ability to open different persistent
streams by providing a path in the $address string. Previously we supported this
behaviour with a combination of "persistent" and "path" (see #139) but this can
be confusing, especially now that we support the redis:// scheme which uses the
path part of an URI string to specify a database number.

After this change, instead of using an URI string such as:

  $parameters = 'tcp://127.0.0.1/first?persistent=1&database=5';

You should use the following ones:

  $parameters = 'tcp://127.0.0.1?persistent=first&database=5';
  $parameters = 'redis://127.0.0.1/5?persistent=first';

Avoiding "path" makes even more sense when using array connection parameters:

  $parameters = [
    'host'       => '127.0.0.1',
    'database'   => 5,
    'persistent' => 'first',
  ]

This feature is not supported when using UNIX domain sockets because the path
trick of stream_socket_client() does not play well with the actual path of the
socket file. The client will throw an InvalidArgumentException exception to
notify the user.

NOTE: unfortunately we have to disable the tests for persistent connections when
running under HHVM due to a bug in their implementation of get_resource_type()
preventing us to recognize a persistent stream from userland code.
2015-07-25 18:34:51 +02:00
Daniele Alessandri b012af3247 Reorganize stream resource creation for stream-based connections. 2015-07-25 14:39:05 +02:00
Daniele Alessandri 7fa3c55f51 Move assertion for connection parameters out of abstract connection class.
Each connection class should implement its own checks for connection parameters,
even at the cost of some code duplication (inheritance is not just about code
reuse after all).
2015-07-25 14:37:22 +02:00
Daniele Alessandri 73c9b9d5be [tests] Fix some tests methods names. 2015-07-25 10:04:27 +02:00
Daniele Alessandri 59798e1f9e [tests] Apply small changes to commands tests with expirations. 2015-07-25 10:04:24 +02:00
Daniele Alessandri d0012e67ff [tests] Cover SET modifiers EX, PX, NX|XX (Redis >= 2.6.12). 2015-07-25 09:10:07 +02:00
Daniele Alessandri 65727ca07d Update .gitattributes file.
[ci skip]
2015-07-24 23:30:21 +02:00
Daniele Alessandri 4ac1a81aa4 Restore alignment for a few equals symbols. 2015-07-24 23:17:05 +02:00
Daniele Alessandri 8dd9893a2f Run php-cs-fixer with new configuration. 2015-07-24 23:17:02 +02:00
Daniele Alessandri 35e97967fd Add .php_cs configuration file for php-cs-fixer. 2015-07-24 23:16:19 +02:00
Daniele Alessandri 7282ca2b52 Remove unneeded "use" imports. 2015-07-24 21:25:40 +02:00
Daniele Alessandri c436e01353 Fix cluster strategy to handle variadic EXISTS (Redis >= 3.0.3). 2015-07-24 18:30:00 +02:00
Daniele Alessandri df2e9f4e71 Fix prefix processor to handle variadic EXISTS (Redis >= 3.0.3). 2015-07-24 18:29:51 +02:00
Daniele Alessandri 6590c44a27 Run php-cs-fixer against codebase in src/ and tests/. 2015-07-24 18:04:42 +02:00
Daniele Alessandri bb89cf67e2 [tests] Fix me being stupid here. 2015-07-24 17:35:27 +02:00
Daniele Alessandri 7c1d324f30 [tests] Apply some fixes and improvements and remove old stuff. 2015-07-24 17:26:06 +02:00
Daniele Alessandri bb6287f22d [tests] Fix obviously wrong annotation. 2015-07-24 16:20:50 +02:00
Daniele Alessandri f315404649 Update CHANGELOG. 2015-07-24 16:06:31 +02:00
Daniele Alessandri 8c76bd6761 Do not parse response to SETNX into boolean value. 2015-07-24 15:52:59 +02:00
Daniele Alessandri 38fafb22ba Do not parse response to MSETNX into boolean value. 2015-07-24 15:52:53 +02:00
Daniele Alessandri 5ce683be09 Do not parse response to SMOVE into boolean value. 2015-07-24 15:52:50 +02:00
Daniele Alessandri e531d39f53 Do not parse response to SISMEMBER into boolean value. 2015-07-24 15:52:45 +02:00
Daniele Alessandri fda9f022dd Do not parse response to RENAMENX into boolean value. 2015-07-24 15:52:27 +02:00
Daniele Alessandri 44e92d8a2f Do not parse response to PERSIST into boolean value. 2015-07-24 15:50:43 +02:00
Daniele Alessandri e75b69f6fd Do not parse response to MOVE into boolean value. 2015-07-24 15:50:38 +02:00
Daniele Alessandri 082c51146a Do not parse response to EXPIREAT into boolean value. 2015-07-24 15:50:34 +02:00
Daniele Alessandri b02e3f4911 Do not parse response to EXPIRE into boolean value. 2015-07-24 15:50:21 +02:00
Daniele Alessandri 87921f7a05 Do not parse response to PFADD into boolean value. 2015-07-24 15:50:10 +02:00
Daniele Alessandri 3fdfc50683 Do not parse response to HSETNX into boolean value. 2015-07-24 15:50:05 +02:00
Daniele Alessandri ae26ecc8bf Do not parse response to HSET into boolean value. 2015-07-24 15:50:01 +02:00
Daniele Alessandri 231a3440f7 Do not parse response to HEXISTS into boolean value. 2015-07-24 15:49:55 +02:00
Daniele Alessandri ab20c52115 Do not parse response to EXISTS into boolean value.
Starting with Redis 3.0.3 the EXISTS command is variadic so that it is
possible to check for the existence of multiple keys in one request,
with the server returning the number of keys found.

This change could break codebases relying on strict comparison (===)
against a boolean value, but just doing $redis->exists('key') == TRUE
is totally fine.
2015-07-24 15:49:40 +02:00
Daniele Alessandri 2eaf3d8595 Remove useless if condition. 2015-07-24 12:40:08 +02:00
Daniele Alessandri bb909c573d No need to check the scheme here.
Bug introduced in v1.0-dev after changes to support redis scheme.

Fixes #268
2015-07-24 10:39:06 +02:00
Daniele Alessandri 35f135be30 Add support for the 'redis://' scheme in URI strings.
The URI string will be handled following the rules as described by the
the provisional IANA registration document that can be found on IANA's
website: http://www.iana.org/assignments/uri-schemes/prov/redis.
2015-07-23 19:16:05 +02:00
Daniele Alessandri 474f3ddbe7 Add missing command: MIGRATE (Redis 2.6.0).
Fixes #209.
2015-07-23 17:22:53 +02:00
Daniele Alessandri ae054fc7e1 [tests] Fix minor oversight. 2015-07-23 16:46:07 +02:00
Daniele Alessandri 8168def08f Switch to container-based builds on Travis CI.
We do not need "sudo" anyway.
See http://docs.travis-ci.com/user/migrating-from-legacy/ for details.
2015-07-23 12:15:14 +02:00
Daniele Alessandri 15f3b6030c [tests] Improve assert failure messages for replication stategy tests. 2015-07-23 11:38:49 +02:00
Daniele Alessandri c0d1a74447 Fix missing BITPOS in replication strategy. 2015-07-23 11:30:32 +02:00
Daniele Alessandri 6882d08373 Add missing BITPOS command in key prefix processor.
See #265.
2015-07-23 11:06:57 +02:00
Daniele Alessandri 871d526300 Exclude .php-version file.
[ci skip]
2015-07-19 09:35:52 +02:00
Richard Heelin d84bca131b Emit socket error if ipredis connection has been lost/reset.
The current code is checking for a failure (return false) or an empty buffer string, however
neither of these will be the case if the connection has been reset or has errored. According
to the docs for socket_recv, $buffer will be set to null if the connection is reset or their
is no data. As currently null is not allowed for, we enter an infinite loop, to prevent this
I've added null to the things we check before we emit a socket error. This prevents the
infinite loop and correctly results in an Exception if the connection is lost/reset.

Conflicts:
	src/Connection/PhpiredisSocketConnection.php
2015-07-07 18:51:00 +02:00
Daniele Alessandri 5cd4f41424 [tests] Fix base test case class to handle required Redis versions.
This change is needed due to some internal changes in one of the
latest minor releases of PHPUnit 4.x that essentially broke how we
were checking for the required Redis version from method annotations.
2015-07-07 17:43:49 +02:00
Daniele Alessandri b3bcf466f5 [tests] Adapt to internal encoding changes for lists in Redis 3.0. 2015-07-07 16:09:20 +02:00
Daniele Alessandri 24d8f68e7f Support ZADD modifiers when using simplified command signature.
The NX|XX, CH and INCR modifiers for ZADD are available in Redis since
version 3.0.2. See http://redis.io/commands/ZADD for additional info.
2015-07-07 16:05:56 +02:00
Daniele Alessandri 0a8754f9b6 Merge remote-tracking branch 'github/pr/235' 2015-07-07 14:48:41 +02:00
Daniele Alessandri 614049cd12 [tests] Remove hhvm-nightly from Travis CI configuration.
See https://github.com/travis-ci/travis-ci/issues/3788 for details.
2015-07-07 14:42:10 +02:00
Daniele Alessandri 5911145d9f [tests] It's 7.0 and not 5.7! 2015-07-07 14:40:34 +02:00
Daniele Alessandri 8029faf72a [tests] Add PHP 5.7 to Travis CI configuration. 2015-07-07 13:23:09 +02:00
Daniele Alessandri e2c08cfe88 Minor tweak in .editorconfig file.
[ci skip]
2015-07-06 18:42:41 +02:00
Daniele Alessandri 3b31b91ad8 Commit .editorconfig file.
See http://editorconfig.org for more info about EditorConfig

[ci skip]
2015-07-06 18:39:28 +02:00
Daniele Alessandri 7a984e7b76 Fix wrong phpdoc.
Thanks @Aliance for spotting this oversight.
2015-07-03 12:12:39 +02:00
Daniele Alessandri 33e6ee2e48 [tests] Implement test for #257 to guard against regressions. 2015-07-03 12:01:47 +02:00
Daniele Alessandri c577c20481 Merge remote-tracking branch 'github/pr/258' 2015-07-03 11:05:42 +02:00
Dominic Scheirlinck 6fbe2d5fa3 Don't check for __invoke on non-objects
`method_exists` will cause autoloading for strings. Fixes #257
2015-06-16 15:55:20 +12:00
Michal Humpula af48b30398 add zrevrangebylex command 2015-01-23 23:06:40 +01:00
Daniele Alessandri b8decc75a8 Update CHANGELOG.
[ci skip]
2015-01-02 14:37:26 +01:00
Daniele Alessandri 32774c925a Bump year in LICENSE.
[ci skip]
2015-01-02 13:44:54 +01:00
Daniele Alessandri 216795e475 Update CHANGELOG.
[ci skip]
2015-01-02 13:43:29 +01:00
Daniele Alessandri 08129999f8 Merge remote-tracking branch 'srhnsn/v1.0' 2015-01-02 13:33:40 +01:00
Daniele Alessandri 0400d7b581 Merge remote-tracking branch 'blocktrail/hhvm-pubsub-blockingread-test-v1.0' 2015-01-02 13:00:38 +01:00
Daniele Alessandri 08fd312fb5 Temporarily allow failures for HHVM on Travis-CI.
[ci skip]
2015-01-02 12:57:45 +01:00
Daniele Alessandri c1e641e356 No need to access a private field used by PHPUnit.
Fixes #207.
2015-01-02 12:23:16 +01:00
Daniele Alessandri e9264bb087 Add minimum required Redis version for BITPOS integration tests. 2015-01-02 12:12:47 +01:00
Daniele Alessandri 1e774f4686 Apply minor CS fixes and trim spurious spaces. 2015-01-02 12:12:23 +01:00
Daniele Alessandri a0db60e9ce Merge remote-tracking branch 'nicchap/v1.0'
Conflicts:
	VERSION
	package.ini
	src/Client.php
2015-01-02 12:09:23 +01:00
Ruben de Vries f3748e45ef added (failing on HHVM) test for pubsub with read_write_timeout=-1 2014-12-19 11:40:59 +01:00
Serhan Şen beb6c28c65 Apply read_write_timeout to Unix socket connections. 2014-12-16 20:40:13 +01:00
Daniele Alessandri 28accc93f0 [tests] Test serialization of redis-cluster connection with @medium.
Serializing an instance of a redis-cluster connection with its nodes
can take more than 1 seconds on extremely slow hardware.

See issue #220 for reference.
2014-11-07 14:24:35 +01:00
Daniele Alessandri 381ca99696 [tests] Use round() to avoid issues with floats on certain plaforms.
See issue #220 on GitHub for reference.
2014-11-07 14:19:08 +01:00
Daniele Alessandri 54d467e530 Add missing doc for zincrby in ClientContextInterface.
[ci skip]
2014-10-26 10:28:56 +01:00
Daniele Alessandri 6db2ca38c2 Apply minor fix to .travis.yml. 2014-10-26 10:23:50 +01:00
Daniele Alessandri 330fb41bdc Update CHANGELOG.
[ci skip]
2014-10-25 17:54:22 +02:00
Daniele Alessandri 5e24d85c8a Fix E_NOTICE emitted on empty response to INFO [section].
Empty responses can be returned when requesting an unsupported section
with the INFO command.
2014-10-25 17:46:34 +02:00
Daniele Alessandri 24e19a9b76 Fix bug in ZSCAN-based iterator when sorted sets have integer members.
When iterating a sorted set containing integer members, our iterator
abstraction based on ZSCAN was always returning "0" as a member value
after the first $member => $score pair because of a wrong assumption
on how the PHP function array_shift() (used internally to advance to
the next pair in our buffered response to ZSCAN) works.

Fixes #216.
2014-10-21 11:58:11 +02:00
Daniele Alessandri 54c8a1ee9b [tests] Relax checks on invalid expire time messages.
Previously there was a bug in Redis that returned the wrong command
in -ERR messages when passing an invalid expire time with SETEX and
PSETEX. Now that the bug has been fixed and that travis-ci uses a an
updated version of Redis, our test suite turned red.
2014-10-21 11:23:19 +02:00
Vitaly Chirkov ed1e541dc6 Add missing doc for zincrby in ClientInterface 2014-10-21 11:10:05 +02:00
Daniele Alessandri cc51db9009 Connection parameters are not the focus of the client options example. 2014-10-21 11:05:36 +02:00
Jordi Boggiano a123ae9159 Add example for client config 2014-10-21 11:05:08 +02:00
Daniele Alessandri 0533b50c6b Add hhvm-nightly as a testing environment on Travis CI. 2014-09-05 11:03:03 +02:00
Daniele Alessandri 76ee6a2f24 Merge remote-tracking branch 'github/pr/208'
Conflicts:
	README.md
	composer.json
2014-09-05 11:01:47 +02:00
Daniele Alessandri cc748d509f Bump minimum required version of PHP to 5.3.9.
This change is needed to address a bug in older versions of PHP 5.3
affecting inheritance (see https://bugs.php.net/bug.php?id=66818).

We will most likely resort to a workaround in v1.0 to stick with the
currently required minimum version of PHP (>= 5.3.2), but v1.1 will
surely require => 5.3.9.

[ci skip]
2014-08-08 15:29:32 +02:00
Graham Campbell 6b088e4bda Removed hhvm from allow failures 2014-08-08 14:29:47 +02:00
Daniele Alessandri 72ebf5d064 Add more badges to README. 2014-08-08 13:57:35 +02:00
Daniele Alessandri 65c2f4bc4f Back to development.
[ci skip]
2014-08-08 13:57:05 +02:00
Daniele Alessandri 180fcdbe5a Merge pull request #200 from GrahamCampbell/patch-1
Updated master branch alias
2014-08-01 15:10:21 +02:00
Graham Campbell 80a5bfa4c1 Added a 1.1 branch alias 2014-08-01 13:49:39 +01:00
Daniele Alessandri 88fa032c33 Remove extras from composer.json.
[ci skip]
2014-08-01 12:20:02 +02:00
1446 changed files with 108703 additions and 35829 deletions
+6
View File
@@ -0,0 +1,6 @@
[codespell]
skip=./.git,./src/Command/Redis/Search/FTSUGGET.php,./examples/Commands/Search/ft_sug_add_get_del_len.php
check-hidden=
check-filenames=
builtin=clear,rare,informal,usage,code,names
ignore-words-list=master,masters,slave,slaves,whitelist,cas,exat,smove,SUGGET,sugget,ro,DOF,dof
+1
View File
@@ -0,0 +1 @@
coverage_clover: build/logs/clover-*.xml
+27
View File
@@ -0,0 +1,27 @@
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
block_comment_start = /*
block_comment = *
block_comment_end = */
[*.php]
max_line_length = 150
[*.{md,yml,yaml,neon,sh}]
indent_size = 2
[VERSION]
insert_final_newline = false
[tests/**.php]
max_line_length = unset
[{src/ClientInterface.php,src/ClientContextInterface.php}]
max_line_length = unset
+14 -2
View File
@@ -1,8 +1,20 @@
* text=auto
/.github export-ignore
/bin export-ignore
/examples export-ignore
/tests export-ignore
/.codespellrc export-ignore linguist-language=INI
/.coveralls.yml export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/.php-cs-fixer.dist.php export-ignore
/CHANGELOG.md export-ignore linguist-documentation
/CONTRIBUTING.md export-ignore linguist-documentation
/FAQ.md export-ignore linguist-documentation
/VERSION export-ignore
/phpunit.relay.xml export-ignore
/phpunit.xml.dist export-ignore
/phpunit.xml.travisci export-ignore
/phpstan.dist.neon export-ignore
/phpstan-tests.dist.neon export-ignore
+14
View File
@@ -0,0 +1,14 @@
# Default
* @tillkruss
# Redis commands
src/Command/Redis/* @predis/team @tillkruss
# Redis Stack
src/Command/Redis/Json/* @predis/team
src/Command/Redis/Search/* @predis/team
src/Command/Redis/TopK/* @predis/team
src/Command/Redis/TDigest/* @predis/team
src/Command/Redis/BloomFilter/* @predis/team
src/Command/Redis/CuckooFilter/* @predis/team
src/Command/Redis/CountMinSketch/* @predis/team
+6
View File
@@ -0,0 +1,6 @@
The Predis code of conduct is derived from the Ruby code of conduct. Any violations of the code of conduct may be reported to [Till Krüss](https://till.im):
- Participants will be tolerant of opposing views.
- Participants must ensure that their language and actions are free of personal attacks and disparaging personal remarks.
- When interpreting the words and actions of others, participants should always assume good intentions.
- Behavior that can be reasonably considered harassment will not be tolerated.
+2
View File
@@ -0,0 +1,2 @@
github: tillkruss
custom: "https://www.paypal.me/tillkruss"
+31
View File
@@ -0,0 +1,31 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Run command '...'
2. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Versions (please complete the following information):**
- Predis: [e.g. 1.1.2]
- PHP [e.g. 8.0.0]
- Redis Server [e.g. 6.0.0]
- OS [e.g. Ubuntu 20.10]
**Code sample**
If applicable, a small snippet of code that reproduces the issue.
**Additional context**
Add any other context about the problem here.
+20
View File
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: feature
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
+73
View File
@@ -0,0 +1,73 @@
---
services:
redis-official:
image: ${REDIS_IMAGE_NAME:-redis:7.4}
container_name: redis-official
healthcheck:
test: [ "CMD", "redis-cli", "PING" ]
interval: 10s
timeout: 5s
retries: 3
ports:
- "6379:6379"
profiles:
- all
- official
- standalone
redis-clients:
image: ${REDIS_IMAGE_NAME:-redislabs/client-libs-test:7.4.2}
container_name: redis-standalone
environment:
- TLS_ENABLED=yes
- REDIS_CLUSTER=no
- PORT=6379
- TLS_PORT=6666
command: ${REDIS_EXTRA_ARGS:---enable-debug-command yes --enable-module-command yes --tls-auth-clients optional --save ""}
ports:
- 6379:6379
- 6666:6666 # TLS port
volumes:
- "./dockers/standalone:/redis/work"
profiles:
- all
- clients
- standalone
redis-cluster:
image: ${REDIS_IMAGE_NAME:-redislabs/client-libs-test:7.4.2}
container_name: redis-cluster
environment:
- REDIS_CLUSTER=yes
- NODES=6
- REPLICAS=1
- TLS_ENABLED=yes
- PORT=16379
- TLS_PORT=27379
command: ${REDIS_EXTRA_ARGS:---enable-debug-command yes --enable-module-command yes --tls-auth-clients optional --save ""}
ports:
- "6372-6377:16379-16384"
volumes:
- "./dockers/cluster:/redis/work"
profiles:
- all
- clients
- cluster
redis-stack:
image: ${REDIS_STACK_IMAGE_NAME:-redislabs/client-libs-test:rs-7.4.0-v2}
container_name: redis-stack
ports:
- "6479:6379"
environment:
- REDIS_CLUSTER=no
- PORT=6379
command: ${REDIS_EXTRA_ARGS:---enable-debug-command yes --enable-module-command yes --save ""}
volumes:
- "./dockers/redis-stack:/redis/work"
profiles:
- all
- clients
- stack
+51
View File
@@ -0,0 +1,51 @@
name-template: 'v$NEXT_MINOR_VERSION'
tag-template: 'v$NEXT_MINOR_VERSION'
change-template: '- $TITLE (#$NUMBER)'
filter-by-comitish: true
commitish: v3.x
autolabeler:
- label: 'maintenance'
files:
- '*.md'
- '.github/*'
- label: 'bug'
branch:
- '/bug-.+'
- label: 'maintenance'
branch:
- '/maintenance-.+'
- label: 'feature'
branch:
- '/feature-.+'
categories:
- title: 'Breaking Changes'
labels:
- 'breakingchange'
- title: 'Experimental Features'
labels:
- 'experimental'
- title: 'New Features'
labels:
- 'feature'
- 'enhancement'
- title: 'Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- 'BUG'
- title: 'Maintenance'
label: 'maintenance'
exclude-labels:
- 'skip-changelog'
template: |
$CHANGES
## Contributors
We'd like to thank all the contributors who worked on this release!
$CONTRIBUTORS
+29
View File
@@ -0,0 +1,29 @@
matrix:
- name: Markdown
expect_match: false
apsell:
lang: en
d: en_US
ignore-case: true
dictionary:
wordlists:
- .github/wordlist.txt
output: wordlist.dic
pipeline:
- pyspelling.filters.markdown:
markdown_extensions:
- markdown.extensions.extra:
- pyspelling.filters.html:
comments: false
attributes:
- alt
ignores:
- ':matches(code, pre)'
- code
- pre
- blockquote
- img
sources:
- 'README.md'
- 'FAQ.md'
- 'docs/**'
+53
View File
@@ -0,0 +1,53 @@
ACLs
Autoloading
CAS
Customizable
ElastiCache
FPM
IANA
Lua
PSR
Packagist
PhpRedis
Predis
README
Redis
SHA
SSL
TCP
OSS
CLI
TLS
URI
autoload
autoloader
autoloading
backend
backends
behaviour
customizable
dataset
de
DevOPS
extensibility
keyspace
keyspaces
localhost
namespace
pipelining
pluggable
rebalanced
rebalancing
redis
runtime
sharding
stunnel
variadic
commitish
Kubernetes
programmatically
unhandled
invalidations
Sharded
sharded
Valkey
+9
View File
@@ -0,0 +1,9 @@
# Workflows
## Delete runs by workflow name
```bash
gh run list --workflow 'redis-server-tests.yml' --limit 1000 --json databaseId \
| jq '.[].databaseId' \
| xargs -I % gh api --silent -X DELETE /repos/predis/predis/actions/runs/%
```
+174
View File
@@ -0,0 +1,174 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow
name: Linters
on:
push:
branches:
- main
- v2.**
- v3.**
pull_request: null
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
byte_level:
name: Byte-level
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Check file permissions
run: test "$(find . -type f -not -path './.git/*' -executable)" = "./bin/create-command-test"
- name: "Find non-printable ASCII characters"
run: |
! LC_ALL=C.UTF-8 find . -type f -name '*.php' -print0 \
| xargs --null -- grep --perl-regexp --with-filename --line-number '[^ -~ü]'
syntax_errors:
name: Syntax errors
runs-on: ubuntu-latest
steps:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
coverage: none
tools: parallel-lint
- name: Checkout repository
uses: actions/checkout@v3
- name: Check source code for syntax errors
run: composer exec -- parallel-lint bin/ examples/ src/ tests/
static_analysis:
name: Static Analysis
needs:
- byte_level
- syntax_errors
runs-on: ubuntu-latest
steps:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
coverage: none
- name: Checkout repository
uses: actions/checkout@v3
- name: Validate Composer configuration
run: composer validate --no-interaction --strict
- name: Install dependencies
uses: ramsey/composer-install@v2
with:
dependency-versions: highest
- name: Check PSR-4 mapping
run: composer dump-autoload --no-interaction --optimize --strict-psr
- name: Perform static analysis
run: composer run phpstan
- name: Perform static analysis on tests
run: composer run phpstan -- --configuration=phpstan-tests.dist.neon
coding_standards:
name: Coding Standards
needs:
- byte_level
- syntax_errors
runs-on: ubuntu-latest
steps:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
coverage: none
- name: Checkout repository
uses: actions/checkout@v3
- name: Check EditorConfig configuration
run: test -f .editorconfig
- name: Check adherence to EditorConfig
uses: greut/eclint-action@v0
- name: Install dependencies
uses: ramsey/composer-install@v2
with:
dependency-versions: highest
- name: Check coding style
run: composer exec -- php-cs-fixer fix --diff --dry-run --allow-risky=yes --using-cache=no
- name: Search for TODO-s and FIXME-s
run: |
! git grep --extended-regexp --ignore-case '\b(TODO|FIXME)\b' -- ':/' ':!tests/*' ':!*/linters\.yml'
exported_files:
name: Exported files
needs:
- byte_level
- syntax_errors
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Check exported files
run: |
EXPECTED="LICENSE,README.md,autoload.php,composer.json"
CURRENT="$(
git archive HEAD \
| tar --list --exclude="src" --exclude="src/*" --exclude="bin" --exclude="bin/*" \
| paste --serial --delimiters=","
)"
echo "CURRENT =${CURRENT}"
echo "EXPECTED=${EXPECTED}"
test "${CURRENT}" = "${EXPECTED}"
changelog:
name: Changelog
runs-on: ubuntu-latest
timeout-minutes: 5
if: >-
github.event_name == 'pull_request' &&
!contains(github.event.head_commit.message, 'nochangelog') &&
!contains(github.event.head_commit.message, 'no-changelog') &&
!contains(github.event.head_commit.message, 'no changelog') &&
!contains(github.event.pull_request.labels.*.name, 'no-changelog')
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for CHANGELOG entry
env:
TARGET: ${{ github.event.pull_request.base.ref }}
run: |
FILES_CHANGED=$(git diff --name-only origin/$TARGET...HEAD | grep -E 'CHANGELOG\.md' -c)
if [ "$FILES_CHANGED" != "1" ]; then
echo "CHANGELOG.md was not updated";
exit 1;
fi;
+34
View File
@@ -0,0 +1,34 @@
name: Release Drafter
on:
push:
branches:
- main
- v2.**
- v3.**
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
update_release_draft:
permissions:
contents: write
pull-requests: write
name: Update release draft
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
with:
config-name: release-drafter-config.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+14
View File
@@ -0,0 +1,14 @@
name: spellcheck
on:
pull_request:
jobs:
check-spelling:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check Spelling
uses: rojopolis/spellcheck-github-actions@0.33.1
with:
config_path: .github/spellcheck-settings.yml
task_name: Markdown
+186
View File
@@ -0,0 +1,186 @@
name: Tests
on:
push:
branches:
- main
- v2.**
- v3.**
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
predis:
name: PHP ${{ matrix.php }} (Redis ${{ matrix.redis }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php:
- '7.2'
- '8.0'
- '8.3'
- '8.4'
redis:
- '4.0'
- '7.2'
- '7.4'
- '8.0'
steps:
- name: Resolve container name
run: |
# Mapping of original redis versions to client test containers
declare -A redis_clients_version_mapping=(
["8.0"]="8.0-RC2-pre"
["7.4"]="7.4.2"
["7.2"]="7.2.7"
)
# Mapping of redis version to stack version
declare -A redis_stack_version_mapping=(
["7.4"]="rs-7.4.0-v3"
["7.2"]="rs-7.2.0-v15"
)
if [[ -v redis_clients_version_mapping[${{ matrix.redis }}] ]]; then
echo "REDIS_IMAGE_NAME=redislabs/client-libs-test:${redis_clients_version_mapping[${{ matrix.redis }}]}" >> $GITHUB_ENV
echo "REDIS_STACK_IMAGE_NAME=redislabs/client-libs-test:${redis_stack_version_mapping[${{ matrix.redis }}]}" >> $GITHUB_ENV
echo "DOCKER_SERVICE=redis-clients" >> $GITHUB_ENV
redis_major_version=$(echo "${{ matrix.redis }}" | grep -oP '^\d+')
# Some configuration options available since Redis > 7
if (( redis_major_version < 7 )); then
echo "REDIS_EXTRA_ARGS="--tls-auth-clients optional --save ''"" >> $GITHUB_ENV
else
# Since 8.0 modules are bundled with core
echo "REDIS_STACK_SERVER_PORT=6379" >> $GITHUB_ENV
fi
else
echo "REDIS_IMAGE_NAME=redis:${{ matrix.redis }}" >> $GITHUB_ENV
echo "DOCKER_SERVICE=redis-official" >> $GITHUB_ENV
fi
- name: Checkout repository
uses: actions/checkout@v3
- name: Start Redis standalone image
uses: hoverkraft-tech/compose-action@v2.0.1
with:
compose-file: .github/docker-compose.yml
services: ${{ env.DOCKER_SERVICE }}
- name: Start Redis stack image
id: stack_infra
uses: hoverkraft-tech/compose-action@v2.0.1
if: ${{ matrix.redis >= '7.2' && matrix.redis < '8.0' }}
with:
compose-file: .github/docker-compose.yml
services: redis-stack
- name: Start Redis cluster image
id: cluster_infra
uses: hoverkraft-tech/compose-action@v2.0.1
if: ${{ matrix.redis > '4.0' }}
with:
compose-file: .github/docker-compose.yml
services: redis-cluster
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: relay
coverage: ${{ (matrix.php == '8.4' && matrix.redis == '7.4') && 'xdebug' || 'none' }}
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
with:
dependency-versions: highest
composer-options: ${{ matrix.php == '8.0' && '--ignore-platform-reqs' || '' }}
- name: Run tests
if: ${{ matrix.php != '8.4' || matrix.redis != '7.4' }}
run: vendor/bin/phpunit
- name: Run tests with coverage
if: ${{ matrix.php == '8.4' && matrix.redis == '7.4' }}
run: vendor/bin/phpunit --coverage-php build/cov/coverage-predis.cov --coverage-filter ./src
- name: Run tests using Relay
if: ${{ matrix.php != '8.4' && matrix.redis >= '7.2' }}
run: vendor/bin/phpunit -c phpunit.relay.xml
- name: Run tests using Relay with coverage
if: ${{ matrix.php == '8.4' && matrix.redis == '7.4' }}
run: vendor/bin/phpunit -c phpunit.relay.xml --coverage-php build/cov/coverage-relay.cov --coverage-filter ./src
- name: Run stack tests
if: ${{ (matrix.php != '8.4' || matrix.redis != '7.4') && matrix.redis >= '7.2' }}
run: vendor/bin/phpunit --group realm-stack
- name: Run stack tests with coverage
if: ${{ matrix.php == '8.4' && matrix.redis == '7.4' && steps.stack_infra.conclusion == 'success' }}
run: vendor/bin/phpunit --group realm-stack --coverage-php build/cov/coverage-stack.cov --coverage-filter ./src
env:
REDIS_STACK_SERVER_PORT: 6479
- name: Run stack tests using Relay
if: ${{ matrix.php != '8.4' && matrix.redis == '7.4' }}
run: vendor/bin/phpunit --group realm-stack -c phpunit.relay.xml
- name: Run stack tests using Relay with coverage
if: ${{ matrix.php == '8.4' && matrix.redis == '7.4' }}
run: vendor/bin/phpunit --group realm-stack -c phpunit.relay.xml --coverage-php build/cov/coverage-stack-relay.cov --coverage-filter ./src
env:
REDIS_STACK_SERVER_PORT: 6479
- name: Run tests against cluster
if: ${{ (matrix.php != '8.4' || matrix.redis != '7.4') && steps.cluster_infra.conclusion == 'success' }}
run: |
vendor/bin/phpunit --group cluster
- name: Run tests against cluster with coverage
if: ${{ matrix.php == '8.4' && matrix.redis == '7.4' && steps.cluster_infra.conclusion == 'success' }}
run: |
vendor/bin/phpunit --group cluster --coverage-php build/cov/coverage-cluster.cov --coverage-filter ./src
- name: Run tests against cluster using Relay
if: ${{ matrix.php != '8.4' && matrix.redis == '7.4' }}
run: |
vendor/bin/phpunit -c phpunit.relay.xml --group cluster
- name: Run tests against cluster using Relay with coverage
if: ${{ matrix.php == '8.4' && matrix.redis == '7.4' }}
run: |
vendor/bin/phpunit -c phpunit.relay.xml --group cluster --coverage-php build/cov/coverage-cluster-relay.cov --coverage-filter ./src
- name: Merge coverage reports
if: ${{ matrix.php == '8.4' && matrix.redis == '7.4' }}
run: php vendor/bin/phpcov merge --clover build/logs/clover.xml build/cov
- name: Send coverage to Coveralls
uses: coverallsapp/github-action@v2
if: ${{ matrix.php == '8.4' && matrix.redis == '7.4' }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
finish:
name: Finish Coverall
needs: predis
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
+7 -6
View File
@@ -1,7 +1,8 @@
*.tgz
*.phar
phpunit.xml
package.xml
/build
/vendor
.php-version
.php_cs.cache
.phpunit.result.cache
.php-cs-fixer.cache
composer.lock
experiments/
vendor/
phpunit.xml
+43
View File
@@ -0,0 +1,43 @@
<?php
$PREDIS_HEADER = <<<EOS
This file is part of the Predis package.
(c) 2009-2020 Daniele Alessandri
(c) 2021-2025 Till Krüss
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
EOS;
$fixer = new PhpCsFixer\Config;
$fixer->setParallelConfig(
\PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect()
);
$fixer->setRules([
'@PHP71Migration' => true,
'header_comment' => ['header' => $PREDIS_HEADER],
'@Symfony' => true,
'phpdoc_separation' => false,
'phpdoc_annotation_without_dot' => false,
'no_superfluous_phpdoc_tags' => false,
'no_unneeded_curly_braces' => false,
'no_unneeded_braces' => false,
'global_namespace_import' => true,
'yoda_style' => false,
'single_line_throw' => false,
'concat_space' => ['spacing' => 'one'],
'increment_style' => false,
'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['array_destructuring', 'arrays']]
])
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__ . '/bin')
->in(__DIR__ . '/examples')
->in(__DIR__ . '/src')
->in(__DIR__ . '/tests')
);
return $fixer;
-24
View File
@@ -1,24 +0,0 @@
language: php
php:
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm
- hhvm-nightly
branches:
except:
- v0.5
- v0.6
- php5.2_backport
- documentation
services: redis-server
before_script:
- composer self-update
- composer install --no-interaction --prefer-source --dev
script:
- vendor/bin/phpunit -c phpunit.xml.travisci
matrix:
allow_failures:
- php: hhvm-nightly
fast_finish: true
+295 -828
View File
File diff suppressed because it is too large Load Diff
-44
View File
@@ -1,44 +0,0 @@
## Filing bug reports ##
Bugs or feature requests can be posted on the [GitHub issues](http://github.com/nrk/predis/issues)
section of the project.
When reporting bugs, in addition to the obvious description of your issue you __must__ always provide
some essential information about your environment such as:
1. version of Predis (check the `VERSION` file or the `Predis\Client::VERSION` constant).
2. version of Redis (check `redis_version` returned by [`INFO`](http://redis.io/commands/info)).
3. version of PHP.
4. name and version of the operating system.
5. when possible, a small snippet of code that reproduces the issue.
__Think about it__: we do not have a crystal ball and cannot predict things or peer into the unknown
so please provide as much details as possible to help us isolating issues and fix them.
__Never__ use GitHub issues to post generic questions about Predis! When you have questions about
how Predis works or how it can be used, please just hop me an email and I will get back to you as
soon as possible.
## Contributing code ##
If you want to work on Predis, it is highly recommended that you first run the test suite in order
to check that everything is OK and report strange behaviours or bugs. When modifying Predis please
make sure that no warnings or notices are emitted by PHP running the interpreter in your development
environment with the `error_reporting` variable set to `E_ALL | E_STRICT`.
The recommended way to contribute to Predis is to fork the project on GitHub, create topic branches
on your newly created repository to fix bugs or add new features (possibly with tests covering your
modifications) and then open a pull request with a description of the applied changes. Obviously you
can use any other Git hosting provider of your preference.
We always aim for consistency in our code base so you should follow basic coding rules as defined by
[PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md)
and [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)
and stick with the conventions used in Predis to name classes and interfaces. Indentation should be
done with 4 spaces and code should be wrapped at 100 columns (please try to stay within this limit
even if the above mentioned official coding guidelines set the soft limit to 120 columns).
Please follow these [commit guidelines](http://git-scm.com/book/ch5-2.html#Commit-Guidelines) when
committing your code to Git and always write a meaningful (not necessarily extended) description of
your changes before opening pull requests.
+37 -109
View File
@@ -1,10 +1,9 @@
# Some frequently asked questions about Predis #
________________________________________________
# Frequently asked questions about Predis #
### What is the point of Predis? ###
## What is the point of Predis? ##
The main point of Predis is about offering a highly customizable and extensible client for Redis,
that can be easily extended by developers while still being reasonabily fast. With Predis you can
that can be easily extended by developers while still being reasonably fast. With Predis you can
swap almost any class with your own custom implementation: you can have custom connection classes,
new distribution strategies for client-side sharding, or handlers to replace or add Redis commands.
All of this can be achieved without messing with the source code of the library and directly in your
@@ -13,21 +12,34 @@ a great asset since it allows developers to add new and still missing features o
the standard behaviour of the library without the need to break dependencies in production code (at
least to some degree).
### Does Predis support UNIX domain sockets and persistent connections? ###
## Does Predis support UNIX domain sockets and persistent connections? ##
Yes. Obviously persistent connections actually work only when using PHP configured as a persistent
process reused by the web server (see [PHP-FPM](http://php-fpm.org)).
### Does Predis support transparent (de)serialization of values? ###
## Does Predis support SSL-encrypted connections? ##
No and it will not ever do that by default. The reason behind this decision is that serialization is
usually something that developers prefer to customize depending on their needs and can not be easily
generalized when using Redis because of the many possible access patterns for your data. This does
not mean that it is impossible to have such a feature since you can leverage the extensibility of
this library to define your own serialization-aware commands. You can find more details about how to
do that [on this issue](http://github.com/nrk/predis/issues/29#issuecomment-1202624).
Yes. Encrypted connections are mostly useful when connecting to Redis instances exposed by various
cloud hosting providers without the need to configure an SSL proxy, but you should also take into
account the general performances degradation especially during the connect() operation when the TLS
handshake must be performed to secure the connection. Persistent SSL-encrypted connections may help
in that respect, but they are supported only when running on PHP >= 7.0.0.
### How can I force Predis to connect to Redis before sending any command? ###
## Does Predis support transparent (de)serialization of values? ##
When using [Relay](https://github.com/cachewerk/relay) as the underlying client, several
serialization and compression algorithms are supported. This slightly increases CPU usage,
but significantly reduces bytes sent over the network and Redis memory usage.
Without Relay, Predis will not serialize data and will never do that by default. The reason
behind this decision is that serialization is usually something that developers prefer to
customize depending on their needs and can not be easily generalized when using Redis because
of the many possible access patterns for your data. This does not mean that it is impossible
to have such a feature since you can leverage the extensibility of this library to define
your own serialization-aware commands. You can find more details about how to do that
[on this issue](http://github.com/predis/predis/issues/29#issuecomment-1202624).
## How can I force Predis to connect to Redis before sending any command? ##
Explicitly connecting to Redis is usually not needed since the client initializes connections lazily
only when they are needed. Admittedly, this behavior can be inconvenient in certain scenarios when
@@ -47,7 +59,7 @@ try {
$client->info();
```
### How Predis abstracts Redis commands? ###
## How Predis abstracts Redis commands? ##
The approach used to implement Redis commands is quite simple: by default each command follows the
same signature as defined on the [Redis documentation](http://redis.io/commands) which makes things
@@ -67,103 +79,19 @@ $client->hmset('my:hash', ['field1'=>'value1', 'field2'=>'value2']); // single n
An exception to this rule is [`SORT`](http://redis.io/commands/sort) for which modifiers are passed
[using a named array](tests/Predis/Command/KeySortTest.php#L54-L75).
## When should I use Relay? ##
# Speaking about performances... #
_________________________________________________
If you care about performance, __always__. [Relay][relay] is free to use.
## When should I use PhpRedis? ###
### Predis is a pure-PHP implementation: it can not be fast enough! ###
Predis is fast enough when Redis is located on the same machine as PHP.
It really depends, but most of the times the answer is: _yes, it is fast enough_. I will give you a
couple of easy numbers with a simple test that uses a single client and is executed by PHP 5.5.6
against a local instance of Redis 2.8 that runs under Ubuntu 13.10 on a Intel Q6600:
[PhpRedis][phpredis] and [Relay][relay] perform significantly better when network I/O is involved,
due to its ability to compress data by ~75%. Fewer bytes and received sent over the network
[means faster operations][performance], and potentially cost savings when network traffic isn't
free (e.g. AWS ElastiCache Inter-AZ transfer costs).
```
21000 SET/sec using 12 bytes for both key and value.
21000 GET/sec while retrieving the very same values.
0.130 seconds to fetch 30000 keys using _KEYS *_.
```
How does it compare with [__phpredis__](http://github.com/nicolasff/phpredis), a nice C extension
providing an efficient client for Redis?
```
30100 SET/sec using 12 bytes for both key and value
29400 GET/sec while retrieving the very same values
0.035 seconds to fetch 30000 keys using "KEYS *"".
```
Wow __phpredis__ seems much faster! Well, we are comparing a C extension with a pure-PHP library so
lower numbers are quite expected but there is a fundamental flaw in them: is this really how you are
going to use Redis in your application? Are you really going to send thousands of commands using a
for-loop on each page request using a single client instance? If so... well I guess you are probably
doing something wrong. Also, if you need to `SET` or `GET` multiple keys you should definitely use
commands such as `MSET` and `MGET`. You can also use pipelining to get more performances when this
technique can be used.
There is one more thing: we have tested the overhead of Predis by connecting on a localhost instance
of Redis but how these numbers change when we hit the physical network by connecting to remote Redis
instances?
```
Using Predis:
3200 SET/sec using 12 bytes for both key and value
3200 GET/sec while retrieving the very same values
0.132 seconds to fetch 30000 keys using "KEYS *".
Using phpredis:
3500 SET/sec using 12 bytes for both key and value
3500 GET/sec while retrieving the very same values
0.045 seconds to fetch 30000 keys using "KEYS *".
```
There you go, you get almost the same average numbers and the reason is simple: network latency is a
real performance killer and you cannot do (almost) anything about that. As a disclaimer, remember
that we are measuring the overhead of client libraries implementations and the effects of network
round-trip times, so we are not really measuring how fast Redis is. Redis shines best with thousands
of concurrent clients doing requests! Also, actual performances should be measured according to how
your application will use Redis.
### I am convinced, but performances for multi-bulk responses are still worse ###
Fair enough, but there is an option available if you need even more speed and consists on installing
__[phpiredis](http://github.com/nrk/phpiredis)__ (note the additional _i_ in the name) and let the
client use it. __phpiredis__ is another C extension that wraps __hiredis__ (the official C client
library for Redis) with a thin layer exposing its features to PHP. You can then choose between two
different connection classes:
- `Predis\Connection\PhpiredisStreamConnection` (using native PHP streams).
- `Predis\Connection\PhpiredisSocketConnection` (requires `ext-socket`).
You will now get the benefits of a faster protocol serializer and parser just by adding a couple of
lines of code:
```php
$client = new Predis\Client('tcp://127.0.0.1', array(
'connections' => array(
'tcp' => 'Predis\Connection\PhpiredisStreamConnection',
'unix' => 'Predis\Connection\PhpiredisSocketConnection',
),
));
```
Dead simple. Nothing changes in the way you use the library in your application. So how fast is it
our basic benchmark script now? There are not much improvements for inline or short bulk responses
like the ones returned by `SET` and `GET`, but the speed for parsing multi-bulk responses is now on
par with phpredis:
```
Fatching 30000 keys with _KEYS *_ using Predis paired with phpiredis::
0.035 seconds from a local Redis instance
0.047 seconds from a remote Redis instance
```
### If I need an extension to get better performances, why not using phpredis? ###
Good question. Generically speaking if you need absolute uber-speed using Redis on the localhost and
you do not care about abstractions built around some Redis features such as MULTI / EXEC, or if you
do not need any kind of extensibility or guaranteed backwards compatibility with different versions
of Redis (Predis currently supports from 1.2 up to 2.8 and the current development version), then
using __phpredis__ makes absolutely sense. Otherwise, Predis is perfect for the job and by adding
__phpiredis__ you can get a nice speed bump almost for free.
[phpredis]: https://github.com/phpredis/phpredis
[relay]: [https://github.com/phpredis/phpredis](https://github.com/cachewerk/relay)
[performance]: https://akalongman.medium.com/phpredis-vs-predis-comparison-on-real-production-data-a819b48cbadb
+19 -19
View File
@@ -1,22 +1,22 @@
Copyright (c) 2009-2014 Daniele Alessandri
MIT License
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
Copyright (c) 2009-2020 Daniele Alessandri (original work)
Copyright (c) 2021-2024 Till Krüss (modified work)
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+418 -177
View File
@@ -1,50 +1,43 @@
# Predis #
[![Latest Stable Version](https://poser.pugx.org/predis/predis/v/stable.png)](https://packagist.org/packages/predis/predis)
[![Total Downloads](https://poser.pugx.org/predis/predis/downloads.png)](https://packagist.org/packages/predis/predis)
[![License](https://poser.pugx.org/predis/predis/license.svg)](https://packagist.org/packages/predis/predis)
[![Build Status](https://travis-ci.org/nrk/predis.svg?branch=v1.0)](https://travis-ci.org/nrk/predis)
[![HHVM Status](http://hhvm.h4cc.de/badge/predis/predis.png)](http://hhvm.h4cc.de/package/predis/predis)
[![Software license][ico-license]](LICENSE)
[![Latest stable][ico-version-stable]][link-releases]
[![Latest development][ico-version-dev]][link-releases]
[![Monthly installs][ico-downloads-monthly]][link-downloads]
[![Build status][ico-build]][link-actions]
[![Coverage Status][ico-coverage]][link-coverage]
Predis is a flexible and feature-complete [Redis](http://redis.io) client library for PHP >= 5.3.
A flexible and feature-complete [Redis](http://redis.io) / [Valkey](https://github.com/valkey-io/valkey) client for PHP 7.2 and newer.
By default Predis does not require any additional C extension, but it can be optionally paired with
[phpiredis](https://github.com/nrk/phpiredis) to lower the overhead of serializing and parsing the
Redis protocol. An asynchronous implementation of the client, albeit experimental, is also available
through [Predis\Async](https://github.com/nrk/predis-async).
Predis can be used with [HHVM](http://www.hhvm.com) >= 2.3.0, but there are no guarantees you will
not run into unexpected issues (especially when the JIT compiler is enabled via `Eval.Jit = true`)
due to HHVM being still under heavy development, thus unstable and not yet 100% compatible with PHP.
More details about the project can be found in our [frequently asked questions](FAQ.md) section or
on the online [wiki](https://github.com/nrk/predis/wiki).
More details about this project can be found on the [frequently asked questions](FAQ.md).
## Main features ##
- Wide range of Redis versions supported (from __2.0__ to __3.0__ and __unstable__) using profiles.
- Cluster of nodes via client-side sharding using consistent hashing or custom distributors.
- Smart support for [redis-cluster](http://redis.io/topics/cluster-tutorial) (Redis >= 3.0).
- Support for master-slave replication configurations (write on master, read from slaves).
- Transparent key prefixing for all known Redis commands using a customizable prefixing strategy.
- Command pipelining (works on both single nodes and aggregate connections).
- Abstraction for Redis transactions (Redis >= 2.0) supporting CAS operations (Redis >= 2.2).
- Abstraction for Lua scripting (Redis >= 2.6) with automatic switching between `EVALSHA` or `EVAL`.
- Support for Redis from __3.0__ to __8.0__.
- Support for clustering using client-side sharding and pluggable keyspace distributors.
- Support for [redis-cluster](http://redis.io/topics/cluster-tutorial) (Redis >= 3.0).
- Support for master-slave replication setups and [redis-sentinel](http://redis.io/topics/sentinel).
- Transparent key prefixing of keys using a customizable prefix strategy.
- Command pipelining on both single nodes and clusters (client-side sharding only).
- Abstraction for Redis transactions (Redis >= 2.0) and CAS operations (Redis >= 2.2).
- Abstraction for Lua scripting (Redis >= 2.6) and automatic switching between `EVALSHA` or `EVAL`.
- Abstraction for `SCAN`, `SSCAN`, `ZSCAN` and `HSCAN` (Redis >= 2.8) based on PHP iterators.
- Connections to Redis are established lazily by the client upon the first command.
- Support for both TCP/IP and UNIX domain sockets and persistent connections.
- Support for [Webdis](http://webd.is) (both `ext-curl` and `ext-phpiredis` are needed).
- Connections are established lazily by the client upon the first command and can be persisted.
- Connections can be established via TCP/IP (also TLS/SSL-encrypted) or UNIX domain sockets.
- Support for custom connection classes for providing different network or protocol backends.
- Flexible system for defining and registering custom sets of supported commands or profiles.
- Flexible system for defining custom commands and override the default ones.
## How to use Predis ##
## How to _install_ and use Predis ##
Predis is available on [Packagist](http://packagist.org/packages/predis/predis) which allows a quick
installation using [Composer](http://packagist.org/about-composer). Alternatively, the library can
be found on our [own PEAR channel](http://pear.nrk.io) for a more traditional installation via PEAR.
Ultimately, archives of each release are [available on GitHub](https://github.com/nrk/predis/tags).
This library can be found on [Packagist](http://packagist.org/packages/predis/predis) for an easier
management of projects dependencies using [Composer](http://packagist.org/about-composer).
Compressed archives of each release are [available on GitHub](https://github.com/predis/predis/releases).
```shell
composer require predis/predis
```
### Loading the library ###
@@ -52,7 +45,7 @@ Ultimately, archives of each release are [available on GitHub](https://github.co
Predis relies on the autoloading features of PHP to load its files when needed and complies with the
[PSR-4 standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md).
Autoloading is handled automatically when dependencies are managed through Composer, but it is also
possible to leverage its own autoloader in projects or scripts not having any autoload facility:
possible to leverage its own autoloader in projects or scripts lacking any autoload facility:
```php
// Prepend a base path if Predis is not available in your "include_path".
@@ -61,17 +54,11 @@ require 'Predis/Autoloader.php';
Predis\Autoloader::register();
```
It is possible to easily create a [phar](http://www.php.net/manual/en/intro.phar.php) archive from
the repository just by launching `bin/create-phar`. The generated phar contains a stub defining an
autoloader function for Predis, so you just need to require the phar to start using the library.
Alternatively it is possible to generate one single PHP file holding every class like older versions
of Predis by launching `bin/create-single-file`, but this practice __is not__ encouraged.
### Connecting to Redis ###
When not specifying any connection parameter to create a new client, Predis assumes `127.0.0.1` and
`6379` as the default host and port with a connection timeout of 5 seconds:
When creating a client instance without passing any connection parameter, Predis assumes `127.0.0.1`
and `6379` as default host and port. The default timeout for the `connect()` operation is 5 seconds:
```php
$client = new Predis\Client();
@@ -79,101 +66,224 @@ $client->set('foo', 'bar');
$value = $client->get('foo');
```
Connection parameters can be supplied either in the form of URI strings or named arrays. While the
latter is the preferred way to supply parameters, URI strings can be useful for quick configurations
or when parameters are read from a non-structured source:
Connection parameters can be supplied either in the form of URI strings or named arrays. The latter
is the preferred way to supply parameters, but URI strings can be useful when parameters are read
from non-structured or partially-structured sources:
```php
// Named array of connection parameters:
// Parameters passed using a named array:
$client = new Predis\Client([
'scheme' => 'tcp',
'host' => '10.0.0.1',
'port' => 6379,
]);
// Same set of parameters, but using an URI string:
// Same set of parameters, passed using an URI string:
$client = new Predis\Client('tcp://10.0.0.1:6379');
```
When an array of connection parameters is provided, Predis automatically works in cluster mode using
client-side sharding. Both named arrays and URI strings can be mixed when providing configurations
for each node:
Password protected servers can be accessed by adding `password` to the parameters set. When ACLs are
enabled on Redis >= 6.0, both `username` and `password` are required for user authentication.
It is also possible to connect to local instances of Redis using UNIX domain sockets, in this case
the parameters must use the `unix` scheme and specify a path for the socket file:
```php
$client = new Predis\Client([
'tcp://10.0.0.1?alias=first-node',
['host' => '10.0.0.2', 'alias' => 'second-node'],
]);
$client = new Predis\Client(['scheme' => 'unix', 'path' => '/path/to/redis.sock']);
$client = new Predis\Client('unix:/path/to/redis.sock');
```
The client can leverage TLS/SSL encryption to connect to secured remote Redis instances without the
need to configure an SSL proxy like stunnel. This can be useful when connecting to nodes running on
various cloud hosting providers. Encryption can be enabled with using the `tls` scheme and an array
of suitable [options](http://php.net/manual/context.ssl.php) passed via the `ssl` parameter:
```php
// Named array of connection parameters:
$client = new Predis\Client([
'scheme' => 'tls',
'ssl' => ['cafile' => 'private.pem', 'verify_peer' => true],
]);
// Same set of parameters, but using an URI string:
$client = new Predis\Client('tls://127.0.0.1?ssl[cafile]=private.pem&ssl[verify_peer]=1');
```
The connection schemes [`redis`](http://www.iana.org/assignments/uri-schemes/prov/redis) (alias of
`tcp`) and [`rediss`](http://www.iana.org/assignments/uri-schemes/prov/rediss) (alias of `tls`) are
also supported, with the difference that URI strings containing these schemes are parsed following
the rules described on their respective IANA provisional registration documents.
The actual list of supported connection parameters can vary depending on each connection backend so
it is recommended to refer to their specific documentation or implementation for details.
Predis can aggregate multiple connections when providing an array of connection parameters and the
appropriate option to instruct the client about how to aggregate them (clustering, replication or a
custom aggregation logic). Named arrays and URI strings can be mixed when providing configurations
for each node:
```php
$client = new Predis\Client([
'tcp://10.0.0.1?alias=first-node', ['host' => '10.0.0.2', 'alias' => 'second-node'],
], [
'cluster' => 'predis',
]);
```
See the [aggregate connections](#aggregate-connections) section of this document for more details.
Connections to Redis are lazy meaning that the client connects to a server only if and when needed.
While it is recommended to let the client do its own stuff under the hood, there may be times when
it is still desired to have control of when the connection is opened or closed: this can easily be
achieved by invoking `$client->connect()` and `$client->disconnect()`. Please note that the effect
of these methods on aggregate connections may differ depending on each specific implementation.
### Client configuration ###
Various aspects of the client can be configured simply by passing options to the second argument of
`Predis\Client::__construct()`:
Many aspects and behaviors of the client can be configured by passing specific client options to the
second argument of `Predis\Client::__construct()`:
```php
$client = new \Predis\Client(
$connection_parameters,
['profile' => '2.8', 'prefix' => 'sample:']
);
$client = new Predis\Client($parameters, ['prefix' => 'sample:']);
```
Options are managed using a mini DI-alike container and their values
are usually lazily initialized only when needed. Predis by default supports the following options:
Options are managed using a mini DI-alike container and their values can be lazily initialized only
when needed. The client options supported by default in Predis are:
- `profile`: which profile to use in order to match a specific version of Redis.
- `prefix`: a prefix string that is automatically applied to keys found in commands.
- `prefix`: prefix string applied to every key found in commands.
- `exceptions`: whether the client should throw or return responses upon Redis errors.
- `connections`: connection backends or a connection factory to be used by the client.
- `cluster`: which backend to use for clustering (`predis`, `redis` or custom configuration).
- `replication`: which backend to use for replication (predis or custom configuration).
- `aggregate`: custom connections aggregator (overrides both `cluster` and `replication`).
- `connections`: list of connection backends or a connection factory instance.
- `cluster`: specifies a cluster backend (`predis`, `redis` or callable).
- `replication`: specifies a replication backend (`predis`, `sentinel` or callable).
- `aggregate`: configures the client with a custom aggregate connection (callable).
- `parameters`: list of default connection parameters for aggregate connections.
- `commands`: specifies a command factory instance to use through the library.
- `readTimeout`: (cluster only) Timeout between read operations while loop over connections.
Users can provide custom options with their values or lazy callable initializers that are stored in
the options container for later use through the library.
Users can also provide custom options with values or callable objects (for lazy initialization) that
are stored in the options container for later use through the library.
### Aggregate connections ###
Predis is able to aggregate multiple connections which is the base for cluster and replication. By
default the client implements a cluster of nodes using either client-side sharding (default) or a
Redis-backed solution using [redis-cluster](http://redis.io/topics/cluster-tutorial).
As for replication, Predis can handle a single-master and multiple-slaves setup by executing read
operations on slaves and switching to the master for write operations. The replication behavior is
fully configurable.
Aggregate connections are the foundation upon which Predis implements clustering and replication and
they are used to group multiple connections to single Redis nodes and hide the specific logic needed
to handle them properly depending on the context. Aggregate connections usually require an array of
connection parameters along with the appropriate client option when creating a new client instance.
#### Replication ####
#### Cluster ####
The client can be configured to work in a master / slave replication setup by executing read-only
commands on slave nodes and automatically switch to the master node as soon as a command performing
a write operation is executed. This is the basic configuration needed to work with replication:
Predis can be configured to work in clustering mode with a traditional client-side sharding approach
to create a cluster of independent nodes and distribute the keyspace among them. This approach needs
some sort of external health monitoring of nodes and requires the keyspace to be rebalanced manually
when nodes are added or removed:
```php
// Parameters require one master node specifically marked with `alias=master`.
$parameters = ['tcp://10.0.0.1?alias=master', 'tcp://10.0.0.2?alias=slave-01'];
$options = ['replication' => true];
$parameters = ['tcp://10.0.0.1', 'tcp://10.0.0.2', 'tcp://10.0.0.3'];
$options = ['cluster' => 'predis'];
$client = new Predis\Client($parameters);
```
Along with Redis 3.0, a new supervised and coordinated type of clustering was introduced in the form
of [redis-cluster](http://redis.io/topics/cluster-tutorial). This kind of approach uses a different
algorithm to distribute the keyspaces, with Redis nodes coordinating themselves by communicating via
a gossip protocol to handle health status, rebalancing, nodes discovery and request redirection. In
order to connect to a cluster managed by redis-cluster, the client requires a list of its nodes (not
necessarily complete since it will automatically discover new nodes if necessary) and the `cluster`
client options set to `redis`:
```php
$parameters = ['tcp://10.0.0.1', 'tcp://10.0.0.2', 'tcp://10.0.0.3'];
$options = ['cluster' => 'redis'];
$client = new Predis\Client($parameters, $options);
```
While Predis is able to distinguish commands performing write and read-only operations, `EVAL` and
`EVALSHA` represent a corner case in which the client switches to the master node because it is not
able to tell when a Lua script is safe to be executed on slaves. While this is the default behavior,
when certain Lua scripts do not perform write operations it is possible to provide an hint to tell
the client to stick with slaves for their execution.
#### Redis Gears with cluster ####
Since Redis v7.2, Redis Gears module is a part of Redis Stack bundle. Client supports a variety of
Redis Gears commands that can be used with OSS cluster API. Currently, before using any Redis
Gears commands against OSS cluster Redis server needs to be aware of cluster topology.
`REDISGEARS_2.REFRESHCLUSTER` command should be called against **each master node** (read replicas
should be ignored) **on cluster creation and each time cluster topology changes**.
In most cases this actions should be performed from the CLI interface by the administrator, DevOPS
or even Kubernetes, depends on your infrastructure managing process. However, client provides an API
to do this programmatically.
```php
$parameters = ['tcp://10.0.0.1?alias=master', 'tcp://10.0.0.2?alias=slave-01'];
/** @var \Predis\Connection\Cluster\ClusterInterface $connection */
$connection->executeCommandOnEachNode(
new \Predis\Command\RawCommand('REDISGEARS_2.REFRESHCLUSTER')
);
```
#### Replication ####
The client can be configured to operate in a single master / multiple slaves setup to provide better
service availability. When using replication, Predis recognizes read-only commands and sends them to
a random slave in order to provide some sort of load-balancing and switches to the master as soon as
it detects a command that performs any kind of operation that would end up modifying the keyspace or
the value of a key. Instead of raising a connection error when a slave fails, the client attempts to
fall back to a different slave among the ones provided in the configuration.
The basic configuration needed to use the client in replication mode requires one Redis server to be
identified as the master (this can be done via connection parameters by setting the `role` parameter
to `master`) and one or more slaves (in this case setting `role` to `slave` for slaves is optional):
```php
$parameters = ['tcp://10.0.0.1?role=master', 'tcp://10.0.0.2', 'tcp://10.0.0.3'];
$options = ['replication' => 'predis'];
$client = new Predis\Client($parameters, $options);
```
The above configuration has a static list of servers and relies entirely on the client's logic, but
it is possible to rely on [`redis-sentinel`](http://redis.io/topics/sentinel) for a more robust HA
environment with sentinel servers acting as a source of authority for clients for service discovery.
The minimum configuration required by the client to work with redis-sentinel is a list of connection
parameters pointing to a bunch of sentinel instances, the `replication` option set to `sentinel` and
the `service` option set to the name of the service:
```php
$sentinels = ['tcp://10.0.0.1', 'tcp://10.0.0.2', 'tcp://10.0.0.3'];
$options = ['replication' => 'sentinel', 'service' => 'mymaster'];
$client = new Predis\Client($sentinels, $options);
```
If the master and slave nodes are configured to require an authentication from clients, a password
must be provided via the global `parameters` client option. This option can also be used to specify
a different database index. The client options array would then look like this:
```php
$options = [
'replication' => 'sentinel',
'service' => 'mymaster',
'parameters' => [
'password' => $secretpassword,
'database' => 10,
],
];
```
While Predis is able to distinguish commands performing write and read-only operations, `EVAL` and
`EVALSHA` represent a corner case in which the client switches to the master node because it cannot
tell when a Lua script is safe to be executed on slaves. While this is indeed the default behavior,
when certain Lua scripts do not perform write operations it is possible to provide an hint to tell
the client to stick with slaves for their execution:
```php
$parameters = ['tcp://10.0.0.1?role=master', 'tcp://10.0.0.2', 'tcp://10.0.0.3'];
$options = ['replication' => function () {
// Set scripts that won't trigger a switch from a slave to the master node.
$strategy = new Predis\Replication\ReplicationStrategy();
$strategy->setScriptReadOnly($LUA_SCRIPT);
return new Predis\Connection\Aggregate\MasterSlaveReplication($strategy);
return new Predis\Connection\Replication\MasterSlaveReplication($strategy);
}];
$client = new Predis\Client($parameters, $options);
@@ -181,29 +291,8 @@ $client->eval($LUA_SCRIPT, 0); // Sticks to slave using `eval`...
$client->evalsha(sha1($LUA_SCRIPT), 0); // ... and `evalsha`, too.
```
The `examples` directory contains two complete scripts showing how replication can be configured for
[simple](examples/replication_simple.php) or [complex](examples/replication_complex.php) scenarios.
#### Cluster ####
Simply passing an array of connection parameters to the client constructor configures Predis to work
in cluster mode using client-side sharding. If you, on the other hand, want to leverage Redis >= 3.0
nodes coordinated by redis-cluster, then the client must be initialized like this:
```php
$parameters = ['tcp://10.0.0.1', 'tcp://10.0.0.2'];
$options = ['cluster' => 'redis'];
$client = new Predis\Client($parameters, $options);
```
When using redis-cluster, it is not necessary to pass all of the nodes that compose your cluster but
you can simply specify only a few nodes: Predis will automatically fetch the full and updated slots
map directly from Redis by contacting one of the servers.
__NOTE__: our support for redis-cluster does not currently consider master / slave replication but
this feature will be added in a future release of this library.
The [`examples`](examples/) directory contains a few scripts that demonstrate how the client can be
configured and used to leverage replication in both basic and complex scenarios.
### Command pipelines ###
@@ -214,7 +303,7 @@ The client can execute the pipeline inside a callable block or return a pipeline
ability to chain commands thanks to its fluent interface:
```php
// Executes a pipeline inside a given callable block:
// Executes a pipeline inside the given callable block:
$responses = $client->pipeline(function ($pipe) {
for ($i = 0; $i < 1000; $i++) {
$pipe->set("key:$i", str_pad($i, 4, '0', 0));
@@ -222,7 +311,7 @@ $responses = $client->pipeline(function ($pipe) {
}
});
// Returns a pipeline instance with fluent interface:
// Returns a pipeline that can be chained thanks to its fluent interface:
$responses = $client->pipeline()->set('foo', 'bar')->get('foo')->execute();
```
@@ -233,13 +322,13 @@ The client provides an abstraction for Redis transactions based on `MULTI` and `
interface to command pipelines:
```php
// Executes a transaction inside a given callable block:
// Executes a transaction inside the given callable block:
$responses = $client->transaction(function ($tx) {
$tx->set('foo', 'bar');
$tx->get('foo');
});
// Returns a transaction instance with fluent interface:
// Returns a transaction that can be chained thanks to its fluent interface:
$responses = $client->transaction()->set('foo', 'bar')->get('foo')->execute();
```
@@ -247,13 +336,32 @@ This abstraction can perform check-and-set operations thanks to `WATCH` and `UNW
automatic retries of transactions aborted by Redis when `WATCH`ed keys are touched. For an example
of a transaction using CAS you can see [the following example](examples/transaction_using_cas.php).
#### Support for clustered connections ####
Since Predis v3.0 transactions could be used with clustered connections. However, it has some limitations due to the
fact that Redis doesn't support distributed transactions. All keys in the transaction context should operate on the same
hash slot, due to this limitation it's recommended to use `{}` syntax to make sure that all keys will be mapped to the same hash
slot. Apart from it no additional configuration needed on a client side.
```php
$redis = $this->getClient();
$response = $redis->transaction(function (MultiExec $tx) {
$tx->set('{foo}foo', 'value');
$tx->set('{foo}bar', 'value');
$tx->set('{foo}baz', 'value');
});
// ['OK', 'OK', 'OK']
```
### Adding new commands ###
While we try to update Predis to stay up to date with all the commands available in Redis, you might
prefer to stick with an older version of the library or provide a different way to filter arguments
or parse responses for specific commands. To achieve that, Predis provides the ability to implement
new command classes to define or override commands in the server profiles used by the client:
prefer to stick with an old version of the library or provide a different way to filter arguments or
parse responses for specific commands. To achieve that, Predis provides the ability to implement new
command classes to define or override commands in the default command factory used by the client:
```php
// Define a new command by extending Predis\Command\Command:
@@ -265,16 +373,19 @@ class BrandNewRedisCommand extends Predis\Command\Command
}
}
// Inject your command in the current profile:
$client = new Predis\Client();
$client->getProfile()->defineCommand('newcmd', 'BrandNewRedisCommand');
// Inject your command in the current command factory:
$client = new Predis\Client($parameters, [
'commands' => [
'newcmd' => 'BrandNewRedisCommand',
],
]);
$response = $client->newcmd();
```
There is also a method to send raw commands without filtering their arguments or parsing responses.
Users must provide the arguments list as an array, following the command signatures as defined by
the [Redis documentation for commands](http://redis.io/commands):
Users must provide the list of arguments for the command as an array, following the signatures as
defined by the [Redis documentation for commands](http://redis.io/commands):
```php
$response = $client->executeRaw(['SET', 'foo', 'bar']);
@@ -284,16 +395,16 @@ $response = $client->executeRaw(['SET', 'foo', 'bar']);
### Script commands ###
While it is possible to leverage [Lua scripting](http://redis.io/commands/eval) on Redis 2.6+ using
[`EVAL`](http://redis.io/commands/eval) and [`EVALSHA`](http://redis.io/commands/evalsha), Predis
offers script commands as an higher level abstraction aiming to make things simple. Script commands
can be registered in the server profile used by the client and are accessible as if they were plain
Redis commands, but they define Lua scripts that get transmitted to the server for remote execution.
Internally they use [`EVALSHA`](http://redis.io/commands/evalsha) by default and identify a script
by its SHA1 hash to save bandwidth, but [`EVAL`](http://redis.io/commands/eval) is used as a fall
back when needed:
directly [`EVAL`](http://redis.io/commands/eval) and [`EVALSHA`](http://redis.io/commands/evalsha),
Predis offers script commands as an higher level abstraction built upon them to make things simple.
Script commands can be registered in the command factory used by the client and are accessible as if
they were plain Redis commands, but they define Lua scripts that get transmitted to the server for
remote execution. Internally they use [`EVALSHA`](http://redis.io/commands/evalsha) by default and
identify a script by its SHA1 hash to save bandwidth, but [`EVAL`](http://redis.io/commands/eval)
is used as a fall back when needed:
```php
// Define a new scriptable command by extending Predis\Command\ScriptCommand:
// Define a new script command by extending Predis\Command\ScriptCommand:
class ListPushRandomValue extends Predis\Command\ScriptCommand
{
public function getKeysCount()
@@ -312,9 +423,12 @@ LUA;
}
}
// Inject your script command in the current profile:
$client = new Predis\Client();
$client->getProfile()->defineCommand('lpushrand', 'ListPushRandomValue');
// Inject the script command in the current command factory:
$client = new Predis\Client($parameters, [
'commands' => [
'lpushrand' => 'ListPushRandomValue',
],
]);
$response = $client->lpushrand('random_values', $seed = mt_rand());
```
@@ -322,22 +436,18 @@ $response = $client->lpushrand('random_values', $seed = mt_rand());
### Customizable connection backends ###
Predis can use different connection backends to connect to Redis. Two of them leverage a third party
extension such as [phpiredis](https://github.com/nrk/phpiredis) resulting in major performance gains
especially when dealing with big multibulk responses. While one is based on PHP streams, the other
is based on socket resources provided by `ext-socket`. Both support TCP/IP or UNIX domain sockets:
Predis can use different connection backends to connect to Redis. The builtin Relay integration
leverages the [Relay](https://github.com/cachewerk/relay) extension for PHP for major performance
gains, by caching a partial replica of the Redis dataset in PHP shared runtime memory.
```php
$client = new Predis\Client('tcp://127.0.0.1', [
'connections' => [
'tcp' => 'Predis\Connection\PhpiredisStreamConnection', // PHP streams
'unix' => 'Predis\Connection\PhpiredisSocketConnection', // ext-socket
],
'connections' => 'relay',
]);
```
Developers can create their own connection classes to support whole new network backends, extend
existing ones or provide completely different implementations. Connection classes must implement
existing classes or provide completely different implementations. Connection classes must implement
`Predis\Connection\NodeConnectionInterface` or extend `Predis\Connection\AbstractConnection`:
```php
@@ -355,16 +465,156 @@ $client = new Predis\Client('tcp://127.0.0.1', [
For a more in-depth insight on how to create new connection backends you can refer to the actual
implementation of the standard connection classes available in the `Predis\Connection` namespace.
## RESP3 ##
### Connection ###
To establish the connection using the [RESP3](https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md) protocol, you need to set parameter `protocol => 3`. The default protocol is RESP2.
You can pass parameter as configuration option in array or as a query parameter in `redis_url`
```php
// Configuration option
$client = new \Predis\Client(['protocol' => 3]);
// Redis URL
$client = new \Predis\Client('redis://localhost:6379?protocol=3');
// ["proto" => "3"]
$client->executeRaw(['HELLO']);
```
### Command responses ###
RESP3 protocol introduce a variety of new [response types](https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#resp3-types),
so on the client-side we have more explicit understanding on data types we retrieve from server. Here's some examples to show the difference
between RESP2 and RESP3 responses.
#### Float responses ####
``` php
// RESP2 connection
$client = new \Predis\Client();
$client->geoadd('my_geo', 11.111, 22.222, 'member1');
// [[0 => string(20) "11.11099988222122192", 1 => string(20) "22.22200052541037252"]]
// RESP2 returns float values as simple strings.
var_dump($client->geopos('my_geo', ['member1']));
// RESP3 connection
$client = new \Predis\Client(['protocol' => 3]);
// [[0 => float(11.110999882221222), 1 => float(22.222000525410373)]]
// RESP3 introduces new double type, that corresponds to PHP float.
var_dump($client->geopos('my_geo', ['member1']));
```
#### Aggregate types ####
In RESP3 new aggregate type [Map](https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#map-type)
was introduced, that represents the sequence of field-value pairs. So it simplifies parsing, since we don't need to specify
parsing strategy per command (RESP2) and instead relies on the type defined by protocol (RESP3).
In most cases RESP2 responses shouldn't differ from RESP3, since we added additional parsing for those
command that return field-value pairs. However, since RESP2 requires additional parsing, it could be that some commands
had lack of it and return unhandled responses. In this case there would be difference like this:
```php
$client = new \Predis\Client();
// RESP2: ['field', 'value]
$client->commandThatReturnsFieldValuePair('key');
$client = new \Predis\Client(['protocol' => 3]);
// RESP3: ['field' => 'value]
$client->commandThatReturnsFieldValuePair('key');
```
Feel free to open PR or GitHub issue if you face those protocol mismatching.
### Push notifications ###
RESP3 introduce a concept of [push connection](https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#push-type),
is the one where server could send asynchronous data to client which was not explicitly requested. Predis 3.0 provides
an API to establish this kind of connection as separate blocking process (worker) and invoke callbacks depends on push
notification message type.
#### Consumer ####
First of all, you need to set up a consumer connection and provide an optional callback that will be executed before
event loop will be started. It allows you to subscribe on channels, enable keys invalidations tracking or enable monitor
connection, any Redis command to let server know that you want to receive push notification within this connection.
```php
// Make sure that RESP3 protocol enabled and read_write_timeout set 0,
// so connection won't be killed by timeout.
$client = new Predis\Client(['read_write_timeout' => 0, 'protocol' => 3]);
// Create push notifications consumer.
// Provides callback where current consumer subscribes to few channels before
// enter the loop.
$push = $client->push(static function (ClientInterface $client) {
$response = $client->subscribe('channel', 'control');
$status = ($response[2] === 1) ? 'OK' : 'FAILED';
echo "Channel subscription status: {$status}\n";
});
```
#### Dispatcher loop ####
Dispatcher object allows you to attach a callback to given push notification type and run the actual worker process that
listen for incoming push notifications. To be able to stop blocking process in runtime you can specify a condition and
call `$dispatcher->stop()` method from given callback. In this example we're waiting for specific message `terminate`
within `control` channel that we subscribed to before entering the loop.
```php
// Storage for incoming notifications.
$messages = [];
// Create dispatcher for push notifications.
$dispatcher = new Predis\Consumer\Push\DispatcherLoop($push);
$dispatcher->attachCallback(
PushResponseInterface::MESSAGE_DATA_TYPE,
static function (array $payload, DispatcherLoopInterface $dispatcher) {
global $messages;
[$channel, $message] = $payload;
if ($channel === 'control' && $message === 'terminate') {
echo "Terminating notification consumer.\n";
$dispatcher->stop();
return;
}
$messages[] = $message;
echo "Received message: {$message}\n";
}
);
// Run consumer loop with attached callbacks.
$dispatcher->run();
// Count all messages that were received during consumer loop.
$messagesCount = count($messages);
echo "We received: {$messagesCount} messages\n";
```
This example shows a simple script to count all incoming messages from push notifications that we receive from
subscribed channels until stop condition will be met. Examples available in `examples/` folder.
### Sharded pub/sub ###
From Redis 7.0, sharded Pub/Sub is introduced in which shard channels are assigned to slots by the same algorithm used
to assign keys to slots.
Predis 3.0 provides an API that allows to use pub/sub for Cluster connections using sharded pub/sub from Redis.
You don't need to specify any additional configuration to enable sharded pub/sub, it will be automatically enabled if
Cluster connection is using.
Implementation looks pretty much the same as Push notification, so you need to set up consumer
and run it over Dispatcher loop object. All examples available in `examples/` folder.
## Development ##
### Reporting bugs and contributing code ###
Contributions to Predis are highly appreciated either in the form of pull requests for new features,
bug fixes, or just bug reports. We only ask you to adhere to a [basic set of rules](CONTRIBUTING.md)
before submitting your changes or filing bugs on the issue tracker to make it easier for everyone to
stay consistent while working on the project.
bug fixes, or just bug reports. We only ask you to adhere to issue and pull request templates.
### Test suite ###
@@ -372,36 +622,27 @@ stay consistent while working on the project.
__ATTENTION__: Do not ever run the test suite shipped with Predis against instances of Redis running
in production environments or containing data you are interested in!
Predis has a comprehensive test suite covering every aspect of the library. This test suite performs
integration tests against a running instance of Redis (>= 2.4.0 is required) to verify the correct
behavior of the implementation of each command and automatically skips commands not defined in the
specified Redis profile. If you do not have Redis up and running, integration tests can be disabled.
By default the test suite is configured to execute integration tests using the profile for Redis 2.8
(which is the current stable version of Redis) but can optionally target a Redis instance built from
the `unstable` branch by modifying `phpunit.xml` and setting `REDIS_SERVER_VERSION` to `dev` so that
the development server profile will be used. You can refer to [the tests README](tests/README.md)
for more detailed information about testing Predis.
Predis uses Travis CI for continuous integration and the history for past and current builds can be
found [on its project page](http://travis-ci.org/nrk/predis).
## Other ##
### Project related links ###
- [Source code](https://github.com/nrk/predis)
- [Wiki](https://wiki.github.com/nrk/predis)
- [Issue tracker](https://github.com/nrk/predis/issues)
- [PEAR channel](http://pear.nrk.io)
### Author ###
- [Daniele Alessandri](mailto:suppakilla@gmail.com) ([twitter](http://twitter.com/JoL1hAHN))
Predis has a comprehensive test suite covering every aspect of the library and that can optionally
perform integration tests against a running instance of Redis (required >= 2.4.0 in order to verify
the correct behavior of the implementation of each command. Integration tests for unsupported Redis
commands are automatically skipped. If you do not have Redis up and running, integration tests can
be disabled. See [the tests README](tests/README.md) for more details about testing this library.
Predis uses GitHub Actions for continuous integration and the history for past and current builds can be
found [on its actions page](https://github.com/predis/predis/actions).
### License ###
The code for Predis is distributed under the terms of the MIT license (see [LICENSE](LICENSE)).
[ico-license]: https://img.shields.io/github/license/predis/predis.svg?style=flat-square
[ico-version-stable]: https://img.shields.io/github/v/tag/predis/predis?label=stable&style=flat-square
[ico-version-dev]: https://img.shields.io/github/v/tag/predis/predis?include_prereleases&label=pre-release&style=flat-square
[ico-downloads-monthly]: https://img.shields.io/packagist/dm/predis/predis.svg?style=flat-square
[ico-build]: https://img.shields.io/github/actions/workflow/status/predis/predis/tests.yml?branch=main&style=flat-square
[ico-coverage]: https://img.shields.io/coverallsCoverage/github/predis/predis?style=flat-square
[link-releases]: https://github.com/predis/predis/releases
[link-actions]: https://github.com/predis/predis/actions
[link-downloads]: https://packagist.org/packages/predis/predis/stats
[link-coverage]: https://coveralls.io/github/predis/predis
+1 -1
View File
@@ -1 +1 @@
1.0.1-dev
3.0.0
-2
View File
@@ -3,8 +3,6 @@
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
+24 -25
View File
@@ -4,8 +4,6 @@
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@@ -15,7 +13,7 @@
// of a test case to test a Redis command by specifying the name of the class
// in the Predis\Command namespace (only classes in this namespace are valid).
// For example, to generate a test case for SET (which is represented by the
// Predis\Command\StringSet class):
// Predis\Command\Redis\StringSet class):
//
// $ ./bin/generate-command-test --class=StringSet
//
@@ -45,6 +43,11 @@ class CommandTestCaseGenerator
if (!isset($options['class'])) {
throw new RuntimeException("Missing 'class' option.");
}
if (!isset($options['realm'])) {
throw new RuntimeException("Missing 'realm' option.");
}
$this->options = $options;
}
@@ -92,8 +95,12 @@ class CommandTestCaseGenerator
throw new RuntimeException("Missing 'class' option.");
}
$options['fqn'] = "Predis\\Command\\{$options['class']}";
$options['path'] = "Command/{$options['class']}.php";
if (!isset($options['realm'])) {
throw new RuntimeException("Missing 'realm' option.");
}
$options['fqn'] = "Predis\\Command\\Redis\\{$options['class']}";
$options['path'] = "Command/Redis/{$options['class']}.php";
$source = __DIR__.'/../src/'.$options['path'];
if (!file_exists($source)) {
@@ -101,7 +108,7 @@ class CommandTestCaseGenerator
}
if (!isset($options['output'])) {
$options['output'] = sprintf("%s/%s", $options['tests'], str_replace('.php', 'Test.php', $options['path']));
$options['output'] = sprintf("%s/%s", $options['tests'], str_replace('.php', '_Test.php', $options['path']));
}
return new self($options);
@@ -109,18 +116,11 @@ class CommandTestCaseGenerator
protected function getTestRealm()
{
if (isset($this->options['realm'])) {
if (!$this->options['realm']) {
throw new RuntimeException('Invalid value for realm has been sepcified (empty).');
}
return $this->options['realm'];
if (empty($this->options['realm'])) {
throw new RuntimeException('Invalid value for realm has been specified (empty).');
}
$fqnParts = explode('\\', $this->options['fqn']);
$class = array_pop($fqnParts);
list($realm,) = preg_split('/([[:upper:]][[:lower:]]+)/', $class, 2, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
return strtolower($realm);
return $this->options['realm'];
}
public function generate()
@@ -130,6 +130,7 @@ class CommandTestCaseGenerator
if (!$reflection->isInstantiable()) {
throw new RuntimeException("Class $class must be instantiable, abstract classes or interfaces are not allowed.");
}
if (!$reflection->implementsInterface('Predis\Command\CommandInterface')) {
throw new RuntimeException("Class $class must implement Predis\Command\CommandInterface.");
}
@@ -167,13 +168,11 @@ class CommandTestCaseGenerator
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Predis\Command;
namespace Predis\Command\Redis;
/**
* @group commands
@@ -184,7 +183,7 @@ class $class extends PredisCommandTestCase
/**
* {@inheritdoc}
*/
protected function getExpectedCommand()
protected function getExpectedCommand(): string
{
return '$fqn';
}
@@ -192,7 +191,7 @@ class $class extends PredisCommandTestCase
/**
* {@inheritdoc}
*/
protected function getExpectedId()
protected function getExpectedId(): string
{
return '$id';
}
@@ -200,7 +199,7 @@ class $class extends PredisCommandTestCase
/**
* @group disconnected
*/
public function testFilterArguments()
public function testFilterArguments(): void
{
\$this->markTestIncomplete('This test has not been implemented yet.');
@@ -216,7 +215,7 @@ class $class extends PredisCommandTestCase
/**
* @group disconnected
*/
public function testParseResponse()
public function testParseResponse(): void
{
\$this->markTestIncomplete('This test has not been implemented yet.');
@@ -236,7 +235,7 @@ PHP;
/**
* @group disconnected
*/
public function testPrefixKeys()
public function testPrefixKeys(): void
{
\$this->markTestIncomplete('This test has not been implemented yet.');
@@ -252,7 +251,7 @@ PHP;
/**
* @group disconnected
*/
public function testPrefixKeysIgnoredOnEmptyArguments()
public function testPrefixKeysIgnoredOnEmptyArguments(): void
{
\$command = \$this->getCommand();
\$command->prefixKeys('prefix:');
-233
View File
@@ -1,233 +0,0 @@
#!/usr/bin/env php
<?php
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
// -------------------------------------------------------------------------- //
// In order to be able to execute this script to create a PEAR package of Predis
// the `pear` binary must be available and executable in your $PATH.
// The parts used to parse author and version strings are taken from Onion (used
// by this library in the past) just to keep on relying on the package.ini file
// to simplify things. We might consider to switch to using the PEAR classes
// directly in the future.
// -------------------------------------------------------------------------- //
function executeWithBackup($file, $callback)
{
$exception = null;
$backup = "$file.backup";
copy($file, $backup);
try {
call_user_func($callback, $file);
} catch (Exception $exception) {
// NOOP
}
unlink($file);
rename($backup, $file);
if ($exception) {
throw $exception;
}
}
function parseAuthor($string)
{
$author = array();
if (preg_match('/^\s*(.+?)\s*(?:"(\S+)"\s*)?<(\S+)>\s*$/x', $string , $regs)) {
if (count($regs) == 4) {
list($_,$name,$user,$email) = $regs;
$author['name'] = $name;
$author['user'] = $user;
$author['email'] = $email;
} elseif (count($regs) == 3) {
list($_,$name,$email) = $regs;
$author['name'] = $name;
$author['email'] = $email;
}
} else {
$author['name'] = $string;
}
return $author;
}
function parseVersion($string)
{
$version_pattern = '([0-9.]+)';
if (preg_match("/^\s*$version_pattern\s*\$/x", $string, $regs)) {
return array('min' => $regs[1] ?: '0.0.0');
} elseif (preg_match("/^\s*[>=]+\s*$version_pattern\s*\$/x", $string, $regs)) {
return array('min' => $regs[1] ?: '0.0.0');
} elseif (preg_match("/^\s*[<=]+\s*$version_pattern\s*\$/x", $string, $regs)) {
return array('max' => $regs[1]);
} elseif (preg_match("/^\s*$version_pattern\s*<=>\s*$version_pattern\s*\$/x", $string, $regs)) {
return array(
'min' => $regs[1] ?: '0.0.0',
'max' => $regs[2],
);
}
return null;
}
function addRolePath($pkg, $path, $role)
{
if (is_dir($path)) {
$dirRoot = new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS);
$dirTree = new RecursiveIteratorIterator($dirRoot, RecursiveIteratorIterator::CHILD_FIRST);
foreach ($dirTree as $fileinfo) {
if ($fileinfo->isFile()) {
addPackageFile($pkg, $fileinfo, $role, $path);
}
}
} else {
foreach (glob($path) as $filename) {
addPackageFile($pkg, new SplFileInfo($filename), $role);
}
}
}
function addPackageFile($pkg, $fileinfo, $role, $baseDir = '')
{
$fileNode = $pkg->contents->dir->addChild('file');
$fileNode->addAttribute('name', $filepath = $fileinfo->getPathname());
$fileNode->addAttribute('role', $role);
$fileNode->addAttribute('md5sum', md5_file($filepath));
$installNode = $pkg->phprelease->filelist->addChild('install');
$installNode->addAttribute('name', $filepath);
$installNode->addAttribute('as', !$baseDir ? basename($filepath) : substr($filepath, strlen($baseDir) + 1));
}
function generatePackageXml($packageINI)
{
$XML = <<<XML
<?xml version="1.0"?>
<package packagerversion="1.4.10" version="2.0"
xmlns="http://pear.php.net/dtd/package-2.0"
xmlns:tasks="http://pear.php.net/dtd/tasks-1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
http://pear.php.net/dtd/tasks-1.0.xsd
http://pear.php.net/dtd/package-2.0
http://pear.php.net/dtd/package-2.0.xsd" />
XML;
$cfg = parse_ini_file($packageINI, true);
$pkg = new SimpleXMLElement($XML);
$pkg->name = $cfg['package']['name'];
$pkg->channel = $cfg['package']['channel'];
$pkg->summary = $cfg['package']['desc'];
$pkg->description = $cfg['package']['desc'];
$author = parseAuthor($cfg['package']['author']);
$pkg->addChild('lead');
$pkg->lead->name = $author['name'];
$pkg->lead->user = $author['user'];
$pkg->lead->email = $author['email'];
$pkg->lead->active = 'yes';
$datetime = new DateTime('now');
$pkg->date = $datetime->format('Y-m-d');
$pkg->time = $datetime->format('H:i:s');
$pkg->addChild('version');
$pkg->version->release = $cfg['package']['version'];
$pkg->version->api = $cfg['package']['version'];
$pkg->addChild('stability');
$pkg->stability->release = $cfg['package']['stability'];
$pkg->stability->api = $cfg['package']['stability'];
$pkg->license = $cfg['package']['license'];
$pkg->notes = '-';
$pkg->addChild('contents')->addChild('dir')->addAttribute('name', '/');
$pkg->addChild('dependencies')->addChild('required');
foreach ($cfg['require'] as $required => $version) {
$version = parseVersion($version);
$pkg->dependencies->required->addChild($required);
if (isset($version['min'])) {
$pkg->dependencies->required->$required->min = $version['min'];
}
if (isset($version['max'])) {
$pkg->dependencies->required->$required->min = $version['max'];
}
}
$pkg->addChild('phprelease')->addChild('filelist');
$pathToRole = array(
'doc' => 'doc', 'docs' => 'doc', 'examples' => 'doc',
'lib' => 'php', 'src' => 'php',
'test' => 'test', 'tests' => 'test',
);
foreach (array_merge($pathToRole, $cfg['roles'] ?: array()) as $path => $role) {
addRolePath($pkg, $path, $role);
}
return $pkg;
}
function rewritePackageInstallAs($pkg)
{
foreach ($pkg->phprelease->filelist->install as $file) {
if (preg_match('/^src\//', $file['name'])) {
$file['as'] = "Predis/{$file['as']}";
}
}
}
function savePackageXml($xml)
{
$dom = new DOMDocument("1.0");
$dom->preserveWhiteSpace = false;
$dom->formatOutput = true;
$dom->loadXML($xml->asXML());
file_put_contents('package.xml', $dom->saveXML());
}
function buildPackage()
{
passthru('pear -q package && rm package.xml');
}
function modifyPhpunitXml($file)
{
$cfg = new SimpleXMLElement($file, null, true);
$cfg[0]['bootstrap'] = str_replace('tests/', '', $cfg[0]['bootstrap']);
$cfg->testsuites->testsuite->directory = str_replace('tests/', '', $cfg->testsuites->testsuite->directory);
$cfg->saveXml($file);
}
// -------------------------------------------------------------------------- //
executeWithBackup(__DIR__.'/../phpunit.xml.dist', function ($file) {
modifyPhpunitXml($file);
$pkg = generatePackageXml('package.ini');
rewritePackageInstallAs($pkg);
savePackageXml($pkg);
buildPackage();
});
-71
View File
@@ -1,71 +0,0 @@
#!/usr/bin/env php
<?php
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
// -------------------------------------------------------------------------- //
// In order to be able to execute this script to create a Phar archive of Predis,
// the Phar module must be loaded and the "phar.readonly" directive php.ini must
// be set to "off". You can change the values in the $options array to customize
// the creation of the Phar archive to better suit your needs.
// -------------------------------------------------------------------------- //
$options = array(
'name' => 'predis',
'project_path' => __DIR__ . '/../src',
'compression' => Phar::NONE,
'append_version' => true,
);
function getPharFilename($options)
{
$filename = $options['name'];
// NOTE: do not consider "append_version" with Phar compression do to a bug in
// Phar::compress() when renaming phar archives containing dots in their name.
if ($options['append_version'] && $options['compression'] === Phar::NONE) {
$versionFile = @fopen(__DIR__ . '/../VERSION', 'r');
if ($versionFile === false) {
throw new Exception("Could not locate the VERSION file.");
}
$version = trim(fgets($versionFile));
fclose($versionFile);
$filename .= "_$version";
}
return "$filename.phar";
}
function getPharStub($options)
{
return <<<EOSTUB
<?php
Phar::mapPhar('predis.phar');
spl_autoload_register(function (\$class) {
if (strpos(\$class, 'Predis\\\\') === 0) {
\$file = 'phar://predis.phar/'.strtr(substr(\$class, 7), '\\\', '/').'.php';
if (file_exists(\$file)) {
require \$file;
return true;
}
}
});
__HALT_COMPILER();
EOSTUB;
}
// -------------------------------------------------------------------------- //
$phar = new Phar(getPharFilename($options));
$phar->compress($options['compression']);
$phar->setStub(getPharStub($options));
$phar->buildFromDirectory($options['project_path']);
-662
View File
@@ -1,662 +0,0 @@
#!/usr/bin/env php
<?php
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
// -------------------------------------------------------------------------- //
// This script can be used to automatically glue all the .php files of Predis
// into a single monolithic script file that can be used without an autoloader,
// just like the other previous versions of the library.
//
// Much of its complexity is due to the fact that we cannot simply join PHP
// files, but namespaces and classes definitions must follow a precise order
// when dealing with subclassing and inheritance.
//
// The current implementation is pretty naïve, but it should do for now.
// -------------------------------------------------------------------------- //
class CommandLine
{
public static function getOptions()
{
$parameters = array(
's:' => 'source:',
'o:' => 'output:',
'e:' => 'exclude:',
'E:' => 'exclude-classes:',
);
$getops = getopt(implode(array_keys($parameters)), $parameters);
$options = array(
'source' => __DIR__ . "/../src",
'output' => PredisFile::NS_ROOT . '.php',
'exclude' => array(),
);
foreach ($getops as $option => $value) {
switch ($option) {
case 's':
case 'source':
$options['source'] = $value;
break;
case 'o':
case 'output':
$options['output'] = $value;
break;
case 'E':
case 'exclude-classes':
$options['exclude'] = @file($value, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) ?: $value;
break;
case 'e':
case 'exclude':
$options['exclude'] = is_array($value) ? $value : array($value);
break;
}
}
return $options;
}
}
class PredisFile
{
const NS_ROOT = 'Predis';
private $namespaces;
public function __construct()
{
$this->namespaces = array();
}
public static function from($libraryPath, array $exclude = array())
{
$predisFile = new PredisFile();
$libIterator = new RecursiveDirectoryIterator($libraryPath);
foreach (new RecursiveIteratorIterator($libIterator) as $classFile)
{
if (!$classFile->isFile()) {
continue;
}
$namespace = self::NS_ROOT.strtr(str_replace($libraryPath, '', $classFile->getPath()), '/', '\\');
if (in_array(sprintf('%s\\%s', $namespace, $classFile->getBasename('.php')), $exclude)) {
continue;
}
$phpNamespace = $predisFile->getNamespace($namespace);
if ($phpNamespace === false) {
$phpNamespace = new PhpNamespace($namespace);
$predisFile->addNamespace($phpNamespace);
}
$phpClass = new PhpClass($phpNamespace, $classFile);
}
return $predisFile;
}
public function addNamespace(PhpNamespace $namespace)
{
if (isset($this->namespaces[(string)$namespace])) {
throw new InvalidArgumentException("Duplicated namespace");
}
$this->namespaces[(string)$namespace] = $namespace;
}
public function getNamespaces()
{
return $this->namespaces;
}
public function getNamespace($namespace)
{
if (!isset($this->namespaces[$namespace])) {
return false;
}
return $this->namespaces[$namespace];
}
public function getClassByFQN($classFqn)
{
if (($nsLastPos = strrpos($classFqn, '\\')) !== false) {
$namespace = $this->getNamespace(substr($classFqn, 0, $nsLastPos));
if ($namespace === false) {
return null;
}
$className = substr($classFqn, $nsLastPos + 1);
return $namespace->getClass($className);
}
return null;
}
private function calculateDependencyScores(&$classes, $fqn)
{
if (!isset($classes[$fqn])) {
$classes[$fqn] = 0;
}
$classes[$fqn] += 1;
if (($phpClass = $this->getClassByFQN($fqn)) === null) {
throw new RuntimeException(
"Cannot found the class $fqn which is required by other subclasses. Are you missing a file?"
);
}
foreach ($phpClass->getDependencies() as $fqn) {
$this->calculateDependencyScores($classes, $fqn);
}
}
private function getDependencyScores()
{
$classes = array();
foreach ($this->getNamespaces() as $phpNamespace) {
foreach ($phpNamespace->getClasses() as $phpClass) {
$this->calculateDependencyScores($classes, $phpClass->getFQN());
}
}
return $classes;
}
private function getOrderedNamespaces($dependencyScores)
{
$namespaces = array_fill_keys(array_unique(
array_map(
function ($fqn) { return PhpNamespace::extractName($fqn); },
array_keys($dependencyScores)
)
), 0);
foreach ($dependencyScores as $classFqn => $score) {
$namespaces[PhpNamespace::extractName($classFqn)] += $score;
}
arsort($namespaces);
return array_keys($namespaces);
}
private function getOrderedClasses(PhpNamespace $phpNamespace, $classes)
{
$nsClassesFQNs = array_map(function ($cl) { return $cl->getFQN(); }, $phpNamespace->getClasses());
$nsOrderedClasses = array();
foreach ($nsClassesFQNs as $nsClassFQN) {
$nsOrderedClasses[$nsClassFQN] = $classes[$nsClassFQN];
}
arsort($nsOrderedClasses);
return array_keys($nsOrderedClasses);
}
public function getPhpCode()
{
$buffer = array("<?php\n\n", PhpClass::LICENSE_HEADER, "\n\n");
$classes = $this->getDependencyScores();
$namespaces = $this->getOrderedNamespaces($classes);
foreach ($namespaces as $namespace) {
$phpNamespace = $this->getNamespace($namespace);
// generate namespace directive
$buffer[] = $phpNamespace->getPhpCode();
$buffer[] = "\n";
// generate use directives
$useDirectives = $phpNamespace->getUseDirectives();
if (count($useDirectives) > 0) {
$buffer[] = $useDirectives->getPhpCode();
$buffer[] = "\n";
}
// generate classes bodies
$nsClasses = $this->getOrderedClasses($phpNamespace, $classes);
foreach ($nsClasses as $classFQN) {
$buffer[] = $this->getClassByFQN($classFQN)->getPhpCode();
$buffer[] = "\n\n";
}
$buffer[] = "/* " . str_repeat("-", 75) . " */";
$buffer[] = "\n\n";
}
return implode($buffer);
}
public function saveTo($outputFile)
{
// TODO: add more sanity checks
if ($outputFile === null || $outputFile === '') {
throw new InvalidArgumentException('You must specify a valid output file');
}
file_put_contents($outputFile, $this->getPhpCode());
}
}
class PhpNamespace implements IteratorAggregate
{
private $namespace;
private $classes;
public function __construct($namespace)
{
$this->namespace = $namespace;
$this->classes = array();
$this->useDirectives = new PhpUseDirectives($this);
}
public static function extractName($fqn)
{
$nsSepLast = strrpos($fqn, '\\');
if ($nsSepLast === false) {
return $fqn;
}
$ns = substr($fqn, 0, $nsSepLast);
return $ns !== '' ? $ns : null;
}
public function addClass(PhpClass $class)
{
$this->classes[$class->getName()] = $class;
}
public function getClass($className)
{
if (isset($this->classes[$className])) {
return $this->classes[$className];
}
}
public function getClasses()
{
return array_values($this->classes);
}
public function getIterator()
{
return new \ArrayIterator($this->getClasses());
}
public function getUseDirectives()
{
return $this->useDirectives;
}
public function getPhpCode()
{
return "namespace $this->namespace;\n";
}
public function __toString()
{
return $this->namespace;
}
}
class PhpUseDirectives implements Countable, IteratorAggregate
{
private $use;
private $aliases;
private $reverseAliases;
private $namespace;
public function __construct(PhpNamespace $namespace)
{
$this->namespace = $namespace;
$this->use = array();
$this->aliases = array();
$this->reverseAliases = array();
}
public function add($use, $as = null)
{
if (in_array($use, $this->use)) {
return;
}
$rename = null;
$this->use[] = $use;
$aliasedClassName = $as ?: PhpClass::extractName($use);
if (isset($this->aliases[$aliasedClassName])) {
$parentNs = $this->getParentNamespace();
if ($parentNs && false !== $pos = strrpos($parentNs, '\\')) {
$parentNs = substr($parentNs, $pos);
}
$newAlias = "{$parentNs}_{$aliasedClassName}";
$rename = (object) array(
'namespace' => $this->namespace,
'from' => $aliasedClassName,
'to' => $newAlias,
);
$this->aliases[$newAlias] = $use;
$as = $newAlias;
} else {
$this->aliases[$aliasedClassName] = $use;
}
if ($as !== null) {
$this->reverseAliases[$use] = $as;
}
return $rename;
}
public function getList()
{
return $this->use;
}
public function getIterator()
{
return new \ArrayIterator($this->getList());
}
public function getPhpCode()
{
$reverseAliases = $this->reverseAliases;
$reducer = function ($str, $use) use ($reverseAliases) {
if (isset($reverseAliases[$use])) {
return $str .= "use $use as {$reverseAliases[$use]};\n";
} else {
return $str .= "use $use;\n";
}
};
return array_reduce($this->getList(), $reducer, '');
}
public function getNamespace()
{
return $this->namespace;
}
public function getParentNamespace()
{
if (false !== $pos = strrpos($this->namespace, '\\')) {
return substr($this->namespace, 0, $pos);
}
return '';
}
public function getFQN($className)
{
if (($nsSepFirst = strpos($className, '\\')) === false) {
if (isset($this->aliases[$className])) {
return $this->aliases[$className];
}
return (string)$this->getNamespace() . "\\$className";
}
if ($nsSepFirst != 0) {
throw new InvalidArgumentException("Partially qualified names are not supported");
}
return $className;
}
public function count()
{
return count($this->use);
}
}
class PhpClass
{
const LICENSE_HEADER = <<<LICENSE
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
LICENSE;
private $namespace;
private $file;
private $body;
private $implements;
private $extends;
private $name;
public function __construct(PhpNamespace $namespace, SplFileInfo $classFile)
{
$this->namespace = $namespace;
$this->file = $classFile;
$this->implements = array();
$this->extends = array();
$this->extractData();
$namespace->addClass($this);
}
public static function extractName($fqn)
{
$nsSepLast = strrpos($fqn, '\\');
if ($nsSepLast === false) {
return $fqn;
}
return substr($fqn, $nsSepLast + 1);
}
private function extractData()
{
$renames = array();
$useDirectives = $this->getNamespace()->getUseDirectives();
$useExtractor = function ($m) use ($useDirectives, &$renames) {
array_shift($m);
if (isset($m[1])) {
$m[1] = str_replace(" as ", '', $m[1]);
}
if ($rename = call_user_func_array(array($useDirectives, 'add'), $m)) {
$renames[] = $rename;
}
};
$classBuffer = stream_get_contents(fopen($this->getFile()->getPathname(), 'r'));
$classBuffer = str_replace(self::LICENSE_HEADER, '', $classBuffer);
$classBuffer = preg_replace('/<\?php\s?\\n\s?/', '', $classBuffer);
$classBuffer = preg_replace('/\s?\?>\n?/ms', '', $classBuffer);
$classBuffer = preg_replace('/namespace\s+[\w\d_\\\\]+;\s?/', '', $classBuffer);
$classBuffer = preg_replace_callback('/use\s+([\w\d_\\\\]+)(\s+as\s+.*)?;\s?\n?/', $useExtractor, $classBuffer);
foreach ($renames as $rename) {
$classBuffer = str_replace($rename->from, $rename->to, $classBuffer);
}
$this->body = trim($classBuffer);
$this->extractHierarchy();
}
private function extractHierarchy()
{
$implements = array();
$extends = array();
$extractor = function ($iterator, $callback) {
$className = '';
$iterator->seek($iterator->key() + 1);
while ($iterator->valid()) {
$token = $iterator->current();
if (is_string($token)) {
if (preg_match('/\s?,\s?/', $token)) {
$callback(trim($className));
$className = '';
} else if ($token == '{') {
$callback(trim($className));
return;
}
}
switch ($token[0]) {
case T_NS_SEPARATOR:
$className .= '\\';
break;
case T_STRING:
$className .= $token[1];
break;
case T_IMPLEMENTS:
case T_EXTENDS:
$callback(trim($className));
$iterator->seek($iterator->key() - 1);
return;
}
$iterator->next();
}
};
$tokens = token_get_all("<?php\n" . trim($this->getPhpCode()));
$iterator = new ArrayIterator($tokens);
while ($iterator->valid()) {
$token = $iterator->current();
if (is_string($token)) {
$iterator->next();
continue;
}
switch ($token[0]) {
case T_CLASS:
case T_INTERFACE:
$iterator->seek($iterator->key() + 2);
$tk = $iterator->current();
$this->name = $tk[1];
break;
case T_IMPLEMENTS:
$extractor($iterator, function ($fqn) use (&$implements) {
$implements[] = $fqn;
});
break;
case T_EXTENDS:
$extractor($iterator, function ($fqn) use (&$extends) {
$extends[] = $fqn;
});
break;
}
$iterator->next();
}
$this->implements = $this->guessFQN($implements);
$this->extends = $this->guessFQN($extends);
}
public function guessFQN($classes)
{
$useDirectives = $this->getNamespace()->getUseDirectives();
return array_map(array($useDirectives, 'getFQN'), $classes);
}
public function getImplementedInterfaces($all = false)
{
if ($all) {
return $this->implements;
}
return array_filter(
$this->implements,
function ($cn) { return strpos($cn, 'Predis\\') === 0; }
);
}
public function getExtendedClasses($all = false)
{
if ($all) {
return $this->extemds;
}
return array_filter(
$this->extends,
function ($cn) { return strpos($cn, 'Predis\\') === 0; }
);
}
public function getDependencies($all = false)
{
return array_merge(
$this->getImplementedInterfaces($all),
$this->getExtendedClasses($all)
);
}
public function getNamespace()
{
return $this->namespace;
}
public function getFile()
{
return $this->file;
}
public function getName()
{
return $this->name;
}
public function getFQN()
{
return (string)$this->getNamespace() . '\\' . $this->name;
}
public function getPhpCode()
{
return $this->body;
}
public function __toString()
{
return "class " . $this->getName() . '{ ... }';
}
}
/* -------------------------------------------------------------------------- */
$options = CommandLine::getOptions();
$predisFile = PredisFile::from($options['source'], $options['exclude']);
$predisFile->saveTo($options['output']);
+34 -12
View File
@@ -1,31 +1,53 @@
{
"name": "predis/predis",
"type": "library",
"description": "Flexible and feature-complete PHP client library for Redis",
"description": "A flexible and feature-complete Redis/Valkey client for PHP.",
"keywords": ["nosql", "redis", "predis"],
"homepage": "http://github.com/nrk/predis",
"homepage": "http://github.com/predis/predis",
"license": "MIT",
"support": {
"issues": "https://github.com/nrk/predis/issues"
"issues": "https://github.com/predis/predis/issues"
},
"authors": [
{
"name": "Daniele Alessandri",
"email": "suppakilla@gmail.com",
"homepage": "http://clorophilla.net"
"name": "Till Krüss",
"homepage": "https://till.im",
"role": "Maintainer"
}
],
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/tillkruss"
}
],
"require": {
"php": ">=5.3.2"
"php": "^7.2 || ^8.0",
"psr/http-message": "^1.0|^2.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
"friendsofphp/php-cs-fixer": "^3.3",
"phpstan/phpstan": "^1.9",
"phpunit/phpunit": "^8.0 || ~9.4.4",
"phpunit/phpcov": "^6.0 || ^8.0"
},
"suggest": {
"ext-phpiredis": "Allows faster serialization and deserialization of the Redis protocol",
"ext-curl": "Allows access to Webdis when paired with phpiredis"
"ext-relay": "Faster connection with in-memory caching (>=0.6.2)"
},
"scripts": {
"phpstan": "phpstan analyse",
"style": "php-cs-fixer fix --diff --dry-run",
"style:fix": "php-cs-fixer fix"
},
"autoload": {
"psr-4": {"Predis\\": "src/"}
}
"psr-4": {
"Predis\\": "src/"
}
},
"config": {
"sort-packages": true,
"preferred-install": "dist"
},
"minimum-stability": "dev",
"prefer-stable": true
}
@@ -0,0 +1,28 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
require __DIR__ . '/../../shared.php';
// Example of JSON.DEBUG command usage:
// 1. Set JSON object
$client = new Client();
$client->jsonset('key', '$', '{"key1":"value1","key2":"value2"}');
// 2. Dump information about json memory usage in bytes
$response = $client->jsondebug->memory('key', '$');
echo 'Response:' . "\n";
print_r($response);
+52
View File
@@ -0,0 +1,52 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
use Predis\Command\Argument\Search\AggregateArguments;
use Predis\Command\Argument\Search\CreateArguments;
use Predis\Command\Argument\Search\SchemaFields\AbstractField;
use Predis\Command\Argument\Search\SchemaFields\NumericField;
use Predis\Command\Argument\Search\SchemaFields\TextField;
require __DIR__ . '/../../shared.php';
// Example of FT.AGGREGATE command usage:
// 1. Create index
$client = new Client();
$ftCreateArguments = (new CreateArguments())->prefix(['user:']);
$schema = [
new TextField('name'),
new TextField('country'),
new NumericField('dob', '', AbstractField::SORTABLE),
];
$client->ftcreate('idx', $schema, $ftCreateArguments);
// 2. Add documents
$client->hset('user:0', 'name', 'Vlad', 'country', 'Ukraine', 'dob', 813801600);
$client->hset('user:1', 'name', 'Vlad', 'country', 'Israel', 'dob', 782265600);
$client->hset('user:2', 'name', 'Vlad', 'country', 'Ukraine', 'dob', 813801600);
// 3. Execute aggregation query
$ftAggregateArguments = (new AggregateArguments())
->apply('year(@dob)', 'birth')
->groupBy('@country', '@birth')
->reduce('COUNT', true, 'country_birth_Vlad_count')
->sortBy(0, '@birth', 'DESC');
$response = $client->ftaggregate('idx', '@name: "Vlad"', $ftAggregateArguments);
// Response grouped by user country and birth year, with users count in each group, sorted by birth year from DESC.
echo 'Response:' . "\n";
print_r($response);
+41
View File
@@ -0,0 +1,41 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
use Predis\Command\Argument\Search\SchemaFields\TextField;
require __DIR__ . '/../../shared.php';
// Example of FT.ALTER command usage:
// 1. Create index
$client = new Client();
$schema = [
new TextField('text_field'),
];
$client->ftcreate('index_alter', $schema);
echo 'Default index attributes:' . "\n";
$defaultAttributes = $client->ftinfo('index_alter');
print_r($defaultAttributes[7]);
// 2. Add additional attribute to existing index
$schema = [
new TextField('new_field_name'),
];
$client->ftalter('index_alter', $schema);
echo 'Updated index attributes:' . "\n";
$updatedAttributes = $client->ftinfo('index_alter');
print_r($updatedAttributes[7]);
@@ -0,0 +1,25 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
require __DIR__ . '/../../shared.php';
// Example of FT.CONFIG HELP command usage:
// 1. Dump helpful information about FT.CONFIG MAXEXPANSIONS option
$client = new Client();
echo 'Response:' . "\n";
print_r(
$client->ftconfig->help('MAXEXPANSIONS')
);
@@ -0,0 +1,29 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
require __DIR__ . '/../../shared.php';
// Example of FT.CONFIG SET command usage:
// 1. Change default timeout setting
$client = new Client();
echo 'Response:' . "\n";
print_r(
$client->ftconfig->set('TIMEOUT', 42)
);
print_r(
$client->ftconfig->get('TIMEOUT')
);
@@ -0,0 +1,54 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
use Predis\Command\Argument\Search\AggregateArguments;
use Predis\Command\Argument\Search\CreateArguments;
use Predis\Command\Argument\Search\SchemaFields\AbstractField;
use Predis\Command\Argument\Search\SchemaFields\NumericField;
use Predis\Command\Argument\Search\SchemaFields\TextField;
require __DIR__ . '/../../shared.php';
// Example of FT.CURSOR DEL command usage
// 1. Create index
$client = new Client();
$ftCreateArguments = (new CreateArguments())->prefix(['user:']);
$schema = [
new TextField('name'),
new TextField('country'),
new NumericField('dob', '', AbstractField::SORTABLE),
];
$client->ftcreate('index_cursor_del', $schema, $ftCreateArguments);
// 2. Add documents
$client->hset('user:0', 'name', 'Vlad', 'country', 'Ukraine', 'dob', 813801600);
$client->hset('user:1', 'name', 'Vlad', 'country', 'Israel', 'dob', 782265600);
$client->hset('user:2', 'name', 'Vlad', 'country', 'Ukraine', 'dob', 813801600);
// 3. Execute aggregation query
$ftAggregateArguments = (new AggregateArguments())
->apply('year(@dob)', 'birth')
->groupBy('@country', '@birth')
->reduce('COUNT', true, 'country_birth_Vlad_count')
->sortBy(0, '@birth', 'DESC')
->withCursor(1);
[$_, $cursor] = $client->ftaggregate('index_cursor_del', '@name: "Vlad"', $ftAggregateArguments);
// 4. Explicitly remove returned cursor
$client->ftcursor->del('index_cursor_del', $cursor);
echo "Cursor with cursorId - {$cursor} was removed";
@@ -0,0 +1,62 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
use Predis\Command\Argument\Search\AggregateArguments;
use Predis\Command\Argument\Search\CreateArguments;
use Predis\Command\Argument\Search\SchemaFields\AbstractField;
use Predis\Command\Argument\Search\SchemaFields\NumericField;
use Predis\Command\Argument\Search\SchemaFields\TextField;
require __DIR__ . '/../../shared.php';
// Example of FT.CURSOR READ command usage
// 1. Create index
$client = new Client();
$ftCreateArguments = (new CreateArguments())->prefix(['user:']);
$schema = [
new TextField('name'),
new TextField('country'),
new NumericField('dob', '', AbstractField::SORTABLE),
];
$client->ftcreate('index_cursor_read', $schema, $ftCreateArguments);
// 2. Add documents
$client->hset('user:0', 'name', 'Vlad', 'country', 'Ukraine', 'dob', 813801600);
$client->hset('user:1', 'name', 'Vlad', 'country', 'Israel', 'dob', 782265600);
$client->hset('user:2', 'name', 'Vlad', 'country', 'Ukraine', 'dob', 813801600);
// 3. Execute aggregation query
$ftAggregateArguments = (new AggregateArguments())
->apply('year(@dob)', 'birth')
->groupBy('@country', '@birth')
->reduce('COUNT', true, 'country_birth_Vlad_count')
->sortBy(0, '@birth', 'DESC')
->withCursor(1);
[$response, $cursor] = $client->ftaggregate('index_cursor_read', '@name: "Vlad"', $ftAggregateArguments);
// 4. Processing response in loop until cursorId exists
$actualResponse = [];
$cursors = [];
while ($cursor) {
$actualResponse[] = $response[1];
$cursors[] = $cursor;
[$response, $cursor] = $client->ftcursor->read('index_cursor_read', $cursor);
}
echo "Response: \n";
print_r($actualResponse);
+32
View File
@@ -0,0 +1,32 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
use Predis\Command\Argument\Search\SchemaFields\TextField;
require __DIR__ . '/../../shared.php';
// Example of FT.EXPLAIN command usage:
// 1. Create index
$client = new Client();
$schema = [
new TextField('text_field'),
];
$client->ftcreate('index_explain', $schema);
// 2. Run query explanations
$response = $client->ftexplain('index_explain', '(foo bar)|(hello world) @date:[100 200]|@date:[500 +inf]');
echo 'Response:' . "\n";
print_r($response);
+38
View File
@@ -0,0 +1,38 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
use Predis\Command\Argument\Search\ProfileArguments;
use Predis\Command\Argument\Search\SchemaFields\TextField;
require __DIR__ . '/../../shared.php';
// Example of FT.PROFILE command usage:
// 1. Create index
$client = new Client();
$schema = [
new TextField('text_field'),
];
$client->ftcreate('index_profile', $schema);
// 2. Create FT.PROFILE command arguments
$arguments = (new ProfileArguments())
->search()
->query('query');
// 3. Run profile query
$response = $client->ftprofile('index_profile', $arguments);
echo 'Response:' . "\n";
print_r($response);
@@ -0,0 +1,40 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
use Predis\Command\Argument\Search\SchemaFields\TextField;
use Predis\Command\Argument\Search\SpellcheckArguments;
require __DIR__ . '/../../shared.php';
// Example of FT.SPELLCHECK command usage:
// 1. Create index
$client = new Client();
$schema = [
new TextField('text_field'),
];
$client->ftcreate('index_spellcheck', $schema);
// 2. Add dictionary with terms
$client->ftdictadd('dict', 'hello', 'help');
// 3. Perform spelling correction query
$response = $client->ftspellcheck(
'index_spellcheck',
'held',
(new SpellcheckArguments())->distance(2)->terms('dict')
);
echo 'Response:' . "\n";
print_r($response);
@@ -0,0 +1,39 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
use Predis\Command\Argument\Search\SugAddArguments;
use Predis\Command\Argument\Search\SugGetArguments;
require __DIR__ . '/../../shared.php';
// Example of FT.SUGADD, FT.SUGGET, FT.SUGDEL, FT.SUGLEN commands usage:
// 1. Add suggestion to key with payload
$client = new Client();
$client->ftsugadd('key', 'hello', 2, (new SugAddArguments())->payload('payload'));
echo 'Suggestions dictionary length: ' . $client->ftsuglen('key') . "\n";
// 2. Perform fuzzy search by prefix to get previous suggestion with payload
$response = $client->ftsugget('key', 'hellp', (new SugGetArguments())->fuzzy()->withPayloads());
echo 'Suggestion for "hellp" prefix:' . "\n";
print_r($response);
// 3. Removes previous suggestion from key
$client->ftsugdel('key', 'hello');
$response = $client->ftsugget('key', 'hello');
echo 'Suggestions, after removing "hello" suggestion:' . "\n";
print_r($response);
+35
View File
@@ -0,0 +1,35 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
use Predis\Command\Argument\Search\SchemaFields\TextField;
require __DIR__ . '/../../shared.php';
// Example of FT.SYNDUMP command usage:
// 1. Create index
$client = new Client();
$schema = [
new TextField('text_field'),
];
$client->ftcreate('index_syndump', $schema);
// 2. Add synonyms group with terms
$client->ftsynupdate('index_syndump', 'synonym1', null, 'term1', 'term2');
// 3. Dump terms with synonyms
$response = $client->ftsyndump('index_syndump');
echo 'Response:' . "\n";
print_r($response);
+32
View File
@@ -0,0 +1,32 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
use Predis\Command\Argument\Search\SchemaFields\TextField;
require __DIR__ . '/../../shared.php';
// Example of FT.SYNUPDATE command usage:
// 1. Create index
$client = new Client();
$schema = [
new TextField('text_field'),
];
$client->ftcreate('index_synupdate', $schema);
// 2. Add synonyms into synonym group
$response = $client->ftsynupdate('index_synupdate', 'synonym1', null, 'term1', 'term2');
echo 'Response:' . "\n";
print_r($response);
+37
View File
@@ -0,0 +1,37 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
use Predis\Command\Argument\Search\CreateArguments;
use Predis\Command\Argument\Search\SchemaFields\TagField;
require __DIR__ . '/../../shared.php';
// Example of FT.TAGVALS command usage:
// 1. Create index
$client = new Client();
$schema = [
new TagField('tag_field'),
];
$client->ftcreate('index_tagvals', $schema, (new CreateArguments())->prefix(['prefix:']));
// 2. Add indexed tags
$client->hset('prefix:1', 'tag_field', 'Hello, World');
$client->hset('prefix:2', 'tag_field', 'Hey, World');
// 3. Unique tags value query
$response = $client->fttagvals('index_tagvals', 'tag_field');
echo 'Response:' . "\n";
print_r($response);
+38
View File
@@ -0,0 +1,38 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
use Predis\Command\Argument\TimeSeries\AddArguments;
use Predis\Command\Argument\TimeSeries\CommonArguments;
use Predis\Command\Argument\TimeSeries\CreateArguments;
require __DIR__ . '/../../shared.php';
// Example of TS.ADD command usage:
// 1. Create time series
$client = new Client();
$arguments = (new CreateArguments())
->retentionMsecs(60000)
->duplicatePolicy(CommonArguments::POLICY_MAX)
->labels('sensor_id', 2, 'area_id', 32);
$client->tscreate('temperature:2:32', $arguments);
// 2. Add sample into newly created time series
$addArguments = (new AddArguments())
->retentionMsecs(31536000000);
$response = $client->tsadd('temperature:2:32', 123123123123, 27, $addArguments);
echo "Timeseries was added with timestamp: {$response}";
+41
View File
@@ -0,0 +1,41 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
use Predis\Command\Argument\TimeSeries\AlterArguments;
use Predis\Command\Argument\TimeSeries\CommonArguments;
use Predis\Command\Argument\TimeSeries\CreateArguments;
require __DIR__ . '/../../shared.php';
// Example of TS.ALTER command usage:
// 1. Create time series
$client = new Client();
$arguments = (new CreateArguments())
->retentionMsecs(60000)
->duplicatePolicy(CommonArguments::POLICY_MAX)
->labels('sensor_id', 2, 'area_id', 32);
$response = $client->tscreate('temperature:2:32', $arguments);
echo "Time series creation status: {$response}\n";
// 2. Update Duplicate policy for time series above
$arguments = (new AlterArguments())
->duplicatePolicy(CommonArguments::POLICY_FIRST);
$response = $client->tsalter('temperature:2:32', $arguments);
$output = ($response == 'OK') ? 'Duplicate policy was successfully updated' : $response;
echo $output;
@@ -0,0 +1,31 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
use Predis\Command\Argument\TimeSeries\CommonArguments;
use Predis\Command\Argument\TimeSeries\CreateArguments;
require __DIR__ . '/../../shared.php';
// Example of TS.CREATE command usage:
// Create time series
$client = new Client();
$arguments = (new CreateArguments())
->retentionMsecs(60000)
->duplicatePolicy(CommonArguments::POLICY_MAX)
->labels('sensor_id', 2, 'area_id', 32);
$response = $client->tscreate('temperature:2:32', $arguments);
echo "Time series creation status: {$response}";
@@ -0,0 +1,33 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
use Predis\Command\Argument\TimeSeries\CreateArguments;
require __DIR__ . '/../../shared.php';
// Example of TS.CREATERULE command usage:
// 1. Create time series
$client = new Client();
$arguments = (new CreateArguments())
->labels('type', 'temp', 'location', 'TLV');
$createResponse = $client->tscreate('temp:TLV', $arguments);
echo "Original time series creation status: {$createResponse}\n";
$createResponse = $client->tscreate('dailyAvgTemp:TLV', $arguments);
echo "Compacted time series creation status: {$createResponse}\n";
$createRuleResponse = $client->tscreaterule('temp:TLV', 'dailyAvgTemp:TLV', 'avg', 1000);
echo "Compacted rule for compacted time series creation status: {$createRuleResponse}\n";
@@ -0,0 +1,45 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
use Predis\Command\Argument\TimeSeries\AddArguments;
use Predis\Command\Argument\TimeSeries\CommonArguments;
use Predis\Command\Argument\TimeSeries\CreateArguments;
use Predis\Command\Argument\TimeSeries\DecrByArguments;
require __DIR__ . '/../../shared.php';
// Example of TS.DECRBY command usage:
// 1. Create time series
$client = new Client();
$arguments = (new CreateArguments())
->retentionMsecs(60000)
->duplicatePolicy(CommonArguments::POLICY_MAX)
->labels('sensor_id', 2, 'area_id', 32);
$client->tscreate('temperature:2:32', $arguments);
// 2. Add sample into newly created time series
$addArguments = (new AddArguments())
->retentionMsecs(31536000000);
$response = $client->tsadd('temperature:2:32', 123123123123, 27, $addArguments);
echo "Timeseries was added with timestamp: {$response}\n";
// 3. Increasing value and timestamp
$client->tsdecrby('temperature:2:32', 1, (new DecrByArguments())->timestamp(123123123124));
$response = $client->tsget('temperature:2:32');
echo "Decreased value to - {$response[1]} and timestamp to {$response[0]}";
+47
View File
@@ -0,0 +1,47 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
use Predis\Command\Argument\TimeSeries\CommonArguments;
use Predis\Command\Argument\TimeSeries\CreateArguments;
require __DIR__ . '/../../shared.php';
// Example of TS.GET command usage:
// 1. Create time series
$client = new Client();
$arguments = (new CreateArguments())
->retentionMsecs(60000)
->duplicatePolicy(CommonArguments::POLICY_MAX)
->labels('sensor_id', 2, 'area_id', 32);
$client->tscreate('temperature:2:32', $arguments);
// 2. Add samples into time series
$client->tsadd('temperature:2:32', 123123123123, 27);
$client->tsadd('temperature:2:32', 123123123124, 28);
$client->tsadd('temperature:2:32', 123123123125, 29);
$response = $client->tsget('temperature:2:32');
echo "Sample with highest timestamp - {$response[0]} and value {$response[1]}\n";
// 3. Removes 2 samples with the highest timestamps
$response = $client->tsdel('temperature:2:32', 123123123124, 123123123125);
echo "Removed {$response} samples from timeseries.\n";
// 3. Retrieve a timestamp with the highest timestamp
$response = $client->tsget('temperature:2:32');
echo "New sample with highest timestamp - {$response[0]} and value {$response[1]}";
@@ -0,0 +1,37 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
use Predis\Command\Argument\TimeSeries\CreateArguments;
require __DIR__ . '/../../shared.php';
// Example of TS.CREATERULE command usage:
// 1. Create time series
$client = new Client();
$arguments = (new CreateArguments())
->labels('type', 'temp', 'location', 'TLV');
$createResponse = $client->tscreate('temp:TLV', $arguments);
echo "Original time series creation status: {$createResponse}\n";
$createResponse = $client->tscreate('dailyAvgTemp:TLV', $arguments);
echo "Compacted time series creation status: {$createResponse}\n";
$createRuleResponse = $client->tscreaterule('temp:TLV', 'dailyAvgTemp:TLV', 'avg', 1000);
echo "Compacted rule for compacted time series creation status: {$createRuleResponse}\n";
// 2. Remove compaction rule
$deleteRuleResponse = $client->tsdeleterule('temp:TLV', 'dailyAvgTemp:TLV');
echo "Compacted rule for compacted time series deletion status: {$deleteRuleResponse}\n";
+38
View File
@@ -0,0 +1,38 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
use Predis\Command\Argument\TimeSeries\CommonArguments;
use Predis\Command\Argument\TimeSeries\CreateArguments;
require __DIR__ . '/../../shared.php';
// Example of TS.GET command usage:
// 1. Create time series
$client = new Client();
$arguments = (new CreateArguments())
->retentionMsecs(60000)
->duplicatePolicy(CommonArguments::POLICY_MAX)
->labels('sensor_id', 2, 'area_id', 32);
$client->tscreate('temperature:2:32', $arguments);
// 2. Add samples into time series
$client->tsadd('temperature:2:32', 123123123123, 27);
$client->tsadd('temperature:2:32', 123123123124, 28);
$client->tsadd('temperature:2:32', 123123123125, 29);
// 3. Retrieve a timestamp with highest timestamp
$response = $client->tsget('temperature:2:32');
echo "Sample with highest timestamp - {$response[0]} and value - {$response[1]}";
@@ -0,0 +1,45 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
use Predis\Command\Argument\TimeSeries\AddArguments;
use Predis\Command\Argument\TimeSeries\CommonArguments;
use Predis\Command\Argument\TimeSeries\CreateArguments;
use Predis\Command\Argument\TimeSeries\IncrByArguments;
require __DIR__ . '/../../shared.php';
// Example of TS.INCRBY command usage:
// 1. Create time series
$client = new Client();
$arguments = (new CreateArguments())
->retentionMsecs(60000)
->duplicatePolicy(CommonArguments::POLICY_MAX)
->labels('sensor_id', 2, 'area_id', 32);
$client->tscreate('temperature:2:32', $arguments);
// 2. Add sample into newly created time series
$addArguments = (new AddArguments())
->retentionMsecs(31536000000);
$response = $client->tsadd('temperature:2:32', 123123123123, 27, $addArguments);
echo "Timeseries was added with timestamp: {$response}\n";
// 3. Increasing value and timestamp
$client->tsincrby('temperature:2:32', 1, (new IncrByArguments())->timestamp(123123123124));
$response = $client->tsget('temperature:2:32');
echo "Increased value to - {$response[1]} and timestamp to {$response[0]}";
+32
View File
@@ -0,0 +1,32 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
use Predis\Command\Argument\TimeSeries\CommonArguments;
use Predis\Command\Argument\TimeSeries\CreateArguments;
require __DIR__ . '/../../shared.php';
// Example of TS.CREATE command usage:
// 1. Create time series
$client = new Client();
$arguments = (new CreateArguments())
->retentionMsecs(60000)
->duplicatePolicy(CommonArguments::POLICY_MAX)
->labels('sensor_id', 2, 'area_id', 32);
$client->tscreate('temperature:2:32', $arguments);
// 2. Show info about given time series
print_r($client->tsinfo('temperature:2:32'));
+36
View File
@@ -0,0 +1,36 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
use Predis\Command\Argument\TimeSeries\CommonArguments;
use Predis\Command\Argument\TimeSeries\CreateArguments;
require __DIR__ . '/../../shared.php';
// Example of TS.MADD command usage:
// 1. Create time series
$client = new Client();
$arguments = (new CreateArguments())
->retentionMsecs(60000)
->duplicatePolicy(CommonArguments::POLICY_MAX)
->labels('sensor_id', 2, 'area_id', 32);
$client->tscreate('temperature:2:32', $arguments);
$client->tscreate('temperature:2:33', $arguments);
// 2. Add samples into few time series
$response = $client->tsmadd('temperature:2:32', 123123123123, 27, 'temperature:2:33', 123123123124, 28);
$stringResponse = implode(', ', $response);
echo "Samples was added to time series - timestamps: {$stringResponse}";
+41
View File
@@ -0,0 +1,41 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
use Predis\Command\Argument\TimeSeries\CommonArguments;
use Predis\Command\Argument\TimeSeries\CreateArguments;
use Predis\Command\Argument\TimeSeries\MGetArguments;
require __DIR__ . '/../../shared.php';
// Example of TS.MGET command usage:
// 1. Create time series
$client = new Client();
$arguments = (new CreateArguments())
->retentionMsecs(60000)
->duplicatePolicy(CommonArguments::POLICY_MAX)
->labels('type', 'temp', 'sensor_id', 2, 'area_id', 32);
$client->tscreate('temperature:2:32', $arguments);
$client->tscreate('temperature:2:33', $arguments);
// 2. Add samples into time series
$client->tsadd('temperature:2:32', 123123123123, 27);
$client->tsadd('temperature:2:33', 123123123124, 27);
// 3. Get sample from multiple time series matching given filter expression, with selected labels only
$response = $client->tsmget((new MGetArguments())->selectedLabels('type'), 'type=temp');
echo "Sample from time series, with label = 'type':\n";
print_r($response);
@@ -0,0 +1,48 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
use Predis\Command\Argument\TimeSeries\CreateArguments;
use Predis\Command\Argument\TimeSeries\MRangeArguments;
require __DIR__ . '/../../shared.php';
// Example of TS.MRANGE command usage:
// 1. Create time series
$client = new Client();
$response = $client->tscreate('stock:A', (new CreateArguments())->labels('type', 'stock', 'name', 'A'));
echo "Time series A creation status: {$response}\n";
$response = $client->tscreate('stock:B', (new CreateArguments())->labels('type', 'stock', 'name', 'B'));
echo "Time series B creation status: {$response}\n";
// 2. Add samples into both time series
$response = $client->tsmadd('stock:A', 1000, 100, 'stock:A', 1010, 110, 'stock:A', 1020, 120);
$stringResponse = implode(', ', $response);
echo "Added samples into time series A with following timestamps: {$stringResponse}\n";
$response = $client->tsmadd('stock:B', 1000, 120, 'stock:B', 1010, 110, 'stock:B', 1020, 100);
$stringResponse = implode(', ', $response);
echo "Added samples into time series B with following timestamps: {$stringResponse}\n";
// 3. Query range across both time series filtered by "type" and grouped by max type
$mrangeArguments = (new MRangeArguments())
->withLabels()
->filter('type=stock')
->groupBy('type', 'max');
$response = $client->tsmrange('-', '+', $mrangeArguments);
echo "Response:\n";
print_r($response);
@@ -0,0 +1,48 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
use Predis\Command\Argument\TimeSeries\CreateArguments;
use Predis\Command\Argument\TimeSeries\MRangeArguments;
require __DIR__ . '/../../shared.php';
// Example of TS.MREVRANGE command usage:
// 1. Create time series
$client = new Client();
$response = $client->tscreate('stock:A', (new CreateArguments())->labels('type', 'stock', 'name', 'A'));
echo "Time series A creation status: {$response}\n";
$response = $client->tscreate('stock:B', (new CreateArguments())->labels('type', 'stock', 'name', 'B'));
echo "Time series B creation status: {$response}\n";
// 2. Add samples into both time series
$response = $client->tsmadd('stock:A', 1000, 100, 'stock:A', 1010, 110, 'stock:A', 1020, 120);
$stringResponse = implode(', ', $response);
echo "Added samples into time series A with following timestamps: {$stringResponse}\n";
$response = $client->tsmadd('stock:B', 1000, 120, 'stock:B', 1010, 110, 'stock:B', 1020, 100);
$stringResponse = implode(', ', $response);
echo "Added samples into time series B with following timestamps: {$stringResponse}\n";
// 3. Query range across both time series filtered by "type" and grouped by max type
$mrangeArguments = (new MRangeArguments())
->withLabels()
->filter('type=stock')
->groupBy('type', 'max');
$response = $client->tsmrevrange('-', '+', $mrangeArguments);
echo "Response:\n";
print_r($response);
@@ -0,0 +1,36 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
use Predis\Command\Argument\TimeSeries\CreateArguments;
require __DIR__ . '/../../shared.php';
// Example of TS.QUERYINDEX command usage:
// 1. Create time series
$client = new Client();
$arguments = (new CreateArguments())
->labels('type', 'temp', 'location', 'TLV');
$createResponse = $client->tscreate('temp:TLV', $arguments);
echo "Time series with location TLV creation status: {$createResponse}\n";
$anotherArguments = (new CreateArguments())
->labels('type', 'temp', 'location', 'JER');
$createResponse = $client->tscreate('temp:JER', $anotherArguments);
echo "Time series with location JER creation status: {$createResponse}\n";
echo "Returns all keys with location=TLV:\n";
print_r($client->tsqueryindex('location=TLV'));
+40
View File
@@ -0,0 +1,40 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
use Predis\Command\Argument\TimeSeries\CreateArguments;
use Predis\Command\Argument\TimeSeries\RangeArguments;
require __DIR__ . '/../../shared.php';
// Example of TS.RANGE command usage:
// 1. Create time series
$client = new Client();
$createArguments = (new CreateArguments())->labels('type', 'temp', 'location', 'TLV');
$createResponse = $client->tscreate('temp:TLV', $createArguments);
echo "Time series creation status: {$createResponse}\n";
// 2. Add samples into time series
$maddResponse = $client->tsmadd('temp:TLV', 1000, 30, 'temp:TLV', 1010, 35, 'temp:TLV', 1020, 9999, 'temp:TLV', 1030, 40);
$stringResponse = implode(', ', $maddResponse);
echo "Samples was added with following timestamps: {$stringResponse}\n";
// 3. Query samples by values in the given range
$rangeArguments = (new RangeArguments())->filterByValue(-100, 100);
$rangeResponse = $client->tsrange('temp:TLV', '-', '+', $rangeArguments);
echo "Samples with temperature in range -100 to 100 degrees:\n";
print_r($rangeResponse);
@@ -0,0 +1,40 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
use Predis\Command\Argument\TimeSeries\CreateArguments;
use Predis\Command\Argument\TimeSeries\RangeArguments;
require __DIR__ . '/../../shared.php';
// Example of TS.REVRANGE command usage:
// 1. Create time series
$client = new Client();
$createArguments = (new CreateArguments())->labels('type', 'temp', 'location', 'TLV');
$createResponse = $client->tscreate('temp:TLV', $createArguments);
echo "Time series creation status: {$createResponse}\n";
// 2. Add samples into time series
$maddResponse = $client->tsmadd('temp:TLV', 1000, 30, 'temp:TLV', 1010, 35, 'temp:TLV', 1020, 9999, 'temp:TLV', 1030, 40);
$stringResponse = implode(', ', $maddResponse);
echo "Samples was added with following timestamps: {$stringResponse}\n";
// 3. Query samples by values in the given range
$rangeArguments = (new RangeArguments())->filterByValue(-100, 100);
$rangeResponse = $client->tsrevrange('temp:TLV', '-', '+', $rangeArguments);
echo "Samples with temperature in range -100 to 100 degrees in reverse order:\n";
print_r($rangeResponse);
+36
View File
@@ -0,0 +1,36 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
require __DIR__ . '/../shared.php';
// Example of ACL DRYRUN command usage:
// 1. Set user with permissions to call only 'SET' command.
$client = new Client($single_server);
$response = $client->acl->setUser('Test_dry', '+SET', '~*');
$created = ($response == 'OK') ? 'Yes' : 'No';
echo "User with username 'Test' was created: {$created}. Permissions only to use SET command\n";
// 2. Dry run 'SET' command under 'Test_dry' user
$response = $client->acl->dryRun('Test_dry', 'SET', 'foo', 'bar');
echo 'Dry run "SET" command.' . "\n";
echo 'Response: ' . $response . "\n";
// 3. Dry run 'GET' command under 'Test_dry' user
$response = $client->acl->dryRun('Test_dry', 'GET', 'foo');
echo 'Dry run "GET" command.' . "\n";
echo 'Response: ' . $response;
+28
View File
@@ -0,0 +1,28 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
require __DIR__ . '/../shared.php';
// Example of ACL GETUSER command usage:
// 1. Set user
$client = new Client($single_server);
$response = $client->acl->setUser('Test');
// 2. Retrieve user rules:
echo 'Rules: ' . "\n";
print_r(
$client->acl->getUser('Test')
);
+24
View File
@@ -0,0 +1,24 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
require __DIR__ . '/../shared.php';
// Example of ACL SETUSER command usage:
// 1. Set user
$client = new Client($single_server);
$response = $client->acl->setUser('Test');
$created = ($response == 'OK') ? 'Yes' : 'No';
echo "User with username 'Test' was created: {$created}";
+43
View File
@@ -0,0 +1,43 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
require __DIR__ . '/../shared.php';
// Example of FCALL_RO command usage:
// 1. Set key-value pair
$client = new Client($single_server);
$client->set('foo', 'bar');
echo "Set key 'foo' with value 'bar'\n";
// 2. Load redis function with 'no-writes' flag
$client->function->load(
"#!lua name=mylib
redis.register_function{
function_name='myfunc',
callback=function(keys, args) return redis.call('GET', keys[1]) end,
flags={'no-writes'}
}"
);
echo 'Loaded custom function that perform GET command against provided key.' . "\n";
// 3. Call function above with given key
$response = $client->fcall_ro('myfunc', ['foo']);
echo "Function returned value against provided key 'foo' is '{$response}'";
// 4. Delete test library
$client->function->delete('mylib');
+41
View File
@@ -0,0 +1,41 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
require __DIR__ . '/../shared.php';
// Example of WAITAOF command usage:
// 1. Enable appendonly mode if it's not (command works only in appendonly mode)
$client = new Client($single_server);
$info = $client->info();
$enabled = false;
if ($info['Persistence']['aof_enabled'] === '0') {
$client->config('set', 'appendonly', 'yes');
$enabled = true;
}
// 2. Set key value pair
$response = $client->set('foo', 'bar');
echo "Key-value pair set status: {$response}\n";
// 3. Run WAITAOF command to make sure that all previous writes was fsynced
$response = $client->waitaof(1, 0, 0);
echo "Quantity of local instances that was fsynced - {$response[0]}, quantity of replicas - {$response[1]}";
// 4. Disable appendonly mode if it was enabled during script execution
if ($enabled) {
$client->config('set', 'appendonly', 'no');
}
+13 -12
View File
@@ -3,22 +3,23 @@
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require __DIR__.'/shared.php';
require __DIR__ . '/shared.php';
// Developers can implement Predis\Distribution\DistributorInterface to create
// their own distributors used by the client to distribute keys among a cluster
// of servers.
use Predis\Cluster\PredisStrategy;
use Predis\Cluster\Distributor\DistributorInterface;
use Predis\Cluster\Hash\HashGeneratorInterface;
use Predis\Connection\Aggregate\PredisCluster;
use Predis\Cluster\PredisStrategy;
use Predis\Connection\Cluster\PredisCluster;
class NaiveDistributor implements DistributorInterface, HashGeneratorInterface
{
@@ -27,14 +28,14 @@ class NaiveDistributor implements DistributorInterface, HashGeneratorInterface
public function __construct()
{
$this->nodes = array();
$this->nodes = [];
$this->nodesCount = 0;
}
public function add($node, $weight = null)
{
$this->nodes[] = $node;
$this->nodesCount++;
++$this->nodesCount;
}
public function remove($node)
@@ -53,7 +54,7 @@ class NaiveDistributor implements DistributorInterface, HashGeneratorInterface
public function getBySlot($slot)
{
return isset($this->nodes[$slot]) ? $this->nodes[$slot] : null;
return $this->nodes[$slot] ?? null;
}
public function getByHash($hash)
@@ -87,7 +88,7 @@ class NaiveDistributor implements DistributorInterface, HashGeneratorInterface
}
}
$options = array(
$options = [
'cluster' => function () {
$distributor = new NaiveDistributor();
$strategy = new PredisStrategy($distributor);
@@ -95,17 +96,17 @@ $options = array(
return $cluster;
},
);
];
$client = new Predis\Client($multiple_servers, $options);
for ($i = 0; $i < 100; $i++) {
for ($i = 0; $i < 100; ++$i) {
$client->set("key:$i", str_pad($i, 4, '0', 0));
$client->get("key:$i");
}
$server1 = $client->getClientFor('first')->info();
$server2 = $client->getClientFor('second')->info();
$server1 = $client->getClientBy('alias', 'first')->info();
$server2 = $client->getClientBy('alias', 'second')->info();
if (isset($server1['Keyspace'], $server2['Keyspace'])) {
$server1 = $server1['Keyspace'];
+18 -17
View File
@@ -3,17 +3,18 @@
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require __DIR__.'/shared.php';
require __DIR__ . '/shared.php';
// This is an example of how you can easily extend an existing connection class
// and trace the execution of commands for debugging purposes. This can be quite
// useful as a starting poing to understand how your application interacts with
// useful as a starting point to understand how your application interacts with
// Redis.
use Predis\Command\CommandInterface;
@@ -22,7 +23,7 @@ use Predis\Connection\StreamConnection;
class SimpleDebuggableConnection extends StreamConnection
{
private $tstart = 0;
private $debugBuffer = array();
private $debugBuffer = [];
public function connect()
{
@@ -36,7 +37,7 @@ class SimpleDebuggableConnection extends StreamConnection
$firtsArg = $command->getArgument(0);
$timestamp = round(microtime(true) - $this->tstart, 4);
$debug = $command->getId();
$debug = $command->getId();
$debug .= isset($firtsArg) ? " $firtsArg " : ' ';
$debug .= "$direction $this";
$debug .= " [{$timestamp}s]";
@@ -65,11 +66,11 @@ class SimpleDebuggableConnection extends StreamConnection
}
}
$options = array(
'connections' => array(
$options = [
'connections' => [
'tcp' => 'SimpleDebuggableConnection',
),
);
],
];
$client = new Predis\Client($single_server, $options);
$client->set('foo', 'bar');
@@ -80,13 +81,13 @@ var_export($client->getConnection()->getDebugBuffer());
/* OUTPUT:
array (
0 => 'SELECT 15 -> 127.0.0.1:6379 [0.0008s]',
1 => 'SELECT 15 <- 127.0.0.1:6379 [0.001s]',
2 => 'SET foo -> 127.0.0.1:6379 [0.001s]',
3 => 'SET foo <- 127.0.0.1:6379 [0.0011s]',
4 => 'GET foo -> 127.0.0.1:6379 [0.0013s]',
5 => 'GET foo <- 127.0.0.1:6379 [0.0015s]',
6 => 'INFO -> 127.0.0.1:6379 [0.0019s]',
7 => 'INFO <- 127.0.0.1:6379 [0.0022s]',
0 => 'SELECT 15 -> 127.0.0.1:6379 [0.0008s]',
1 => 'SELECT 15 <- 127.0.0.1:6379 [0.001s]',
2 => 'SET foo -> 127.0.0.1:6379 [0.001s]',
3 => 'SET foo <- 127.0.0.1:6379 [0.0011s]',
4 => 'GET foo -> 127.0.0.1:6379 [0.0013s]',
5 => 'GET foo <- 127.0.0.1:6379 [0.0015s]',
6 => 'INFO -> 127.0.0.1:6379 [0.0019s]',
7 => 'INFO <- 127.0.0.1:6379 [0.0022s]',
)
*/
+9 -8
View File
@@ -3,13 +3,14 @@
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require __DIR__.'/shared.php';
require __DIR__ . '/shared.php';
// This is a basic example on how to use the Predis\DispatcherLoop class.
//
@@ -23,13 +24,13 @@ require __DIR__.'/shared.php';
// PUBLISH control terminate_dispatcher
// Create a client and disable r/w timeout on the socket
$client = new Predis\Client($single_server + array('read_write_timeout' => 0));
$client = new Predis\Client($single_server + ['read_write_timeout' => 0]);
// Return an initialized PubSub consumer instance from the client.
$pubsub = $client->pubSubLoop();
// Create a dispatcher loop instance and attach a bunch of callbacks.
$dispatcher = new Predis\PubSub\DispatcherLoop($pubsub);
$dispatcher = new Predis\Consumer\PubSub\DispatcherLoop($pubsub);
// Demonstrate how to use a callable class as a callback for the dispatcher loop.
class EventsListener implements Countable
@@ -38,7 +39,7 @@ class EventsListener implements Countable
public function __construct()
{
$this->events = array();
$this->events = [];
}
public function count()
@@ -51,17 +52,17 @@ class EventsListener implements Countable
return $this->events;
}
public function __invoke($payload)
public function __invoke($payload, $dispatcher)
{
$this->events[] = $payload;
}
}
// Attach our callable class to the dispatcher.
$dispatcher->attachCallback('events', ($events = new EventsListener()));
$dispatcher->attachCallback('events', $events = new EventsListener());
// Attach a function to control the dispatcher loop termination with a message.
$dispatcher->attachCallback('control', function ($payload) use ($dispatcher) {
$dispatcher->attachCallback('control', function ($payload, $dispatcher) {
if ($payload === 'terminate_dispatcher') {
$dispatcher->stop();
}
+25 -19
View File
@@ -3,13 +3,14 @@
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require __DIR__.'/shared.php';
require __DIR__ . '/shared.php';
$client = new Predis\Client($single_server);
@@ -17,41 +18,46 @@ $client = new Predis\Client($single_server);
$client->set('library', 'predis');
$response = $client->get('library');
var_export($response); echo PHP_EOL;
var_export($response);
echo PHP_EOL;
/* OUTPUT: 'predis' */
// Redis has the MSET and MGET commands to set or get multiple keys in one go,
// cases like this Predis accepts arguments for variadic commands both as a list
// of arguments or an array containing all of the keys and/or values.
$mkv = array(
$mkv = [
'uid:0001' => '1st user',
'uid:0002' => '2nd user',
'uid:0003' => '3rd user'
);
'uid:0003' => '3rd user',
];
$client->mset($mkv);
$response = $client->mget(array_keys($mkv));
var_export($response); echo PHP_EOL;
var_export($response);
echo PHP_EOL;
/* OUTPUT:
array (
0 => '1st user',
1 => '2nd user',
2 => '3rd user',
) */
0 => '1st user',
1 => '2nd user',
2 => '3rd user',
)
*/
// Predis can also send "raw" commands to Redis. The difference between sending
// commands to Redis the usual way and the "raw" way is that in the latter case
// their arguments are not filtered nor responses coming from Redis are parsed.
$response = $client->executeRaw(array(
'MGET', 'uid:0001', 'uid:0002', 'uid:0003'
));
$response = $client->executeRaw([
'MGET', 'uid:0001', 'uid:0002', 'uid:0003',
]);
var_export($response); echo PHP_EOL;
var_export($response);
echo PHP_EOL;
/* OUTPUT:
array (
0 => '1st user',
1 => '2nd user',
2 => '3rd user',
) */
0 => '1st user',
1 => '2nd user',
2 => '3rd user',
)
*/
+9 -8
View File
@@ -3,34 +3,35 @@
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require __DIR__.'/shared.php';
require __DIR__ . '/shared.php';
// Predis can prefix keys found in commands arguments before sending commands to
// Redis, even for complex commands such as SORT, ZUNIONSTORE and ZINTERSTORE.
// Prefixing keys can be useful to create user-level namespaces for you keyspace
// thus reducing the need for separate logical databases in certain scenarios.
$client = new Predis\Client($single_server, array('prefix' => 'nrk:'));
$client = new Predis\Client($single_server, ['prefix' => 'nrk:']);
$client->mset(array('foo' => 'bar', 'lol' => 'wut'));
$client->mset(['foo' => 'bar', 'lol' => 'wut']);
var_export($client->mget('foo', 'lol'));
/*
array (
0 => 'bar',
1 => 'wut',
0 => 'bar',
1 => 'wut',
)
*/
var_export($client->keys('*'));
/*
array (
0 => 'nrk:foo',
1 => 'nrk:lol',
0 => 'nrk:foo',
1 => 'nrk:lol',
)
*/
+20 -23
View File
@@ -3,21 +3,21 @@
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require __DIR__.'/shared.php';
require __DIR__ . '/shared.php';
// This example will not work with versions of Redis < 2.6.
//
// Additionally to the EVAL command defined in the current development profile,
// the Predis\Command\ScriptCommand class can be used to build an higher level
// abstraction for "scriptable" commands so that they will appear just like any
// other command on the client-side. This is a quick example used to implement
// INCREX.
// Additionally to the EVAL command, the Predis\Command\ScriptCommand class can
// be used to leverage an higher level abstraction for Lua scripting that makes
// scripts appear just like any other command on the client-side. This is basic
// example on how a script-based INCREX command can be defined:
use Predis\Command\ScriptCommand;
@@ -37,11 +37,11 @@ local cmd, insert = redis.call, table.insert
local increment, results = ARGV[1], { }
for idx, key in ipairs(KEYS) do
if cmd('exists', key) == 1 then
insert(results, idx, cmd('incrby', key, increment))
else
insert(results, idx, false)
end
if cmd('exists', key) == 1 then
insert(results, idx, cmd('incrby', key, increment))
else
insert(results, idx, false)
end
end
return results
@@ -49,14 +49,11 @@ LUA;
}
}
$client = new Predis\Client($single_server, array(
'profile' => function ($options) {
$profile = $options->getDefault('profile');
$profile->defineCommand('increxby', 'IncrementExistingKeysBy');
return $profile;
}
));
$client = new Predis\Client($single_server, [
'commands' => [
'increxby' => 'IncrementExistingKeysBy',
],
]);
$client->mset('foo', 10, 'foobar', 100);
@@ -64,8 +61,8 @@ var_export($client->increxby('foo', 'foofoo', 'foobar', 50));
/*
array (
0 => 60,
1 => NULL,
2 => 150,
0 => 60,
1 => NULL,
2 => 150,
)
*/
+5 -4
View File
@@ -3,13 +3,14 @@
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require __DIR__.'/shared.php';
require __DIR__ . '/shared.php';
// This is a basic example on how to use the Predis\Monitor\Consumer class. You
// can use redis-cli to send commands to the same Redis instance your client is
@@ -17,7 +18,7 @@ require __DIR__.'/shared.php';
// exit the monitor loop and terminate this script in a graceful way.
// Create a client and disable r/w timeout on the socket.
$client = new Predis\Client($single_server + array('read_write_timeout' => 0));
$client = new Predis\Client($single_server + ['read_write_timeout' => 0]);
// Use only one instance of DateTime, we will update the timestamp later.
$timestamp = new DateTime();
@@ -28,7 +29,7 @@ foreach (($monitor = $client->monitor()) as $event) {
// If we notice a ECHO command with the message QUIT_MONITOR, we stop the
// monitor consumer and then break the loop.
if ($event->command === 'ECHO' && $event->arguments === '"QUIT_MONITOR"') {
echo "Exiting the monitor loop...", PHP_EOL;
echo 'Exiting the monitor loop...', PHP_EOL;
$monitor->stop();
break;
}
+14 -13
View File
@@ -3,13 +3,14 @@
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require __DIR__.'/shared.php';
require __DIR__ . '/shared.php';
// When you have a whole set of consecutive commands to send to a redis server,
// you can use a pipeline to dramatically improve performances. Pipelines can
@@ -30,16 +31,16 @@ var_export($responses);
/* OUTPUT:
array (
0 => Predis\Response\Status::__set_state(array(
'payload' => 'OK',
)),
1 => 10,
2 => 40,
3 => true,
4 => '40',
5 => array (
0 => NULL,
1 => '40',
),
0 => Predis\Response\Status::__set_state(array(
'payload' => 'OK',
)),
1 => 10,
2 => 40,
3 => true,
4 => '40',
5 => array (
0 => NULL,
1 => '40',
),
)
*/
+9 -8
View File
@@ -3,19 +3,20 @@
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require __DIR__.'/shared.php';
require __DIR__ . '/shared.php';
// Starting from Redis 2.0 clients can subscribe and listen for events published
// on certain channels using a Publish/Subscribe (PUB/SUB) approach.
// Create a client and disable r/w timeout on the socket
$client = new Predis\Client($single_server + array('read_write_timeout' => 0));
$client = new Predis\Client($single_server + ['read_write_timeout' => 0]);
// Initialize a new pubsub consumer.
$pubsub = $client->pubSubLoop();
@@ -23,10 +24,10 @@ $pubsub = $client->pubSubLoop();
// Subscribe to your channels
$pubsub->subscribe('control_channel', 'notifications');
// Start processing the pubsup messages. Open a terminal and use redis-cli
// Start processing the pubsub messages. Open a terminal and use redis-cli
// to push messages to the channels. Examples:
// ./redis-cli PUBLISH notifications "this is a test"
// ./redis-cli PUBLISH control_channel quit_loop
// redis-cli PUBLISH notifications "this is a test"
// redis-cli PUBLISH control_channel quit_loop
foreach ($pubsub as $message) {
switch ($message->kind) {
case 'subscribe':
@@ -36,14 +37,14 @@ foreach ($pubsub as $message) {
case 'message':
if ($message->channel == 'control_channel') {
if ($message->payload == 'quit_loop') {
echo "Aborting pubsub loop...", PHP_EOL;
echo 'Aborting pubsub loop...', PHP_EOL;
$pubsub->unsubscribe();
} else {
echo "Received an unrecognized command: {$message->payload}.", PHP_EOL;
}
} else {
echo "Received the following message from {$message->channel}:",
PHP_EOL, " {$message->payload}", PHP_EOL, PHP_EOL;
PHP_EOL, " {$message->payload}", PHP_EOL, PHP_EOL;
}
break;
}
+49
View File
@@ -0,0 +1,49 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\ClientInterface;
use Predis\Consumer\Push\PushResponseInterface;
require __DIR__ . '/shared.php';
// 1. Create client with RESP3 protocol specified. Push notifications allowed only in RESP3 mode.
$client = new Predis\Client($single_server + ['read_write_timeout' => 0, 'protocol' => 3]);
// 2. Create push notifications consumer. Provides callback where current consumer subscribes to few channels before enter the loop.
$push = $client->push(static function (ClientInterface $client) {
$response = $client->subscribe('channel', 'control');
$status = ($response[2] === 1) ? 'OK' : 'FAILED';
echo "Channel subscription status: {$status}\n";
});
// 3. Run consumer that will handle message data type push notifications. And stops if certain message will be sent to control channel.
// Send following commands via redis-cli to test:
//
// PUBLISH channel message1
// PUBLISH channel message2
// PUBLISH channel message3
// PUBLISH control terminate
// Data types should be changed in near future. Instead of Message data type it should be one of kind data types.
foreach ($push as $notification) {
if ((null !== $notification) && $notification->getDataType() === PushResponseInterface::MESSAGE_DATA_TYPE) {
if ($notification[1] === 'control' && $notification[2] === 'terminate') {
echo "Terminating notification consumer.\n";
$push->stop();
break;
}
$message = $notification[2];
echo "Received message: {$message}\n";
}
}
@@ -0,0 +1,68 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\ClientInterface;
use Predis\Consumer\DispatcherLoopInterface;
use Predis\Consumer\Push\DispatcherLoop;
use Predis\Consumer\Push\PushResponseInterface;
require __DIR__ . '/shared.php';
// 1. Create client with RESP3 protocol specified. Push notifications allowed only in RESP3 mode.
$client = new Predis\Client($single_server + ['read_write_timeout' => 0, 'protocol' => 3]);
// 2. Create push notifications consumer. Provides callback where current consumer subscribes to few channels before enter the loop.
$push = $client->push(static function (ClientInterface $client) {
$response = $client->subscribe('channel', 'control');
$status = ($response[2] === 1) ? 'OK' : 'FAILED';
echo "Channel subscription status: {$status}\n";
});
// 3. Storage for upcoming notifications.
$messages = [];
// 4. Create dispatcher for push notifications.
$dispatcher = new DispatcherLoop($push);
// 5. Attach callback for message data type. Print every message and store them in storage.
// Send following commands via redis-cli to test:
//
// PUBLISH channel message1
// PUBLISH channel message2
// PUBLISH channel message3
// PUBLISH control terminate
// Data types should be changed in near future. Instead of Message data type it should be one of kind data types.
$dispatcher->attachCallback(
PushResponseInterface::MESSAGE_DATA_TYPE,
static function (array $payload, DispatcherLoopInterface $dispatcher) {
global $messages;
[$channel, $message] = $payload;
if ($channel === 'control' && $message === 'terminate') {
echo "Terminating notification consumer.\n";
$dispatcher->stop();
return;
}
$messages[] = $message;
echo "Received message: {$message}\n";
}
);
// 6. Run consumer loop with attached callbacks.
$dispatcher->run();
// 7. Count all messages that were received during consumer loop.
$messagesCount = count($messages);
echo "We received: {$messagesCount} messages\n";
+24 -24
View File
@@ -3,17 +3,18 @@
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require __DIR__.'/shared.php';
require __DIR__ . '/shared.php';
use Predis\Collection\Iterator;
// Starting from Redis 2.8, clients can iterate incrementally over collections
// Starting with Redis 2.8, clients can iterate incrementally over collections
// without blocking the server like it happens when a command such as KEYS is
// executed on a Redis instance storing millions of keys. These commands are:
//
@@ -29,12 +30,11 @@ use Predis\Collection\Iterator;
// See http://redis.io/commands/scan for more details.
//
// Create a client using `2.8` as a server profile (needs Redis 2.8!)
$client = new Predis\Client($single_server, array('profile' => '2.8'));
$client = new Predis\Client($single_server);
// Prepare some keys for our example
$client->del('predis:set', 'predis:zset', 'predis:hash');
for ($i = 0; $i < 5; $i++) {
for ($i = 0; $i < 5; ++$i) {
$client->sadd('predis:set', "member:$i");
$client->zadd('predis:zset', -$i, "member:$i");
$client->hset('predis:hash', "field:$i", "value:$i");
@@ -48,9 +48,9 @@ foreach (new Iterator\Keyspace($client, 'predis:*') as $key) {
/* OUTPUT
Scan the keyspace matching only our prefixed keys:
- predis:zset
- predis:set
- predis:hash
- predis:zset
- predis:set
- predis:hash
*/
// === Set iterator based on SSCAN ===
@@ -61,11 +61,11 @@ foreach (new Iterator\SetKey($client, 'predis:set') as $member) {
/* OUTPUT
Scan members of `predis:set`:
- member:1
- member:4
- member:0
- member:3
- member:2
- member:1
- member:4
- member:0
- member:3
- member:2
*/
// === Sorted set iterator based on ZSCAN ===
@@ -76,11 +76,11 @@ foreach (new Iterator\SortedSetKey($client, 'predis:zset') as $member => $rank)
/* OUTPUT
Scan members and ranks of `predis:zset`:
- member:4 [rank: -4]
- member:3 [rank: -3]
- member:2 [rank: -2]
- member:1 [rank: -1]
- member:0 [rank: 0]
- member:4 [rank: -4]
- member:3 [rank: -3]
- member:2 [rank: -2]
- member:1 [rank: -1]
- member:0 [rank: 0]
*/
// === Hash iterator based on HSCAN ===
@@ -91,9 +91,9 @@ foreach (new Iterator\HashKey($client, 'predis:hash') as $field => $value) {
/* OUTPUT
Scan fields and values of `predis:hash`:
- field:0 => value:0
- field:1 => value:1
- field:2 => value:2
- field:3 => value:3
- field:4 => value:4
- field:0 => value:0
- field:1 => value:1
- field:2 => value:2
- field:3 => value:3
- field:4 => value:4
*/
+51
View File
@@ -0,0 +1,51 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require __DIR__ . '/shared.php';
// Enable igbinary serializer as well as LZ4 compression
$options = [
'serializer' => 'igbinary',
'compression' => 'lz4',
];
$client = new Predis\Client($single_server + $options, [
'connections' => 'relay',
]);
$quote = (object) [
'author' => 'Jean-Luc Picard',
'text' => 'I look forward to your report Mr. Broccoli.',
];
// Serialize object and apply LZ4 compression, then write key to Redis
$client->set('quote', $client->pack($quote));
// NOTE: In Predis v3.x serialization and compression will happen
// automatically without the need to call `pack()` and `unpack()`
// Retrieve raw binary value from Redis
$raw = $client->get('quote');
// Decompress and unserialize binary value
$data = $client->unpack($raw);
var_dump($quote == $data); // true
var_dump($data);
/*
object(stdClass)#11 (2) {
["author"]=>string(15) "Jean-Luc Picard"
["text"]=>string(43) "I look forward to your report Mr. Broccoli."
}
*/
+55
View File
@@ -0,0 +1,55 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require __DIR__ . '/shared.php';
$options = [
'timeout' => 1.0,
'read_write_timeout' => 1.0,
// Relay specific options
'cache' => true,
// 'compression' => 'lz4',
// 'serializer' => 'igbinary',
];
$client = new Predis\Client($single_server + $options, [
'connections' => 'relay',
]);
// Write key to Redis
$client->set('torpedo', mt_rand());
// Retrieve key from Redis
$client->get('torpedo');
// Retrieve key from Relay (without talking to Redis)
// This key is now available to all PHP workers in this FPM pool
$client->get('torpedo');
// For debugging only:
var_export(
$client->getConnection()->getClient()->_getKeys()
);
/*
array (
'torpedo' => array (
0 => array (
'type' => 'string',
'local-len' => 10,
'remote-len' => 10,
'size' => 10,
),
),
)
*/
+61
View File
@@ -0,0 +1,61 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require __DIR__ . '/shared.php';
$key = null;
$client = new Predis\Client($single_server, [
'connections' => 'relay',
]);
/** @var Predis\Connection\RelayConnection $relay */
$relay = $client->getConnection();
// establish connection
$client->ping();
// register `FLUSH*` callback
$relay->onFlushed(
static function (Relay\Event $event) use (&$key) {
echo 'Redis was flushed, unsetting $key...' . PHP_EOL;
$key = null;
}
);
// register `INVALIDATE` callback
$relay->onInvalidated(
static function (Relay\Event $event) use (&$key) {
if ($event->key === 'library') {
echo "The `{$event->key}` key was invalidated, unsetting \$key..." . PHP_EOL;
$key = null;
}
}
);
// Write key to Redis
$client->set('library', mt_rand());
// Retrieve key once from Redis, then cached in Relay and $key
$key = $client->get('library');
while (true) {
echo '$key is: ' . var_export($key, true) . PHP_EOL;
// To trigger our event callbacks, we need to either interact with Relay:
$client->get(mt_rand());
// ... or alternatively dispatch events directly on Relay:
$relay->dispatchEvents();
sleep(1);
}
+59
View File
@@ -0,0 +1,59 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require __DIR__ . '/shared.php';
// Create a Relay client and disable r/w timeout on the connection
$client = new Predis\Client(
$single_server + ['read_write_timeout' => 0],
['connections' => 'relay']
);
// Initialize a new pubsub consumer.
$pubsub = $client->pubSubLoop();
// When using Relay you cannot use foreach-loops to iterate
// over messages instead use a callback function
$poorMansKafka = function ($message, $client) {
switch ($message->kind) {
case 'subscribe':
echo "Subscribed to {$message->channel}", PHP_EOL;
break;
case 'message':
case 'pmessage':
if ($message->channel == 'control_channel') {
if ($message->payload == 'quit_loop') {
echo 'Aborting pubsub loop...', PHP_EOL;
$client->unsubscribe();
} else {
echo "Received an unrecognized command: {$message->payload}.", PHP_EOL;
}
} else {
echo "Received the message from `{$message->channel}` channel:",
PHP_EOL, " {$message->payload}", PHP_EOL, PHP_EOL;
}
}
};
// Subscribe to your channels and start processing the messages.
$pubsub->subscribe('control_channel', 'notifications', $poorMansKafka);
// Open a terminal and use redis-cli to push messages to the channels. Examples:
// redis-cli PUBLISH notifications "this is a test"
// redis-cli PUBLISH control_channel quit_loop
// When using Relay, there is no need to unset the pubsub consumer instance when you are done
// Say goodbye :-)
$version = redis_version($client->info());
echo "Goodbye from Redis $version!", PHP_EOL;
+19 -21
View File
@@ -3,23 +3,24 @@
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require __DIR__.'/shared.php';
require __DIR__ . '/shared.php';
// Predis allows to set Lua scripts as read-only operations for replication.
// This works for both EVAL and EVALSHA and also for the client-side abstraction
// built upon them (Predis\Command\ScriptCommand). This example shows a slightly
// more complex configuration that injects a new script command in the server
// profile used by the new client instance and marks it marks it as a read-only
// operation for replication so that it will be executed on slaves.
// more complex configuration that injects a new script command in the command
// factory used by the client and marks it as a read-only operation so that it
// will be executed on slaves.
use Predis\Command\ScriptCommand;
use Predis\Connection\Aggregate\MasterSlaveReplication;
use Predis\Connection\Replication\MasterSlaveReplication;
use Predis\Replication\ReplicationStrategy;
// ------------------------------------------------------------------------- //
@@ -29,7 +30,7 @@ use Predis\Replication\ReplicationStrategy;
class HashMultipleGetAll extends ScriptCommand
{
const BODY = <<<LUA
public const BODY = <<<LUA
local hashes = {}
for _, key in pairs(KEYS) do
table.insert(hashes, key)
@@ -46,18 +47,15 @@ LUA;
// ------------------------------------------------------------------------- //
$parameters = array(
'tcp://127.0.0.1:6379/?alias=master',
'tcp://127.0.0.1:6380/?alias=slave',
);
$parameters = [
'tcp://127.0.0.1:6381?role=master&database=15',
'tcp://127.0.0.1:6382?role=slave&alias=slave-01&database=15',
];
$options = array(
'profile' => function ($options, $option) {
$profile = $options->getDefault($option);
$profile->defineCommand('hmgetall', 'HashMultipleGetAll');
return $profile;
},
$options = [
'commands' => [
'hmgetall' => 'HashMultipleGetAll',
],
'replication' => function () {
$strategy = new ReplicationStrategy();
$strategy->setScriptReadOnly(HashMultipleGetAll::BODY);
@@ -66,7 +64,7 @@ $options = array(
return $replication;
},
);
];
// ------------------------------------------------------------------------- //
@@ -79,7 +77,7 @@ $client = new Predis\Client($parameters, $options);
$hashes = $client->hmgetall('metavars', 'servers');
$replication = $client->getConnection();
$stillOnSlave = $replication->getCurrent() === $replication->getConnectionById('slave');
$stillOnSlave = $replication->getCurrent() === $replication->getConnectionByAlias('slave-01');
echo "Is still on slave? ", $stillOnSlave ? 'YES!' : 'NO!', PHP_EOL;
echo 'Is still on slave? ', $stillOnSlave ? 'YES!' : 'NO!', PHP_EOL;
var_export($hashes);
+59
View File
@@ -0,0 +1,59 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require __DIR__ . '/shared.php';
// Predis supports redis-sentinel to provide high availability in master / slave
// scenarios. The only but relevant difference with a basic replication scenario
// is that sentinel servers can manage the master server and its slaves based on
// their state, which means that they are able to provide an authoritative and
// updated configuration to clients thus avoiding static configurations for the
// replication servers and their roles.
// Instead of connection parameters pointing to redis nodes, we provide a list
// of instances of redis-sentinel. Users should always provide a timeout value
// low enough to not hinder operations just in case a sentinel is unreachable
// but Predis uses a default value of 100 milliseconds for sentinel parameters
// without an explicit timeout value.
//
// NOTE: in real-world scenarios sentinels should be running on different hosts!
$sentinels = [
'tcp://127.0.0.1:5380?timeout=0.100',
'tcp://127.0.0.1:5381?timeout=0.100',
'tcp://127.0.0.1:5382?timeout=0.100',
];
$client = new Predis\Client($sentinels, [
'replication' => 'sentinel',
'service' => 'mymaster',
]);
// Read operation.
$exists = $client->exists('foo') ? 'yes' : 'no';
$current = $client->getConnection()->getCurrent()->getParameters();
echo "Does 'foo' exist on {$current->role}? $exists.", PHP_EOL;
// Write operation.
$client->set('foo', 'bar');
$current = $client->getConnection()->getCurrent()->getParameters();
echo "Now 'foo' has been set to 'bar' on {$current->role}!", PHP_EOL;
// Read operation.
$bar = $client->get('foo');
$current = $client->getConnection()->getCurrent()->getParameters();
echo "We fetched 'foo' from {$current->role} and its value is '$bar'.", PHP_EOL;
/* OUTPUT:
Does 'foo' exist on slave-127.0.0.1:6381? yes.
Now 'foo' has been set to 'bar' on master!
We fetched 'foo' from master and its value is 'bar'.
*/
+11 -10
View File
@@ -3,13 +3,14 @@
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require __DIR__.'/shared.php';
require __DIR__ . '/shared.php';
// Predis supports master / slave replication scenarios where write operations
// are performed on the master server and read operations are executed against
@@ -21,29 +22,29 @@ require __DIR__.'/shared.php';
// slave of the first one (see the "SLAVEOF" command).
//
$parameters = array(
'tcp://127.0.0.1:6379?database=15&alias=master',
'tcp://127.0.0.1:6380?database=15&alias=slave',
);
$parameters = [
'tcp://127.0.0.1:6381?role=master&database=15',
'tcp://127.0.0.1:6382?role=slave&database=15',
];
$options = array('replication' => true);
$options = ['replication' => 'predis'];
$client = new Predis\Client($parameters, $options);
// Read operation.
$exists = $client->exists('foo') ? 'yes' : 'no';
$current = $client->getConnection()->getCurrent()->getParameters();
echo "Does 'foo' exist on {$current->alias}? $exists.", PHP_EOL;
echo "Does 'foo' exist on {$current->role}? $exists.", PHP_EOL;
// Write operation.
$client->set('foo', 'bar');
$current = $client->getConnection()->getCurrent()->getParameters();
echo "Now 'foo' has been set to 'bar' on {$current->alias}!", PHP_EOL;
echo "Now 'foo' has been set to 'bar' on {$current->role}!", PHP_EOL;
// Read operation.
$bar = $client->get('foo');
$current = $client->getConnection()->getCurrent()->getParameters();
echo "We fetched 'foo' from {$current->alias} and its value is '$bar'.", PHP_EOL;
echo "We fetched 'foo' from {$current->role} and its value is '$bar'.", PHP_EOL;
/* OUTPUT:
Does 'foo' exist on slave? yes.
+6 -5
View File
@@ -3,13 +3,14 @@
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require __DIR__.'/shared.php';
require __DIR__ . '/shared.php';
// This example demonstrates how to use Predis to save PHP sessions on Redis.
//
@@ -25,16 +26,16 @@ require __DIR__.'/shared.php';
//
if (!interface_exists('SessionHandlerInterface')) {
die("ATTENTION: the session handler implemented by Predis requires PHP >= 5.4.0 ".
exit('ATTENTION: the session handler implemented by Predis requires PHP >= 5.4.0 ' .
"or a polyfill for SessionHandlerInterface provided by an external package.\n");
}
// Instantiate a new client just like you would normally do. Using a prefix for
// keys will effectively prefix all session keys with the specified string.
$client = new Predis\Client($single_server, array('prefix' => 'sessions:'));
$client = new Predis\Client($single_server, ['prefix' => 'sessions:']);
// Set `gc_maxlifetime` to specify a time-to-live of 5 seconds for session keys.
$handler = new Predis\Session\Handler($client, array('gc_maxlifetime' => 5));
$handler = new Predis\Session\Handler($client, ['gc_maxlifetime' => 5]);
// Register the session handler.
$handler->register();
+91
View File
@@ -0,0 +1,91 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
require __DIR__ . '/shared.php';
// This is a basic example on how to use the Predis\DispatcherLoop class in sharded pub/sub mode.
//
// Both channels belong to different shards. So in sharded mode we can subscribe
// and receive messages from different shard channels.
//
// To see this example in action you can just use redis-cli and publish some
// messages to the '{channels}_events' and 'control' channel, e.g.:
// ./redis-cli
// SPUBLISH {channels}_events first
// SPUBLISH {channels}_events second
// SPUBLISH {channels}_events third
// SPUBLISH control terminate_dispatcher
// 1. Create client and setup RW timeout to 0.
$client = new Client(
[
'tcp://127.0.0.1:6372?read_write_timeout=0',
'tcp://127.0.0.1:6373?read_write_timeout=0',
'tcp://127.0.0.1:6374?read_write_timeout=0',
], [
'cluster' => 'redis',
]);
// 2. Run pub/sub loop.
$pubSub = $client->pubSubLoop();
// 3. Create a dispatcher loop instance and attach a bunch of callbacks.
$dispatcher = new Predis\Consumer\PubSub\DispatcherLoop($pubSub);
// 4. Demonstrate how to use a callable class as a callback for the dispatcher loop.
class EventsListener implements Countable
{
private $events;
public function __construct()
{
$this->events = [];
}
public function count()
{
return count($this->events);
}
public function getEvents()
{
return $this->events;
}
public function __invoke($payload, $dispatcher)
{
$this->events[] = $payload;
}
}
// 5. Attach our callable class to the dispatcher.
$dispatcher->attachCallback('{channels}_events', $events = new EventsListener());
// 6. Attach a function to control the dispatcher loop termination with a message.
$dispatcher->attachCallback('control', function ($payload, $dispatcher) {
if ($payload === 'terminate_dispatcher') {
$dispatcher->stop();
}
});
// 7. Run the dispatcher loop until the callback attached to the 'control' channel
// receives 'terminate_dispatcher' as a message.
$dispatcher->run();
// Display our achievements!
echo "We received {$events->count()} messages!", PHP_EOL;
// Say goodbye :-)
echo 'Goodbye from Redis!', PHP_EOL;
+64
View File
@@ -0,0 +1,64 @@
<?php
/*
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Predis\Client;
require __DIR__ . '/shared.php';
// 1. Create client and setup RW timeout to 0.
$client = new Client(
[
'tcp://127.0.0.1:6372?read_write_timeout=0',
'tcp://127.0.0.1:6373?read_write_timeout=0',
'tcp://127.0.0.1:6374?read_write_timeout=0',
], [
'cluster' => 'redis',
]);
// 2. Run pub/sub loop. Sharded channels belongs to different shards.
$pubSub = $client->pubSubLoop();
$pubSub->ssubscribe('{channels}_notifications');
$pubSub->ssubscribe('control_channel');
// Start processing the pubsup messages. Open a terminal and use redis-cli
// to push messages to the channels. Examples:
// ./redis-cli SPUBLISH {channels}_notifications "this is a test"
// ./redis-cli SPUBLISH control_channel quit_loop
foreach ($pubSub as $message) {
switch ($message->kind) {
case 'ssubscribe':
echo "Subscribed to {$message->channel}", PHP_EOL;
break;
case 'message':
if ($message->channel == 'control_channel') {
if ($message->payload == 'quit_loop') {
echo 'Aborting pubsub loop...', PHP_EOL;
$pubSub->sunsubscribe();
} else {
echo "Received an unrecognized command: {$message->payload}.", PHP_EOL;
}
} else {
echo "Received the following message from {$message->channel}:",
PHP_EOL, " {$message->payload}", PHP_EOL, PHP_EOL;
}
break;
}
}
// Always unset the pubsub consumer instance when you are done! The
// class destructor will take care of cleanups and prevent protocol
// desynchronizations between the client and the server.
unset($pubsub);
// Say goodbye :-)
echo 'Goodbye from Redis!', PHP_EOL;
+26 -21
View File
@@ -3,13 +3,18 @@
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require __DIR__.'/../autoload.php';
if (PHP_SAPI !== 'cli') {
exit('Example scripts are meant to be executed locally via CLI.');
}
require __DIR__ . '/../autoload.php';
function redis_version($info)
{
@@ -22,23 +27,23 @@ function redis_version($info)
}
}
$single_server = array(
'host' => '127.0.0.1',
'port' => 6379,
'database' => 15
);
$single_server = [
'host' => '127.0.0.1',
'port' => 6379,
'database' => 15,
];
$multiple_servers = array(
array(
'host' => '127.0.0.1',
'port' => 6379,
'database' => 15,
'alias' => 'first',
),
array(
'host' => '127.0.0.1',
'port' => 6380,
'database' => 15,
'alias' => 'second',
),
);
$multiple_servers = [
[
'host' => '127.0.0.1',
'port' => 6379,
'database' => 15,
'alias' => 'first',
],
[
'host' => '127.0.0.1',
'port' => 6380,
'database' => 15,
'alias' => 'second',
],
];
+9 -8
View File
@@ -3,13 +3,14 @@
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require __DIR__.'/shared.php';
require __DIR__ . '/shared.php';
// This is an implementation of an atomic client-side ZPOP using the support for
// check-and-set (CAS) operations with MULTI/EXEC transactions, as described in
@@ -27,15 +28,15 @@ require __DIR__.'/shared.php';
function zpop($client, $key)
{
$element = null;
$options = array(
'cas' => true, // Initialize with support for CAS operations
$options = [
'cas' => true, // Initialize with support for CAS operations
'watch' => $key, // Key that needs to be WATCHed to detect changes
'retry' => 3, // Number of retries on aborted transactions, after
// which the client bails out with an exception.
);
// which the client bails out with an exception.
];
$client->transaction($options, function ($tx) use ($key, &$element) {
@list($element) = $tx->zrange($key, 0, 0);
@[$element] = $tx->zrange($key, 0, 0);
if (isset($element)) {
$tx->multi(); // With CAS, MULTI *must* be explicitly invoked.
@@ -49,4 +50,4 @@ function zpop($client, $key)
$client = new Predis\Client($single_server);
$zpopped = zpop($client, 'zset');
echo isset($zpopped) ? "ZPOPed $zpopped" : "Nothing to ZPOP!", PHP_EOL;
echo isset($zpopped) ? "ZPOPed $zpopped" : 'Nothing to ZPOP!', PHP_EOL;
-36
View File
@@ -1,36 +0,0 @@
; This file is meant to be used with Onion http://c9s.github.com/Onion/
; For instructions on how to build a PEAR package of Predis please follow
; the instructions at this URL:
;
; https://github.com/c9s/Onion#a-quick-tutorial-for-building-pear-package
;
[package]
name = "Predis"
desc = "Flexible and feature-complete PHP client library for Redis"
homepage = "http://github.com/nrk/predis"
license = "MIT"
version = "1.0.1"
stability = "devel"
channel = "pear.nrk.io"
author = "Daniele Alessandri \"nrk\" <suppakilla@gmail.com>"
[require]
php = ">= 5.3.2"
pearinstaller = "1.4.1"
[roles]
*.xml.dist = test
*.md = doc
LICENSE = doc
[optional phpiredis]
hint = "Add support for faster protocol handling with phpiredis"
extensions[] = socket
extensions[] = phpiredis
[optional webdis]
hint = "Add support for Webdis"
extensions[] = curl
extensions[] = phpiredis
+15
View File
@@ -0,0 +1,15 @@
parameters:
level: 0
paths:
- tests/
ignoreErrors:
# Uses func_get_args()
- message: "#^Static method Predis\\\\Command\\\\RawCommand\\:\\:create\\(\\) invoked with 0 parameters, at least 1 required\\.$#"
count: 1
path: tests/Predis/Command/RawCommandTest.php
# Mockery
- message: "#^Call to an undefined method Predis\\\\Configuration\\\\Option\\\\AggregateTest\\:\\:getMockConnectionClass\\(\\)\\.$#"
count: 2
path: tests/Predis/Configuration/Option/AggregateTest.php
+50
View File
@@ -0,0 +1,50 @@
parameters:
level: 2
paths:
- src/
ignoreErrors:
# Tricky ones
- message: "#^Cannot cast Predis\\\\Response\\\\ResponseInterface to string\\.$#"
count: 1
path: src/Client.php
- message: "#^Cannot cast Predis\\\\Connection\\\\ConnectionInterface to string\\.$#"
count: 1
path: src/Client.php
# "new static" in non-final classes
- message: "#^Unsafe usage of new static\\(\\)\\.$#"
count: 3
path: src/Client.php
- message: "#^Unsafe usage of new static\\(\\)\\.$#"
count: 1
path: src/Connection/Parameters.php
# Using an interface as concrete type
- message: "#^Call to an undefined method Predis\\\\Command\\\\FactoryInterface\\:\\:define\\(\\)\\.$#"
count: 1
path: src/Configuration/Option/Commands.php
- message: "#^Call to an undefined method Predis\\\\Command\\\\FactoryInterface\\:\\:undefine\\(\\)\\.$#"
count: 1
path: src/Configuration/Option/Commands.php
- message: "#^Access to an undefined property Predis\\\\Connection\\\\ParametersInterface\\:\\:\\$weight\\.$#"
count: 1
path: src/Connection/Cluster/PredisCluster.php
- message: "#^Variable \\$response might not be defined\\.$#"
count: 2
path: src/Connection/Cluster/RedisCluster.php
- message: "#^Access to an undefined property Predis\\\\Connection\\\\ParametersInterface\\:\\:\\$role\\.$#"
count: 1
path: src/Connection/Replication/MasterSlaveReplication.php
- message: "#^Access to an undefined property Predis\\\\Connection\\\\ParametersInterface\\:\\:\\$role\\.$#"
count: 1
path: src/Connection/Replication/SentinelReplication.php
# try/catch problems
- message: "#^Variable \\$connection might not be defined\\.$#"
count: 1
path: src/Connection/Replication/MasterSlaveReplication.php
- message: "#^Variable \\$response might not be defined\\.$#"
count: 1
path: src/Connection/Replication/MasterSlaveReplication.php
- message: "#^Variable \\$response might not be defined\\.$#"
count: 1
path: src/Connection/Replication/SentinelReplication.php
+52
View File
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
bootstrap="tests/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
beStrictAboutTestsThatDoNotTestAnything="true"
>
<testsuites>
<testsuite name="Predis Test Suite">
<directory phpVersion="7.4">tests/Predis/</directory>
</testsuite>
</testsuites>
<logging>
<log type="coverage-php" target="build/cov/coverage.cov"/>
</logging>
<groups>
<exclude>
<group>relay-incompatible</group>
<group>relay-resp3</group>
<group>realm-stack</group>
<group>ext-curl</group>
<group>cluster</group>
<group>gears</group>
</exclude>
</groups>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
<php>
<const name="REDIS_SERVER_HOST" value="127.0.0.1" />
<const name="REDIS_SERVER_PORT" value="6379" />
<const name="REDIS_SERVER_DBNUM" value="0" />
<env name="USE_RELAY" value="true" />
<env name="REDIS_STACK_SERVER_PORT" value="6479" />
<!-- Redis Cluster -->
<!-- Only master nodes endpoints included -->
<const name="REDIS_CLUSTER_ENDPOINTS" value="127.0.0.1:6372,127.0.0.1:6373,127.0.0.1:6374" />
</php>
</phpunit>
+26 -9
View File
@@ -1,17 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
bootstrap="tests/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
beStrictAboutTestsThatDoNotTestAnything="true"
>
<phpunit bootstrap="tests/bootstrap.php" colors="true" strict="true">
<testsuites>
<testsuite name="Predis Test Suite">
<directory>tests/Predis/</directory>
</testsuite>
</testsuites>
<logging>
<log type="coverage-php" target="build/cov/coverage.cov"/>
</logging>
<groups>
<exclude>
<group>ext-phpiredis</group>
<group>realm-stack</group>
<group>ext-relay</group>
<group>ext-curl</group>
<group>realm-webdis</group>
<group>cluster</group>
<group>gears</group>
<group>gears-cluster</group>
<!-- <group>connected</group> -->
<!-- <group>disconnected</group> -->
<!-- <group>commands</group> -->
@@ -26,14 +43,14 @@
</filter>
<php>
<!-- Redis -->
<const name="REDIS_SERVER_VERSION" value="2.8" />
<const name="REDIS_SERVER_HOST" value="127.0.0.1" />
<const name="REDIS_SERVER_PORT" value="6379" />
<const name="REDIS_SERVER_DBNUM" value="15" />
<const name="REDIS_SERVER_DBNUM" value="0" />
<env name="USE_RELAY" value="false" />
<env name="REDIS_STACK_SERVER_PORT" value="6479" />
<!-- Webdis -->
<const name="WEBDIS_SERVER_HOST" value="127.0.0.1" />
<const name="WEBDIS_SERVER_PORT" value="7379" />
<!-- Redis Cluster -->
<!-- Only master nodes endpoints included -->
<const name="REDIS_CLUSTER_ENDPOINTS" value="127.0.0.1:6372,127.0.0.1:6373,127.0.0.1:6374" />
</php>
</phpunit>
-43
View File
@@ -1,43 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="tests/bootstrap.php" colors="true" strict="true">
<testsuites>
<testsuite name="Predis Test Suite">
<directory>tests/Predis/</directory>
</testsuite>
</testsuites>
<groups>
<exclude>
<group>ext-phpiredis</group>
<group>ext-curl</group>
<group>realm-webdis</group>
<!-- <group>connected</group> -->
<!-- <group>disconnected</group> -->
<!-- <group>commands</group> -->
<!-- <group>slow</group> -->
</exclude>
</groups>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-text" target="php://stdout" />
</logging>
<php>
<!-- Redis -->
<const name="REDIS_SERVER_VERSION" value="2.8" />
<const name="REDIS_SERVER_HOST" value="127.0.0.1" />
<const name="REDIS_SERVER_PORT" value="6379" />
<const name="REDIS_SERVER_DBNUM" value="15" />
<!-- Webdis -->
<const name="WEBDIS_SERVER_HOST" value="127.0.0.1" />
<const name="WEBDIS_SERVER_PORT" value="7379" />
</php>
</phpunit>
+6 -4
View File
@@ -3,7 +3,8 @@
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -16,6 +17,7 @@ namespace Predis;
*
* @author Eric Naeseth <eric@thumbtack.com>
* @author Daniele Alessandri <suppakilla@gmail.com>
* @codeCoverageIgnore
*/
class Autoloader
{
@@ -40,7 +42,7 @@ class Autoloader
*/
public static function register($prepend = false)
{
spl_autoload_register(array(new self, 'autoload'), true, $prepend);
spl_autoload_register([new self(), 'autoload'], true, $prepend);
}
/**
@@ -52,10 +54,10 @@ class Autoloader
{
if (0 === strpos($className, $this->prefix)) {
$parts = explode('\\', substr($className, $this->prefixLength));
$filepath = $this->directory.DIRECTORY_SEPARATOR.implode(DIRECTORY_SEPARATOR, $parts).'.php';
$filepath = $this->directory . DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, $parts) . '.php';
if (is_file($filepath)) {
require($filepath);
require $filepath;
}
}
}

Some files were not shown because too many files have changed in this diff Show More