php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #63685 Make it easier to supply include paths on the CLI
Submitted: 2012-12-04 10:47 UTC Modified: -
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: alastair at propcom dot co dot uk Assigned:
Status: Open Package: *General Issues
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2012-12-04 10:47 UTC] 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.




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-01-20 02:32 UTC] ben at hl9 dot net
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().
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Nov 13 14:01:29 2019 UTC