mirror of
https://github.com/php/php-src.git
synced 2024-10-09 10:37:29 +00:00
17 lines
345 B
PHP
17 lines
345 B
PHP
|
<?php
|
||
|
|
||
|
class FindFile extends SearchIterator
|
||
|
{
|
||
|
protected $file;
|
||
|
|
||
|
function __construct($path, $file) {
|
||
|
$this->file = $file;
|
||
|
parent::__construct(new DirectoryTree($path));
|
||
|
}
|
||
|
function accept() {
|
||
|
return !strcmp($this->it->current(), $this->file);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
foreach(new FindFile($argv[1], $argv[2]) as $pathname => $file) echo "$pathname\n";
|
||
|
?>
|