From 8999079c23c91b50e8022b940281505f85cd8303 Mon Sep 17 00:00:00 2001 From: Philipp Fehre Date: Thu, 16 Feb 2023 18:05:53 +0100 Subject: [PATCH 1/5] Remove deprecation warning `unserialize(null)` causes a deprecation warning flooding the logs, so in case the cache for a given cache is empty this warning will be seen. To avoid this use `''` as a replacement. `unserialize(null) === unserialzie('') === false` this does not change behaviour. --- src/Adapter/Predis/PredisCachePool.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Adapter/Predis/PredisCachePool.php b/src/Adapter/Predis/PredisCachePool.php index f1ec6eee..ea737e53 100644 --- a/src/Adapter/Predis/PredisCachePool.php +++ b/src/Adapter/Predis/PredisCachePool.php @@ -42,7 +42,7 @@ public function __construct(Client $cache) */ protected function fetchObjectFromCache($key) { - if (false === $result = unserialize($this->cache->get($this->getHierarchyKey($key)))) { + if (false === $result = unserialize($this->cache->get($this->getHierarchyKey($key)) ?? '')) { return [false, null, [], null]; } From fd7e534dff07aca76fa0578e92858a28e514b271 Mon Sep 17 00:00:00 2001 From: Philipp Fehre Date: Thu, 16 Feb 2023 18:07:29 +0100 Subject: [PATCH 2/5] Update predis/predis Predis `^2.0` has been released some time ago, this version constraint allows applications depending on `predis-adapter` to update to `predis/predis:^2.0`. --- src/Adapter/Predis/composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Adapter/Predis/composer.json b/src/Adapter/Predis/composer.json index 2739326b..a90c3f42 100644 --- a/src/Adapter/Predis/composer.json +++ b/src/Adapter/Predis/composer.json @@ -27,7 +27,7 @@ "php": ">=7.4", "cache/adapter-common": "^1.0", "cache/hierarchical-cache": "^1.0", - "predis/predis": "^1.1", + "predis/predis": "^2.0", "psr/cache": "^1.0 || ^2.0", "psr/simple-cache": "^1.0" }, From 098ed25529ed8b365c53665c005e85a30ad4bec0 Mon Sep 17 00:00:00 2001 From: Philipp Fehre Date: Thu, 16 Feb 2023 18:11:05 +0100 Subject: [PATCH 3/5] Update changelog - Include predis update - Include unserialize deprecation warning --- src/Adapter/Predis/Changelog.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Adapter/Predis/Changelog.md b/src/Adapter/Predis/Changelog.md index 82944367..dd5d3c19 100644 --- a/src/Adapter/Predis/Changelog.md +++ b/src/Adapter/Predis/Changelog.md @@ -4,6 +4,9 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" betwee ## UNRELEASED +* Update predis/predis: ^2.0 +* Fixed unserialized(null) deprecation + ## 1.2.0 * Support for PHP 8.1 From 6be5d7855b436ea70c9ccbefd1d0d5c50ad693aa Mon Sep 17 00:00:00 2001 From: Philipp Fehre Date: Mon, 13 Mar 2023 17:39:23 +0100 Subject: [PATCH 4/5] Update ci workflow - Update redis to a supported version - Update redis-cluser to a supported version, use 6.2.10 as 7.x fails non local connections see https://github.com/Grokzen/docker-redis-cluster/issues/155 - Set redis-cluster IP to 0.0.0.0 interface to allow all connections --- .github/workflows/ci.yml | 8 ++++---- composer.json | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4afbe0ff..68505a88 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,17 +17,17 @@ jobs: services: redis: - image: redis:6.0.0 + image: redis:7.0 ports: - 6379:6379 redis-cluster: - image: grokzen/redis-cluster:5.0.4 + image: grokzen/redis-cluster:6.2.10 ports: - 7000:7000 - 7001:7001 - 7002:7002 env: - STANDALONE: 1 + IP: 0.0.0.0 memcached: image: memcached:1.6.5 ports: @@ -39,7 +39,7 @@ jobs: steps: - name: Set up PHP - uses: shivammathur/setup-php@2.7.0 + uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} coverage: none diff --git a/composer.json b/composer.json index 858c316f..f6a2bb11 100644 --- a/composer.json +++ b/composer.json @@ -106,5 +106,10 @@ "branch-alias": { "dev-master": "1.1-dev" } + }, + "config": { + "allow-plugins": { + "kylekatarnls/update-helper": true + } } } From bc6f9612bce4ce8ca60dc8d8758144c9ee92d930 Mon Sep 17 00:00:00 2001 From: Philipp Fehre Date: Wed, 15 Mar 2023 11:31:41 +0100 Subject: [PATCH 5/5] Fix composer-normalize workflow - requires php version >= 8.0 - apply normalize fixes --- .github/workflows/checks.yml | 4 ++-- composer.json | 7 +------ src/Adapter/Illuminate/composer.json | 7 ++++++- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index d89112ff..99bb23cf 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -9,9 +9,9 @@ jobs: steps: - name: Set up PHP - uses: shivammathur/setup-php@2.7.0 + uses: shivammathur/setup-php@v2 with: - php-version: 7.4 + php-version: 8.1 coverage: none tools: composer-normalize diff --git a/composer.json b/composer.json index f6a2bb11..ac05163d 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "require-dev": { "cache/integration-tests": "^0.17", "defuse/php-encryption": "^2.0", - "illuminate/cache": "^5.4 || ^5.5 || ^5.6", + "illuminate/cache": "^5.4", "mockery/mockery": "^1.0", "phpunit/phpunit": "^7.5.20 || ^9.5.10", "predis/predis": "^1.1", @@ -106,10 +106,5 @@ "branch-alias": { "dev-master": "1.1-dev" } - }, - "config": { - "allow-plugins": { - "kylekatarnls/update-helper": true - } } } diff --git a/src/Adapter/Illuminate/composer.json b/src/Adapter/Illuminate/composer.json index 03822e0f..eeb7cdc5 100644 --- a/src/Adapter/Illuminate/composer.json +++ b/src/Adapter/Illuminate/composer.json @@ -32,7 +32,7 @@ "php": ">=7.4", "cache/adapter-common": "^1.0", "cache/hierarchical-cache": "^1.0", - "illuminate/cache": "^5.4 || ^5.5 || ^5.6", + "illuminate/cache": "^5.4", "psr/cache": "^1.0 || ^2.0", "psr/simple-cache": "^1.0" }, @@ -55,6 +55,11 @@ "/Tests/" ] }, + "config": { + "allow-plugins": { + "kylekatarnls/update-helper": true + } + }, "extra": { "branch-alias": { "dev-master": "1.1-dev"