[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 Daniel Brown
On Fri, Jul 10, 2009 at 16:56, J.P.
Trosclairjptroscl...@judelawfirm.com wrote:
 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.

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.

-- 
/Daniel P. Brown
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Check out our great hosting and dedicated server deals at
http://twitter.com/pilotpig

-- 
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 Daniel Brown
On Fri, Jul 10, 2009 at 17:24, J.P.
Trosclairjptroscl...@judelawfirm.com wrote:

 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.

No problem at all, J.P., and my apologies if I came across with a
tone (in writing) to make you think it was.

-- 
/Daniel P. Brown
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Check out our great hosting and dedicated server deals at
http://twitter.com/pilotpig

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

On Jul 10, 2009, at 3:16 PM, Daniel Brown wrote:


On Fri, Jul 10, 2009 at 16:56, J.P.
Trosclairjptroscl...@judelawfirm.com wrote:
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.


   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.


yes, look for posts with this subject line:
Re: [PHP] best way to properly build an include path *regardless*   
from where I am calling the include?


(just don't ask me to explain everything that those good souls were  
trying to teach me in those posts..   I assimilated some of it.  ;-)


--
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 Daniel Brown
On Fri, Jul 10, 2009 at 17:28, Govindagovinda.webdnat...@gmail.com wrote:

 yes, look for posts with this subject line:
 Re: [PHP] best way to properly build an include path *regardless*  from
 where I am calling the include?

 (just don't ask me to explain everything that those good souls were trying
 to teach me in those posts..   I assimilated some of it.  ;-)

Found here, with previous posts in the thread being linked from
that page as References:

http://news.php.net/php.general/294985

Politeness should be rewarded, at the very least, with a link.  ;-P

-- 
/Daniel P. Brown
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Check out our great hosting and dedicated server deals at
http://twitter.com/pilotpig

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