Re: Re: Current working directory and multi-threaded environments

From: Date: Thu, 16 Mar 2000 21:15:03 +0000
Subject: Re: Re: Current working directory and multi-threaded environments
References: 1 2 3 4  Groups: php.dev 
Request: Send a blank email to php-dev+get-16909@lists.php.net to get a copy of this message
It seems that the cwd framework Sascha and I have written is pretty close to being what we need. From doing a few greps on the source tree (for chdir()) we need to also add a function which "virtually" does the same as apache's chdir_filename(). The same kind of functionality was added in php4isapi.c, the code from there is:
                char *path_end = strrchr(SG(request_info).path_translated, '\\');
                if (path_end) {
                        *path_end = 0;
                        chdir(SG(request_info).path_translated);
                        *path_end = '\\';
                }
Basically what it does, it takes the whole filepath as an argument and chdir()'s to the path minus the filename. The Apache version does pretty much the same although it chdir()'s to the whole path in case there is no filename (no idea if this can ever happen). I think what remains to be implemented is: virtual_chdir_filepath() virtual_expand_filepath() - Just need to split the main function into two. Anyone else see some other work which needs to be done? The way I see us integrating this is to have sapi_startup() call getcwd() and store it in a true global and then duplicate it per-request first thing. Andi --- Andi Gutmans <andi@zend.com> http://www.zend.com/

« previous php.dev (#16909) next »