summaryrefslogtreecommitdiff
path: root/ext/spl/examples/findfile.inc
blob: e0c685b659bc193fb1caece8527f137d539909f6 (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
<?php

/**
 * @brief   Base class to find files
 * @author  Marcus Boerger
 * @version 1.0
 *
 */
class FindFile extends FilterIterator
{
	protected $file;

	function __construct($path, $file)
	{
		$this->file = $file;
		parent::__construct(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)));
	}

	function accept()
	{
		return !strcmp($this->current(), $this->file);
	}
}

?>