Skip to content

Commit ffabb4b

Browse files
committed
Updated documentation for ext-redis usage.
1 parent a48d435 commit ffabb4b

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ php-lock/lock follows semantic versioning. Read more on [semver.org][1].
2525
- Optionally the [php-pcntl][3] extension to enable locking with `flock()` without
2626
busy waiting in CLI scripts.
2727
- Optionally `flock()`, `ext-redis`, `ext-pdo_mysql`, `ext-pdo_sqlite`, `ext-pdo_pgsql` or `ext-memcached` can be used as a backend for locks. See examples below.
28+
- If `ext-redis` is used for locking and is configured to use igbinary for serialization or
29+
lzf for compression, additionally `ext-igbinary` and/or `ext-lzf` have to be installed.
2830

2931
----
3032

classes/mutex/PHPRedisMutex.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ protected function evalScript($redis, string $script, int $numkeys, array $argum
7272
// Determine if we need to compress eval arguments.
7373
$lzfCompression = false;
7474
if (defined("Redis::COMPRESSION_LZF") &&
75-
constant("Redis::COMPRESSION_LZF") === $redis->getOption(Redis::OPT_COMPRESSION) &&
75+
Redis::COMPRESSION_LZF === $redis->getOption(Redis::OPT_COMPRESSION) &&
7676
function_exists('lzf_compress')
7777
) {
7878
$lzfCompression = true;

composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"psr/log": "^1"
4747
},
4848
"require-dev": {
49+
"ext-igbinary": "*",
4950
"ext-lzf": "*",
5051
"ext-memcached": "*",
5152
"ext-pcntl": "*",
@@ -63,6 +64,7 @@
6364
"squizlabs/php_codesniffer": "^3.3"
6465
},
6566
"suggest": {
67+
"ext-igbinary": "To use this library with PHP Redis igbinary serializer enabled.",
6668
"ext-lzf": "To use this library with PHP Redis lzf compression enabled.",
6769
"ext-pnctl": "Enables locking with flock without busy waiting in CLI scripts.",
6870
"ext-redis": "To use this library with the PHP Redis extension.",

0 commit comments

Comments
 (0)