summaryrefslogtreecommitdiff
path: root/ext/spl/examples/directoryfilterdots.inc
blob: 3ca0e6a2f89a5c4f28b2a5df454dd6eb47d34a08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php

class DirectoryFilterDots extends FilterIterator implements RecursiveIterator
{
	function __construct($path) {
		parent::__construct(new DirectoryIterator($path));
	}
	
	function accept() {
		return !$this->it->isDot();
	}
	
	function hasChildren() {
		return $this->it->hasChildren();
	}

	function getChildren() {
		return new DirectoryFilterDots($this->it->getPathname());
	}
	
	function key() {
		return $this->it->getPathname();
	}
}

?>