I think we either need to make clearstatcache()
not affect the realpath
cache, or we should add an optional argument to it to specify whether or
not the realpath cache should be cleared as well.
The realpath cache makes a huge difference on includes and having the
cache blown away by a script calling clearstatcache()
really hurts. In
almost all cases the script is doing it to clear the stat cache for some
local file it is doing stuff to and the author has no idea that she is
blowing away the realpath_cache as well. And if that script is run on
every request, the realpath_cache becomes completely useless.
-Rasmus
Rasmus Lerdorf wrote:
I think we either need to make
clearstatcache()
not affect the realpath
cache, or we should add an optional argument to it to specify whether or
not the realpath cache should be cleared as well.
See this: http://bugs.php.net/39367
Considering some people seem to want to clear realpath cache as well, I'd make
it an optional parameter which defaults to NOT clear realpath cache:
clearstatchache(true); /* BOOM! realpath cache gone.. */
btw. I just noticed chroot() calls this realpath_cache_clean()..intentional?
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?
Here is a patch to add that optional parameter (for PHP_5_3):
http://pecl.php.net/~jani/patches/clearstatcache_optional_param.patch
--Jani
Hi,
On Wednesday 06 August 2008 18:18:49 Jani Taskinen wrote:
Rasmus Lerdorf wrote:
I think we either need to make
clearstatcache()
not affect the realpath
cache, or we should add an optional argument to it to specify whether or
not the realpath cache should be cleared as well.See this: http://bugs.php.net/39367
Considering some people seem to want to clear realpath cache as well, I'd
make it an optional parameter which defaults to NOT clear realpath cache:clearstatchache(true); /* BOOM! realpath cache gone.. */
btw. I just noticed chroot() calls this
realpath_cache_clean()..intentional? 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.patch :)
It also adds the "filename" argument to
clearstatcache([bool clear_realpath_cache[, filename]])
Here is a patch to add that optional parameter (for PHP_5_3):
http://pecl.php.net/~jani/patches/clearstatcache_optional_param.patch
--Jani
On Wednesday 06 August 2008 19:56:58 Arnaud Le Blanc wrote:
Hi,
On Wednesday 06 August 2008 18:18:49 Jani Taskinen wrote:
Rasmus Lerdorf wrote:
I think we either need to make
clearstatcache()
not affect the realpath
cache, or we should add an optional argument to it to specify whether
or not the realpath cache should be cleared as well.See this: http://bugs.php.net/39367
Considering some people seem to want to clear realpath cache as well, I'd
make it an optional parameter which defaults to NOT clear realpath cache:clearstatchache(true); /* BOOM! realpath cache gone.. */
btw. I just noticed chroot() calls this
realpath_cache_clean()..intentional? 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.patch :)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()
.
Here is a patch to add that optional parameter (for PHP_5_3):
http://pecl.php.net/~jani/patches/clearstatcache_optional_param.patch
--Jani
On Wednesday 06 August 2008 19:56:58 Arnaud Le Blanc wrote:
Hi,
On Wednesday 06 August 2008 18:18:49 Jani Taskinen wrote:
Rasmus Lerdorf wrote:
I think we either need to make
clearstatcache()
not affect the realpath
cache, or we should add an optional argument to it to specify whether
or not the realpath cache should be cleared as well.See this: http://bugs.php.net/39367
Considering some people seem to want to clear realpath cache as well, I'd
make it an optional parameter which defaults to NOT clear realpath cache:clearstatchache(true); /* BOOM! realpath cache gone.. */
btw. I just noticed chroot() calls this
realpath_cache_clean()..intentional? 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.patch :)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 toclearstatcache()
.
Don't forget to update the arginfo
-Hannes
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.patch :)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 toclearstatcache()
.
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
On Thursday 07 August 2008 01:50:06 Johannes Schlüter 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.patch
:)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 toclearstatcache()
.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 :)
On Thursday 07 August 2008 11:33:02 Arnaud Le Blanc wrote:
On Thursday 07 August 2008 01:50:06 Johannes Schlüter 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 toclearstatcache()
.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
hi Arnaud!
Commited :)
Do you have a windows dev box? It seems that something is broken on
Windows. One reproduce case is
ext\standard\tests\file\copy_variation4-win32.phpt which fails using
current 5.3-cvs.
Let me know if you do not have a win box, I can try to fix it later this week.
Cheers,
Pierre
On Sunday 10 August 2008 17:14:52 Pierre Joye wrote:
hi Arnaud!
Commited :)
Do you have a windows dev box? It seems that something is broken on
Windows. One reproduce case is
ext\standard\tests\file\copy_variation4-win32.phpt which fails using
current 5.3-cvs.Let me know if you do not have a win box, I can try to fix it later this
week.Cheers,
Hi Pierre,
No, I do not have a windows box here.
Does this test pass without this change ? http://news.php.net/php.cvs/52079
Regards,
Arnaud
On Sunday 10 August 2008 17:46:20 Arnaud Le Blanc wrote:
On Sunday 10 August 2008 17:14:52 Pierre Joye wrote:
hi Arnaud!
On Sat, Aug 9, 2008 at 4:20 PM, Arnaud Le Blanc arnaud.lb@gmail.com
wrote:Commited :)
Do you have a windows dev box? It seems that something is broken on
Windows. One reproduce case is
ext\standard\tests\file\copy_variation4-win32.phpt which fails using
current 5.3-cvs.Let me know if you do not have a win box, I can try to fix it later this
week.Cheers,
Hi Pierre,
No, I do not have a windows box here.
Does this test pass without this change ? http://news.php.net/php.cvs/52079Regards,
Arnaud
Just readden the test, actually it seems it just needs to be updated (changing
clearstatcache()
by clearstatcache(true)).
Regards,
Arnaud