tree.php

Go to the documentation of this file.
00001 <?php
00002 
00014 // The following line only operates on classes which are converted to c already.
00015 // But does not generate a graphical output.
00016 //foreach(new RecursiveIteratorIterator(new ParentIterator(new RecursiveDirectoryIterator($argv[1])), 1) as $file) {
00017 
00018 if ($argc < 2) {
00019     echo <<<EOF
00020 Usage: php ${_SERVER['PHP_SELF']} <path>
00021 
00022 Displays a graphical tree for the given <path>.
00023 
00024 <path> The directory for which to generate the tree graph.
00025 
00026 
00027 EOF;
00028     exit(1);
00029 }
00030 
00031 if (!class_exists("DirectoryTreeIterator", false)) require_once("directorytreeiterator.inc");
00032 if (!class_exists("DirectoryGraphIterator", false)) require_once("directorygraphiterator.inc");
00033 
00034 echo $argv[1]."\n";
00035 foreach(new DirectoryGraphIterator($argv[1]) as $file)
00036 {
00037     echo $file . "\n";
00038 }
00039 
00040 ?>

Generated on Thu Apr 26 01:04:48 2007 for SPL-StandardPHPLibrary by  doxygen 1.5.2