Back to index

php5  5.3.10
directorytree.php
Go to the documentation of this file.
00001 <?php
00002 
00014 if ($argc < 2) {
00015        echo <<<EOF
00016 Usage: php ${_SERVER['PHP_SELF']} <path>
00017 
00018 Displays a graphical directory tree for the given <path>.
00019 
00020 <path> The directory for which to generate the directory tree graph.
00021 
00022 
00023 EOF;
00024        exit(1);
00025 }
00026 
00027 if (!class_exists("DirectoryTreeIterator", false)) require_once("directorytreeiterator.inc");
00028 
00029 $length = $argc > 3 ? $argv[3] : -1;
00030 
00031 echo $argv[1]."\n";
00032 foreach(new LimitIterator(new DirectoryTreeIterator($argv[1]), @$argv[2], $length) as $key=>$file) {
00033 //foreach(new DirectoryTreeIterator($argv[1]) as $file) {
00034        echo $file . "\n";
00035 }
00036 
00037 ?>