fix: fix even more PHP errors and warnings

This commit is contained in:
Emmanuel BENOîT 2024-12-31 13:43:31 +01:00
parent 077f97d5fc
commit 7debdba37c
Signed by: Emmanuel BENOîT
SSH key fingerprint: SHA256:l7PFUUF5TCDsvYeQC9OnTNz08dFY7Fvf4Hv3neIqYpg
28 changed files with 80 additions and 72 deletions

View file

@ -81,16 +81,17 @@ function disableTicks() {
$statusMessage = "";
// Start / stop manager
if ($_GET['c'] == 'sm') {
$command = $_GET['c'] ?? '';
if ($command == 'sm') {
startManager();
} elseif ($_GET['c'] == 'km') {
} elseif ($command == 'km') {
killManager();
} else {
$mRunning = __isManagerRunning();
$tActive = ($mRunning !== false) ? ticksActive() : false;
// Run tick manually
if ($_GET['c'] == 'rt' && $_GET['g'] != '' && $_GET['t'] != '') {
if ($command == 'rt' && $_GET['g'] != '' && $_GET['t'] != '') {
$__runFromAdmin = true;
$__adminParams = array($_GET['g'], $_GET['t']);
__logAdmin("is running tick " . join("::", $__adminParams));
@ -102,10 +103,10 @@ if ($_GET['c'] == 'sm') {
} else {
// Enable / disable ticks
if ($tActive === true && $_GET['c'] == 'dt') {
if ($tActive === true && $command == 'dt') {
disableTicks();
$tActive = 'pending';
} elseif ($mRunning !== false && $tActive === false && $_GET['c'] == 'et') {
} elseif ($mRunning !== false && $tActive === false && $command == 'et') {
enableTicks();
$tActive = 'pending';
}
@ -140,7 +141,7 @@ if (!class_exists('config')) {
if ($mRunning === false) {
?>
<b>not running</b> - <a href="?c=sm">Start manager</a>
<?php
<?php
} else {
?> <b>running</b>, process ID #<?=$mRunning?> - <a href="?c=km">Kill manager</a><br/>
<?php