Word count of current working dir.
$url = getcwd();
function listDeep($dir) {
$out = array();
$dbug = array();
$ddir = scandir($dir);
$nosho = array('..', '.', '.DS_Store', '', '.svn');
foreach($ddir as $file) {
if(!in_array($file, $nosho)) {
if(@is_dir($dir . '/' .$file)) {
$p = listDeep($dir . '/' . $file);
foreach($p as $f) {
$out[] = str_replace(' ', '\ ', $f);
}
} else {
$out[] = str_replace(' ', '\ ', $dir . '/' . $file);
}
}
}
return $out;
}
$g = implode(' ', listDeep($url));
echo '';
echo 'Word count for: '. $url . "\n" .' Lines Words Chars'. "\n";
echo exec('wc '. $g) . '
';