Bug #60280 [Opn->Fbk]: stream_resolve_include_path does not resolved path when drive letter missing

From: Date: Wed, 18 Nov 2020 15:22:26 +0000
Subject: Bug #60280 [Opn->Fbk]: stream_resolve_include_path does not resolved path when drive letter missing
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230438@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=60280&edit=1

 ID:                 60280
 Updated by:         cmb@php.net
 Reported by:        pear at laurent-laville dot org
 Summary:            stream_resolve_include_path does not resolved path
                     when drive letter missing
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            Filesystem function related
 Operating System:   Windows XP
 PHP Version:        5.3.8
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

Looks like this has been fixed in the meantime, or can you still
reproduce this with any of the actively supported PHP versions[1]?

[1] <https://www.php.net/supported-versions.php>


Previous Comments:
------------------------------------------------------------------------
[2011-11-12 13:01:13] pear at laurent-laville dot org

Description:
------------
I've tested it under PHP 5.3.5 (I don't have the possibilty to test it under new PHP 5.3
version sorry).

While I run PHPUnit 3.5.15 with --bootstrap feature, I found a problem only with PHP 5.3, because
PHPUnit implement if availale the stream_resolve_include_path function.

Here are my tests :

1. forgotten the drive letter (c:) on the path I given to PHPUnit --bootstrap 
With a Xdebug Trace I got a stream_resolve_include_path return FALSE

    1.1564     776408               -> PHPUnit_Util_Filesystem::fileExistsInIncludePath($file =
'\\UwAmp\\www\\TODO\\PHP_Reflect_NS\\PHP\\Reflect\\Autoload.php')
C:\UwAmp\bin\php\php-5.3.5\PEAR\PHPUnit\Util\Fileloader.php:75
    1.1565     776512                 -> function_exists('stream_resolve_include_path')
C:\UwAmp\bin\php\php-5.3.5\PEAR\PHPUnit\Util\Filesystem.php:135
                                       >=> TRUE
    1.1566     776440                 ->
stream_resolve_include_path('\\UwAmp\\www\\TODO\\PHP_Reflect_NS\\PHP\\Reflect\\Autoload.php')
C:\UwAmp\bin\php\php-5.3.5\PEAR\PHPUnit\Util\Filesystem.php:136
                                       >=> FALSE
                                     >=> FALSE

2. do not forgot the drive letter (c:) on the path I given to PHPUnit --bootstrap

With a Xdebug Trace I got a stream_resolve_include_path return STRING

    1.1798     776416               -> PHPUnit_Util_Filesystem::fileExistsInIncludePath($file =
'c:\\UwAmp\\www\\TODO\\PHP_Reflect_NS\\PHP\\Reflect\\Autoload.php')
C:\UwAmp\bin\php\php-5.3.5\PEAR\PHPUnit\Util\Fileloader.php:75
    1.1799     776520                 -> function_exists('stream_resolve_include_path')
C:\UwAmp\bin\php\php-5.3.5\PEAR\PHPUnit\Util\Filesystem.php:135
                                       >=> TRUE
    1.1800     776448                 ->
stream_resolve_include_path('c:\\UwAmp\\www\\TODO\\PHP_Reflect_NS\\PHP\\Reflect\\Autoload.php')
C:\UwAmp\bin\php\php-5.3.5\PEAR\PHPUnit\Util\Filesystem.php:136
                                       >=>
                                       >'C:\\UwAmp\\www\\TODO\\PHP_Reflect_NS\\PHP\\Reflect\\Autoload.php'
                                     >=>
                                     >'C:\\UwAmp\\www\\TODO\\PHP_Reflect_NS\\PHP\\Reflect\\Autoload.php'

As drive letter is not required on all file system operation, I think there is a little problem on
windows platform only !



Test script:
---------------
<?php 

# case 1
stream_resolve_include_path('\\UwAmp\\www\\TODO\\PHP_Reflect_NS\\PHP\\Reflect\\Autoload.php');

# RETURN FALSE

# case 2
stream_resolve_include_path('c:\\UwAmp\\www\\TODO\\PHP_Reflect_NS\\PHP\\Reflect\\Autoload.php');

# RETURN C:\\UwAmp\\www\\TODO\\PHP_Reflect_NS\\PHP\\Reflect\\Autoload.php


Expected result:
----------------
Expect to return STRING on case 1


Actual result:
--------------
RETURN FALSE on case 1


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



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


Thread (3 messages)

« previous php.bugs (#230438) next »