Some bugfixes with PHP-Warnings

This commit is contained in:
Kim Hübel 2020-05-03 22:05:51 +01:00
parent 86b02015ac
commit 8f0a996a76
3 changed files with 6 additions and 11 deletions

View file

@ -223,11 +223,11 @@ if ($_GET['section'] == "sysinfo") {
showLapTime("cpuusage");
$output = shell_exec('grep -c processor /proc/cpuinfo');
$cpucores = $output;
$cpucores = intval($output);
$output = shell_exec('cat /proc/uptime');
$uptime = format_time(substr($output,0,strpos($output," ")));
$idletime = format_time((substr($output,strpos($output," ")))/$cpucores);
$idletime = format_time(doubleval((substr($output,strpos($output," "))))/$cpucores);
showLapTime("idletime");
if (defined("SHOWPOWERSTATE")) {

View file

@ -1,5 +1,7 @@
<?php
function format_time($seconds) {
echo gettype($seconds);
echo $seconds;
$secs = intval($seconds % 60);
$mins = intval($seconds / 60 % 60);
$hours = intval($seconds / 3600 % 24);
@ -73,17 +75,10 @@ function getSize($filesize, $precision = 2) {
function checkSetup() {
$el = error_reporting();
error_reporting(E_ERROR | E_WARNING | E_PARSE);
if (defined(DISTRIBUTION)) {
?>
<div class="alert alert-danger" role="alert"><?php echo _("You are using an old config.php. Please configure your Dashboard by calling <a href=\"setup.php\">setup.php</a>!"); ?></div>
<?php
} else {
if (file_exists ("setup.php") && ! defined("DISABLESETUPWARNING")) {
if (file_exists ("setup.php") && ! defined("DISABLESETUPWARNING")) {
?>
<div class="alert alert-danger" role="alert"><?php echo _("You forgot to remove setup.php in root-directory of your dashboard or you forgot to configure it! Please delete the file or configure your Dashboard by calling <a href=\"setup.php\">setup.php</a>!"); ?></div>
<?php
}
}
error_reporting($el);
}

View file

@ -1,3 +1,3 @@
<?php
define("VERSION", "20191209-1 (".getGitVersion().")");
define("VERSION", "20200503-1 (".getGitVersion().")");
?>