I did not find a way to do this in netbeans (on any OS), but I think you could get away from something like the following:
Save this little script somewhere where you can find it: (let's say "cntln.php")
<?php
function countLinesInFile($fileInfo)
{
return count(file($fileInfo));
}
function countLinesInDir($directory, $filePattern)
{
$total = 0;
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory));
foreach($iterator as $fileInfo)
{
if (-1 < preg_match($filePattern, $fileInfo->getFileName()))
{
$total += countLinesInFile($fileInfo);
}
}
return $total;
}
function usage($argv)
{
printf("usage: php -q %s <directory> <filematch>\n", reset($argv));
printf(" - directory: path to the root directory of a project.\n");
printf(" - filematch: regex pattern for files to include.\n");
return 1;
}
if (count($argv) < 3)
{
die(usage($argv));
}
printf("%d\n", countLinesInDir($argv[1], $argv[2]));
and use it on the command line (cmd.exe):
c:> php -q cntln.php "C:\projects\foo" "~\.php$~"
With some minor tricks, I'm sure you can create a shortcut for it that you can put on the quick launch bar or use it in some other tools.
, , SO.