You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.
I was doing some tests and when I tried manipulate a document more than one time, I got an encoding error. Investigating the error, I saw that the function Filesystem::read() use fread() function to read the document content. And is passed the size of the length of the buffer with the function filesize. What happens is that PHP uses a cache to save the file status and this behavior can affect the value of filesize function.
When I add clearstatcache() on Filesystem::read() before the fread($file, filesize($path)), the error doesn't happen anymore.
I tried isolate in a script to prove what is happen on my case, but it just happen on my application. So I create a script that use the PHP library functions used on this project to simulate the error.
I was doing some tests and when I tried manipulate a document more than one time, I got an encoding error. Investigating the error, I saw that the function
Filesystem::read()
usefread()
function to read the document content. And is passed the size of the length of the buffer with the functionfilesize
. What happens is that PHP uses a cache to save the file status and this behavior can affect the value offilesize
function.When I add
clearstatcache()
onFilesystem::read()
before thefread($file, filesize($path))
, the error doesn't happen anymore.I tried isolate in a script to prove what is happen on my case, but it just happen on my application. So I create a script that use the PHP library functions used on this project to simulate the error.
This script outputs:
The text was updated successfully, but these errors were encountered: