Re: Re: Current working directory and multi-threaded environments
| From: | Andi Gutmans | Date: | Wed, 15 Mar 2000 21:03:39 +0000 |
| Subject: | Re: Re: Current working directory and multi-threaded environments | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-16862@lists.php.net to get a copy of this message | ||
At 03:42 PM 3/15/00 -0500, rubys@us.ibm.com wrote:
Today the cwd is the initial cwd of the process and not of the executing script (unless I'm wrong, which is very possible). I believe that today the cwd is the directory which contains the executing script. Take a look at fopen-wrappers.c. This behavior is important to a number of people.I don't think so. The cwd seems to be taken from getcwd() and not from the executing scripts filename. Look at expand_filepath(). My suggestion should not change the behavior for anyone because it won't be changing the code nor logic in fopen_wrappers.c but only the chdir() and getcwd() calls used in there and would return the same result, but do it differently behind the scenes.
Retaining the current behavior is a bit more involved than simply saving the virtual path away some place. Every place in which a user can enter a relative path will need to be examined.There aren't many such places. The relative path calculations are done mostly in php_realpath and fopen_wrappers. These places will automatically work. There are very few other places in PHP where people can give paths to files and not go via these calls. But yes, that is why we talked about also supporting a virtual_get_filepath() function which would return a full path from a relative part in order to fix those places. Andi --- Andi Gutmans <andi@zend.com> http://www.zend.com/