|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-10-30 17:03 UTC] jani@php.net
[2008-11-02 11:53 UTC] gk at gknw dot de
[2008-11-03 16:06 UTC] lbarnaud@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
Description: ------------ On NetWare we have volume names similar to drive letters on Win32; however the volume names are not just one char, but can be up to 16 chars, so an valid absolute path can look like: data1:/myfolder/otherfolder Now if I use f.e. is_dir(data1:/myfolder/otherfolder) then I get: Notice: is_file() [function.is-file]: Unable to find the wrapper "data1" - did you forget to enable it when you configured PHP? in data1:/web/project/tstpaths.php on line 13 It seems to me that the problem is in ./main/streams/streams.c at line 1519; I did modify this line as below, and the issue is then gone: --- streams.c.orig Wed Aug 08 08:01:50 2007 +++ streams.c Tue Nov 20 23:45:45 2007 @@ -1516,7 +1516,7 @@ n++; } - if ((*p == ':') && (n > 1) && (!strncmp("//", p+1, 2) || !memcmp("data", path, 4))) { + if ((*p == ':') && (n > 1) && (!strncmp("//", p+1, 2))) { protocol = path; } else if (n == 5 && strncasecmp(path, "zlib:", 5) == 0) { /* BC with older php scripts and zlib wrapper */ however I'm not sure if now the 'data' wrapper still works; but formerly due to the '||' everything beginning with 'data' did match. I cant see a reason why the test for 'data' has to be handled without checking for '://', but then I'm not familar with the 'data' wrapper at all. Reproduce code: --------------- <pre> <?php // Test for the 'data' wrapper bug. ini_set('display_errors', 1); ini_set('error_reporting', E_ALL); $mydir = "data:/myfolder/another/folder"; echo "is_dir ( $mydir ) = " . (is_dir($mydir) ? "true" : "false") . "\n"; $mydir = "data1:/myfolder/another/folder"; echo "is_dir ( $mydir ) = " . (is_dir($mydir) ? "true" : "false") . "\n"; $mydir = "data2:/myfolder/another/folder"; echo "is_dir ( $mydir ) = " . (is_dir($mydir) ? "true" : "false") . "\n"; ?> <pre> Expected result: ---------------- is_dir ( data:/myfolder/another/folder ) = false is_dir ( data1:/myfolder/another/folder ) = false is_dir ( data2:/myfolder/another/folder ) = false Actual result: -------------- is_dir ( data:/myfolder/another/folder ) = false Notice: is_dir() [function.is-dir]: Unable to find the wrapper "data1" - did you forget to enable it when you configured PHP? in sys:/www/tstphp/temp/wrapper_bug.php on line 10 Notice: is_dir() [function.is-dir]: Unable to find the wrapper "data1" - did you forget to enable it when you configured PHP? in sys:/www/tstphp/temp/wrapper_bug.php on line 10 is_dir ( data1:/myfolder/another/folder ) = false Notice: is_dir() [function.is-dir]: Unable to find the wrapper "data2" - did you forget to enable it when you configured PHP? in sys:/www/tstphp/temp/wrapper_bug.php on line 13 Notice: is_dir() [function.is-dir]: Unable to find the wrapper "data2" - did you forget to enable it when you configured PHP? in sys:/www/tstphp/temp/wrapper_bug.php on line 13 is_dir ( data2:/myfolder/another/folder ) = false