mirror of
https://github.com/php/php-src.git
synced 2024-10-10 11:12:08 +00:00
25 lines
395 B
PHP
25 lines
395 B
PHP
|
<?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);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
?>
|