Files
librenms-librenms/html/graph.php
Tony Murray 61c89794e4 Remove debug globals (#12811)
* Remove $debug global
and $vdebug global
makes these variables more accessible and protects from collisions.

* the on boot set sends application as the first parameter, just handle that

* Relocate other debug related functions

* Log debug to stdout

* Wrong output

* remove stupid constants

* Fix lint and style issues
2021-04-29 22:42:18 -05:00

38 lines
785 B
PHP

<?php
/**
* LibreNMS
*
* This file is part of LibreNMS.
*
* @copyright (C) 2006 - 2012 Adam Armstrong
*/
use LibreNMS\Data\Store\Datastore;
use LibreNMS\Util\Debug;
$start = microtime(true);
$init_modules = ['web', 'graphs', 'auth'];
require realpath(__DIR__ . '/..') . '/includes/init.php';
if (! Auth::check()) {
// check for unauthenticated graphs and set auth
$auth = is_client_authorized($_SERVER['REMOTE_ADDR']);
if (! $auth) {
exit('Unauthorized');
}
}
Debug::set(isset($_GET['debug']));
require \LibreNMS\Config::get('install_dir') . '/includes/html/graphs/graph.inc.php';
Datastore::terminate();
if (Debug::isEnabled()) {
echo '<br />';
printf('Runtime %.3fs', microtime(true) - $start);
echo '<br />';
printStats();
}