From 6d1f9cc869d62f17230b3174f320bad4f2d1c435 Mon Sep 17 00:00:00 2001 From: onefang Date: Sat, 4 Jan 2020 17:28:24 +1000 Subject: Work with CGI PHP. --- conf/common.inc.php | 3 --- conf/config.php | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'conf') diff --git a/conf/common.inc.php b/conf/common.inc.php index 506134d..07a7475 100644 --- a/conf/common.inc.php +++ b/conf/common.inc.php @@ -2,9 +2,6 @@ require_once 'config.php'; -$CONFIG['webdir'] = preg_replace('/\/[a-z\.]+$/', '', $_SERVER['SCRIPT_FILENAME']); -$CONFIG['weburl'] = preg_replace('/(?<=\/)[a-z\.]+$/', '', $_SERVER['SCRIPT_NAME']); - if (!ini_get('date.timezone')) { date_default_timezone_set($CONFIG['default_timezone']); } diff --git a/conf/config.php b/conf/config.php index eae3307..23a3a90 100644 --- a/conf/config.php +++ b/conf/config.php @@ -3,6 +3,10 @@ # collectd version $CONFIG['version'] = 5; +# Do this here, so it can be overriden, usually in case part of the path is a script for wrapping PHP. +$CONFIG['webdir'] = preg_replace('/\/[a-z\.]+$/', '', $_SERVER['SCRIPT_FILENAME']); +$CONFIG['weburl'] = preg_replace('/(?<=\/)[a-z\.]+$/', '', $_SERVER['SCRIPT_NAME']); + # collectd's datadir $CONFIG['datadir'] = '../apt-panopticon/rrd'; -- cgit v1.1