Compare commits

..

53 Commits

Author SHA1 Message Date
Till Krüss 8cc4319c06 Prepare 3.5.0 (#1682) 2026-06-02 12:25:56 -07:00
dependabot[bot] 84c77ea460 Bump the github-actions group with 5 updates (#1683) 2026-06-02 10:32:02 -07:00
Till Krüss 3da5d996bd move file 2026-06-02 10:20:38 -07:00
Till Krüss 5d1d9fdf11 Add dependabot configuration for GitHub Actions and Composer 2026-06-02 10:18:37 -07:00
Vladyslav Vildanov 135b405eae Added support for UNLINK command (#1680) 2026-06-02 09:28:57 -07:00
Vladyslav Vildanov 1611b33e4a Updated 8.8 GA test image (#1679) 2026-06-02 09:28:39 -07:00
Vladyslav Vildanov 37ed2dcd77 Updated INCREX arguments (#1677)
* Updated INCREX command arguments

* Updated test image

* Updated CHANGELOG.md

* Updated test image
2026-05-22 12:17:15 +03:00
Vladyslav Vildanov d6f91964e0 Added support for new array commands (#1672)
* Added support for new array commands

* Updated test image, fixed tests

* Updated CHANGELOG.md

* Removed ARLASTITEMS from ClusterStrategy testing

* Fixed broken tests

* Fixed broken test

* Updated 8.8-RC1 image

* Fixed Vector Set tests
2026-05-19 12:19:46 +03:00
Vladyslav Vildanov afc8035491 Revert GCRA command support (#1673)
* Revert GCRA command support

* Updated test image

* Fixed flacky test
2026-05-19 11:36:42 +03:00
Vladyslav Vildanov b2d1397fc6 Fixed SENTINEL SLAVES RESP3 incompatible response (#1676)
* Fixed SENTINEL SLAVES RESP3 incompatible response

* Updated CHANGELOG.md

* Revert relay-incompatible annotations
2026-05-14 09:56:32 +03:00
Vladyslav Vildanov f12e6694b5 Added support for INCREX command (#1674)
* Added support for INCREX command

* Fixed RESP2 and RESP3 incompatibility

* Removed non-printable characters

* Codestyle fixes
2026-05-13 11:11:07 +03:00
Vladyslav Vildanov 268449ae69 Added testing for subkey notification channels (#1671)
* Added testing for subkey notification channels

* Updated CHANGELOG.md

* Codestyle fixes

* Added test cleanup

* Added relay-incompatible label
2026-04-29 22:29:28 +03:00
Vladyslav Vildanov 52286f8164 Added support for multiple aggregators for TS range commands (#1670)
* Added support for multiple aggregators for TS range commands

* Updated CHANGELOG.md
2026-04-23 10:26:00 +03:00
Vladyslav Vildanov 6c3909e675 Added new COUNT aggregator for Sorted Set commands (#1668)
* Added test coverage with new COUNT aggregator

* Updated CHANGELOG.md

* Changed version constraint

* Fixed broken test

* Marked as relay-resp3
2026-04-22 10:47:00 +03:00
Vladyslav Vildanov 622f4df2b6 Added XNACK support (#1666)
* Renamed GCRA parameters to match latest API

* Added support for XNACK command

* Updated test image

* Updated test image

* Updated version requirements

* Fixed broken test

* Updated CHANGELOG.md

* Updated CHANGELOG.md
2026-04-22 10:30:57 +03:00
Vladyslav Vildanov ae4a706b01 Fixed Sentinel retry to narrow retryable exceptions to CommunicationException (#1665)
* Fixed Sentinel retry to narrow retryable exceptions to CommunicationException

* Update CHANGELOG.md
2026-04-20 10:10:15 +03:00
Vladyslav Vildanov 54bb300931 Updated arguments name for GCRA command (#1667)
* Renamed GCRA parameters to match latest API

* Updated test image

* Updated version requirements

* Fixed broken test

* Updated CHANGELOG.md
2026-04-20 10:09:34 +03:00
Vladyslav Vildanov 5024c7a662 Fixed ZRANGE to include 6.2 arguments (#1662)
* Fixed ZRANGE to include 6.2 arguments

* Removed duplicated arguments entry
2026-04-06 10:59:15 +03:00
Vladyslav Vildanov 3fc01fed58 Added FPHA argument for JSON.SET command (#1661) 2026-04-03 18:50:19 +09:00
messikiller 4c56d5d290 Fix SlotMap::offsetUnset() corrupting mappings when unsetting a slot in a gap (#1660) 2026-03-25 18:36:01 +09:00
Vladyslav Vildanov 7a4fa99d13 Added support for GCRA command (#1657)
* Added support for GCRA command

* Codestyle fixes

* Updated test image
2026-03-24 13:50:23 +02:00
Kevin Rojas bb37322a24 Handle -READONLY as a redirection signal for Redis Cluster (AWS ElastiCache support) (#1656)
* feature: Added support for READONLY responses from AWS Elastic Cache

* chore: improve -READONLY handler comment and add changelog entry (#1656)

* tests: add unit test demonstrating ServerException behavior with READONLY error
2026-03-23 09:00:26 +02:00
Copilot 1c4219cf88 Include command name in unsupported container command error messages (#1654)
Co-authored-by: tillkruss <665029+tillkruss@users.noreply.github.com>
2026-03-18 10:09:30 +09:00
Till Krüss 383623eb05 bump dev version 2026-03-09 13:34:39 -07:00
Till Krüss 2033429520 tag v3.4.2 2026-03-09 13:33:04 -07:00
Till Krüss 87390e7381 Use static closures (#1652) 2026-03-09 13:30:46 -07:00
Till Krüss f57dfcbeea Format changelog entry [skip ci] 2026-03-09 13:04:50 -07:00
Vasil Chomakov 7388d91153 Add upstream_driver option for CLIENT SETINFO upstream reporting (#1645)
* Add driver_info option for CLIENT SETINFO upstream reporting

* Use null default for upstreamDriver and ternary operator

* Remove redundant null initialization

* fix: remove trailing newline from VERSION file

* fix: update copyright year to 2026 in DriverInfo files

* refactor: rename driver_info to upstream_driver

* fix: code style issues

* docs: update CHANGELOG to reflect upstream_driver rename
2026-03-05 17:05:02 +02:00
Wolfgang Kerschbaumer d0f6671a60 Fix sentinel discovery methods not catching StreamInitException (#1650)
* Fix sentinel discovery methods not catching StreamInitException

The getMaster(), getSlaves(), and updateSentinels() methods only catch
ConnectionException when connecting to Sentinel nodes. StreamInitException
(thrown by stream_socket_client() failures) extends PredisException directly,
not ConnectionException, so it propagates uncaught — preventing fallback to
the next Sentinel node.

This causes complete application failure when any single Sentinel is
unreachable, even if other Sentinels are healthy.

Add StreamInitException to the catch clause using a union type in all three
methods. This is more precise than catching PredisException, which would
also swallow ServerException (e.g. "ERR No such master with that name")
and mask configuration errors.

See also #1577 which applied a similar fix to retryCommandOnFailure().

* Fix coding standards and add changelog entry

- Remove spaces around | in union catch (php-cs-fixer)
- Add CHANGELOG.md entry for #1650

* Codestlye fixes

---------

Co-authored-by: Wolfgang Kerschbaumer <wolfgang.kerschbaumer@bergfex.at>
Co-authored-by: vladvildanov <vladyslav.vildanov@redis.com>
2026-03-05 17:01:40 +02:00
Vladyslav Vildanov 274cb866bd Fixed Sentinel getParameters() executed on string configuration (#1649) 2026-02-26 11:01:54 -08:00
Till Krüss 0850f2f36e Prepare v3.4.1 release (#1647) 2026-02-23 11:51:21 -08:00
Till Krüss 581c5659bd update year in headers 2026-02-23 11:48:06 -08:00
predakanga 4a5be21d62 Make LMPOP and BLMPOP commands prefixable (#1646)
* Make LMPOP and BLMPOP commands prefixable

* Update CHANGELOG
2026-02-23 10:31:19 +02:00
Thomas Stägemann 7fd23dbcb9 Removed static from callables because it's deprecated since PHP 8.2 (#1642) 2026-02-20 11:05:12 +02:00
Amir Hossein Shokri dd0713b515 Fix typo (#1640) 2026-02-17 09:12:43 -08:00
Vladyslav Vildanov 4b527ba961 Make HTTL and HPTTL commands Prefixable (#1639) 2026-02-17 09:12:12 -08:00
Vladyslav Vildanov 6c9de258be Fixed getParameter() call on array + added integration testing with Sentinel (#1636)
* Fixed getParameter() call on array + added integration testing with Sentinel

* Added sentinel.conf

* Updated CHANGELOG.md

* Added handling of ParametersInterface
2026-02-13 11:30:43 +02:00
Till Krüss 1183f5732e fix changelog date 2026-02-11 09:30:28 -08:00
Till Krüss 83dbdbeb43 prepare v3.4.0 2026-02-11 09:28:17 -08:00
Denis 5d85628a11 Add normalizeVariadic to RPUSHX and LPUSHX commands (#1633)
* Add normalizeVariadic to RPUSHX and LPUSHX commands

RPUSHX and LPUSHX commands were missing the setArguments method
with normalizeVariadic call, unlike their RPUSH and LPUSH counterparts.
This caused errors when passing values as a single array argument
(e.g. $client->rpushx('key', ['val1', 'val2'])).

Fixes #1504

* Update CHANGELOG.md with RPUSHX/LPUSHX variadic fix (#1633)

* Fix variadic arguments normalization for [L|R]PUSHX

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2026-02-11 19:07:39 +02:00
Vladyslav Vildanov 8b9f882a43 Added testing with Redis 8.6 GA (#1634) 2026-02-11 09:00:42 -08:00
Vladyslav Vildanov e851ed6ceb Added support for idempotent stream API (#1632)
* Added augment commands support

* Added support for Redis 8.6

* Codestyle changes and test fixes

* Fixed hybdrid tests

* Updated CHANGELOG.md and composer.json

* Fixed XINFO tests

* Added support for idempontent stream API

* Update CHANGELOG.md

* Updated expected exported files

* Removed agentic files

* Removed .augment entry
2026-02-09 10:25:51 +02:00
Vladyslav Vildanov 861bde010a Added support for HOTKEYS container command (#1630)
* Added testing with SSL authentication using CN

* Update CHANGELOG.md

* Codestyle changes

* Fixed broken tests

* Fixed hybdrid tests

* Fixed SSL tests

* Fixed array merging

* Updated README.md

* Updated spelling list

* Added support for HOTKEYS container command

* Added ignoring for PHPUnit package

* Update CHANGELOG.md, codestyle fixes, mark tests as relay-incompatible

* Added RESP3 test, fixed response parsing

* Removed redundant tests

* Added cluster test

* Fix assertion
2026-02-05 10:48:48 +02:00
Vladyslav Vildanov 53504469d7 Added testing with TimeSeries NaN values (#1628)
* Added testing with SSL authentication using CN

* Update CHANGELOG.md

* Codestyle changes

* Fixed broken tests

* Fixed hybdrid tests

* Fixed SSL tests

* Fixed array merging

* Updated README.md

* Updated spelling list

* Added testing with TimeSeries NaN values

* Updated CHANGELOG.md

* Fixed incorrect annotation

* Added support for Redis 8.6

* Codestyle changes and test fixes

* Fixed hybdrid tests

* Updated CHANGELOG.md and composer.json

* Fixed XINFO tests
2026-02-04 11:29:24 +02:00
Vladyslav Vildanov d8a99ef674 Added testing with SSL authentication using CN (#1627)
* Added testing with SSL authentication using CN

* Update CHANGELOG.md

* Codestyle changes

* Fixed broken tests

* Fixed hybdrid tests

* Fixed SSL tests

* Fixed array merging

* Updated README.md

* Updated spelling list

* Added support for Redis 8.6

* Codestyle changes and test fixes

* Fixed hybdrid tests

* Updated CHANGELOG.md and composer.json

* Fixed XINFO tests
2026-02-04 11:18:53 +02:00
Vladyslav Vildanov a24a7be9b4 Added support for Redis 8.6 (#1631)
* Added support for Redis 8.6

* Codestyle changes and test fixes

* Fixed hybdrid tests

* Updated CHANGELOG.md and composer.json

* Fixed XINFO tests
2026-02-04 10:49:05 +02:00
Vladyslav Vildanov 95e802430d Added testing with SSL connection (#1624)
* Added testing with SSL connection

* Update CHANGELOG.md

* Revert changes

* Codestyle fixes

* Add version restriction

* Fixed issue with connecting to SSL port to check redis version

* Mark tests as relay-incompatible

* Codestyle fixes
2026-01-20 17:45:10 +02:00
Vladyslav Vildanov 0703c3cae6 Added support for VRANGE command (#1623)
* Added support for VRANGE command

* Update CHANGELOG.md

* Codestyle fixes

* Codestyle fixes
2026-01-19 10:50:39 +02:00
Vladyslav Vildanov 7c7cf90152 Improve connection handshake by pipelining commands (#1622)
* Improve connection handshake by pipelining commands

* Added exceptions handling for Redis < 6.0

* Updated CHANGELOG.md
2026-01-08 13:56:55 +02:00
Markus Reinhold b211afd755 Make ZRANDMEMBER prefixable (#1621)
* Make ZRANDMEMBER prefixable

* Update CHANGELOG.md

---------

Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
2025-12-23 13:27:27 +02:00
Vladyslav Vildanov 980326d5d8 Added retry support (#1616)
* Initial work on retries

* Added retry class and test coverage

* Added support for standalone and cluster

* Make TimeoutException instance of CommunicationException

* Added pipeline, trasnaction, replication support

* Fixed broken test

* Marked test as relay-incompatible

* Marked test as relay-incompatible

* Fixed analysis errors, added missing tests

* Codestyle fixes

* Fixed test

* Update README.md

* Update README.md

* Update README.md

* Updated README.md

* Refactor retry on read and write

* Added check for timeout value

* Updated README.md

* Fixed README.md

* Codestyle changes

* Added missing coverage

* Added missing test coverage

* Removed comments

* Added retry support for Relay connection (#1620)

* Added integration test case with mocked retry

* Changed client initialisation in tests

* Marked test as relay-incompatible

---------

Co-authored-by: Pavlo Yatsukhnenko <yatsukhnenko@users.noreply.github.com>
2025-12-23 10:40:46 +02:00
Pavlo Yatsukhnenko 0ae180c942 Enable more Relay tests (#1617)
run tests against relay nightly for faster testing
2025-11-27 16:18:22 -08:00
Andrew Ivchenkov 98c853a689 fixed param annotation (#1614) 2025-11-25 09:04:34 -08:00
1273 changed files with 12996 additions and 2069 deletions
+20
View File
@@ -0,0 +1,20 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: /
schedule:
interval: "monthly"
groups:
github-actions:
patterns:
- "*"
- package-ecosystem: "composer"
directory: /
schedule:
interval: "monthly"
groups:
composer-minor:
update-types:
- "minor"
- "patch"
+25
View File
@@ -24,6 +24,7 @@ services:
container_name: redis-standalone
environment:
- TLS_ENABLED=yes
- TLS_CLIENT_CNS=test_user
- REDIS_CLUSTER=no
- REDIS_PASSWORD=foobar
- PORT=6379
@@ -56,6 +57,7 @@ services:
- all
- clients
- unprotected
- sentinel
redis-cluster:
image: ${REDIS_IMAGE_NAME:-redislabs/client-libs-test:8.0.2}
@@ -66,11 +68,13 @@ services:
- NODES=6
- REPLICAS=1
- TLS_ENABLED=yes
- TLS_CLIENT_CNS=test_user
- PORT=6372
- TLS_PORT=27379
command: ${REDIS_EXTRA_ARGS:---enable-debug-command yes --enable-module-command yes --tls-auth-clients optional --save "" --requirepass "foobar"}
ports:
- "6372-6377:6372-6377"
- "27379-27384:27379-27384"
volumes:
- "./dockers/cluster:/redis/work"
profiles:
@@ -94,3 +98,24 @@ services:
- all
- clients
- stack
sentinel:
image: ${REDIS_IMAGE_NAME:-redislabs/client-libs-test:8.0.2}
container_name: redis-sentinel
depends_on:
- redis-unprotected
environment:
- REDIS_CLUSTER=no
- NODES=3
- PORT=26379
command: ${REDIS_EXTRA_ARGS:---sentinel}
ports:
- 26379:26379
- 26380:26380
- 26381:26381
volumes:
- "./dockers/sentinel.conf:/redis/config-default/redis.conf"
- "./dockers/sentinel:/redis/work"
profiles:
- sentinel
- all
+8
View File
@@ -0,0 +1,8 @@
sentinel resolve-hostnames yes
sentinel monitor predis-test 127.0.0.1 6380 2
# Be much more tolerant to transient stalls (index builds, GC, I/O)
sentinel down-after-milliseconds predis-test 60000
# Avoid rapid repeated failover attempts
sentinel failover-timeout predis-test 180000
# Keep it conservative: sync one replica at a time
sentinel parallel-syncs predis-test 1
+4
View File
@@ -1,11 +1,15 @@
ACLs
AUTH
Autoloading
cafile
CAS
CN
Customizable
ElastiCache
FPM
GC
IANA
mTLS
Lua
PSR
Packagist
+8 -8
View File
@@ -24,7 +24,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Check file permissions
run: test "$(find . -type f -not -path './.git/*' -executable)" = "./bin/create-command-test"
@@ -47,7 +47,7 @@ jobs:
tools: parallel-lint
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Check source code for syntax errors
run: composer exec -- parallel-lint bin/ examples/ src/ tests/
@@ -67,13 +67,13 @@ jobs:
coverage: none
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Validate Composer configuration
run: composer validate --no-interaction --strict
- name: Install dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v4
with:
dependency-versions: highest
@@ -101,7 +101,7 @@ jobs:
coverage: none
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Check EditorConfig configuration
run: test -f .editorconfig
@@ -110,7 +110,7 @@ jobs:
uses: greut/eclint-action@v0
- name: Install dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v4
with:
dependency-versions: highest
@@ -130,7 +130,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Check exported files
run: |
@@ -159,7 +159,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0
+1 -1
View File
@@ -27,7 +27,7 @@ jobs:
steps:
- uses: release-drafter/release-drafter@v5
- uses: release-drafter/release-drafter@v7
with:
config-name: release-drafter-config.yml
env:
+2 -2
View File
@@ -6,9 +6,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Check Spelling
uses: rojopolis/spellcheck-github-actions@0.33.1
uses: rojopolis/spellcheck-github-actions@0.60.0
with:
config_path: .github/spellcheck-settings.yml
task_name: Markdown
+28 -8
View File
@@ -33,6 +33,8 @@ jobs:
- '8.0'
- '8.2'
- '8.4'
- '8.6'
- '8.8'
steps:
@@ -40,8 +42,10 @@ jobs:
run: |
# Mapping of original redis versions to client test containers
declare -A redis_clients_version_mapping=(
["8.8"]="8.8.0"
["8.6"]="8.6.1"
["8.4"]="8.4.0"
["8.2"]="8.2.2-pre"
["8.2"]="8.2.2"
["8.0"]="8.0.2"
["7.4"]="7.4.2"
["7.2"]="7.2.7"
@@ -74,16 +78,16 @@ jobs:
fi
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Start Redis standalone image
uses: hoverkraft-tech/compose-action@v2.0.1
uses: hoverkraft-tech/compose-action@v2.6.0
with:
compose-file: .github/docker-compose.yml
services: ${{ env.DOCKER_SERVICE }}
- name: Start Redis unprotected image
uses: hoverkraft-tech/compose-action@v2.0.1
uses: hoverkraft-tech/compose-action@v2.6.0
if: ${{ matrix.redis > '4.0' }}
with:
compose-file: .github/docker-compose.yml
@@ -91,7 +95,7 @@ jobs:
- name: Start Redis stack image
id: stack_infra
uses: hoverkraft-tech/compose-action@v2.0.1
uses: hoverkraft-tech/compose-action@v2.6.0
if: ${{ matrix.redis >= '7.2' && matrix.redis < '8.0' }}
with:
compose-file: .github/docker-compose.yml
@@ -99,21 +103,29 @@ jobs:
- name: Start Redis cluster image
id: cluster_infra
uses: hoverkraft-tech/compose-action@v2.0.1
uses: hoverkraft-tech/compose-action@v2.6.0
if: ${{ matrix.redis > '4.0' }}
with:
compose-file: .github/docker-compose.yml
services: redis-cluster
- name: Start Redis sentinels image
id: sentinel_infra
uses: hoverkraft-tech/compose-action@v2.6.0
if: ${{ matrix.redis > '4.0' }}
with:
compose-file: .github/docker-compose.yml
services: sentinel
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: relay
extensions: relay-nightly
coverage: ${{ (matrix.php == '8.4' && matrix.redis == '8.0') && 'xdebug' || 'none' }}
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v4
with:
dependency-versions: highest
composer-options: ${{ matrix.php == '8.0' && '--ignore-platform-reqs' || '' }}
@@ -142,6 +154,14 @@ jobs:
if: ${{ matrix.php == '8.4' && matrix.redis == '8.0' }}
run: vendor/bin/phpunit --group unprotected --coverage-php build/cov/coverage-unprotected.cov --coverage-filter ./src
- name: Run sentinel tests
if: ${{ (matrix.php != '8.4' || matrix.redis != '8.0') && matrix.redis > '4.0'}}
run: vendor/bin/phpunit --group sentinel
- name: Run sentinel tests with coverage
if: ${{ matrix.php == '8.4' && matrix.redis == '8.0' }}
run: vendor/bin/phpunit --group sentinel --coverage-php build/cov/coverage-sentinel.cov --coverage-filter ./src
- name: Run stack tests
if: ${{ (matrix.php != '8.4' || matrix.redis != '8.0') && matrix.redis >= '7.2' }}
run: vendor/bin/phpunit --group realm-stack
+1 -1
View File
@@ -4,7 +4,7 @@ $PREDIS_HEADER = <<<EOS
This file is part of the Predis package.
(c) 2009-2020 Daniele Alessandri
(c) 2021-2025 Till Krüss
(c) 2021-2026 Till Krüss
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
+51
View File
@@ -1,5 +1,56 @@
## Changelog
## v3.5.0 (2026-06-02)
### Added
- Added support for `XNACK` command (#1666)
- Added support for `INCREX` command (#1674)
- Added support for `UNLINK` command (#1680)
- Added support for `AR*` array commands (#1672)
- Handle Redis Cluster `-READONLY` responses failover events (#1656)
- Added `FPHA` argument for `JSON.SET` command (#1661)
- Added new `COUNT` aggregator for Sorted Set commands (#1668)
- Added support for multiple aggregators for `TS.range` commands (#1670)
### Changed
- Include command name in unsupported container command error messages (#1653)
### Fixed
- Fixed handling of gap slots in `SlotMap::offsetUnset()` (#1660)
- Fixed `ZRANGE` to include 6.2 arguments (#1662)
- Fixed Sentinel retry to narrow retryable exceptions to `CommunicationException` (#1665)
- Fixed `SENTINEL SLAVES` RESP3 incompatible response (#1676)
## v3.4.2 (2026-03-09)
### Changed
- Switch to `static` closures
### Fixed
- Fixed Sentinel `getParameters()` executed on string configuration (#1649)
- Fixed Sentinel discovery methods not catching `StreamInitException` on connection failure (#1650)
## v3.4.1 (2026-02-23)
### Added
- Added `upstream_driver` option for CLIENT SETINFO upstream reporting (#1645)
- Made `H(P)TTL` commands prefixable (#1639)
- Made `(B)LMPOP` commands prefixable (#1643)
### Fixed
- Fixed Sentinel `getParameter()` call on array error (#2423)
- Removed deprecated `static` from callables (#1642)
## v3.4.0 (2026-02-11)
### Added
- Added optional retry support (#1616)
- Added support for `VRANGE` command (#1623)
- Added support for idempotent stream API (#1632)
- Added support for `HOTKEYS` container command (#1630)
### Fixed
- Fixed `[L|R]PUSHX` variadic arguments normalization (#1633)
- Fixed wrong `@param` annotation in `Parameters` (#1614)
- Made `ZRANDMEMBER` prefixable (#1621)
- Improve connection handshake by pipelining commands (#1622)
## v3.3.0 (2025-11-24)
### Added
- Added cluster support for `XADD`, `XDEL` and `XRANGE` (#1587)
+72 -1
View File
@@ -114,6 +114,40 @@ The connection schemes [`redis`](http://www.iana.org/assignments/uri-schemes/pro
also supported, with the difference that URI strings containing these schemes are parsed following
the rules described on their respective IANA provisional registration documents.
Since Redis 8.6, you can authenticate a client using the Subject CN from its TLS client certificate (mTLS).
When this is enabled on the server, the client is authenticated during the TLS handshake, so you dont need
to send an AUTH command.
To use this, configure:
- a CA certificate used to verify the server certificate (cafile),
- a client certificate (local_cert) signed by a CA trusted by the Redis server for client authentication,
- the corresponding private key (local_pk).
Make sure:
- the Redis server certificate is signed by a CA trusted by the client, and
- the client certificate is signed by a CA trusted by the Redis server (mTLS).
```php
// Named array of connection parameters:
$client = new Predis\Client([
'scheme' => 'tls',
'ssl' => [
'cafile' => 'ca.pem', // CA used to verify the server certificate
'local_cert' => 'client.crt', // client certificate (Subject CN maps to ACL user)
'local_pk' => 'client.key', // client private key
'verify_peer' => true,
],
]);
// ACL user must exist and match the certificate Subject CN (example: CN=CN_NAME).
// Enable the user and grant permissions as needed:
$client->acl->setUser('CN_NAME', 'on', '>clientpass', 'allcommands', 'allkeys')
echo $client->acl->whoami() // CN_NAME
```
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.
@@ -509,6 +543,43 @@ $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.
### Retry exceptions
You can enable automatic retry that is disabled by default, to be able to reduce the amount of
false-positives in case of network issues. By default, we're retrying on any connection,
timeout or socket initialization exception, but you can update the list of retry
exceptions. For now `EqualBackoff` and `ExponentialBackoff` strategies are available,
but you may provide your custom one. Retry may be configured with any type of communication
(standalone node, cluster, pipeline, transaction, replication). Here's an example of
configuration:
```php
// Standalone client
$client = new Predis\Client([
'retry' => new \Predis\Retry\Retry(
new \Predis\Retry\Strategy\ExponentialBackoff(1000, 10000), // Base and cap configuration in microseconds
3 // Number of retries
),
]);
// Cluster configuration
$options = [
'parameters' => [
'retry' => new \Predis\Retry\Retry(new \Predis\Retry\Strategy\ExponentialBackoff(1000, 10000), 3),
],
];
$client = new Predis\Client(['tcp://host:port', 'tcp://host:port', 'tcp://host:port'], $options);
$retry = new \Predis\Retry\Retry(
new \Predis\Retry\Strategy\ExponentialBackoff(1000, 10000),
3
);
// Update a list of exceptions to catch
$retry->updateCatchableExceptions([Exception::class]);
```
## RESP3 ##
### Connection ###
@@ -593,7 +664,7 @@ $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) {
$push = $client->push(function (ClientInterface $client) {
$response = $client->subscribe('channel', 'control');
$status = ($response[2] === 1) ? 'OK' : 'FAILED';
echo "Channel subscription status: {$status}\n";
+1 -1
View File
@@ -1 +1 @@
3.3.0
3.5.0
+7 -1
View File
@@ -46,7 +46,13 @@
},
"config": {
"sort-packages": true,
"preferred-install": "dist"
"preferred-install": "dist",
"audit": {
"ignore": [
"GHSA-vvj3-c3rp-c85p",
"PKSA-z3gr-8qht-p93v"
]
}
},
"minimum-stability": "dev",
"prefer-stable": true
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+3 -3
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -40,7 +40,7 @@ class NaiveDistributor implements DistributorInterface, HashGeneratorInterface
public function remove($node)
{
$this->nodes = array_filter($this->nodes, function ($n) use ($node) {
$this->nodes = array_filter($this->nodes, static function ($n) use ($node) {
return $n !== $node;
});
@@ -89,7 +89,7 @@ class NaiveDistributor implements DistributorInterface, HashGeneratorInterface
}
$options = [
'cluster' => function () {
'cluster' => static function () {
$distributor = new NaiveDistributor();
$strategy = new PredisStrategy($distributor);
$cluster = new PredisCluster($strategy);
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+2 -2
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -62,7 +62,7 @@ class EventsListener implements Countable
$dispatcher->attachCallback('events', $events = new EventsListener());
// Attach a function to control the dispatcher loop termination with a message.
$dispatcher->attachCallback('control', function ($payload, $dispatcher) {
$dispatcher->attachCallback('control', static function ($payload, $dispatcher) {
if ($payload === 'terminate_dispatcher') {
$dispatcher->stop();
}
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+2 -2
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -18,7 +18,7 @@ require __DIR__ . '/shared.php';
$client = new Predis\Client($single_server);
$responses = $client->pipeline(function ($pipe) {
$responses = $client->pipeline(static function ($pipe) {
$pipe->flushdb();
$pipe->incrby('counter', 10);
$pipe->incrby('counter', 30);
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+2 -2
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -23,7 +23,7 @@ $pubsub = $client->pubSubLoop();
// When using Relay you cannot use foreach-loops to iterate
// over messages instead use a callback function
$poorMansKafka = function ($message, $client) {
$poorMansKafka = static function ($message, $client) {
switch ($message->kind) {
case 'subscribe':
echo "Subscribed to {$message->channel}", PHP_EOL;
+2 -2
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -56,7 +56,7 @@ $options = [
'commands' => [
'hmgetall' => 'HashMultipleGetAll',
],
'replication' => function () {
'replication' => static function () {
$strategy = new ReplicationStrategy();
$strategy->setScriptReadOnly(HashMultipleGetAll::BODY);
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+2 -2
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -74,7 +74,7 @@ class EventsListener implements Countable
$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) {
$dispatcher->attachCallback('control', static function ($payload, $dispatcher) {
if ($payload === 'terminate_dispatcher') {
$dispatcher->stop();
}
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+3 -3
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -22,9 +22,9 @@ function redis_version($info)
return $info['Server']['redis_version'];
} elseif (isset($info['redis_version'])) {
return $info['redis_version'];
} else {
return 'unknown version';
}
return 'unknown version';
}
$single_server = [
+2 -2
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -35,7 +35,7 @@ function zpop($client, $key)
// which the client bails out with an exception.
];
$client->transaction($options, function ($tx) use ($key, &$element) {
$client->transaction($options, static function ($tx) use ($key, &$element) {
@[$element] = $tx->zrange($key, 0, 0);
if (isset($element)) {
-6
View File
@@ -29,9 +29,6 @@ parameters:
- 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
@@ -45,6 +42,3 @@ parameters:
- 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
+22
View File
@@ -33,6 +33,7 @@
<group>gears</group>
<group>gears-cluster</group>
<group>unprotected</group>
<group>sentinel</group>
<!-- <group>connected</group> -->
<!-- <group>disconnected</group> -->
<!-- <group>commands</group> -->
@@ -55,6 +56,27 @@
<env name="USE_RELAY" value="false" />
<env name="REDIS_STACK_SERVER_PORT" value="6479" />
<!-- Sentinel -->
<const name="REDIS_SENTINEL_SERVICE" value="predis-test" />
<const
name="REDIS_SENTINEL_ENDPOINTS"
value="127.0.0.1:26379,127.0.0.1:26380,127.0.0.1:26381"
/>
<!-- SSL -->
<env name="STANDALONE_CA_CERT_PATH" value=".github/dockers/standalone/tls/ca.crt" />
<env name="STANDALONE_LOCAL_CERT_PATH" value=".github/dockers/standalone/tls/test_user.crt" />
<env name="STANDALONE_LOCAL_PK_PATH" value=".github/dockers/standalone/tls/test_user.key" />
<env name="CN_USER_NAME" value="test_user" />
<env name="REDIS_SSL_PORT" value="6666" />
<env name="CLUSTER_CA_CERT_PATH" value=".github/dockers/cluster/tls/ca.crt" />
<env name="CLUSTER_LOCAL_CERT_PATH" value=".github/dockers/cluster/tls/test_user.crt" />
<env name="CLUSTER_LOCAL_PK_PATH" value=".github/dockers/cluster/tls/test_user.key" />
<const
name="SSL_REDIS_CLUSTER_ENDPOINTS"
value="127.0.0.1:27379?password=foobar,127.0.0.1:27380?password=foobar,127.0.0.1:27381?password=foobar"
/>
<!-- Redis Cluster -->
<!-- Only master nodes endpoints included -->
<const
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+22 -9
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -22,6 +22,7 @@ use Predis\Command\RawCommand;
use Predis\Command\ScriptCommand;
use Predis\Configuration\Options;
use Predis\Configuration\OptionsInterface;
use Predis\Connection\AggregateConnectionInterface;
use Predis\Connection\ConnectionInterface;
use Predis\Connection\Parameters;
use Predis\Connection\ParametersInterface;
@@ -41,6 +42,7 @@ use Predis\Response\ServerException;
use Predis\Transaction\MultiExec as MultiExecTransaction;
use ReturnTypeWillChange;
use RuntimeException;
use Throwable;
use Traversable;
/**
@@ -54,7 +56,7 @@ use Traversable;
*/
class Client implements ClientInterface, IteratorAggregate
{
public const VERSION = '3.3.0';
public const VERSION = '3.5.0';
/** @var OptionsInterface */
private $options;
@@ -90,9 +92,8 @@ class Client implements ClientInterface, IteratorAggregate
return new Options($options);
} elseif ($options instanceof OptionsInterface) {
return $options;
} else {
throw new InvalidArgumentException('Invalid type for client options');
}
throw new InvalidArgumentException('Invalid type for client options');
}
/**
@@ -138,11 +139,10 @@ class Client implements ClientInterface, IteratorAggregate
return $initializer($parameters, true);
} elseif ($options->defined('aggregate') && $initializer = $options->aggregate) {
return $initializer($parameters, false);
} else {
throw new InvalidArgumentException(
'Array of connection parameters requires `cluster`, `replication` or `aggregate` client option'
);
}
throw new InvalidArgumentException(
'Array of connection parameters requires `cluster`, `replication` or `aggregate` client option'
);
}
if (is_callable($parameters)) {
@@ -376,12 +376,25 @@ class Client implements ClientInterface, IteratorAggregate
/**
* {@inheritdoc}
* @throws Throwable
*/
public function executeCommand(CommandInterface $command)
{
$response = $this->connection->executeCommand($command);
$parameters = $this->connection->getParameters();
if ($this->connection instanceof AggregateConnectionInterface || $this->connection instanceof RelayConnection) {
$response = $this->connection->executeCommand($command);
} else {
$response = $parameters->retry->callWithRetry(
function () use ($command) {
return $this->connection->executeCommand($command);
},
function () {
$this->connection->disconnect();
}
);
}
if ($response instanceof ResponseInterface) {
if ($response instanceof ErrorResponseInterface) {
$response = $this->onErrorResponse($command, $response);
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+29 -3
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -42,10 +42,12 @@ use Predis\Command\CommandInterface;
use Predis\Command\Container\ACL;
use Predis\Command\Container\CLIENT;
use Predis\Command\Container\FUNCTIONS;
use Predis\Command\Container\HOTKEYS;
use Predis\Command\Container\Json\JSONDEBUG;
use Predis\Command\Container\Search\FTCONFIG;
use Predis\Command\Container\Search\FTCURSOR;
use Predis\Command\Container\XGROUP;
use Predis\Command\Redis\HSETEX;
use Predis\Command\Redis\VADD;
/**
@@ -75,7 +77,26 @@ use Predis\Command\Redis\VADD;
* @method $this sort_ro(string $key, ?string $byPattern = null, ?LimitOffsetCount $limit = null, array $getPatterns = [], ?string $sorting = null, bool $alpha = false)
* @method $this ttl($key)
* @method $this type($key)
* @method $this unlink(string ...$keys)
* @method $this append($key, $value)
* @method $this arcount(string $key)
* @method $this ardel(string $key, int ...$index)
* @method $this ardelrange(string $key, int ...$startEnd)
* @method $this arget(string $key, int $index)
* @method $this argetrange(string $key, int $start, int $end)
* @method $this argrep(string $key, int $start, int $end, array $predicates, ?string $combinator = null, ?int $limit = null, bool $withValues = false, bool $noCase = false)
* @method $this arinfo(string $key, bool $full = false)
* @method $this arinsert(string $key, string ...$value)
* @method $this arlastitems(string $key, int $count, bool $reverse = false)
* @method $this arlen(string $key)
* @method $this armget(string $key, int ...$index)
* @method $this armset(string $key, array $indexValueDictionary)
* @method $this arnext(string $key)
* @method $this arop(string $key, int $start, int $end, string $operation, $matchValue = null)
* @method $this arring(string $key, int $size, string ...$value)
* @method $this arscan(string $key, int $start, int $end, ?int $limit = null)
* @method $this arseek(string $key, int $index)
* @method $this arset(string $key, int $index, string ...$value)
* @method $this bfadd(string $key, $item)
* @method $this bfexists(string $key, $item)
* @method $this bfinfo(string $key, string $modifier = '')
@@ -150,6 +171,7 @@ use Predis\Command\Redis\VADD;
* @method $this incr($key)
* @method $this incrby($key, $increment)
* @method $this incrbyfloat($key, $increment)
* @method $this increx(string $key, int|float|string $value, ?int $lbound = null, ?int $ubound = null, bool $saturate = false, ?string $expireType = null, $expireValue = null, bool $enx = false)
* @method $this mget(array $keys)
* @method $this mset(array $dictionary)
* @method $this msetex(array $dictionary, ?string $existModifier = null, ?string $expireResolution = null, ?int $expireTTL = null)
@@ -206,7 +228,7 @@ use Predis\Command\Redis\VADD;
* @method $this jsonobjkeys(string $key, string $path = '$')
* @method $this jsonobjlen(string $key, string $path = '$')
* @method $this jsonresp(string $key, string $path = '$')
* @method $this jsonset(string $key, string $path, string $value, ?string $subcommand = null)
* @method $this jsonset(string $key, string $path, string $value, ?string $subcommand = null, ?string $fpha = null)
* @method $this jsonstrappend(string $key, string $path, string $value)
* @method $this jsonstrlen(string $key, string $path = '$')
* @method $this jsontoggle(string $key, string $path)
@@ -272,7 +294,7 @@ use Predis\Command\Redis\VADD;
* @method $this topklist(string $key, bool $withCount = false)
* @method $this topkquery(string $key, ...$items)
* @method $this topkreserve(string $key, int $topK, int $width = 8, int $depth = 7, float $decay = 0.9)
* @method $this tsadd(string $key, int $timestamp, float $value, ?AddArguments $arguments = null)
* @method $this tsadd(string $key, int $timestamp, string|float $value, ?AddArguments $arguments = null)
* @method $this tsalter(string $key, ?TSAlterArguments $arguments = null)
* @method $this tscreate(string $key, ?TSCreateArguments $arguments = null)
* @method $this tscreaterule(string $sourceKey, string $destKey, string $aggregator, int $bucketDuration, int $alignTimestamp = 0)
@@ -294,9 +316,11 @@ use Predis\Command\Redis\VADD;
* @method $this xadd(string $key, array $dictionary, string $id = '*', array $options = null)
* @method $this xautoclaim(string $key, string $group, string $consumer, int $minIdleTime, string $start, ?int $count = null, bool $justId = false)
* @method $this xclaim(string $key, string $group, string $consumer, int $minIdleTime, string|array $ids, ?int $idle = null, ?int $time = null, ?int $retryCount = null, bool $force = false, bool $justId = false, ?string $lastId = null)
* @method $this xcfgset(string $key, ?int $duration = null, ?int $maxsize = null)
* @method $this xdel(string $key, string ...$id)
* @method $this xdelex(string $key, string $mode, array $ids)
* @method $this xlen(string $key)
* @method $this xnack(string $key, string $group, string $mode, array $ids, ?int $retryCount = null, bool $force = false)
* @method $this xpending(string $key, string $group, ?int $minIdleTime = null, ?string $start = null, ?string $end = null, ?int $count = null, ?string $consumer = null)
* @method $this xrevrange(string $key, string $end, string $start, ?int $count = null)
* @method $this xrange(string $key, string $start, string $end, ?int $count = null)
@@ -355,6 +379,7 @@ use Predis\Command\Redis\VADD;
* @method $this vinfo(string $key)
* @method $this vlinks(string $key, string $elem, bool $withScores = false)
* @method $this vrandmember(string $key, int $count = null)
* @method $this vrange(string $key, string $start, string $end, int $count = null)
* @method $this vrem(string $key, string $elem)
* @method $this vsetattr(string $key, string $elem, string|array $attributes)
* @method $this vsim(string $key, string|array $vectorOrElem, bool $isElem = false, bool $withScores = false, int $count = null, float $epsilon = null, int $ef = null, string $filter = null, int $filterEf = null, bool $truth = false, bool $noThread = false)
@@ -394,6 +419,7 @@ use Predis\Command\Redis\VADD;
*
* Container commands
* @property CLIENT $client
* @property HOTKEYS $hotkeys
* @property FUNCTIONS $function
* @property FTCONFIG $ftconfig
* @property FTCURSOR $ftcursor
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+29 -3
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -42,12 +42,14 @@ use Predis\Command\CommandInterface;
use Predis\Command\Container\ACL;
use Predis\Command\Container\CLIENT;
use Predis\Command\Container\FUNCTIONS;
use Predis\Command\Container\HOTKEYS;
use Predis\Command\Container\Json\JSONDEBUG;
use Predis\Command\Container\Search\FTCONFIG;
use Predis\Command\Container\Search\FTCURSOR;
use Predis\Command\Container\XGROUP;
use Predis\Command\Container\XINFO;
use Predis\Command\FactoryInterface;
use Predis\Command\Redis\HSETEX;
use Predis\Command\Redis\VADD;
use Predis\Configuration\OptionsInterface;
use Predis\Connection\ConnectionInterface;
@@ -85,7 +87,26 @@ use Predis\Response\Status;
* @method array sort_ro(string $key, ?string $byPattern = null, ?LimitOffsetCount $limit = null, array $getPatterns = [], ?string $sorting = null, bool $alpha = false)
* @method int ttl(string $key)
* @method mixed type(string $key)
* @method int unlink(string ...$keys)
* @method int append(string $key, $value)
* @method int arcount(string $key)
* @method int ardel(string $key, int ...$index)
* @method int ardelrange(string $key, int ...$startEnd)
* @method string|null arget(string $key, int $index)
* @method array argetrange(string $key, int $start, int $end)
* @method array argrep(string $key, int $start, int $end, array $predicates, ?string $combinator = null, ?int $limit = null, bool $withValues = false, bool $noCase = false)
* @method array arinfo(string $key, bool $full = false)
* @method int arinsert(string $key, string ...$value)
* @method array arlastitems(string $key, int $count, bool $reverse = false)
* @method int arlen(string $key)
* @method array armget(string $key, int ...$index)
* @method int armset(string $key, array $indexValueDictionary)
* @method int|null arnext(string $key)
* @method mixed arop(string $key, int $start, int $end, string $operation, $matchValue = null)
* @method int arring(string $key, int $size, string ...$value)
* @method array arscan(string $key, int $start, int $end, ?int $limit = null)
* @method int arseek(string $key, int $index)
* @method int arset(string $key, int $index, string ...$value)
* @method mixed bfadd(string $key, $item)
* @method mixed bfexists(string $key, $item)
* @method array bfinfo(string $key, string $modifier = '')
@@ -160,6 +181,7 @@ use Predis\Response\Status;
* @method int incr(string $key)
* @method int incrby(string $key, int $increment)
* @method string incrbyfloat(string $key, int|float $increment)
* @method array increx(string $key, int|float|string $value, ?int $lbound = null, ?int $ubound = null, bool $saturate = false, ?string $expireType = null, $expireValue = null, bool $enx = false)
* @method array mget(string[]|string $keyOrKeys, string ...$keys = null)
* @method mixed mset(array $dictionary)
* @method array msetex(array $dictionary, ?string $existModifier = null, ?string $expireResolution = null, ?int $expireTTL = null)
@@ -216,7 +238,7 @@ use Predis\Response\Status;
* @method array jsonobjkeys(string $key, string $path = '$')
* @method array jsonobjlen(string $key, string $path = '$')
* @method array jsonresp(string $key, string $path = '$')
* @method string jsonset(string $key, string $path, string $value, ?string $subcommand = null)
* @method string jsonset(string $key, string $path, string $value, ?string $subcommand = null, ?string $fpha = null)
* @method array jsonstrappend(string $key, string $path, string $value)
* @method array jsonstrlen(string $key, string $path = '$')
* @method array jsontoggle(string $key, string $path)
@@ -283,7 +305,7 @@ use Predis\Response\Status;
* @method array topklist(string $key, bool $withCount = false)
* @method array topkquery(string $key, ...$items)
* @method Status topkreserve(string $key, int $topK, int $width = 8, int $depth = 7, float $decay = 0.9)
* @method int tsadd(string $key, int $timestamp, float $value, ?AddArguments $arguments = null)
* @method int tsadd(string $key, int $timestamp, string|float $value, ?AddArguments $arguments = null)
* @method Status tsalter(string $key, ?TSAlterArguments $arguments = null)
* @method Status tscreate(string $key, ?TSCreateArguments $arguments = null)
* @method Status tscreaterule(string $sourceKey, string $destKey, string $aggregator, int $bucketDuration, int $alignTimestamp = 0)
@@ -305,9 +327,11 @@ use Predis\Response\Status;
* @method string xadd(string $key, array $dictionary, string $id = '*', array $options = null)
* @method array xautoclaim(string $key, string $group, string $consumer, int $minIdleTime, string $start, ?int $count = null, bool $justId = false)
* @method array xclaim(string $key, string $group, string $consumer, int $minIdleTime, string|array $ids, ?int $idle = null, ?int $time = null, ?int $retryCount = null, bool $force = false, bool $justId = false, ?string $lastId = null)
* @method Status xcfgset(string $key, ?int $duration = null, ?int $maxsize = null)
* @method int xdel(string $key, string ...$id)
* @method array xdelex(string $key, string $mode, array $ids)
* @method int xlen(string $key)
* @method int xnack(string $key, string $group, string $mode, array $ids, ?int $retryCount = null, bool $force = false)
* @method array xpending(string $key, string $group, ?int $minIdleTime = null, ?string $start = null, ?string $end = null, ?int $count = null, ?string $consumer = null)
* @method array xrevrange(string $key, string $end, string $start, ?int $count = null)
* @method array xrange(string $key, string $start, string $end, ?int $count = null)
@@ -367,6 +391,7 @@ use Predis\Response\Status;
* @method array|null vinfo(string $key)
* @method array|null vlinks(string $key, string $elem, bool $withScores = false)
* @method string|array|null vrandmember(string $key, int $count = null)
* @method array vrange(string $key, string $start, string $end, int $count = null)
* @method bool vrem(string $key, string $elem)
* @method array vsim(string $key, string|array $vectorOrElem, bool $isElem = false, bool $withScores = false, int $count = null, float $epsilon = null, int $ef = null, string $filter = null, int $filterEf = null, bool $truth = false, bool $noThread = false)
* @method bool vsetattr(string $key, string $elem, string|array $attributes)
@@ -407,6 +432,7 @@ use Predis\Response\Status;
*
* Container commands
* @property CLIENT $client
* @property HOTKEYS $hotkeys
* @property FUNCTIONS $function
* @property FTCONFIG $ftconfig
* @property FTCURSOR $ftcursor
+26 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -42,6 +42,7 @@ abstract class ClusterStrategy implements StrategyInterface
/* commands operating on the key space */
'EXISTS' => $getKeyFromAllArguments,
'DEL' => $getKeyFromAllArguments,
'UNLINK' => $getKeyFromAllArguments,
'TYPE' => $getKeyFromFirstArgument,
'EXPIRE' => $getKeyFromFirstArgument,
'EXPIREAT' => $getKeyFromFirstArgument,
@@ -68,6 +69,7 @@ abstract class ClusterStrategy implements StrategyInterface
'INCR' => $getKeyFromFirstArgument,
'INCRBY' => $getKeyFromFirstArgument,
'INCRBYFLOAT' => $getKeyFromFirstArgument,
'INCREX' => $getKeyFromFirstArgument,
'SETBIT' => $getKeyFromFirstArgument,
'SETEX' => $getKeyFromFirstArgument,
'MSET' => [$this, 'getKeyFromInterleavedArguments'],
@@ -99,6 +101,26 @@ abstract class ClusterStrategy implements StrategyInterface
'LSET' => $getKeyFromFirstArgument,
'LTRIM' => $getKeyFromFirstArgument,
/* commands operating on arrays */
'ARCOUNT' => $getKeyFromFirstArgument,
'ARDEL' => $getKeyFromFirstArgument,
'ARDELRANGE' => $getKeyFromFirstArgument,
'ARGET' => $getKeyFromFirstArgument,
'ARGETRANGE' => $getKeyFromFirstArgument,
'ARGREP' => $getKeyFromFirstArgument,
'ARINFO' => $getKeyFromFirstArgument,
'ARINSERT' => $getKeyFromFirstArgument,
'ARLASTITEMS' => $getKeyFromFirstArgument,
'ARLEN' => $getKeyFromFirstArgument,
'ARMGET' => $getKeyFromFirstArgument,
'ARMSET' => $getKeyFromFirstArgument,
'ARNEXT' => $getKeyFromFirstArgument,
'AROP' => $getKeyFromFirstArgument,
'ARRING' => $getKeyFromFirstArgument,
'ARSCAN' => $getKeyFromFirstArgument,
'ARSEEK' => $getKeyFromFirstArgument,
'ARSET' => $getKeyFromFirstArgument,
/* commands operating on sets */
'SADD' => $getKeyFromFirstArgument,
'SCARD' => $getKeyFromFirstArgument,
@@ -189,6 +211,9 @@ abstract class ClusterStrategy implements StrategyInterface
/* cluster */
'CLUSTER' => [$this, 'getFakeKey'],
/* control */
'ACL' => [$this, 'getFakeKey'],
];
}
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+2 -2
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -16,7 +16,7 @@ use Predis\Cluster\Hash\HashGeneratorInterface;
/**
* This class implements an hashring-based distributor that uses the same
* algorithm of memcache to distribute keys in a cluster using client-side
* algorithm of memcached to distribute keys in a cluster using client-side
* sharding.
* @author Lorenzo Castelli <lcastelli@gmail.com>
*/
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+7 -6
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -87,7 +87,7 @@ class SlotMap implements ArrayAccess, IteratorAggregate, Countable
{
return array_reduce(
$this->slotRanges,
function ($carry, $slotRange) {
static function ($carry, $slotRange) {
return $carry + $slotRange->toArray();
},
[]
@@ -102,7 +102,7 @@ class SlotMap implements ArrayAccess, IteratorAggregate, Countable
public function getNodes()
{
return array_unique(array_map(
function ($slotRange) {
static function ($slotRange) {
return $slotRange->getConnection();
},
$this->slotRanges
@@ -192,7 +192,7 @@ class SlotMap implements ArrayAccess, IteratorAggregate, Countable
return array_reduce(
$intersections,
function ($carry, $slotRange) {
static function ($carry, $slotRange) {
return $carry + $slotRange->toArray();
},
[]
@@ -264,6 +264,7 @@ class SlotMap implements ArrayAccess, IteratorAggregate, Countable
foreach ($this->slotRanges as $slotRange) {
if (!$slotRange->hasSlot($slot)) {
$results[] = $slotRange;
continue;
}
if (static::isValidRange($slotRange->getStart(), $slot - 1)) {
@@ -287,7 +288,7 @@ class SlotMap implements ArrayAccess, IteratorAggregate, Countable
public function count()
{
return array_sum(array_map(
function ($slotRange) {
static function ($slotRange) {
return $slotRange->count();
},
$this->slotRanges
@@ -370,7 +371,7 @@ class SlotMap implements ArrayAccess, IteratorAggregate, Countable
{
usort(
$slotRanges,
function (SlotRange $a, SlotRange $b) {
static function (SlotRange $a, SlotRange $b) {
if ($a->getStart() == $b->getStart()) {
return 0;
}
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
+1 -1
View File
@@ -4,7 +4,7 @@
* This file is part of the Predis package.
*
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2025 Till Krüss
* (c) 2021-2026 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

Some files were not shown because too many files have changed in this diff Show More