From d25bbe773c5162c1cf3784343cd86ffbd999da51 Mon Sep 17 00:00:00 2001 From: "steven.lewis" Date: Sat, 22 Jun 2024 19:19:32 +0100 Subject: [PATCH] Gracefully exit prepareToFork if driver has not been used. --- lib/Phpfastcache/Extensions/Drivers/Couchbasev4/Driver.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Phpfastcache/Extensions/Drivers/Couchbasev4/Driver.php b/lib/Phpfastcache/Extensions/Drivers/Couchbasev4/Driver.php index a72de00..d544fb7 100644 --- a/lib/Phpfastcache/Extensions/Drivers/Couchbasev4/Driver.php +++ b/lib/Phpfastcache/Extensions/Drivers/Couchbasev4/Driver.php @@ -148,6 +148,10 @@ protected function connect(?int $appendPPID = null): bool */ public static function prepareToFork(): void { + if (!isset(static::$posixLoaded) && !isset(static::$extVersion)) { + return; + } + if (!static::$posixLoaded) { throw new PhpfastcacheDriverCheckException('POSIX extension is required to prepare for forking'); }