Fix coding style part 2

This commit is contained in:
Job Snijders
2015-07-14 17:41:54 +02:00
parent ad9590df9b
commit 361653aa81
731 changed files with 37529 additions and 33991 deletions
+34 -39
View File
@@ -4,38 +4,35 @@
// need to get some infrastructure going and make it available on an opt-in
// basis (i.e. disabled by default). We should schedule it from cron rather
// than putting it into the discovery process.
// See https://github.com/librenms/librenms/issues/25 for some thoughts on where to go with this code under git.
/*
// Generate some statistics to send along with the version request.
// Generate some statistics to send along with the version request.
$stats['ports'] = dbFetchCell("SELECT count(*) FROM ports");
$stats['devices'] = dbFetchCell("SELECT count(*) FROM devices");
$stats['sensors'] = dbFetchCell("SELECT count(*) FROM sensors");
$stats['services'] = dbFetchCell("SELECT count(*) FROM services");
$stats['applications'] = dbFetchCell("SELECT count(*) FROM applications");
$stats['bgp'] = dbFetchCell("SELECT count(*) FROM bgpPeers");
$stats['ports'] = dbFetchCell("SELECT count(*) FROM ports");
$stats['devices'] = dbFetchCell("SELECT count(*) FROM devices");
$stats['sensors'] = dbFetchCell("SELECT count(*) FROM sensors");
$stats['services'] = dbFetchCell("SELECT count(*) FROM services");
$stats['applications'] = dbFetchCell("SELECT count(*) FROM applications");
$stats['bgp'] = dbFetchCell("SELECT count(*) FROM bgpPeers");
foreach (dbFetch("SELECT COUNT(*) AS count,os from devices group by `os`") as $dt_data)
{
$stats['devicetypes'][$dt_data['os']] = $dt_data['count'];
}
foreach (dbFetch("SELECT COUNT(*) AS count,os from devices group by `os`") as $dt_data)
{
$stats['devicetypes'][$dt_data['os']] = $dt_data['count'];
}
$stat_serial = base64_encode(serialize($stats));
$stat_serial = base64_encode(serialize($stats));
#$url = "http://www.observium.org/latest.php?i=".$stats['ports']."&d=".$stats['devices']."&stats=".$stat_serial."&v=".$config['version'];
#$dataHandle = fopen($url, r);
#$url = "http://www.observium.org/latest.php?i=".$stats['ports']."&d=".$stats['devices']."&stats=".$stat_serial."&v=".$config['version'];
#$dataHandle = fopen($url, r);
if ($dataHandle)
{
while (!feof($dataHandle))
{
if ($dataHandle)
{
while (!feof($dataHandle))
{
$data.= fread($dataHandle, 4096);
}
if ($data)
{
}
if ($data)
{
list($omnipotence, $year, $month, $revision) = explode(".", $data);
list($cur, $tag) = explode("-", $config['version']);
list($cur_omnipotence, $cur_year, $cur_month, $cur_revision) = explode(".", $cur);
@@ -57,22 +54,20 @@ if ($dataHandle)
echo("New Revision : $omnipotence\n");
}
# if ($omnipotence > $cur_omnipotence)
# {
# echo("New version : $omnipotence.$year.$month.$revision\n");
# } elseif ($year > $cur_year) {
# echo("New version : $omnipotence.$year.$month.$revision\n");
# } elseif ($month > $cur_month) {
# echo("New version : $omnipotence.$year.$month.$revision\n");
# } elseif ($revision > $cur_revision) {
# echo("New release : $omnipotence.$year.$month.$revision\n");
# }
# if ($omnipotence > $cur_omnipotence)
# {
# echo("New version : $omnipotence.$year.$month.$revision\n");
# } elseif ($year > $cur_year) {
# echo("New version : $omnipotence.$year.$month.$revision\n");
# } elseif ($month > $cur_month) {
# echo("New version : $omnipotence.$year.$month.$revision\n");
# } elseif ($revision > $cur_revision) {
# echo("New release : $omnipotence.$year.$month.$revision\n");
# }
}
}
}
}
fclose($dataHandle);
}
fclose($dataHandle);
}
*/
?>