Update system.php (#5369)

* Update system.php

PHP version info is not displaying when FreeSWITCH is off.  Line 169 corrects this issue and the information is displayed regardless if FreeSWITCH is on or off.

Added Windows support to display System Memory.
This commit is contained in:
jrmcclean
2020-07-30 11:36:27 -04:00
committed by GitHub
parent f765cefb51
commit e22b1fc4e2

View File

@@ -166,14 +166,15 @@
echo " <td class=\"row_style1\">$switch_git_info</td>\n";
echo "</tr>\n";
}
echo "<tr>\n";
echo " <td width='20%' class=\"vncell\" style='text-align: left;'>\n";
echo " ".$text['label-php']." ".$text['label-version']."\n";
echo " </td>\n";
echo " <td class=\"row_style1\">".phpversion()."</td>\n";
echo "</tr>\n";
}
echo "<tr>\n";
echo " <td width='20%' class=\"vncell\" style='text-align: left;'>\n";
echo " ".$text['label-php']." ".$text['label-version']."\n";
echo " </td>\n";
echo " <td class=\"row_style1\">".phpversion()."</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <th class='th' colspan='2' align='left' style='padding-top:2em'>".$text['title-os-info']."</th>\n";
echo "</tr>\n";
@@ -308,6 +309,36 @@
echo "<br /><br />";
}
}
//Windows
if (stristr(PHP_OS, 'WIN')) {
echo "<!--\n";
// connect to WMI
$wmi = new COM('WinMgmts:root/cimv2');
// Query this Computer for Total Physical RAM
$res = $wmi->ExecQuery('Select TotalPhysicalMemory from Win32_ComputerSystem');
// Fetch the first item from the results
$system = $res->ItemIndex(0);
$shell_result = round($system->TotalPhysicalMemory / 1024 /1024, 0);
echo "-->\n";
if (strlen($shell_result) > 0) {
echo "<table width=\"100%\" border=\"0\" cellpadding=\"7\" cellspacing=\"0\">\n";
echo "<tr>\n";
echo " <th class='th' colspan='2' align='left'>".$text['Physical Memory']."</th>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <td width='20%' class=\"vncell\" style='text-align: left;'>\n";
echo " ".$text['label-mem']." \n";
echo " </td>\n";
echo " <td class=\"row_style1\">\n";
echo " $shell_result mb\n";
echo " </td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<br /><br />";
}
}
}
//cpu information