All pastes #617293 Raw Edit

Rishi

public text v1 · immutable
#617293 ·published 2007-07-13 04:21 UTC
rendered paste body

<?
$lines = 0;
function print_dir($dir = "", $indent = 0){
	global $lines;
	foreach (glob("$dir*") as $file){
		if (is_dir($file)){ $dir = true; }else{ $dir = false; }
		if (substr_count($file, ".php") >= 1 || $dir){
			for ($i = 0; $i < $indent; $i++){	
				echo "  ";
			}
			echo $file;
			echo "\n";
			if ($dir){
				if ($file != "include2"){
					print_dir($file."/", $indent+1);
				}
			}else{
				$lines += count(file($file));
			}
		}
	}
}

print_dir();
echo "\n";
echo "Lines: $lines";
?>