1
0
Fork 0

Fixed bin proxies on PHP < 8 to support stream_seek (#10468)

pull/10475/head
John Stevenson 2022-01-21 09:09:58 +00:00 committed by GitHub
parent 6a70161c01
commit db64534b26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -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;