From db64534b26189bacc95956222677fc34fb62e845 Mon Sep 17 00:00:00 2001 From: John Stevenson Date: Fri, 21 Jan 2022 09:09:58 +0000 Subject: [PATCH] Fixed bin proxies on PHP < 8 to support stream_seek (#10468) --- src/Composer/Installer/BinaryInstaller.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Composer/Installer/BinaryInstaller.php b/src/Composer/Installer/BinaryInstaller.php index 03bd0839f..1f6f14d78 100644 --- a/src/Composer/Installer/BinaryInstaller.php +++ b/src/Composer/Installer/BinaryInstaller.php @@ -333,6 +333,16 @@ if (PHP_VERSION_ID < 80000) { return \$operation ? flock(\$this->handle, \$operation) : true; } + public function stream_seek(\$offset, \$whence) + { + if (0 === fseek(\$this->handle, \$offset, \$whence)) { + \$this->position = ftell(\$this->handle); + return true; + } + + return false; + } + public function stream_tell() { return \$this->position;