Re: Discussion: Remove file statcache?
| From: | Niels Dossche | Date: | Sat, 21 Dec 2024 20:50:52 +0000 |
| Subject: | Re: Discussion: Remove file statcache? | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-126160@lists.php.net to get a copy of this message | ||
On 21/12/2024 21:38, Rowan Tommins [IMSoP] wrote:
>
>
> On 21 December 2024 18:49:46 GMT, Niels Dossche <dossche.niels@gmail.com> wrote:
>>> $perms = fileperms($name, statcache: true);
>>> $size = filesize($name, statcache: true);
>>
>> In my opinion, this will become very messy.
>
> Could you elaborate?
Adding a parameter for a cache, which should've been transparent in the first place, to every
file operation is messy.
A cache should normally be transparent, and the reason we're having this discussion in the
first place is because the cache isn't transparent and causes problems. Adding an extra
parameter is going further away from transparency. It's also inconvenient for programmers to
add this to different places in their codebase.
>
>
>> Changing a default would be another BC break.
>
> "Another" after what? Adding either an INI setting or an optional parameter is not a
> BC break, unless and until the default is changed, at which point there is exactly one BC break.
Adding an INI: no BC break indeed.
But if you want to add extra parameters to functions that can potentially touch the stat cache, then
you need to take into account spl as well. Adding extra parameters to the functions in those classes
are a BC break because the signature of potential userland function overrides would no longer be
compatible at compile time.
>
> Regards,
> Rowan Tommins
> [IMSoP]
Kind regards
Niels