3 $cfgfile = __DIR__ . '/config.php';
4 if (!file_exists($cfgfile)) {
5 echo "Copy config.php.dist to config.php and adjust it\n";
10 if (!function_exists('rrd_lastupdate')) {
11 echo "rrd PHP extension is missing\n";
16 foreach ($names as $id => $name) {
17 $data[$id]['name'] = $name;
18 foreach (array('humidity', 'temperature') as $item) {
21 array('{item}', '{id}'),
27 throw new Exception(rrd_error());
30 $data[$id][$item] = reset($lu['data']);
34 foreach (glob(__DIR__ . '/templates/*.php') as $tplfile) {
35 $outfile = $outdir . basename($tplfile, '.php');
38 $content = ob_get_contents();
40 file_put_contents($outfile, $content);