mirror of
https://github.com/php/php-src.git
synced 2025-08-20 01:14:28 +02:00
17 lines
No EOL
389 B
PHP
Executable file
17 lines
No EOL
389 B
PHP
Executable file
<?php
|
|
|
|
class FindFile extends SearchIterator
|
|
{
|
|
protected $file;
|
|
|
|
function __construct($path, $file) {
|
|
$this->file = $file;
|
|
parent::__construct(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)));
|
|
}
|
|
function accept() {
|
|
return !strcmp($this->it->current(), $this->file);
|
|
}
|
|
}
|
|
|
|
foreach(new FindFile($argv[1], $argv[2]) as $pathname => $file) echo "$pathname\n";
|
|
?>
|