diff options
author | Marcus Boerger <helly@php.net> | 2005-11-27 12:22:54 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2005-11-27 12:22:54 +0000 |
commit | e8ec9a98dd7196635543f1be77c91ecfce3829fe (patch) | |
tree | dd94360b57001f4eae0b9b9382547a09eb41d22f /ext/spl | |
parent | 51e3beb4cb4d7a9ca81dc1657a4af27d8e9ca014 (diff) | |
download | php-git-e8ec9a98dd7196635543f1be77c91ecfce3829fe.tar.gz |
- Fixed bug #35423 RecursiveDirectoryIterator doesnt appear to recurse with RecursiveFilterIterator
Diffstat (limited to 'ext/spl')
-rwxr-xr-x | ext/spl/examples/nocvsdir.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ext/spl/examples/nocvsdir.php b/ext/spl/examples/nocvsdir.php index 5ad57864b0..e89dc13d9f 100755 --- a/ext/spl/examples/nocvsdir.php +++ b/ext/spl/examples/nocvsdir.php @@ -28,13 +28,23 @@ if (!class_exists("RecursiveFilterIterator")) require_once("recursivefilteritera class NoCvsDirectory extends RecursiveFilterIterator { + function __construct($path) + { + parent::__construct(new RecursiveDirectoryIterator($path)); + } + function accept() { return $this->getInnerIterator()->getFilename() != 'CVS'; } + + function getChildren() + { + return new NoCvsDirectory($this->current()->getPathName()); + } } -$it = new RecursiveIteratorIterator(new NoCvsDirectory(new RecursiveDirectoryIterator($argv[1]))); +$it = new RecursiveIteratorIterator(new NoCvsDirectory($argv[1])); foreach($it as $pathname => $file) { |