Bug #60776 [NEW]: FilesystemIterator always uses SPL_FILE_DIR_SKIPDOTS
| From: | alex dot schuch at gmx dot de | Date: | Tue, 17 Jan 2012 12:01:50 +0000 |
| Subject: | Bug #60776 [NEW]: FilesystemIterator always uses SPL_FILE_DIR_SKIPDOTS | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-166532@lists.php.net to get a copy of this message | ||
From:
Operating system: GNU/Linux
PHP version: 5.3SVN-2012-01-17 (SVN)
Package: *Directory/Filesystem functions
Bug Type: Bug
Bug description:FilesystemIterator always uses SPL_FILE_DIR_SKIPDOTS
Description:
------------
The documentation of FilesystemIterator::__construct()
(http://de.php.net/manual/en/filesystemiterator.construct.php) suggests
that it is possible to use arbitrary valid flags for the iterator.
I do not fully understand the PHP source, butâ¦
/* {{{ proto void FilesystemIterator::__construct(string path [, int
flags])
Cronstructs a new dir iterator from a path. */
SPL_METHOD(FilesystemIterator, __construct)
{
spl_filesystem_object_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU,
DIT_CTOR_FLAGS | SPL_FILE_DIR_SKIPDOTS);
}
/* }}} */
The code above makes me believe that the flag SPL_FILE_DIR_SKIPDOTS is
*always* added to the flags when using the FilesystemIterator. So it is not
possible to make the flag NOT be there, by for example using 0 as
argument.
So either this is a documentation issue, or this is an implementation bug.
Test script:
---------------
<?php
$oDirectoryIt = new FilesystemIterator('.', 0);
$oDirectoryIt->setFlags(0);
foreach ($oDirectoryIt as $oDirectory) {
var_dump($oDirectory);
}
?>
Expected result:
----------------
I expect to see "." and ".." in the output.
Actual result:
--------------
I do not see "." or "..".
--
Edit bug report at https://bugs.php.net/bug.php?id=60776&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60776&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60776&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60776&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=60776&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60776&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=60776&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=60776&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=60776&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=60776&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=60776&r=support
Expected behavior: https://bugs.php.net/fix.php?id=60776&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=60776&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=60776&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=60776&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60776&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=60776&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=60776&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=60776&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=60776&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=60776&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=60776&r=mysqlcfg