moved database-informations to config.php, added sample config

highcharts
agp8x 2014-08-26 14:50:45 +02:00
parent f7774cfc38
commit 98f0a3c717
3 changed files with 12 additions and 1 deletions

9
config.default.php Normal file
View File

@ -0,0 +1,9 @@
<?php
$database = array(
'host' => "localhost",
'user' => "temp",
'password' => "temppw",
'database' => "temp",
);

View File

@ -11,13 +11,13 @@ function generateChart($today,$mode,$hours=0,$dateInput){
global $day;
global $month;
global $year;
global $db;
$diffuse=0; # 10min -+ start/end time
$types=array('ambi1','ambi2','humi1','temp1','temp2','baro1');
$dummy=array(array(),array());
$db=new DBLib('localhost','temp','temppw','temp');
$stats="";
$selectionStart=$selectionEnd=0;
$chartname="";

View File

@ -3,6 +3,7 @@
header("Cache-Control: no-cache, must-revalidate");
$start=microtime(true);
date_default_timezone_set("Europe/Berlin");
include('config.php');
include('lib/DBLib.php');
include('draw.php');
include('function.php');
@ -86,6 +87,7 @@ if($mode==1){
if(!$error===false){
$html.=$error;
}else{
$db=new DBLib($database['host'],$database['user'],$database['password'],$database['database']);
$html.=generateChart($today,$mode,$num,$date);
}
$runtime=microtime(true)-$start;