Re: clearstatcache change
| From: | Arnaud Le Blanc | Date: | Sat, 09 Aug 2008 14:20:31 +0000 |
| Subject: | Re: clearstatcache change | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-39796@lists.php.net to get a copy of this message | ||
On Thursday 07 August 2008 11:33:02 Arnaud Le Blanc wrote:
> On Thursday 07 August 2008 01:50:06 Johannes Schlüter wrote:
> > On Wed, 2008-08-06 at 21:00 +0200, Arnaud Le Blanc wrote:
> > > > > btw. I just noticed chroot() calls this
> > > > > realpath_cache_clean()..intentional?
> >
> > I'd assume that, as /foo inside a chroot is different from /foo
> > outside...
> >
> > > Also some streams stuff uses the
> > >
> > > > > php_clear_stat_cache() func but those should propably use the
> > > > > realpatch_cache_del() instead and not blow away whole cache?
> > > >
> > > > Yes, I think too.
> > > > I added that to your patch:
> > > >
> > > > http://arnaud.lb.s3.amazonaws.com/clearstatcache_optional_params.patc
> > > >h
> > > >
> > > > :)
> > > >
> > > > It also adds the "filename" argument to
> > > > clearstatcache([bool clear_realpath_cache[, filename]])
> > >
> > > I reply to myself, actually this may cause troubles to not clear the
> > > full cache in plain_wrapper.c :/ I updated the patch, just left the
> > > filename argument to clearstatcache().
> >
> > If you fix the arginfo like Hannes it's, good. If the name of the second
> > parameter in the proto ("filename") is the same as in the implementation
> > ("pathname") it might even be a bit better :-)
> >
> > johanes
>
> Commited :)
Hi,
I have noticed that there is no function to know the realpath cache usage
(e.g. is the realpath cache full ? what files are in the cache ?)
I have written two functions:
realpath_cache_get_entries() which returns an array of entries in the cache,
and realpath_cache_get_usage() which returns the cache size. The first one may
also help in writing tests for the realpath cache.
http://arnaud.lb.s3.amazonaws.com/realpath_cache_funcs.patch
Can I add them ?
Regards,
Arnaud