From f099f6135a798b8591fdb792a8e286d362aca3d8 Mon Sep 17 00:00:00 2001 From: Geolim4 Date: Sun, 22 Mar 2020 23:35:24 +0100 Subject: [PATCH 01/14] Added V8 mention --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4c2add5da..861070b9b 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ One of the biggest change is the configuration system which is now an object that replace the primitive array that we used to implement back then. Also please note that the V7 requires at least PHP7 or higher to work properly. +>:new: The V8 is now released, upgrade Phpfastcache by following our migration guide in `docs/migration` --------------------------- Simple Yet Powerful PHP Caching Class --------------------------- From f16d1dbd530d8608374e2da7cf88851cd3d57e0a Mon Sep 17 00:00:00 2001 From: Kevin Gilleard Date: Sun, 12 Apr 2020 16:41:16 -0700 Subject: [PATCH 02/14] Removing path check in Redis driver before auth. --- lib/Phpfastcache/Drivers/Redis/Driver.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/Phpfastcache/Drivers/Redis/Driver.php b/lib/Phpfastcache/Drivers/Redis/Driver.php index 311e86026..ed21d71c8 100644 --- a/lib/Phpfastcache/Drivers/Redis/Driver.php +++ b/lib/Phpfastcache/Drivers/Redis/Driver.php @@ -85,10 +85,9 @@ protected function driverConnect(): bool $this->instance->setOption(RedisClient::OPT_PREFIX, $this->getConfig()->getOptPrefix()); } - if (!$this->getConfig()->getPath()) { - if ($this->getConfig()->getPassword() && !$this->instance->auth($this->getConfig()->getPassword())) { - return false; - } + + if ($this->getConfig()->getPassword() && !$this->instance->auth($this->getConfig()->getPassword())) { + return false; } if ($this->getConfig()->getDatabase() !== null) { From eebebf3e4e0cd1fd2fd3d5fa826dc63e6a069e8c Mon Sep 17 00:00:00 2001 From: Geolim4 Date: Fri, 24 Apr 2020 23:41:29 +0200 Subject: [PATCH 03/14] Released 7.1.1 --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf30ed1ec..aa65b2576 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## 7.1.1 +#### _"Rust-out"_ +##### 24 april 2020 +- __Drivers__ + - Fixed #716 // TypeError in lib/Phpfastcache/Drivers/Cookie/Driver.php (@motikan2010) + - Fixed #733 // Removing path check in Redis driver before auth. (@gillytech) +- __Helpers__ + - Fixed #717 // Deprecate "ActOnAll" to remove it in v8 (@geolim4) +- __Misc__ + - Added v8 mention in Readme (@geolim4) + - Added Github Funding option (@geolim4) + ## 7.1.0 #### _"Wake the rust"_ ##### 15 september 2019 From 9c9a57894b8b811aa564048864cc530120082518 Mon Sep 17 00:00:00 2001 From: Diederik Noordhuis Date: Sat, 8 Aug 2020 15:23:25 -0500 Subject: [PATCH 04/14] PHP 7.4 support --- lib/Phpfastcache/Config/ConfigurationOption.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Phpfastcache/Config/ConfigurationOption.php b/lib/Phpfastcache/Config/ConfigurationOption.php index 2392f747b..a98a5d41f 100644 --- a/lib/Phpfastcache/Config/ConfigurationOption.php +++ b/lib/Phpfastcache/Config/ConfigurationOption.php @@ -142,7 +142,7 @@ public function __construct(...$args) $typeHintGot = \is_object($value) ? \get_class($value) : \gettype($value); $reflectionMethod = new \ReflectionMethod($this, $method); $parameter = $reflectionMethod->getParameters()[0] ?? null; - $typeHintExpected = ($parameter instanceof \ReflectionParameter ? ($parameter->getType() === 'object' ? $parameter->getClass() : $parameter->getType()) : 'Unknown type'); + $typeHintExpected = ($parameter instanceof \ReflectionParameter ? ($parameter->getType()->getName() === 'object' ? $parameter->getClass() : $parameter->getType()->getName()) : 'Unknown type'); throw new PhpfastcacheInvalidConfigurationException(\sprintf( 'Invalid type hint found for "%s", expected "%s" got "%s"', @@ -447,4 +447,4 @@ public function setCacheSlamsTimeout(int $cacheSlamsTimeout): self $this->cacheSlamsTimeout = $cacheSlamsTimeout; return $this; } -} \ No newline at end of file +} From 14af03b17c8da3f06c8bbf89b54ec80dd95adf3f Mon Sep 17 00:00:00 2001 From: Diederik Noordhuis Date: Sat, 8 Aug 2020 15:39:25 -0500 Subject: [PATCH 05/14] Fix PHP 7.0 break due to undefined method. --- .../Config/ConfigurationOption.php | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/lib/Phpfastcache/Config/ConfigurationOption.php b/lib/Phpfastcache/Config/ConfigurationOption.php index a98a5d41f..cecfdd5d2 100644 --- a/lib/Phpfastcache/Config/ConfigurationOption.php +++ b/lib/Phpfastcache/Config/ConfigurationOption.php @@ -142,14 +142,24 @@ public function __construct(...$args) $typeHintGot = \is_object($value) ? \get_class($value) : \gettype($value); $reflectionMethod = new \ReflectionMethod($this, $method); $parameter = $reflectionMethod->getParameters()[0] ?? null; - $typeHintExpected = ($parameter instanceof \ReflectionParameter ? ($parameter->getType()->getName() === 'object' ? $parameter->getClass() : $parameter->getType()->getName()) : 'Unknown type'); - - throw new PhpfastcacheInvalidConfigurationException(\sprintf( - 'Invalid type hint found for "%s", expected "%s" got "%s"', - \lcfirst(\substr($method, 3)), - $typeHintExpected, - $typeHintGot - )); + $paraReflectionType = $parameter->getType(); + if(method_exists($paraReflectionType, "getName")) { + $typeHintExpected = ($parameter instanceof \ReflectionParameter ? ($paraReflectionType->getName() === 'object' ? $parameter->getClass() : $paraReflectionType->getName()) : 'Unknown type'); + throw new PhpfastcacheInvalidConfigurationException(\sprintf( + 'Invalid type hint found for "%s", expected "%s" got "%s"', + \lcfirst(\substr($method, 3)), + $typeHintExpected, + $typeHintGot + )); + } else { + $typeHintExpected = ($parameter instanceof \ReflectionParameter ? ($paraReflectionType === 'object' ? $parameter->getClass() : $paraReflectionType) : 'Unknown type'); + throw new PhpfastcacheInvalidConfigurationException(\sprintf( + 'Invalid type hint found for "%s", expected "%s" got "%s"', + \lcfirst(\substr($method, 3)), + $typeHintExpected, + $typeHintGot + )); + } } } } From 645c168ee4c027a64c85f5d9864194933191d350 Mon Sep 17 00:00:00 2001 From: Geolim4 Date: Wed, 16 Sep 2020 00:00:20 +0200 Subject: [PATCH 06/14] Fixed #759 --- lib/Phpfastcache/Drivers/Memcached/Driver.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Phpfastcache/Drivers/Memcached/Driver.php b/lib/Phpfastcache/Drivers/Memcached/Driver.php index a7e1c74b9..140ceca9f 100644 --- a/lib/Phpfastcache/Drivers/Memcached/Driver.php +++ b/lib/Phpfastcache/Drivers/Memcached/Driver.php @@ -194,9 +194,9 @@ protected function driverClear(): bool public function getStats(): DriverStatistic { $stats = current($this->instance->getStats()); - $stats['uptime'] = (isset($stats['uptime']) ? $stats['uptime'] : 0); - $stats['version'] = (isset($stats['version']) ? $stats['version'] : $this->instance->getVersion()); - $stats['bytes'] = (isset($stats['bytes']) ? $stats['version'] : 0); + $stats['uptime'] = $stats['uptime'] ?? 0; + $stats['version'] = $stats['version'] ?? $this->instance->getVersion(); + $stats['bytes'] = $stats['bytes'] ?? 0; $date = (new \DateTime())->setTimestamp(\time() - $stats['uptime']); From 385e5847bd539bd089aa0634dcd2e708a84af388 Mon Sep 17 00:00:00 2001 From: Geolim4 Date: Wed, 18 Nov 2020 21:13:26 +0100 Subject: [PATCH 07/14] Fixed #768 --- lib/Phpfastcache/Helper/Psr16Adapter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Phpfastcache/Helper/Psr16Adapter.php b/lib/Phpfastcache/Helper/Psr16Adapter.php index 0f7679bbf..e2fa5a7a0 100644 --- a/lib/Phpfastcache/Helper/Psr16Adapter.php +++ b/lib/Phpfastcache/Helper/Psr16Adapter.php @@ -76,7 +76,7 @@ public function get($key, $default = null) /** * @param string $key * @param mixed $value - * @param null $ttl + * @param null|int|\DateInterval $ttl * @return bool * @throws \Phpfastcache\Exceptions\PhpfastcacheSimpleCacheException */ From 0c64ad7085c0d97a3d0af650dfbe5cfaeb51b700 Mon Sep 17 00:00:00 2001 From: Geolim4 Date: Fri, 29 Jan 2021 13:46:47 +0100 Subject: [PATCH 08/14] Fixed #781 --- lib/Phpfastcache/Drivers/Riak/Driver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Phpfastcache/Drivers/Riak/Driver.php b/lib/Phpfastcache/Drivers/Riak/Driver.php index 2c15a62c8..00f5c76af 100644 --- a/lib/Phpfastcache/Drivers/Riak/Driver.php +++ b/lib/Phpfastcache/Drivers/Riak/Driver.php @@ -145,7 +145,7 @@ public function getStats(): DriverStatistic return (new DriverStatistic()) ->setData(\implode(', ', \array_keys($this->itemInstances))) ->setRawData($info) - ->setSize(false) + ->setSize(0) ->setInfo('Riak does not provide size/date information att all :('); } -} \ No newline at end of file +} From 05a1cd5bbaecbcbac759036c4ba44f0a3e58d69b Mon Sep 17 00:00:00 2001 From: Geolim4 Date: Thu, 12 Aug 2021 13:31:41 +0200 Subject: [PATCH 09/14] Fixed vulnerability issue that cause exposed phpinfo() in some situations. --- .gitattributes | 3 ++- docs/examples/phpinfo.php | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) delete mode 100644 docs/examples/phpinfo.php diff --git a/.gitattributes b/.gitattributes index d995ab8db..e6ef3db5b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,5 @@ /tests export-ignore +/docs/examples export-ignore /bin/ci export-ignore /bin/stubs export-ignore /.github export-ignore @@ -14,4 +15,4 @@ CODING_GUIDELINE.md export-ignore phpunit.xml.dist export-ignore phpcs.xml.dist export-ignore composer.lock export-ignore -CNAME export-ignore \ No newline at end of file +CNAME export-ignore diff --git a/docs/examples/phpinfo.php b/docs/examples/phpinfo.php deleted file mode 100644 index cf6086080..000000000 --- a/docs/examples/phpinfo.php +++ /dev/null @@ -1,3 +0,0 @@ - From 298d138904b538a562633b3fda11bfc148a9d0ef Mon Sep 17 00:00:00 2001 From: Geolim4 Date: Thu, 12 Aug 2021 13:52:17 +0200 Subject: [PATCH 10/14] Released 7.1.2 --- CHANGELOG.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa65b2576..d6d5a15da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## 7.1.2 +#### _"Rust-weak"_ +##### 12 august 2021 +- __Global__ + - Improved PHP 7.4 support + - Fixed #768 // Psalm issue with the 3rd parameter of Psr16Adapter::set has to be null (@geolim4) + - Fixed #781 // Type issue (@geolim4) +- __Docs__ + - Fixed vulnerability issue that cause exposed phpinfo() in some situations (@geolim4) +- __Drivers__ + - Fixed #759 // Memcached Bytes Replaced with Version (@geolim4) + ## 7.1.1 #### _"Rust-out"_ ##### 24 april 2020 @@ -305,4 +317,4 @@ ## 7.0.0-dev ##### 01 october 2017 -- Initialized v7 development \ No newline at end of file +- Initialized v7 development From 9f9997b636ff9ca3b3b8b8bfc5b2587ac000f96e Mon Sep 17 00:00:00 2001 From: Geolim4 Date: Sun, 15 Aug 2021 04:15:01 +0200 Subject: [PATCH 11/14] Updated badges --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 861070b9b..136d6c9df 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![Total Downloads](https://img.shields.io/packagist/dt/phpfastcache/phpfastcache.svg?maxAge=86400)](https://packagist.org/packages/phpfastcache/phpfastcache) [![Latest Stable Version](https://img.shields.io/packagist/v/phpfastcache/phpfastcache.svg?maxAge=86400)](https://packagist.org/packages/phpfastcache/phpfastcache) [![License](https://img.shields.io/packagist/l/phpfastcache/phpfastcache.svg?maxAge=86400)](https://packagist.org/packages/phpfastcache/phpfastcache) [![Coding Standards](https://img.shields.io/badge/CI-PSR6-orange.svg?maxAge=86400)](https://github.com/php-fig/cache) [![Coding Standards](https://img.shields.io/badge/CS-PSR16-orange.svg?maxAge=86400)](https://github.com/php-fig/simple-cache) -[![Code Climate](https://codeclimate.com/github/PHPSocialNetwork/phpfastcache/badges/gpa.svg)](https://codeclimate.com/github/PHPSocialNetwork/phpfastcache) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/PHPSocialNetwork/phpfastcache/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/PHPSocialNetwork/phpfastcache/?branch=master) [![Build Status](https://travis-ci.org/PHPSocialNetwork/phpfastcache.svg?branch=master)](https://travis-ci.org/PHPSocialNetwork/phpfastcache) [![Semver compliant](https://img.shields.io/badge/Semver-2.0.0-yellow.svg?maxAge=86400)](https://semver.org/spec/v2.0.0.html) [![Patreon](https://img.shields.io/badge/Support%20us%20on-Patreon-f96854.svg?maxAge=86400)](https://www.patreon.com/geolim4) +[![Code Climate](https://codeclimate.com/github/PHPSocialNetwork/phpfastcache/badges/gpa.svg)](https://codeclimate.com/github/PHPSocialNetwork/phpfastcache) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/PHPSocialNetwork/phpfastcache/badges/quality-score.png?b=v7)](https://scrutinizer-ci.com/g/PHPSocialNetwork/phpfastcache/?branch=v7) [![Build Status](https://travis-ci.com/PHPSocialNetwork/phpfastcache.svg?branch=v7)](https://travis-ci.com/PHPSocialNetwork/phpfastcache) [![Semver compliant](https://img.shields.io/badge/Semver-2.0.0-yellow.svg?maxAge=86400)](https://semver.org/spec/v2.0.0.html) [![Patreon](https://img.shields.io/badge/Support%20us%20on-Patreon-f96854.svg?maxAge=86400)](https://www.patreon.com/geolim4) #### :warning: Please note that the V7 is a major (BC breaking) update of PhpFastCache ! > As the V7 is **absolutely** not compatible with previous versions, please read carefully the [migration guide](./docs/migration/MigratingFromV6ToV7.md) to ensure you the smoothest migration possible. From cb70b1c914a4c6ca3317ba437fcacefa564791e5 Mon Sep 17 00:00:00 2001 From: Geolim4 Date: Sun, 15 Aug 2021 04:32:00 +0200 Subject: [PATCH 12/14] Fixed pecl Mongodb install --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ddbee2d86..6744d0f2c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,7 +28,7 @@ before_script: else phpenv config-add bin/ci/php_phpfastcache.ini pecl channel-update pecl.php.net - pecl install -f mongodb-stable + pecl install -f mongodb-1.9 fi - sleep 15 - mongo pfc_test --eval 'db.createUser({user:"travis",pwd:"test",roles:["readWrite"]});' From c94fd9020ad438db68f18f3c7cffeadadf264aec Mon Sep 17 00:00:00 2001 From: Geolim4 Date: Sun, 15 Aug 2021 04:48:01 +0200 Subject: [PATCH 13/14] Fixed pecl Mongodb install --- .travis.yml | 2 +- bin/ci/install_dependencies.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 618b39ce4..e246e36a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,7 +28,7 @@ before_script: else phpenv config-add bin/ci/php_phpfastcache.ini pecl channel-update pecl.php.net - pecl install -f mongodb-1.9.0 + pecl install -f mongodb-1.9.2 fi - sleep 15 - mongo pfc_test --eval 'db.createUser({user:"travis",pwd:"test",roles:["readWrite"]});' diff --git a/bin/ci/install_dependencies.sh b/bin/ci/install_dependencies.sh index 6b0b87005..d370b40f8 100755 --- a/bin/ci/install_dependencies.sh +++ b/bin/ci/install_dependencies.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash composer self-update; -composer install --ignore-platform-reqs; -composer require "phpfastcache/couchdb:~1.0.0" "phpfastcache/phpssdb:~1.0.0" "predis/predis:~1.1.0" "mongodb/mongodb:^1.1" "phpfastcache/riak-client:^1.4.4" --ignore-platform-reqs; +composer install; +composer require "phpfastcache/couchdb:~1.0.0" "phpfastcache/phpssdb:~1.0.0" "predis/predis:~1.1.0" "mongodb/mongodb:^1.1" "phpfastcache/riak-client:^1.4.4"; From 07fb5d92fd34f2fb2472002d6bc96cb923a1e9ec Mon Sep 17 00:00:00 2001 From: Geolim4 Date: Sun, 15 Aug 2021 05:40:07 +0200 Subject: [PATCH 14/14] Fixed pecl Mongodb install --- .travis.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index e246e36a7..ca572bd8e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,18 +21,6 @@ services: - riak - mongodb -before_script: - - | - if [[ $TRAVIS_PHP_VERSION = "hhv"* ]]; then - cat bin/ci/hhvm_phpfastcache.ini >> /etc/hhvm/php.ini - else - phpenv config-add bin/ci/php_phpfastcache.ini - pecl channel-update pecl.php.net - pecl install -f mongodb-1.9.2 - fi - - sleep 15 - - mongo pfc_test --eval 'db.createUser({user:"travis",pwd:"test",roles:["readWrite"]});' - php: # - 5.3 # - 5.4 @@ -52,6 +40,18 @@ matrix: - php: nightly - php: hhvm +before_install: + - | + if [[ $TRAVIS_PHP_VERSION = "hhv"* ]]; then + cat bin/ci/hhvm_phpfastcache.ini >> /etc/hhvm/php.ini + else + phpenv config-add bin/ci/php_phpfastcache.ini + pecl channel-update pecl.php.net + pecl install -f mongodb-1.9.2 + fi + - sleep 15 + - mongo pfc_test --eval 'db.createUser({user:"travis",pwd:"test",roles:["readWrite"]});' + install: - ./bin/ci/install_dependencies.sh