Re: Document root, preferred way to find it???
| From: | Richard Lynch | Date: | Fri, 04 Mar 2005 20:25:35 +0000 |
| Subject: | Re: Document root, preferred way to find it??? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-210037@lists.php.net to get a copy of this message | ||
> 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