Bug #70734 [NEW]: Error
| From: | messiah at os dot pl | Date: | Sun, 18 Oct 2015 21:02:55 +0000 |
| Subject: | Bug #70734 [NEW]: Error | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-196678@lists.php.net to get a copy of this message | ||
From: messiah at os dot pl
Operating system: Linux
PHP version: 5.4.45
Package: *Directory/Filesystem functions
Bug Type: Bug
Bug description:Error
Description:
------------
RecursiveDirectoryIterator() with RecursiveIteratorIterator() not
sorting all values by name like on Windows. Try script below on Windows
and Linux. This should be sorted by default by name folder and subfolder
then next filename. Fix this. I tessted this on PHP 5.5.24 Linux and
5.4.8 Linux and 5.6.11 Windows
Test script:
---------------
<?php
$MójFolder = __DIR__;
$Pliki = array('Pliki'=>array(), 'Foldery'=>array());
$SkanerKatalogówIPlików = new RecursiveDirectoryIterator($MójFolder,
RecursiveDirectoryIterator::SKIP_DOTS);
$SkanujWszystkiePodkatalogi = new
RecursiveIteratorIterator($SkanerKatalogówIPlików,
RecursiveIteratorIterator::SELF_FIRST);
foreach($SkanujWszystkiePodkatalogi as $WszystkiePlikiIFoldery){
if($WszystkiePlikiIFoldery->isDir()){
$Pliki['Foldery'][] = $WszystkiePlikiIFoldery .'/';
}elseif($WszystkiePlikiIFoldery->isFile()){
$Pliki['Pliki'][] = $WszystkiePlikiIFoldery->getPathname();
}
}
#print_r($Pliki);
return $Pliki;
Expected result:
----------------
Add sorting by name example:
folder/subfolder1/filename.php
folder/subfolder1/filename1.php
--
Edit bug report at https://bugs.php.net/bug.php?id=70734&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70734&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70734&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70734&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=70734&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=70734&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=70734&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=70734&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=70734&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=70734&r=support
Expected behavior: https://bugs.php.net/fix.php?id=70734&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=70734&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=70734&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=70734&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70734&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=70734&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=70734&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=70734&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70734&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=70734&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=70734&r=mysqlcfg