Req #63685 [Com]: Make it easier to supply include paths on the CLI

From: Date: Wed, 20 Jan 2016 02:32:48 +0000
Subject: Req #63685 [Com]: Make it easier to supply include paths on the CLI
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-198783@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=63685&edit=1

 ID:                 63685
 Comment by:         ben at hl9 dot net
 Reported by:        alastair at propcom dot co dot uk
 Summary:            Make it easier to supply include paths on the CLI
 Status:             Open
 Type:               Feature/Change Request
 Package:            *General Issues
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

While I agree somewhat with your sentiment

You can use php --define include_path=/path/to/your/stuff or shorter, -d include_path=/path/to...

You could also do this entirely in PHP, by reading the environment and using set_include_path().


Previous Comments:
------------------------------------------------------------------------
[2012-12-04 10:47:37] alastair at propcom dot co dot uk

Description:
------------
C standard is to use -I to add an include path for header files. There are also the environment
variables CPATH, C_INCLUDE_PATH and CPLUS_INCLUDE_PATH.

Other languages follow suit. Python uses the PYTHONPATH environment variable. Perl uses PERL5LIB
*and* -I, and also has a runtime 'use lib' too.

PHP's current only way of doing it is to set the config itself (I didn't see anything
about environment variables in the docs on include_path), which usually involves getting the config
and manually merging the extras. 

Setting include paths is a much more common operation than the procedure to do so would suggest; it
would be very helpful for this boilerplate code (get, merge, set) to be performed by PHP itself as a
result of an option. -I is a good idea because it's established by C already, and hence
maintains consistency. It would also be useful to honour an environment variable and possibly also a
runtime function, just to make it easier.





------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=63685&edit=1


Thread (3 messages)

« previous php.bugs (#198783) next »