Skip to content
This repository has been archived by the owner on Jun 10, 2018. It is now read-only.

Commit

Permalink
cleanup sonarqube warnings, switch from tabs to spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
kkretsch committed Dec 28, 2017
1 parent 62dedd3 commit 0e30dac
Show file tree
Hide file tree
Showing 28 changed files with 2,464 additions and 2,130 deletions.
59 changes: 29 additions & 30 deletions admin/cron.php
@@ -1,33 +1,32 @@
<?php

spl_autoload_register(function($class) {
include __DIR__ . '/../inc/' . strtolower($class) . '_class.php';
});

$iCount=0;
$aPerf=array();
$l = null;
try {
$config = new AdminConfig();

$state = new LggrState();
$state->setLocalCall(true);

$l = new Lggr($state, $config);

$iCount = $l->purgeOldMessages();
$aPerf = $l->getPerf();
} catch(LggrException $e) {
die($e->getMessage());
} // try

$pCount = count($aPerf);
$pTime = 0;
foreach($aPerf as $perf) {
$aTmp = $perf->getPerf();
$pTime += $aTmp['time'];
} // foreach

<?php
spl_autoload_register(function ($class) {
include __DIR__ . '/../inc/' . strtolower($class) . '_class.php';
});

$iCount = 0;
$aPerf = array();
$l = null;
try {
$config = new AdminConfig();

$state = new LggrState();
$state->setLocalCall(true);

$l = new Lggr($state, $config);

$iCount = $l->purgeOldMessages();
$aPerf = $l->getPerf();
} catch (LggrException $e) {
die($e->getMessage());
} // try

$pCount = count($aPerf);
$pTime = 0;
foreach ($aPerf as $perf) {
$aTmp = $perf->getPerf();
$pTime += $aTmp['time'];
} // foreach

?>
Purging <?= $iCount ?> old messages with <?= $pCount ?> queries in <?= $pTime ?> seconds.

61 changes: 30 additions & 31 deletions admin/cron_often.php
@@ -1,33 +1,32 @@
<?php

spl_autoload_register(function($class) {
include __DIR__ . '/../inc/' . strtolower($class) . '_class.php';
});

$iCountServers=0;
$aPerf=array();
$l = null;
try {
$config = new AdminConfig();

$state = new LggrState();
$state->setLocalCall(true);

$l = new Lggr($state, $config);

$iCountServers = $l->updateServers();

$aPerf = $l->getPerf();
} catch(LggrException $e) {
die($e->getMessage());
} // try

$pCount = count($aPerf);
$pTime = 0;
foreach($aPerf as $perf) {
$aTmp = $perf->getPerf();
$pTime += $aTmp['time'];
} // foreach

<?php
spl_autoload_register(function ($class) {
include __DIR__ . '/../inc/' . strtolower($class) . '_class.php';
});

$iCountServers = 0;
$aPerf = array();
$l = null;
try {
$config = new AdminConfig();

$state = new LggrState();
$state->setLocalCall(true);

$l = new Lggr($state, $config);

$iCountServers = $l->updateServers();

$aPerf = $l->getPerf();
} catch (LggrException $e) {
die($e->getMessage());
} // try

$pCount = count($aPerf);
$pTime = 0;
foreach ($aPerf as $perf) {
$aTmp = $perf->getPerf();
$pTime += $aTmp['time'];
} // foreach

?>
Purging updating <?= $iCountServers ?> servers with <?= $pCount ?> queries in <?= $pTime ?> seconds.
44 changes: 21 additions & 23 deletions admin/normalize.php
@@ -1,24 +1,22 @@
<?php

spl_autoload_register(function($class) {
include __DIR__ . '/../inc/' . strtolower($class) . '_class.php';
});

$iCount=0;
$a=array();
$l = null;
try {
$config = new AdminConfig();

$state = new LggrState();
$state->setLocalCall(true);

$l = new Lggr($state, $config);

$l->normalizeHosts();

$a = $l->getPerf();
} catch(LggrException $e) {
die($e->getMessage());
<?php
spl_autoload_register(function ($class) {
include __DIR__ . '/../inc/' . strtolower($class) . '_class.php';
});

$iCount = 0;
$a = array();
$l = null;
try {
$config = new AdminConfig();

$state = new LggrState();
$state->setLocalCall(true);

$l = new Lggr($state, $config);

$l->normalizeHosts();

$a = $l->getPerf();
} catch (LggrException $e) {
die($e->getMessage());
} // try

63 changes: 31 additions & 32 deletions api.php
@@ -1,34 +1,33 @@
<?php

spl_autoload_register(function($class) {
include 'inc/' . strtolower($class) . '_class.php';
});

session_start();

if(!isset($_REQUEST['a'])) {
header('Location: index.php');
exit;
} // if

$config = new Config();
$state = new LggrState();
$l = new Lggr($state, $config);

switch($_REQUEST['a']) {

case 'latest':
$id = intval($_REQUEST['id']);
$aEvents = $l->getNewer($id);

header('Content-Type: application/json; charset=utf8');

echo json_encode($aEvents);

break;

default:
// ignore
break;
<?php
spl_autoload_register(function ($class) {
include 'inc/' . strtolower($class) . '_class.php';
});

session_start();

if (! isset($_REQUEST['a'])) {
header('Location: index.php');
exit();
} // if

$config = new Config();
$state = new LggrState();
$l = new Lggr($state, $config);

switch ($_REQUEST['a']) {

case 'latest':
$id = intval($_REQUEST['id']);
$aEvents = $l->getNewer($id);

header('Content-Type: application/json; charset=utf8');

echo json_encode($aEvents);

break;

default:
// ignore
break;
} // switch

0 comments on commit 0e30dac

Please sign in to comment.