Req #60742 [Asn->Csd]: FilesystemIterator::OTHER_MODE_MASK
| From: | johannes@php.net | Date: | Mon, 19 Mar 2012 22:47:58 +0000 |
| Subject: | Req #60742 [Asn->Csd]: FilesystemIterator::OTHER_MODE_MASK | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-168634@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=60742&edit=1
ID: 60742
Updated by: johannes@php.net
Reported by: jthijssen at noxlogic dot nl
Summary: FilesystemIterator::OTHER_MODE_MASK
-Status: Assigned
+Status: Closed
Type: Feature/Change Request
Package: SPL related
PHP Version: 5.4.0RC5
-Assigned To: colder
+Assigned To: dsp
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
For Windows:
http://windows.php.net/snapshots/
Thank you for the report, and for helping us make PHP better.
(sorry for the outdated message above ;-) )
Previous Comments:
------------------------------------------------------------------------
[2012-03-19 21:39:38] jthijssen at noxlogic dot nl
Pull request merged by dsp_ into the git 5.4 branch:
https://github.com/php/php-src/pull/5
------------------------------------------------------------------------
[2012-01-13 12:44:46] jthijssen at noxlogic dot nl
Description:
------------
The FileSystemIterator defines a few constants to mask its flags: CURRENT_MODE_MASK and
KEY_MODE_MASK. However, there are other flags (SKIP_DOTS and UNIX_PATHS) which cannot be masked of
by a constant.
However, internally, there is a mask constant defined (SPL_FILE_DIR_OTHERS_MASK). It makes sense
that this value is also known in PHP userland by the OTHER_MODE_MASK constant.
The attached patch adds this constant and is compatible with trunk, php_5_4 and php_5_3 branches.
Test script:
---------------
<?php
$it = new fileSystemIterator(".", FileSystemIterator::SKIP_DOTS |
FileSystemIterator::CURRENT_AS_SELF);
$masked_flags = ($it->getFlags() & FileSystemIterator::OTHER_MODE_MASK);
print $masked_flags;
Expected result:
----------------
4096
Actual result:
--------------
PHP Notice: Use of undefined constant OTHER_MODE_MASK - assumed 'OTHER_MODE_MASK'
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=60742&edit=1