summaryrefslogtreecommitdiff
path: root/ext/spl/examples/findfile.php
diff options
context:
space:
mode:
Diffstat (limited to 'ext/spl/examples/findfile.php')
-rwxr-xr-xext/spl/examples/findfile.php41
1 files changed, 0 insertions, 41 deletions
diff --git a/ext/spl/examples/findfile.php b/ext/spl/examples/findfile.php
deleted file mode 100755
index 68c0e0dd65..0000000000
--- a/ext/spl/examples/findfile.php
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-
-/** Find a specific file by name.
- *
- * Usage: php findfile.php <path> <name>
- *
- * <path> Path to search in.
- * <name> Filename to look for.
- *
- * (c) Marcus Boerger, 2003
- */
-
-if ($argc < 3) {
- echo <<<EOF
-Usage: php findfile.php <file> <name>
-
-Find a specific file by name.
-
-<path> Path to search in.
-<name> Filename to look for.
-
-
-EOF;
- exit(1);
-}
-
-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);
- }
-}
-
-foreach(new FindFile($argv[1], $argv[2]) as $pathname => $file) echo $file->getPathname()."\n";
-?> \ No newline at end of file