Re: Document root, preferred way to find it???

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

 



> 6. The method (and this is the important one IMHO) would not require
>    editing "x" number of pages in a site to change some static path
>    that was set on each page.

I believe you could get "x" to be 1, if you do this:

1. Set up a config_include_path.inc file in your DocumentRoot (possibly
virtual) directory.

2. Utilize $_SERVER['path_translated'] and $_SERVER{'documentRoot'] in all
the pages to temporarily set_include_path to your [virtual] DocumentRoot. 
If *those* are broken, you might as well just not use that host. :-^

3. In the config_include_path.inc, use set_include_path to set up whatever
you need to use for the new server/configuration.

So every page will set their include_path to DocumentRoot, then include a
file that from there that will change the include_path to whatever you
need for that particular server.

It's a bit of a hack, but cuts the number of config files to one (1) for a
transfer/install.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[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