Re: Opendir on site root directory?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Please keep the discussion on-list.

2009/3/10 Clancy <clancy_1@xxxxxxxxxxxx>

> Hi,
>
> After I posted my message to the group today I realised that my program
> achieves its
> almost infinite flexibility by loading different include files in different
> circumstances,
> and from many different parts of the program.  The program always specifies
> the location
> of the include file by the relative path from the root directory.   If the
> uncertainty
> about the current working directory you worry about were really a problem
> this would never
> work, but I have been doing this for well over a year, and had never had
> any problems.
>

Just because you haven't experienced a problem with the way you do things
yet it certainly doesn't mean the problem isn't there. You're not specifying
the location of an include file relative to the home directory, it's
relative to the current working directory which is not necessarily the
directory you expect it to be.

At the end of the day you need to do what you're comfortable with, and if
you're happy relying on the current working directory being what you expect
it to be then I wish you the best of luck. Personally I will never do that
again because a bad experience that involved the need to change hundreds of
lines of code have taught me that it's not a safe bet.

But feel free to ignore me.

-Stuart

-- 
http://stut.net/

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux