Req #63685 [Opn->Csd]: Make it easier to supply include paths on the CLI
Edit report at https://bugs.php.net/bug.php?id=63685&edit=1
ID: 63685
Updated by: cmb@php.net
Reported by: alastair at propcom dot co dot uk
Summary: Make it easier to supply include paths on the CLI
-Status: Open
+Status: Closed
Type: Feature/Change Request
-Package: *General Issues
+Package: PHP options/info functions
PHP Version: Irrelevant
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
You can also use environment variables in the INI files[1].
[1] <https://www.php.net/manual/en/configuration.file.php>
Previous Comments:
------------------------------------------------------------------------
[2016-01-20 02:32:46] 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().
------------------------------------------------------------------------
[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)