Apply automated PHP8 safety transforms
Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/89922108-1604-44ae-949d-358d32b9d70a Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
parent
aca850b6cd
commit
e44519c030
465 changed files with 1716 additions and 1716 deletions
|
|
@ -48,7 +48,7 @@ if ($os == "windows")
|
|||
|
||||
$cpu_num = '0';
|
||||
|
||||
foreach ($cpus as $cpu)
|
||||
foreach ((array)$cpus as $cpu)
|
||||
{
|
||||
$cpu_num = $cpu->NumberOfLogicalProcessors;
|
||||
}
|
||||
|
|
@ -59,7 +59,7 @@ if ($os == "windows")
|
|||
|
||||
$cpu_loop = 1;
|
||||
|
||||
foreach($cpus_info as $cpu_info)
|
||||
foreach ((array)$cpus_info as $cpu_info)
|
||||
{
|
||||
$cores[$cpu_loop] = 100 - $cpu_info->PercentIdleTime;
|
||||
|
||||
|
|
@ -97,7 +97,7 @@ elseif ($os == "linux")
|
|||
$first = 1;
|
||||
|
||||
$cores = array();
|
||||
foreach($lb as $line)
|
||||
foreach ((array)$lb as $line)
|
||||
{
|
||||
if($first == 0)
|
||||
{
|
||||
|
|
@ -125,12 +125,12 @@ elseif ($os == "linux")
|
|||
/* compares two information snapshots and returns the cpu percentage */
|
||||
function getCpuUsage($stat1, $stat2)
|
||||
{
|
||||
if( count($stat1) !== count($stat2) )
|
||||
if( count((array)$stat1) !== count((array)$stat2) )
|
||||
{
|
||||
return False;
|
||||
}
|
||||
|
||||
for( $i = 0; $i < count($stat1) ; $i++ )
|
||||
for( $i = 0; $i < count((array)$stat1) ; $i++ )
|
||||
{
|
||||
$diff_idle[$i] = $stat2[$i]['idle'] - $stat1[$i]['idle'];
|
||||
$diff_total[$i] = $stat2[$i]['total'] - $stat1[$i]['total'];
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ if ($os == "windows") {
|
|||
{
|
||||
$wmiq = new COM("Winmgmts://");
|
||||
$ossq = $wmiq->execquery("SELECT * FROM Win32_OperatingSystem");
|
||||
foreach ($ossq as $osq) {
|
||||
foreach ((array)$ossq as $osq) {
|
||||
$total = $osq->TotalVisibleMemorySize * 1024;
|
||||
$free = $osq->FreePhysicalMemory * 1024;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
function numbersFormatting($bytes){
|
||||
$si_prefix = array( 'B', 'KB', 'MB', 'GB', 'TB', 'EB', 'ZB', 'YB' );
|
||||
$base = 1024;
|
||||
$class = min((int)log($bytes , $base) , count($si_prefix) - 1);
|
||||
$class = min((int)log($bytes , $base) , count((array)$si_prefix) - 1);
|
||||
return sprintf('%1.2f' , $bytes / pow($base,$class)) . ' ' . $si_prefix[$class];
|
||||
}
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ function exec_ogp_module()
|
|||
<h4>".get_lang('cpu_usage')."</h4>
|
||||
<div class=\"dragbox-content\">";
|
||||
ksort($cores);
|
||||
foreach($cores as $cpu => $percent)
|
||||
foreach ((array)$cores as $cpu => $percent)
|
||||
{
|
||||
echo "<b>CPU" . $cpu . " ".get_lang('cpu_load').": " . $percent . " %</b><br>";
|
||||
drawBarDiv($percent, "CPU" . $cpu);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue