Skip to content

Commit 6dec77d

Browse files
committed
- MFH Add class SplFileInfo as base for DirectoryIterator and SplFileObject
# As discussed with ilia before 5.1.0
1 parent 4a400ce commit 6dec77d

File tree

8 files changed

+984
-739
lines changed

8 files changed

+984
-739
lines changed

ext/spl/examples/nocvsdir.php

+1-6
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,13 @@ class NoCvsDirectory extends RecursiveFilterIterator
3030
{
3131
function __construct($path)
3232
{
33-
parent::__construct(new RecursiveDirectoryIterator($path));
33+
parent::__construct(new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::CURRENT_AS_PATHNAME));
3434
}
3535

3636
function accept()
3737
{
3838
return $this->getInnerIterator()->getFilename() != 'CVS';
3939
}
40-
41-
function getChildren()
42-
{
43-
return new NoCvsDirectory($this->current()->getPathName());
44-
}
4540
}
4641

4742
$it = new RecursiveIteratorIterator(new NoCvsDirectory($argv[1]));

ext/spl/php_spl.c

+1
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ PHP_FUNCTION(class_implements)
183183
SPL_ADD_CLASS(RuntimeException, z_list, sub, allow, ce_flags); \
184184
SPL_ADD_CLASS(SeekableIterator, z_list, sub, allow, ce_flags); \
185185
SPL_ADD_CLASS(SimpleXMLIterator, z_list, sub, allow, ce_flags); \
186+
SPL_ADD_CLASS(SplFileInfo, z_list, sub, allow, ce_flags); \
186187
SPL_ADD_CLASS(SplFileObject, z_list, sub, allow, ce_flags); \
187188
SPL_ADD_CLASS(SplObjectStorage, z_list, sub, allow, ce_flags); \
188189
SPL_ADD_CLASS(SplObserver, z_list, sub, allow, ce_flags); \

0 commit comments

Comments
 (0)