mirror of
https://github.com/php/php-src.git
synced 2024-10-09 10:37:29 +00:00
159c538bcf
- Remove all overloading hooks -> array_read/array_access must be rewritten - Remove all basic iterators - Remove all 'spl_' prefixing exposed to user level - Add RecursiveIterator, RecursiveIteratorIterator - Add DirectoryIterator, DirectoryTreeIterator - Add some examples
17 lines
345 B
PHP
Executable File
17 lines
345 B
PHP
Executable File
<?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";
|
|
?>
|