|
Posted by Rik on 07/29/07 16:52
On Sun, 29 Jul 2007 18:48:58 +0200, Ray <rod@iol.ie> wrote:
> On Jul 29, 5:14 pm, Rik <luiheidsgoe...@hotmail.com> wrote:
>
>> On both. PHP has a 'current working dir', the files are searched in the
>> include_path, wich usually holds '.' (the current working directory),
>> and
>> possibly others. This current working dir is not the directory of the
>> file
>> that asks for an include/require, but usually where the process started.
>> It can be quite confusing when including several files, so to check what
>> the dir is you can use get_cwd();
>
> OK, I'm starting to understand. I've experimented a bit, and when I
> access the first app, getcwd() returns c:\windows\system32. However, I
> then access the other app, and then when I go back to the first, the
> working directory has changed to the root of the second app!
>
> I don't yet understand why the second changes the working directory,
> while the first doesn't....the only difference between them is that
> the first uses require() while the second uses require_once().
Impossible to tell without the code (and I must confess I try to stay
clear of IIS), but a simple chdir() will offcourse change the working dir.
--
Rik Wasmus
[Back to original message]
|