#48361 [NEW]: SplFileInfo::getPathinfo no returning info of path

2009-05-22 Thread petercowburn at gmail dot com
From: petercowburn at gmail dot com
Operating system: OS X
PHP version:  5.3.0RC2
PHP Bug Type: SPL related
Bug description:  SplFileInfo::getPathinfo no returning info of path

Description:

It appears that using PHP5.3.0RC2-dev the SplFileInfo::getPathinfo method
just returns the SplFileInfo object on which it was called rather than an
SplFileInfo object for its path.



Reproduce code:
---
getPathInfo();
var_dump($parent_info->getRealPath());
?>

Expected result:

string(8) "/usr/bin"


Actual result:
--
string(12) "/usr/bin/php"

-- 
Edit bug report at http://bugs.php.net/?id=48361&edit=1
-- 
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=48361&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=48361&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=48361&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=48361&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=48361&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=48361&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=48361&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=48361&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=48361&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=48361&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=48361&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=48361&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=48361&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=48361&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=48361&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=48361&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=48361&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=48361&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=48361&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=48361&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=48361&r=mysqlcfg



#48361 [Asn]: SplFileInfo::getPathinfo no returning info of path

2009-06-16 Thread petercowburn at gmail dot com
 ID:   48361
 User updated by:  petercowburn at gmail dot com
 Reported By:  petercowburn at gmail dot com
 Status:   Assigned
 Bug Type: SPL related
 Operating System: OS X
 PHP Version:  5.3.0RC2
 Assigned To:  colder
 New Comment:

I downloaded a recent snap of PHP 5.3 (200906162030) which gives me PHP
5.3.0RC4 and amended the method definition which was using
spl_filesystem_object_get_pathname rather than
spl_filesystem_object_get_path.  With that function name changed, the
call to SplFileInfo::getPathInfo now appears to work as expected from
the description given in the documentation.

Reproduce code:
---
getPathInfo();
var_dump($parent_info->getRealPath());
?>

Expected result:

string(8) "/usr/bin"

Actual result:

string(8) "/usr/bin"

Diff file:
--
Index: spl_directory.c
===
RCS file: /repository/php-src/ext/spl/spl_directory.c,v
retrieving revision 1.45.2.27.2.23.2.43
diff -u -u -r1.45.2.27.2.23.2.43 spl_directory.c
--- spl_directory.c 4 Jun 2009 14:46:26 -   1.45.2.27.2.23.2.43
+++ spl_directory.c 16 Jun 2009 22:13:45 -
@@ -1176,7 +1176,7 @@
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|C", &ce) ==
SUCCESS) {
int path_len;
-   char *path = spl_filesystem_object_get_pathname(intern, 
&path_len
TSRMLS_CC);
+   char *path = spl_filesystem_object_get_path(intern, &path_len
TSRMLS_CC);
if (path) {
spl_filesystem_object_create_info(intern, path, 
path_len, 1, ce,
return_value TSRMLS_CC);
}


Previous Comments:
--------

[2009-05-22 10:30:21] petercowburn at gmail dot com

Description:

It appears that using PHP5.3.0RC2-dev the SplFileInfo::getPathinfo
method just returns the SplFileInfo object on which it was called rather
than an SplFileInfo object for its path.



Reproduce code:
---
getPathInfo();
var_dump($parent_info->getRealPath());
?>

Expected result:

string(8) "/usr/bin"


Actual result:
--
string(12) "/usr/bin/php"





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