|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-07-06 20:14 UTC] tony2001@php.net
[2006-07-10 13:44 UTC] flconseil at yahoo dot fr
[2010-12-22 12:57 UTC] johannes@php.net
-Status: Open
+Status: Closed
-Package: Feature/Change Request
+Package: *General Issues
-Assigned To:
+Assigned To: johannes
[2010-12-22 12:57 UTC] johannes@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 10:00:01 2025 UTC |
Description: ------------ After having declared a new stream wrapper, I want to add a sub-path of this stram wrapper to the include path. The set_onclude_path() works fine, but, then, PHP does not use this path when searching a file through the include path. It seems annoying, but normal on Unix, as the path separator is ':'. But it also fails on Windows, where the path separator is ';'. It will be hard to maintain backward compatibility but, if dirname() is able to work on these paths, I think that it should be possible to append them to the include path. One solution would be to consider the include path as an array, instead of maintaining it as a string. The get_include_path() and set_include_path() could be kept as compatibility functions, the php.ini file could be kept the same, but there would be two new functions get_include_path_array() and set_include_path_array() which would work with arrays and would be compatible with stream wrapper paths. More important, the PHP engine would only use the array internally and could find files in stream wrapped pseudo-directories. The stream wrapper should be ready to support '/' and '\' characters as directory separators, if they want to work on Windows and Unix. Reproduce code: --------------- 1. I register a stream wrapper for the 'phk' prefix 2. 'include('phk://example/ex.php');' works OK. My virtual file is included. 3. I add this path to the include path : set_include_path(get_include_path().PATH_SEPARATOR.'phk://example'); 4. I try to 'include(ex.php)' without specifying the path, as it is in the include path -> it fails. Expected result: ---------------- file included Actual result: -------------- PHP Warning: include(ex.php): failed to open stream: No such file or directory in ... on line ... PHP Warning: include(): Failed opening 'ex.php' for inclusion (include_path='/logi/http/php/lib/php:/logi/http/php/lib/adodb:phk://example') in ... on line ...