adding further error-messages to ignore, relocate function into tools.

This commit is contained in:
dg9vh 2016-07-12 17:34:21 +00:00
parent 4408d1cff8
commit 539263381e
3 changed files with 16 additions and 17 deletions

View file

@ -99,7 +99,7 @@ function getMMDVMLog() {
$logLines = array(); $logLines = array();
if ($log = fopen(MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log", 'r')) { if ($log = fopen(MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log", 'r')) {
while ($logLine = fgets($log)) { while ($logLine = fgets($log)) {
if (!strpos($logLine, "Debug") && !strpos($logLine,"Received a NAK") && !startsWith($logLine,"I:")) { if (!strpos($logLine, "Debug") && !strpos($logLine,"Received a NAK") && !startsWith($logLine,"I:") && !startsWith($logLine,"E:")) {
array_push($logLines, $logLine); array_push($logLines, $logLine);
} }
} }
@ -155,8 +155,11 @@ function getHeardList($logLines) {
continue; continue;
} else if(strpos($logLine,"unable to decode the network CSBK")) { } else if(strpos($logLine,"unable to decode the network CSBK")) {
continue; continue;
} else if(strpos($logLine,"overflow in the DMR slot RF queue")) {
continue;
} }
if(strpos($logLine,"end of") || strpos($logLine,"watchdog has expired") || strpos($logLine,"ended RF data") || strpos($logLine,"ended network")) { if(strpos($logLine,"end of") || strpos($logLine,"watchdog has expired") || strpos($logLine,"ended RF data") || strpos($logLine,"ended network")) {
$lineTokens = explode(", ",$logLine); $lineTokens = explode(", ",$logLine);
if (array_key_exists(2,$lineTokens)) { if (array_key_exists(2,$lineTokens)) {
@ -475,21 +478,6 @@ function getActiveYSFReflectors($logLines) {
return $reflectorlist; return $reflectorlist;
} }
function getSize($filesize, $precision = 2)
{
$units = array('', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y');
foreach ($units as $idUnit => $unit)
{
if ($filesize > 1024)
$filesize /= 1024;
else
break;
}
return round($filesize, $precision).' '.$units[$idUnit].'B';
}
//Some basic inits //Some basic inits
$mmdvmconfigs = getMMDVMConfig(); $mmdvmconfigs = getMMDVMConfig();
$logLinesMMDVM = getMMDVMLog(); $logLinesMMDVM = getMMDVMLog();

View file

@ -54,6 +54,17 @@ function createConfigLines() {
return $out; return $out;
} }
function getSize($filesize, $precision = 2) {
$units = array('', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y');
foreach ($units as $idUnit => $unit) {
if ($filesize > 1024)
$filesize /= 1024;
else
break;
}
return round($filesize, $precision).' '.$units[$idUnit].'B';
}
function checkSetup() { function checkSetup() {
$el = error_reporting(); $el = error_reporting();
error_reporting(E_ERROR | E_WARNING | E_PARSE); error_reporting(E_ERROR | E_WARNING | E_PARSE);

View file

@ -1,3 +1,3 @@
<?php <?php
define("VERSION", "20160711-3"); define("VERSION", "20160712-1");
?> ?>