Re: primary file realpath change
| From: | Andi Gutmans | Date: | Fri, 10 Mar 2006 06:25:33 +0000 |
| Subject: | Re: primary file realpath change | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-22318@lists.php.net to get a copy of this message | ||
Are you sure VCWD_REALPATH doesn't use the realpath cache? It did last time I checked and I think is still the right method to use there...
At 09:13 PM 3/9/2006, Brian J. France wrote:
Does anybody see a problem with this patch (which is currently against the 5.1.2 release)? expand_filepath will eventual do a realpath, but it also uses the realpath cache before calling realpath. VCWD_REALPATH just maps directly to realpath and doesn't use the realpath cache so for every request you get a realpath call (and all the syscalls that go with it) on the primary file. I think I need to pass TSRMLS_CC, but I am not sure. Any problems committing it to PHP_5_1 and HEAD? Brian--- ../php-5.1.2.orig/main/main.c Sun Jan 1 04:50:17 2006+++ main/main.c Thu Mar 9 20:00:47 2006 @@ -1684,7 +1684,7 @@char realfile[MAXPATHLEN]; int realfile_len; int dummy = 1; - if (VCWD_REALPATH(primary_file->filename,realfile)) {+ if (expand_filepath(primary_file->filename,realfile TSRMLS_CC)) {realfile_len = strlen(realfile); zend_hash_add(&EG(included_files),realfile, realfile_len+1, (void *)&dummy, sizeof(int), NULL);if (strncmp(realfile, primary_file- >filename, realfile_len)) {-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php