It seems like you do not handle an error condition here. This can introduce security issues, and is generally not recommended.
If you suppress an error, we recommend checking for the error condition explicitly:
// For example instead of@mkdir($dir);// Better useif(@mkdir($dir)===false){thrownew\RuntimeException('The directory '.$dir.' could not be created.');}
Loading history...
50
51
// if output is exist
52
if ($output) {
53
// try to find line with numeric data
54
foreach ($output as $line) {
55
if ($line && preg_match("/^[0-9]+\$/", $line)) {
56
$load = $line;
57
break;
58
}
59
}
60
}
61
} else {
62
$sys_load = sys_getloadavg(); // get linux load average (1 = 100% of 1 CPU)
If you suppress an error, we recommend checking for the error condition explicitly: