ID:               38006
 Updated by:       [EMAIL PROTECTED]
 Reported By:      flconseil at yahoo dot fr
 Status:           Open
-Bug Type:         Streams related
+Bug Type:         Feature/Change Request
 Operating System: Unix & Windows
 PHP Version:      5.1.4
 New Comment:

Reclassified as feature request.


Previous Comments:
------------------------------------------------------------------------

[2006-07-04 15:02:38] flconseil at yahoo dot fr

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 ...



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=38006&edit=1

Reply via email to