LocalFilesystemAdapter. Call clearstatcache in several methods#1873
LocalFilesystemAdapter. Call clearstatcache in several methods#1873frankdejonge merged 1 commit intothephpleague:3.xfrom
Conversation
…id php's statcache. Fixes thephpleague#1826
|
Can you add a configuration option to opt-in to this behaviour? |
|
Thanks for the quick reply! Do we really have to have a configuration option for this?
As mentioned in the issue, this commit would mostly reapply an older fix (6f2211c). Though that's on a much older release. If you'd still like a configuration option, I can add one. But I think we should then move the existing |
|
Would you merge an PR to make this opt-in @frankdejonge? This change makes stat-cache useless, and tbh when you call exec, the caller should clear stat-cache not the filesystem abstraction on EVERYTHING 😅 |
|
@shyim hi, yes that would work! 👍 |
|
No objections from my side to make it configurable. I would maybe consider this option being opt-out instead of opt-in. Mostly because having no caching would be a reasonable default and there have even been calls to remove the statcache in php itself entirely (https://externals.io/message/115912). Just to clarify our use case since it is different from the one in the related issue (calling |
Php's statcache caches the results of some file functions like
is_fileorfilesize.For the
visibility()method, aclearstatcacheis already used to clear this cache, but this is not the case for several other methods.Fixes #1826