From 0382d9aced6da1400b2f8b9d4878312eed84fd0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20B=C3=B6sing?= <2189546+boesing@users.noreply.github.com> Date: Thu, 3 Jun 2021 16:06:26 +0200 Subject: [PATCH 1/5] docs: update maximum key length for redis adapter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With laminas/laminas-cache-storage-adapter-redis#14, the maximum key length was increased for redis v3+ Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com> --- docs/book/storage/adapter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/book/storage/adapter.md b/docs/book/storage/adapter.md index daad5e90..cfb4f492 100644 --- a/docs/book/storage/adapter.md +++ b/docs/book/storage/adapter.md @@ -760,7 +760,7 @@ Capability | Value `ttlPrecision` | 1 `useRequestTime` | `false` `lockOnExpire` | 0 -`maxKeyLength` | 255 +`maxKeyLength` | 512000000 (in redis v3+, 255 otherwise) `namespaceIsPrefix` | `true` `namespaceSeparator` | none From 9b597e0fd967616e9f6ccbc7179b730130f9f3fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20B=C3=B6sing?= <2189546+boesing@users.noreply.github.com> Date: Thu, 3 Jun 2021 16:08:00 +0200 Subject: [PATCH 2/5] docs: update redis adapter docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com> --- docs/book/storage/adapter.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/book/storage/adapter.md b/docs/book/storage/adapter.md index cfb4f492..9d04afb4 100644 --- a/docs/book/storage/adapter.md +++ b/docs/book/storage/adapter.md @@ -741,10 +741,12 @@ Name | Data Type | Default Value | Description ## Redis Adapter `Laminas\Cache\Storage\Adapter\Redis` stores cache items over the redis protocol -using the PHP extension [redis](https://github.com/nicolasff/phpredis). +using the PHP extension [redis](https://github.com/phpredis/phpredis). This adapter implements the following interfaces: +- `Laminas\Cache\Storage\ClearByNamespaceInterface` +- `Laminas\Cache\Storage\ClearByPrefixInterface` - `Laminas\Cache\Storage\FlushableInterface` - `Laminas\Cache\Storage\TotalSpaceCapableInterface` @@ -753,7 +755,7 @@ This adapter implements the following interfaces: Capability | Value ---------- | ----- `supportedDatatypes` | `string`, `array` (serialized), `object` (serialized) -`supportedMetadata` | none +`supportedMetadata` | ttl (redis v2+) `minTtl` | 1 `maxTtl` | 0 `staticTtl` | `true` From fed87c0d7501169e312c5be85ffa18de0c9bfbba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20B=C3=B6sing?= <2189546+boesing@users.noreply.github.com> Date: Thu, 3 Jun 2021 18:06:11 +0200 Subject: [PATCH 3/5] docs: `RedisCluster` adapter documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Providing initial `RedisCluster` documentation See laminas/laminas-cache-storage-adapter-redis#13 for implementation details. Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com> --- docs/book/storage/adapter.md | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/docs/book/storage/adapter.md b/docs/book/storage/adapter.md index 9d04afb4..c0460e98 100644 --- a/docs/book/storage/adapter.md +++ b/docs/book/storage/adapter.md @@ -784,6 +784,47 @@ Name | Data Type | Default Value | Description - Associative array: `['host' => [, 'port' => [, 'timeout' => ]]]` - List: `[[, , [, ]]]` +## RedisCluster Adapter + +`Laminas\Cache\Storage\Adapter\RedisCluster` stores cache items over the redis cluster protocol +using the PHP extension [redis](https://github.com/phpredis/phpredis). + +This adapter implements the following interfaces: + +- `Laminas\Cache\Storage\ClearByNamespaceInterface` +- `Laminas\Cache\Storage\ClearByPrefixInterface` +- `Laminas\Cache\Storage\FlushableInterface` + +### Capabilities + +Capability | Value +---------- | ----- +`supportedDatatypes` | `string`, `array` (serialized), `object` (serialized) +`supportedMetadata` | ttl (redis v2+) +`minTtl` | 1 +`maxTtl` | 0 +`staticTtl` | `true` +`ttlPrecision` | 1 +`useRequestTime` | `false` +`lockOnExpire` | 0 +`maxKeyLength` | 512000000 (in redis v3+, 255 otherwise) +`namespaceIsPrefix` | `true` +`namespaceSeparator` | none + +### Adapter Specific Options + +Name | Data Type | Default Value | Description +---- | --------- | ------------- | ----------- +`lib_options` | `array` | `[]` | Associative array of redis options where the array key is the options constant value (see `RedisCluster::OPT_*` [constants](https://github.com/JetBrains/phpstorm-stubs/blob/master/redis/RedisCluster.php#L20) for details). +`namespace_separator` | `string` | ":" | A separator for the namespace and prefix. +`password` | `string` | "" | Password for authentication with redis +`name` | `string` | "" | Name to determine configuration from [php.ini](https://github.com/phpredis/phpredis/blob/e9ba9ff12e74c3483f2cb54b7fc9fb7250829a2a/cluster.markdown#loading-a-cluster-configuration-by-name) (**MUST NOT** be combined with `seeds`) +`seeds` | `array` | `[]` | List of strings containing `:` (**MUST NOT** be combined with `name`) +`timeout` | `float` | `1.0` | Timeout for commands, see [phpredis](https://github.com/phpredis/phpredis/blob/e9ba9ff12e74c3483f2cb54b7fc9fb7250829a2a/cluster.markdown#timeouts) timeouts documentation for more background. +`read_timeout` | `float` | `2.0` | Read timeout for commands, see [phpredis](https://github.com/phpredis/phpredis/blob/e9ba9ff12e74c3483f2cb54b7fc9fb7250829a2a/cluster.markdown#timeouts) timeouts documentation for more background. +`persistent` | `bool` | `false` | Flag to specify whether to create a persistent connection or not +`version` | `string` | "" | The redis server version. **MUST** be specified in a [semantic versioning](https://semver.org/lang/de/#semantic-versioning-200) format. This information is used to determine some features/capabilities without opening a connection to the server. + ## Memory Adapter The `Laminas\Cache\Storage\Adapter\Memory` stores items in-memory in the current From ee9f093757c90db7648e505e965bc32ae5148906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20B=C3=B6sing?= <2189546+boesing@users.noreply.github.com> Date: Thu, 3 Jun 2021 21:00:51 +0200 Subject: [PATCH 4/5] docs: use official extension name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com> --- docs/book/storage/adapter.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/book/storage/adapter.md b/docs/book/storage/adapter.md index c0460e98..3d04b87d 100644 --- a/docs/book/storage/adapter.md +++ b/docs/book/storage/adapter.md @@ -741,7 +741,7 @@ Name | Data Type | Default Value | Description ## Redis Adapter `Laminas\Cache\Storage\Adapter\Redis` stores cache items over the redis protocol -using the PHP extension [redis](https://github.com/phpredis/phpredis). +using the PHP extension [PhpRedis](https://github.com/phpredis/phpredis). This adapter implements the following interfaces: @@ -787,7 +787,7 @@ Name | Data Type | Default Value | Description ## RedisCluster Adapter `Laminas\Cache\Storage\Adapter\RedisCluster` stores cache items over the redis cluster protocol -using the PHP extension [redis](https://github.com/phpredis/phpredis). +using the PHP extension [PhpRedis](https://github.com/phpredis/phpredis). This adapter implements the following interfaces: From c3a9f32bcb5f1dd97716b28ab22ccfa0aa2fb16c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20B=C3=B6sing?= <2189546+boesing@users.noreply.github.com> Date: Thu, 3 Jun 2021 21:11:51 +0200 Subject: [PATCH 5/5] docs: change some documentation links and names to reflect officla `Redis` product name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com> --- docs/book/storage/adapter.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/book/storage/adapter.md b/docs/book/storage/adapter.md index 3d04b87d..c472973d 100644 --- a/docs/book/storage/adapter.md +++ b/docs/book/storage/adapter.md @@ -740,7 +740,7 @@ Name | Data Type | Default Value | Description ## Redis Adapter -`Laminas\Cache\Storage\Adapter\Redis` stores cache items over the redis protocol +`Laminas\Cache\Storage\Adapter\Redis` stores cache items over the [Redis](https://redis.io) protocol using the PHP extension [PhpRedis](https://github.com/phpredis/phpredis). This adapter implements the following interfaces: @@ -755,14 +755,14 @@ This adapter implements the following interfaces: Capability | Value ---------- | ----- `supportedDatatypes` | `string`, `array` (serialized), `object` (serialized) -`supportedMetadata` | ttl (redis v2+) +`supportedMetadata` | ttl (Redis v2+) `minTtl` | 1 `maxTtl` | 0 `staticTtl` | `true` `ttlPrecision` | 1 `useRequestTime` | `false` `lockOnExpire` | 0 -`maxKeyLength` | 512000000 (in redis v3+, 255 otherwise) +`maxKeyLength` | 512000000 (in Redis v3+, 255 otherwise) `namespaceIsPrefix` | `true` `namespaceSeparator` | none @@ -771,12 +771,12 @@ Capability | Value Name | Data Type | Default Value | Description ---- | --------- | ------------- | ----------- `database` | `integer` | 0 | Set database identifier. -`lib_options` | `array` | `[]` | Associative array of redis options where the array key is the option name. +`lib_options` | `array` | `[]` | Associative array of Redis options where the array key is the option name. `namespace_separator` | `string` | ":" | A separator for the namespace and prefix. `password` | `string` | "" | Set password. `persistent_id` | `string` | | Set persistent id (name of the connection, leave blank to not use a persistent connection). -`resource_manager` | `string` | | Set the redis resource manager to use -`server` | | | See below. +`resource_manager` | `string` | "" | Set the Redis resource manager to use +`server` | `string\|array` | "" | See below. `server` can be described as any of the following: @@ -786,7 +786,7 @@ Name | Data Type | Default Value | Description ## RedisCluster Adapter -`Laminas\Cache\Storage\Adapter\RedisCluster` stores cache items over the redis cluster protocol +`Laminas\Cache\Storage\Adapter\RedisCluster` stores cache items over the [Redis cluster](https://github.com/phpredis/phpredis#redis-cluster-support) protocol using the PHP extension [PhpRedis](https://github.com/phpredis/phpredis). This adapter implements the following interfaces: @@ -800,14 +800,14 @@ This adapter implements the following interfaces: Capability | Value ---------- | ----- `supportedDatatypes` | `string`, `array` (serialized), `object` (serialized) -`supportedMetadata` | ttl (redis v2+) +`supportedMetadata` | ttl (Redis v2+) `minTtl` | 1 `maxTtl` | 0 `staticTtl` | `true` `ttlPrecision` | 1 `useRequestTime` | `false` `lockOnExpire` | 0 -`maxKeyLength` | 512000000 (in redis v3+, 255 otherwise) +`maxKeyLength` | 512000000 (in Redis v3+, 255 otherwise) `namespaceIsPrefix` | `true` `namespaceSeparator` | none @@ -815,15 +815,15 @@ Capability | Value Name | Data Type | Default Value | Description ---- | --------- | ------------- | ----------- -`lib_options` | `array` | `[]` | Associative array of redis options where the array key is the options constant value (see `RedisCluster::OPT_*` [constants](https://github.com/JetBrains/phpstorm-stubs/blob/master/redis/RedisCluster.php#L20) for details). +`lib_options` | `array` | `[]` | Associative array of Redis options where the array key is the options constant value (see `RedisCluster::OPT_*` [constants](https://github.com/JetBrains/phpstorm-stubs/blob/master/redis/RedisCluster.php) for details). `namespace_separator` | `string` | ":" | A separator for the namespace and prefix. -`password` | `string` | "" | Password for authentication with redis -`name` | `string` | "" | Name to determine configuration from [php.ini](https://github.com/phpredis/phpredis/blob/e9ba9ff12e74c3483f2cb54b7fc9fb7250829a2a/cluster.markdown#loading-a-cluster-configuration-by-name) (**MUST NOT** be combined with `seeds`) +`password` | `string` | "" | Password to authenticate with Redis server +`name` | `string` | "" | Name to determine configuration from [php.ini](https://github.com/phpredis/phpredis/blob/develop/cluster.markdown#loading-a-cluster-configuration-by-name) (**MUST NOT** be combined with `seeds`) `seeds` | `array` | `[]` | List of strings containing `:` (**MUST NOT** be combined with `name`) -`timeout` | `float` | `1.0` | Timeout for commands, see [phpredis](https://github.com/phpredis/phpredis/blob/e9ba9ff12e74c3483f2cb54b7fc9fb7250829a2a/cluster.markdown#timeouts) timeouts documentation for more background. -`read_timeout` | `float` | `2.0` | Read timeout for commands, see [phpredis](https://github.com/phpredis/phpredis/blob/e9ba9ff12e74c3483f2cb54b7fc9fb7250829a2a/cluster.markdown#timeouts) timeouts documentation for more background. +`timeout` | `float` | `1.0` | Timeout for commands, see [PhpRedis](https://github.com/phpredis/phpredis/blob/develop/cluster.markdown#timeouts) timeouts documentation for more background. +`read_timeout` | `float` | `2.0` | Read timeout for commands, see [PhpRedis](https://github.com/phpredis/phpredis/blob/develop/cluster.markdown#timeouts) timeouts documentation for more background. `persistent` | `bool` | `false` | Flag to specify whether to create a persistent connection or not -`version` | `string` | "" | The redis server version. **MUST** be specified in a [semantic versioning](https://semver.org/lang/de/#semantic-versioning-200) format. This information is used to determine some features/capabilities without opening a connection to the server. +`version` | `string` | "" | The Redis server version. **MUST** be specified in a [Semantic Versioning 2.0.0](https://semver.org/#semantic-versioning-200) format. This information is used to determine some features/capabilities without opening a connection to the server. ## Memory Adapter