Simple site hosted on shared server running Apache and PHP5. Minimal use of php at this time but do use a number of scripts for maintenance and improved functionality.
Virtual root ./htdocs/ PHP include files located in ./htdocs/lib/php/
HTML files and PHP files (other than files stored in ./htdocs/lib/php/) located in
.htdocs/(DomainName)_htdocs/
Currently calling includes using following
[php]
include $_SERVER[‘DOCUMENT_ROOT’] . “/lib/php/foo.php”;
include $_SERVER[‘DOCUMENT_ROOT’] . “/lib/php/foo2.php”;
include $_SERVER[‘DOCUMENT_ROOT’] . “/lib/php/foo3.php”;
[/php]
Works fine from any directory level without having to to remember how many levels I am down from ./
(Was that …/…/…/ or …/…/…/…/ ?) One oops less and saves some time without seeming to impact performance
Most scripts need several includes (or sometimes require) eg: connection files, function files, etc. Question is can you (easily) include several files in one include call? As run to the library and fetch all this sh*t in one trip?
Have spent several days lookin’ and readin’ without finding a solution. Probably means there isn’t one that is less trouble than include \n include \n include…
Not really a big thing just seems like it would be a bit more elegant. 400 lines, what’s 3 more?
Appreciate any suggestions or comments
TIA