Req #28790 [Com]: Add php.ini option to disable stat cache

From: Date: Sat, 25 Jul 2020 09:37:43 +0000
Subject: Req #28790 [Com]: Add php.ini option to disable stat cache
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-228222@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=28790&edit=1 ID: 28790 Comment by: kevin at lyda dot ie Reported by: jnoll at prim dot hu Summary: Add php.ini option to disable stat cache Status: Open Type: Feature/Change Request Package: *General Issues Operating System: * PHP Version: * Block user comment: N Private report: N New Comment: Can this please be disabled. Modern operating systems have their own stat cache that is properly maintained. A cache on these systems reduces performance *and* causes subtle and frustrating errors. Previous Comments: ------------------------------------------------------------------------ [2017-03-09 11:23:52] nikic@php.net The stat cache is cleared between requests. What you have in mind is the realpath cache. ------------------------------------------------------------------------ [2017-03-08 21:53:08] spam2 at rhsoft dot net > You guys realize that the stat cache is per-request nonsense - it's per prcoess and "You only need to clear the stat cache before a file_exists() call" is bullshit, you should be able to clear it *after* change a file but you just paly lotterly for which request in the future clearstatcache() has any effect or was just a joke https://bugs.php.net/bug.php?id=73888 is a deisgn error wihich makes a) the cache mostly usesless and b) clearstatcache() to a lottery game ------------------------------------------------------------------------ [2014-02-13 14:54:34] roman at litgroup dot ru We really need this option to disable cache in daemons, written in PHP. WebSocket server for example. Or some worker, which listens the queue and performs some jobs. ------------------------------------------------------------------------ [2012-01-17 20:38:00] landeholm at gmail dot com Okay, the stat cache was not to blame for this problem I commented on above as I just learned it doesn't cache negative results but I still need a way to disable it. I could get problems in the future when file_exists returns true for a file that does not exist anymore. ------------------------------------------------------------------------ [2012-01-17 20:23:08] landeholm at gmail dot com I'm writing a PHP CLI daemon and the stat cache just burned me hard because it made file_exists() incorrectly return false for a file that had been created by another program. There NEEDS to be a way to disable this. My only option now appears to be to write my own file system wrapper functions to bypass this annoying behavior. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=28790 -- Edit this bug report at https://bugs.php.net/bug.php?id=28790&edit=1

« previous php.bugs (#228222) next »