Re: [PHP-DEV] Re: Current working directory and multi-threaded environments From: Andi Gutmans (andi <email protected>)
Date: 03/16/00

At 04:14 PM 3/15/00 -0500, rubys <email protected> wrote:
> >>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().
>
>expand_filepath is only used to locate the script.
>
>Once the script is located, the php_fopen_primary_script (in CGI) and
>send_php (in Apache) do the dirty deed.

Are you saying that if we write new thread-safe virtual_chdir() and
virtual_getcwd() functions and substitute the ones existing in PHP things
won't work? I very much disagree with you.
Anyway, most places in PHP that open files use fopen-wrappers.c so they
will automatically work later on. If there are any places which don't use
them (there really shouldn't be very many if any at all), we will have
another function for them char *virtual_get_fullpath(char *filepath) which
will return the fullpath to a filepath.

Andi

---
Andi Gutmans <andi <email protected>>
http://www.zend.com/

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>