php.ini directive include_path variables

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

 



I'm wondering if there is a way to dynamically set the absolute path of an include directory based on the document root of the site via htaccess or some other method other than in the scripts themselves within the site.

Example of what I'm looking for:

$doc_root/.htaccess:
php_value include_path "$_SERVER['DOCUMENT_ROOT']/include"

I have a live site and a development site both hosted on 2 entirely different systems. The issue stems because the path to the code base for each site is not the same. The problem I'm trying to solve is to not have to modify the include path settings when pushing revisions from the development system to upstream, in other words, I'd like for the code base to be a drop in replacement which is why I'm defining php settings via htaccess rather than php.ini to begin with.

I'm not setting include paths in scripts because the vast majority of the classes in the include directory depend on other classes and include said classes directly in their code. This breaks scripts deep in the directory tree without using an absolute path. I suppose one option (that I'm trying to avoid) is to modify the scripts to use:

require_once($_SERVER['DOCUMENT_ROOT']."include/foobar.inc.php");

Thanks

--
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