Doc #51895 [Opn->Asn]: SPL RecursiveDirectoryIteratory Flags documentation
| From: | salathe@php.net | Date: | Sun, 23 May 2010 23:26:15 +0000 |
| Subject: | Doc #51895 [Opn->Asn]: SPL RecursiveDirectoryIteratory Flags documentation | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-4433@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51895&edit=1
ID: 51895
Updated by: salathe@php.net
Reported by: therandshow at gmail dot com
Summary: SPL RecursiveDirectoryIteratory Flags documentation
-Status: Open
+Status: Assigned
Type: Documentation Problem
Package: Documentation problem
Operating System: Fedora Linux
PHP Version: 5.3.2
-Assigned To:
+Assigned To: salathe
New Comment:
The RecursiveDirectoryIterator extends from FilesystemIterator and all
of those constants are inherited from it. The docs for the
FilesystemIterator constants [1] should give insight into what they are
to be used for (they are brief but better than nothing).
I'll leave this bug open as a reminder to update the
RecursiveDirectoryIterator skeleton documentation with something more
substantial.
[1] http://php.net/class.filesystemiterator#filesystemiterator.constants
Previous Comments:
------------------------------------------------------------------------
[2010-05-24 00:07:54] therandshow at gmail dot com
Description:
------------
While understand that much of the SPL extension is undocumented, it
occurs to me that there's a simple piece of documentation that could be
added.
On this page:
http://us.php.net/manual/en/recursivedirectoryiterator.construct.php
it refers to "flags" without telling what options there are for flags.
Now it is documented here that there are flags defined as recursive
iterator class constants http://us.php.net/manual/en/spl.constants.php
,
but I guessed that was unlikely to be all the flags possible. Thus I
used the ReflectionClass to get all of RecursiveDirectoryIterator's
class constants and got this array:
array(11) {
["CURRENT_MODE_MASK"]=>
int(240)
["CURRENT_AS_PATHNAME"]=>
int(32)
["CURRENT_AS_FILEINFO"]=>
int(0)
["CURRENT_AS_SELF"]=>
int(16)
["KEY_MODE_MASK"]=>
int(3840)
["KEY_AS_PATHNAME"]=>
int(0)
["FOLLOW_SYMLINKS"]=>
int(512)
["KEY_AS_FILENAME"]=>
int(256)
["NEW_CURRENT_AND_KEY"]=>
int(256)
["SKIP_DOTS"]=>
int(4096)
["UNIX_PATHS"]=>
int(8192)
}
Test script:
---------------
$reflector = new ReflectionClass('RecursiveDirectoryIterator');
var_dump($reflector->getConstants());
Expected result:
----------------
array(11) {
["CURRENT_MODE_MASK"]=>
int(240)
["CURRENT_AS_PATHNAME"]=>
int(32)
["CURRENT_AS_FILEINFO"]=>
int(0)
["CURRENT_AS_SELF"]=>
int(16)
["KEY_MODE_MASK"]=>
int(3840)
["KEY_AS_PATHNAME"]=>
int(0)
["FOLLOW_SYMLINKS"]=>
int(512)
["KEY_AS_FILENAME"]=>
int(256)
["NEW_CURRENT_AND_KEY"]=>
int(256)
["SKIP_DOTS"]=>
int(4096)
["UNIX_PATHS"]=>
int(8192)
}
Actual result:
--------------
array(11) {
["CURRENT_MODE_MASK"]=>
int(240)
["CURRENT_AS_PATHNAME"]=>
int(32)
["CURRENT_AS_FILEINFO"]=>
int(0)
["CURRENT_AS_SELF"]=>
int(16)
["KEY_MODE_MASK"]=>
int(3840)
["KEY_AS_PATHNAME"]=>
int(0)
["FOLLOW_SYMLINKS"]=>
int(512)
["KEY_AS_FILENAME"]=>
int(256)
["NEW_CURRENT_AND_KEY"]=>
int(256)
["SKIP_DOTS"]=>
int(4096)
["UNIX_PATHS"]=>
int(8192)
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51895&edit=1