[PHP] php.ini directive include_path variables

2009-07-10 Thread J.P. Trosclair
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



Re: [PHP] php.ini directive include_path variables

2009-07-10 Thread J.P. Trosclair

Daniel Brown wrote:

 Please check the archives and Google before posting here.  This
exact question was just discussed and answered within the last seven
days.  I don't recall the name of the thread (perhaps someone else
could name it for me), but I believe the original poster was Govinda.



I've spent the better part of this afternoon looking through google and 
the archives for different variations on terminology before resorting to 
subscribing and posting to this list. Will go back to digging based on 
your suggestion. Thanks for your time and sorry if I've caused any problems.



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



Re: [PHP] php.ini directive include_path variables

2009-07-10 Thread J.P. Trosclair

Govinda wrote:

[PHP] best way to properly build an include path*regardless*


Thanks, appreciated.

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