Updated PHP to preferred "elseif" single statement

This commit is contained in:
bergware
2016-10-29 09:24:54 +02:00
parent 3f62efe64c
commit f00238ff43
7 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -181,7 +181,7 @@ case 'port':
$mtu = file_get_contents("/sys/class/net/$port/mtu");
if (substr($port,0,4)=='bond') {
$ports[$i++] = exec("grep -Pom1 '^Bonding Mode: \K.+' /proc/net/bonding/$port").", mtu $mtu";
} else if ($port=='lo') {
} elseif ($port=='lo') {
$ports[$i++] = str_replace('yes','loopback',exec("ethtool lo|grep -Pom1 '^\s+Link detected: \K.+'"));
} else {
unset($info);
+1 -1
View File
@@ -92,7 +92,7 @@ function fs_info(&$disk) {
if ($disk['fsStatus']=='-') {
echo "<td colspan='5'></td>";
return;
} else if ($disk['fsStatus']=='Mounted') {
} elseif ($disk['fsStatus']=='Mounted') {
echo "<td>{$disk['fsType']}</td>";
echo "<td>".my_scale($disk['fsSize']*1024,$unit)." $unit</td>";
if ($display['text']%10==0) {
+2 -2
View File
@@ -69,8 +69,8 @@ case "attributes":
$color = "";
$highlight = strpos($info[8],'FAILING_NOW')!==false || ($select ? $info[5]>0 && $info[3]<=$info[5]*$level : $info[9]>0);
if (in_array($info[0], $events) && $highlight) $color = " class='warn'";
else if (in_array($info[0], $temps)) {
if ($info[9]>=$max) $color = " class='alert'"; else if ($info[9]>=$hot) $color = " class='warn'";
elseif (in_array($info[0], $temps)) {
if ($info[9]>=$max) $color = " class='alert'"; elseif ($info[9]>=$hot) $color = " class='warn'";
}
if ($info[8]=='-') $info[8] = 'Never';
if ($info[0]==9 && is_numeric($info[9])) duration($info[9]);