From 90a28a166c33b0a9d0614a0074cfda557a921ebc Mon Sep 17 00:00:00 2001 From: Geolim4 Date: Mon, 4 Apr 2022 20:15:21 +0200 Subject: [PATCH 1/9] Fixed an issue with tags not properly reinitialized when a backend driver returns an expired cache item --- lib/Phpfastcache/Core/Item/TaggableCacheItemTrait.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/Phpfastcache/Core/Item/TaggableCacheItemTrait.php b/lib/Phpfastcache/Core/Item/TaggableCacheItemTrait.php index 7e509057..a3324309 100644 --- a/lib/Phpfastcache/Core/Item/TaggableCacheItemTrait.php +++ b/lib/Phpfastcache/Core/Item/TaggableCacheItemTrait.php @@ -90,12 +90,10 @@ public function hasTags(array $tagNames, int $strategy = TaggableCacheItemInterf */ public function setTags(array $tags): ExtendedCacheItemInterface { - if (\count($tags)) { - if (\array_filter($tags, 'is_string')) { - $this->tags = $tags; - } else { - throw new PhpfastcacheInvalidArgumentException('$tagName must be an array of string'); - } + if ($tags === [] || \array_filter($tags, 'is_string')) { + $this->tags = $tags; + } else { + throw new PhpfastcacheInvalidArgumentException('$tagName must be an array of string'); } return $this; From a7fc02d99da87bc947900e33dbd43ee3f7551ba9 Mon Sep 17 00:00:00 2001 From: Geolim4 Date: Mon, 4 Apr 2022 20:15:57 +0200 Subject: [PATCH 2/9] Reworked scrutinizer file --- .scrutinizer.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 87cbbeef..9c80d2dc 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -9,9 +9,10 @@ # @author Contributors https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors # -before_commands: - - "./bin/ci/scripts/install_dependencies.sh" build: + dependencies: + override: + - "./bin/ci/scripts/install_dependencies.sh" nodes: analysis: project_setup: @@ -21,7 +22,14 @@ build: environment: php: version: 8.0.0 -checks: + ini: + date.timezone: 'Europe/Paris' + pecl_extensions: + - couchbase + - redis + - memcache + - grpc +checks: php: true coding_style: php: From 4edbd681009e35d8761a03211fc3af8387460078 Mon Sep 17 00:00:00 2001 From: Geolim4 Date: Tue, 5 Apr 2022 01:02:18 +0200 Subject: [PATCH 3/9] Fixed #860 // Cache item throw an error on save with DateTimeImmutable date objects --- lib/Phpfastcache/Core/Item/CacheItemTrait.php | 9 ++++- .../Core/Item/ExtendedCacheItemTrait.php | 4 +-- .../Core/Pool/DriverBaseTrait.php | 18 +++++----- tests/issues/Github-860.test.php | 35 +++++++++++++++++++ 4 files changed, 54 insertions(+), 12 deletions(-) create mode 100644 tests/issues/Github-860.test.php diff --git a/lib/Phpfastcache/Core/Item/CacheItemTrait.php b/lib/Phpfastcache/Core/Item/CacheItemTrait.php index 01b84d00..dce87cbd 100644 --- a/lib/Phpfastcache/Core/Item/CacheItemTrait.php +++ b/lib/Phpfastcache/Core/Item/CacheItemTrait.php @@ -102,7 +102,7 @@ public function expiresAt(?\DateTimeInterface $expiration): static { if ($expiration instanceof DateTimeInterface) { $this->eventManager->dispatch(Event::CACHE_ITEM_EXPIRE_AT, $this, $expiration); - $this->expirationDate = $expiration; + $this->expirationDate = $this->demutateDatetime($expiration); } else { throw new PhpfastcacheInvalidArgumentException('$expiration must be an object implementing the DateTimeInterface got: ' . \gettype($expiration)); } @@ -139,4 +139,11 @@ public function expiresAfter(int|\DateInterval|null $time): static return $this; } + + protected function demutateDatetime(\DateTimeInterface $dateTime): \DateTimeInterface + { + return $dateTime instanceof \DateTimeImmutable + ? \DateTime::createFromImmutable($dateTime) + : $dateTime; + } } diff --git a/lib/Phpfastcache/Core/Item/ExtendedCacheItemTrait.php b/lib/Phpfastcache/Core/Item/ExtendedCacheItemTrait.php index 82c05e1e..59def564 100644 --- a/lib/Phpfastcache/Core/Item/ExtendedCacheItemTrait.php +++ b/lib/Phpfastcache/Core/Item/ExtendedCacheItemTrait.php @@ -136,7 +136,7 @@ public function getCreationDate(): DateTimeInterface public function setCreationDate(DateTimeInterface $date): ExtendedCacheItemInterface { if ($this->driver->getConfig()->isItemDetailedDate()) { - $this->creationDate = $date; + $this->creationDate = $this->demutateDatetime($date); return $this; } @@ -163,7 +163,7 @@ public function getModificationDate(): DateTimeInterface public function setModificationDate(DateTimeInterface $date): ExtendedCacheItemInterface { if ($this->driver->getConfig()->isItemDetailedDate()) { - $this->modificationDate = $date; + $this->modificationDate = $this->demutateDatetime($date); return $this; } diff --git a/lib/Phpfastcache/Core/Pool/DriverBaseTrait.php b/lib/Phpfastcache/Core/Pool/DriverBaseTrait.php index 0b10f429..3c654dd5 100644 --- a/lib/Phpfastcache/Core/Pool/DriverBaseTrait.php +++ b/lib/Phpfastcache/Core/Pool/DriverBaseTrait.php @@ -203,11 +203,11 @@ public function driverUnwrapData(array $wrapper): mixed /** * @param array $wrapper - * @return DateTime + * @return DateTimeInterface */ - public function driverUnwrapEdate(array $wrapper): \DateTime + public function driverUnwrapEdate(array $wrapper): \DateTimeInterface { - if ($wrapper[self::DRIVER_EDATE_WRAPPER_INDEX] instanceof \DateTime) { + if ($wrapper[self::DRIVER_EDATE_WRAPPER_INDEX] instanceof \DateTimeInterface) { return $wrapper[self::DRIVER_EDATE_WRAPPER_INDEX]; } @@ -216,11 +216,11 @@ public function driverUnwrapEdate(array $wrapper): \DateTime /** * @param array $wrapper - * @return DateTime|null + * @return DateTimeInterface|null */ - public function driverUnwrapCdate(array $wrapper): ?\DateTime + public function driverUnwrapCdate(array $wrapper): ?\DateTimeInterface { - if ($wrapper[self::DRIVER_CDATE_WRAPPER_INDEX] instanceof \DateTime) { + if ($wrapper[self::DRIVER_CDATE_WRAPPER_INDEX] instanceof \DateTimeInterface) { return $wrapper[self::DRIVER_CDATE_WRAPPER_INDEX]; } @@ -229,11 +229,11 @@ public function driverUnwrapCdate(array $wrapper): ?\DateTime /** * @param array $wrapper - * @return DateTime|null + * @return DateTimeInterface|null */ - public function driverUnwrapMdate(array $wrapper): ?\DateTime + public function driverUnwrapMdate(array $wrapper): ?\DateTimeInterface { - if ($wrapper[self::DRIVER_MDATE_WRAPPER_INDEX] instanceof \DateTime) { + if ($wrapper[self::DRIVER_MDATE_WRAPPER_INDEX] instanceof \DateTimeInterface) { return $wrapper[self::DRIVER_MDATE_WRAPPER_INDEX]; } diff --git a/tests/issues/Github-860.test.php b/tests/issues/Github-860.test.php new file mode 100644 index 00000000..d3cc91d7 --- /dev/null +++ b/tests/issues/Github-860.test.php @@ -0,0 +1,35 @@ + https://www.phpfastcache.com + * @author Georges.L (Geolim4) + */ + +use Phpfastcache\CacheManager; +use Phpfastcache\Drivers\Files\Config as FilesConfig; +use Phpfastcache\Tests\Helper\TestHelper; + +chdir(__DIR__); +require_once __DIR__ . '/../../vendor/autoload.php'; +$testHelper = new TestHelper('Github issue #860 - Cache item throw an error on save with DateTimeImmutable date objects'); + +$config = new FilesConfig(); +$testHelper->preConfigure($config); +$cacheInstance = CacheManager::getInstance('Files', $config); +$cacheInstance->clear(); + +try { + $key = 'pfc_' . bin2hex(random_bytes(12)); + $item = $cacheInstance->getItem($key); + $item->set(random_int(1000, 999999)) + ->setExpirationDate(new DateTimeImmutable('+1 month')) + ->setCreationDate(new DateTimeImmutable()) + ->setModificationDate(new DateTimeImmutable('+1 week')); + $cacheInstance->save($item); + $cacheInstance->detachAllItems(); + $item = $cacheInstance->getItem($key); + $testHelper->assertPass('Github issue #860 have not regressed.'); +} catch (\TypeError $e) { + $testHelper->assertFail('Github issue #860 have regressed, exception caught: ' . $e->getMessage()); +} + From bf6db688eb44d66d4e586b5fa36604e50dd24c30 Mon Sep 17 00:00:00 2001 From: Geolim4 Date: Tue, 5 Apr 2022 01:06:26 +0200 Subject: [PATCH 4/9] Fixed Scrutinize configuration file --- .scrutinizer.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 9c80d2dc..946e08cd 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -22,8 +22,8 @@ build: environment: php: version: 8.0.0 - ini: - date.timezone: 'Europe/Paris' + ini: + date.timezone: 'Europe/Paris' pecl_extensions: - couchbase - redis From 6ac7ba501875d2c83157a63b9fd1caf27d525a0c Mon Sep 17 00:00:00 2001 From: Geolim4 Date: Tue, 5 Apr 2022 21:12:47 +0200 Subject: [PATCH 5/9] Fixed typo and scrutinizer conf file --- .scrutinizer.yml | 6 +++--- CHANGELOG.md | 6 ++++++ tests/issues/Github-860.test.php | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 946e08cd..614b0ab4 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -12,7 +12,7 @@ build: dependencies: override: - - "./bin/ci/scripts/install_dependencies.sh" + - "composer require -W --ignore-platform-reqs doctrine/couchdb:dev-master phpfastcache/phpssdb:~1.1 predis/predis:~1.1 mongodb/mongodb:~1.9 triagens/arangodb:~3.8 aws/aws-sdk-php:~3.2 google/cloud-firestore:~1.20 solarium/solarium:~6.1" nodes: analysis: project_setup: @@ -25,10 +25,10 @@ build: ini: date.timezone: 'Europe/Paris' pecl_extensions: - - couchbase + # - couchbase + # - grpc - redis - memcache - - grpc checks: php: true coding_style: diff --git a/CHANGELOG.md b/CHANGELOG.md index 90c53e2f..c1947cef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 9.1.1 +##### _Date to be defined_ +- __Core__ + - Fixed #860 - Cache item throw an error on reading with DateTimeImmutable date objects + - Fixed an issue with tags not properly reinitialized when a backend driver returns an expired cache item + ## 9.1.0 ##### 04 april 2022 - __API__ diff --git a/tests/issues/Github-860.test.php b/tests/issues/Github-860.test.php index d3cc91d7..6ff05159 100644 --- a/tests/issues/Github-860.test.php +++ b/tests/issues/Github-860.test.php @@ -11,7 +11,7 @@ chdir(__DIR__); require_once __DIR__ . '/../../vendor/autoload.php'; -$testHelper = new TestHelper('Github issue #860 - Cache item throw an error on save with DateTimeImmutable date objects'); +$testHelper = new TestHelper('Github issue #860 - Cache item throw an error on reading with DateTimeImmutable date objects'); $config = new FilesConfig(); $testHelper->preConfigure($config); From 384b6fc73cd644c15f141638fee482aea8585191 Mon Sep 17 00:00:00 2001 From: Geolim4 Date: Thu, 14 Apr 2022 01:07:10 +0200 Subject: [PATCH 6/9] Fixed #862 (@ShockedPlot7560's issue) --- lib/Phpfastcache/Drivers/Files/Driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Phpfastcache/Drivers/Files/Driver.php b/lib/Phpfastcache/Drivers/Files/Driver.php index 7f8b876f..f44917d1 100644 --- a/lib/Phpfastcache/Drivers/Files/Driver.php +++ b/lib/Phpfastcache/Drivers/Files/Driver.php @@ -71,7 +71,7 @@ protected function driverRead(ExtendedCacheItemInterface $item): ?array return null; } - return $this->decode($content); + return $this->decode($content) ?: null; } /** From 8e5038ff9886f4c8d2e6da8e4e85e9a7cebccd84 Mon Sep 17 00:00:00 2001 From: Geolim4 Date: Thu, 14 Apr 2022 22:14:09 +0200 Subject: [PATCH 7/9] Fixed multiple type issues revealed in #862 --- lib/Phpfastcache/Core/Pool/DriverBaseTrait.php | 2 +- lib/Phpfastcache/Drivers/Apcu/Driver.php | 2 +- lib/Phpfastcache/Drivers/Arangodb/Driver.php | 2 +- lib/Phpfastcache/Drivers/Cassandra/Driver.php | 2 +- lib/Phpfastcache/Drivers/Couchdb/Driver.php | 2 +- lib/Phpfastcache/Drivers/Files/Driver.php | 2 +- lib/Phpfastcache/Drivers/Memcache/Driver.php | 2 +- lib/Phpfastcache/Drivers/Memcached/Driver.php | 2 +- lib/Phpfastcache/Drivers/Predis/Driver.php | 3 ++- lib/Phpfastcache/Drivers/Ssdb/Driver.php | 3 ++- lib/Phpfastcache/Drivers/Wincache/Driver.php | 2 +- lib/Phpfastcache/Drivers/Zenddisk/Driver.php | 3 ++- lib/Phpfastcache/Drivers/Zendshm/Driver.php | 3 ++- tests/Memcached.test.php | 3 +++ tests/lib/Helper/TestHelper.php | 7 ++++--- 15 files changed, 24 insertions(+), 16 deletions(-) diff --git a/lib/Phpfastcache/Core/Pool/DriverBaseTrait.php b/lib/Phpfastcache/Core/Pool/DriverBaseTrait.php index 3c654dd5..2716d6fb 100644 --- a/lib/Phpfastcache/Core/Pool/DriverBaseTrait.php +++ b/lib/Phpfastcache/Core/Pool/DriverBaseTrait.php @@ -269,6 +269,6 @@ protected function encode($data): string */ protected function decode(?string $value): mixed { - return \unserialize((string) $value, ['allowed_classes' => true]); + return $value ? \unserialize($value, ['allowed_classes' => true]) : null; } } diff --git a/lib/Phpfastcache/Drivers/Apcu/Driver.php b/lib/Phpfastcache/Drivers/Apcu/Driver.php index f61c15ac..6c65938f 100644 --- a/lib/Phpfastcache/Drivers/Apcu/Driver.php +++ b/lib/Phpfastcache/Drivers/Apcu/Driver.php @@ -92,7 +92,7 @@ protected function driverRead(ExtendedCacheItemInterface $item): ?array { $data = apcu_fetch($item->getKey(), $success); - if ($success === false) { + if ($success === false || !\is_array($data)) { return null; } diff --git a/lib/Phpfastcache/Drivers/Arangodb/Driver.php b/lib/Phpfastcache/Drivers/Arangodb/Driver.php index 53f9643c..1c124c86 100644 --- a/lib/Phpfastcache/Drivers/Arangodb/Driver.php +++ b/lib/Phpfastcache/Drivers/Arangodb/Driver.php @@ -131,7 +131,7 @@ protected function driverRead(ExtendedCacheItemInterface $item): ?array return null; } throw new PhpfastcacheDriverException( - 'Got unexpeced error from Arangodb: ' . $e->getMessage() + 'Got unexpected error from Arangodb: ' . $e->getMessage() ); } diff --git a/lib/Phpfastcache/Drivers/Cassandra/Driver.php b/lib/Phpfastcache/Drivers/Cassandra/Driver.php index 2c04b009..499c3a91 100644 --- a/lib/Phpfastcache/Drivers/Cassandra/Driver.php +++ b/lib/Phpfastcache/Drivers/Cassandra/Driver.php @@ -140,7 +140,7 @@ protected function driverRead(ExtendedCacheItemInterface $item): ?array $results = $this->instance->execute(new Cassandra\SimpleStatement($query), $options); if ($results instanceof Cassandra\Rows && $results->count() === 1) { - return $this->decode($results->first()['cache_data']); + return $this->decode($results->first()['cache_data']) ?: null; } return null; diff --git a/lib/Phpfastcache/Drivers/Couchdb/Driver.php b/lib/Phpfastcache/Drivers/Couchdb/Driver.php index 2407b022..c8ff5342 100644 --- a/lib/Phpfastcache/Drivers/Couchdb/Driver.php +++ b/lib/Phpfastcache/Drivers/Couchdb/Driver.php @@ -257,7 +257,7 @@ protected function encodeDocument(array $data): array * @return mixed * @throws \Exception */ - protected function decode($value): mixed + protected function decode($value): array { $value[ExtendedCacheItemPoolInterface::DRIVER_DATA_WRAPPER_INDEX] = \unserialize( $value[ExtendedCacheItemPoolInterface::DRIVER_DATA_WRAPPER_INDEX], diff --git a/lib/Phpfastcache/Drivers/Files/Driver.php b/lib/Phpfastcache/Drivers/Files/Driver.php index f44917d1..7f8b876f 100644 --- a/lib/Phpfastcache/Drivers/Files/Driver.php +++ b/lib/Phpfastcache/Drivers/Files/Driver.php @@ -71,7 +71,7 @@ protected function driverRead(ExtendedCacheItemInterface $item): ?array return null; } - return $this->decode($content) ?: null; + return $this->decode($content); } /** diff --git a/lib/Phpfastcache/Drivers/Memcache/Driver.php b/lib/Phpfastcache/Drivers/Memcache/Driver.php index 3020d768..b8b1935d 100644 --- a/lib/Phpfastcache/Drivers/Memcache/Driver.php +++ b/lib/Phpfastcache/Drivers/Memcache/Driver.php @@ -149,7 +149,7 @@ protected function driverRead(ExtendedCacheItemInterface $item): ?array { $val = $this->instance->get($item->getKey()); - if ($val === false) { + if (empty($val) || !\is_array($val)) { return null; } diff --git a/lib/Phpfastcache/Drivers/Memcached/Driver.php b/lib/Phpfastcache/Drivers/Memcached/Driver.php index 04254a86..730e87c9 100644 --- a/lib/Phpfastcache/Drivers/Memcached/Driver.php +++ b/lib/Phpfastcache/Drivers/Memcached/Driver.php @@ -147,7 +147,7 @@ protected function driverRead(ExtendedCacheItemInterface $item): ?array { $val = $this->instance->get($item->getKey()); - if ($val === false) { + if (empty($val) || !\is_array($val)) { return null; } diff --git a/lib/Phpfastcache/Drivers/Predis/Driver.php b/lib/Phpfastcache/Drivers/Predis/Driver.php index 46a33862..b555d9fc 100644 --- a/lib/Phpfastcache/Drivers/Predis/Driver.php +++ b/lib/Phpfastcache/Drivers/Predis/Driver.php @@ -143,7 +143,8 @@ protected function driverConnect(): bool protected function driverRead(ExtendedCacheItemInterface $item): ?array { $val = $this->instance->get($item->getKey()); - if ($val == false) { + + if ($val === null) { return null; } diff --git a/lib/Phpfastcache/Drivers/Ssdb/Driver.php b/lib/Phpfastcache/Drivers/Ssdb/Driver.php index 5cfa9328..7493b6eb 100644 --- a/lib/Phpfastcache/Drivers/Ssdb/Driver.php +++ b/lib/Phpfastcache/Drivers/Ssdb/Driver.php @@ -94,7 +94,8 @@ protected function driverConnect(): bool protected function driverRead(ExtendedCacheItemInterface $item): ?array { $val = $this->instance->get($item->getEncodedKey()); - if (!$val) { + + if (empty($val)) { return null; } diff --git a/lib/Phpfastcache/Drivers/Wincache/Driver.php b/lib/Phpfastcache/Drivers/Wincache/Driver.php index dfe1e2c7..c3a2c142 100644 --- a/lib/Phpfastcache/Drivers/Wincache/Driver.php +++ b/lib/Phpfastcache/Drivers/Wincache/Driver.php @@ -72,7 +72,7 @@ protected function driverRead(ExtendedCacheItemInterface $item): ?array { $val = wincache_ucache_get($item->getKey(), $suc); - if ($suc === false) { + if ($suc === false || empty($val)) { return null; } diff --git a/lib/Phpfastcache/Drivers/Zenddisk/Driver.php b/lib/Phpfastcache/Drivers/Zenddisk/Driver.php index d52541e5..0ec6badf 100644 --- a/lib/Phpfastcache/Drivers/Zenddisk/Driver.php +++ b/lib/Phpfastcache/Drivers/Zenddisk/Driver.php @@ -80,7 +80,8 @@ protected function driverConnect(): bool protected function driverRead(ExtendedCacheItemInterface $item): ?array { $data = zend_disk_cache_fetch($item->getKey()); - if ($data === false) { + + if (empty($data) || !\is_array($data)) { return null; } diff --git a/lib/Phpfastcache/Drivers/Zendshm/Driver.php b/lib/Phpfastcache/Drivers/Zendshm/Driver.php index ae6bffe2..69224bd1 100644 --- a/lib/Phpfastcache/Drivers/Zendshm/Driver.php +++ b/lib/Phpfastcache/Drivers/Zendshm/Driver.php @@ -79,7 +79,8 @@ protected function driverConnect(): bool protected function driverRead(ExtendedCacheItemInterface $item): ?array { $data = zend_shm_cache_fetch($item->getKey()); - if ($data === false) { + + if (empty($data) || !\is_array($data)) { return null; } diff --git a/tests/Memcached.test.php b/tests/Memcached.test.php index 9649a0e2..47c2f534 100644 --- a/tests/Memcached.test.php +++ b/tests/Memcached.test.php @@ -13,6 +13,7 @@ */ use Phpfastcache\CacheManager; +use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; use Phpfastcache\Drivers\Memcached\Config as MemcachedConfig; use Phpfastcache\Tests\Helper\TestHelper; @@ -82,4 +83,6 @@ $cacheInstanceDefSyntax->clear(); $cacheInstanceOldSyntax->clear(); $cacheInstanceNewSyntax->clear(); + +$testHelper->runCRUDTests($cacheInstanceNewSyntax); $testHelper->terminateTest(); diff --git a/tests/lib/Helper/TestHelper.php b/tests/lib/Helper/TestHelper.php index c80449a0..5a6cb4e9 100644 --- a/tests/lib/Helper/TestHelper.php +++ b/tests/lib/Helper/TestHelper.php @@ -550,11 +550,12 @@ public function runCRUDTests(ExtendedCacheItemPoolInterface|PhpfastcacheAbstract $pool->getIO()->getWriteHit() ) ); - $this->printInfoText('Driver info: ' . $pool->getStats()->getInfo() . ''); - $poolSize = $pool->getStats()->getSize(); + $stats = $pool->getStats(); + $this->printInfoText('Driver info: ' . $stats->getInfo() . ''); + $poolSize = $stats->getSize(); if($poolSize){ - $this->printInfoText('Driver size (approximative): ' . round($pool->getStats()->getSize() / (1024 ** 2), 3) . ' Mo'); + $this->printInfoText('Driver size (approximative): ' . round($stats->getSize() / (1024 ** 2), 3) . ' Mo'); } } From 96c960de1c094ba7634fd5320367bf1d630291fc Mon Sep 17 00:00:00 2001 From: Geolim4 Date: Thu, 14 Apr 2022 23:02:41 +0200 Subject: [PATCH 8/9] Include php redis extension version in driver stats --- lib/Phpfastcache/Drivers/Redis/Driver.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Phpfastcache/Drivers/Redis/Driver.php b/lib/Phpfastcache/Drivers/Redis/Driver.php index 544abf39..40dfdd9c 100644 --- a/lib/Phpfastcache/Drivers/Redis/Driver.php +++ b/lib/Phpfastcache/Drivers/Redis/Driver.php @@ -57,8 +57,9 @@ public function getStats(): DriverStatistic ->setSize((int)$info['used_memory']) ->setInfo( sprintf( - "The Redis daemon v%s is up since %s.\n For more information see RawData. \n Driver size includes the memory allocation size.", + "The Redis daemon v%s, php-ext v%s, is up since %s.\n For more information see RawData. \n Driver size includes the memory allocation size.", $info['redis_version'], + \phpversion("redis"), $date->format(DATE_RFC2822) ) ); From 4de9fce06eece503d1712d5be591286de82c9c08 Mon Sep 17 00:00:00 2001 From: Geolim4 Date: Fri, 15 Apr 2022 23:12:13 +0200 Subject: [PATCH 9/9] Updated changelog version --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1947cef..a7d27a10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,10 @@ ## 9.1.1 ##### _Date to be defined_ - __Core__ - - Fixed #860 - Cache item throw an error on reading with DateTimeImmutable date objects + - Fixed #860 // Cache item throw an error on reading with DateTimeImmutable date objects - Fixed an issue with tags not properly reinitialized when a backend driver returns an expired cache item +- __Drivers__ + - Fixed #862 // Multiple driver errors caused by invalid return type of `driverRead()` (reported by @ShockedPlot7560 and @aemla) ## 9.1.0 ##### 04 april 2022