Merge branch 'origin'
[php-utility-classes.git] / testbed / rrd / rrd-test.php
CommitLineData
4a778b7e 1<?php
1759d73b 2date_default_timezone_set("Europe/Vienna");
4a778b7e 3$myfile = $_SERVER['SCRIPT_FILENAME'];
4while (is_link($myfile)) { $myfile = readlink($myfile); }
5if (getcwd() != dirname($myfile)) {
6 // change to directory of the script if called from different directory
7 $orig_workingdir = getcwd();
8 chdir(dirname($myfile));
9}
10
11include_once('rrdstat.php-class');
4d8d65db
RK
12
13$rrd_config_file = 'rrd-config/'.php_uname('n').'.inc.php';
14if (!file_exists($rrd_config_file)) { $rrd_config_file = 'rrd-config.inc.php'; }
15include_once($rrd_config_file);
4a778b7e 16
17if (php_sapi_name() == 'cli') {
18 // automated updates
19 $rrd = new rrdstat($rrd_info, 'video.temp');
20 $rrd->update();
21}
22else {
23 print('this is a commandline app.');
24}
25?>