Count lines on the fly if count is not available

This commit is contained in:
Michal Čihař 2013-10-03 14:41:29 +02:00
parent a7192e9b25
commit ddd64ec794

View File

@ -164,7 +164,21 @@ function PMA_sendErrorReport($report) {
function PMA_countLines($filename)
{
global $LINE_COUNT;
return $LINE_COUNT[$filename];
if (!defined('LINE_COUNTS')) {
$linecount = 0;
$handle = fopen('./js/' . $filename, 'r');
while (!feof($handle)){
$line = fgets($handle);
if ($line === false) {
break;
}
$linecount++;
}
fclose($handle);
return $linecount;
} else {
return $LINE_COUNT[$filename];
}
}
/**