|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[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.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 20:00:01 2025 UTC |
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()).