php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #32362 Some functions to manipulate include_path (or any path list in general)
Submitted: 2005-03-18 14:50 UTC Modified: 2013-02-17 12:10 UTC
From: ceefour at gauldong dot net Assigned: nikic (profile)
Status: Closed Package: *General Issues
PHP Version: 5.0.3 OS: All
Private report: No CVE-ID: None
 [2005-03-18 14:50 UTC] ceefour at gauldong dot net
Description:
------------
include_path *is* complex. How do you add something to include path without detecting the operating system first? How do you remove something from the include path?
It would be great if PHP has an API that allows manipulation of include paths as array.

include_path is so tied to the operating system platform and many libraries have tried to autodetect the platform and map it to a path separator (usually ';' for Windows and ':' for non-Windows, but you can easily see that even my statement is wrong, as is not always the case). How to separate paths in Mac? It uses ':' as the path element separator, so? (I don't know the answer).

Adding a constant for path separator ('/', '\', ...) and path list separator (';', ':', ...) would partly solve the problem. It'll be even better if there are some functions to manipulate them. Of course not tied to include_path, but general functions to manipulate any path list, since they're very often used, like for manipulating the PATH environment variable, and other stuff.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-02-17 12:10 UTC] nikic@php.net
Closing as by now PHP has both PATH_SEPARATOR and DIRECTORY_SEPARATOR. Paths can be added to include_path with:

    set_include_path(get_include_path() . PATH_SEPARATOR . 'foobar');

If you want to work on it as an array you can use explode(PATH_SEPARATOR, get_include_path()).
 [2013-02-17 12:10 UTC] nikic@php.net
-Status: Open +Status: Closed -Package: Feature/Change Request +Package: *General Issues -Assigned To: +Assigned To: nikic
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 14 16:01:34 2025 UTC