You are here: Re: [PHP] Document root, preferred way to find it??? « PHP « IT news, forums, messages
Re: [PHP] Document root, preferred way to find it???

Posted by Richard Lynch on 03/04/05 22:25

> 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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация