Date: 03/15/00
- Next message: rubys <email protected>: "Re: [PHP-DEV] Re: Current working directory and multi-threaded environments"
- Previous message: Sascha Schumann: "Re: [PHP-DEV] Re: Current working directory and multi-threaded environments"
- In reply to: Sascha Schumann: "Re: [PHP-DEV] Re: Current working directory and multi-threaded environments"
- Next in thread: Andi Gutmans: "Re: [PHP-DEV] Re: Current working directory and multi-threaded environments"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
At 08:53 PM 3/15/00 +0100, Sascha Schumann wrote:
>On Wed, Mar 15, 2000 at 09:30:19PM +0200, Andi Gutmans wrote:
> > On Wed, 15 Mar 2000, Sascha Schumann wrote:
> > > On Wed, Mar 15, 2000 at 02:21:51PM -0500, rubys <email protected> wrote:
> > > >
> > > >
> > > > >> I'm not sure if I need to do the real getcwd() per-request or if
> doing
> > > > it
> > > > >> on PHP startup once is good enough.
> > > > >
> > > > >Why should a threaded web server change its per-process
> > > > >work directory?
> > > >
> > > > I'm confused. getwd doesn't change the working directory, right?
> > >
> > > We are talking about reacting (getcwd) to an action by the server
> (chdir).
> > >
> > > Fortunately, this action does not take place.
> > >
> > > I think we should always start with cwd = dirname(executing_script).
> > >
> > > (Perhaps the code fragment you posted does that.)
> > >
> > > That would mean that we do not need to execute getcwd at all.
> > >
> > > Thoughts?
> >
> > If we do one single getcwd on PHP module startup and use that to
> > initialize every requests cwd everything should work out of the box. Using
> > your approach would mean that we might have to dig into the
> > fopen_wrappers() and all of PHP to fix things with break. I really don't
> > want to do this.
> > If we can just emulate what chdir() and getcwd() are doing now, we would
> > in a very short time have a working PHP.
>
>You are probably meaning the same thing as I do, while looking at the problem
>from another perspective.
>
>If we simply "emulate" chdir/getcwd, we enable the SAPI modules to chdir
>to the dirname of the executing script. This will usually replace the
>default cwd (i.e. the result of an initial getcwd()).
What I meant was that the initial cwd should be the result of what would be
an initial getcwd() in php_module_startup(). That would definitely not be
the same as changing the initial cwd per-request according to the dirname
of the executing script. The latter would not be consistent with the way it
is today and might break stuff. Today the cwd is the initial cwd of the
process and not of the executing script (unless I'm wrong, which is very
possible).
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>
- Next message: rubys <email protected>: "Re: [PHP-DEV] Re: Current working directory and multi-threaded environments"
- Previous message: Sascha Schumann: "Re: [PHP-DEV] Re: Current working directory and multi-threaded environments"
- In reply to: Sascha Schumann: "Re: [PHP-DEV] Re: Current working directory and multi-threaded environments"
- Next in thread: Andi Gutmans: "Re: [PHP-DEV] Re: Current working directory and multi-threaded environments"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

