Fix issue with using RedisCluster with compression or serialization #54934
+6
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Using
RedisCluster
(Laravel Vapor) with compression or serialization doesn't work, because theOPT_SERIALIZER
andOPT_COMPRESSION
don't exist on the RedisCluster class.The error:
Undefined constant RedisCluster::OPT_SERIALIZER
I replaced
$client::
withRedis::
.Even in the PhpRedis extension tests they are using
Redis::OPT_SERIALIZER
and notRedisCluster::OPT_SERIALIZER
https://github.com/phpredis/phpredis/blob/d342e4ac18723607b001deb593c8d45e40bbc4c8/tests/RedisClusterTest.php#L281-L295This should also be backported to Laravel 11.x. Should I open another PR?