37 if(!defined(
'TESTROOT'))
40 $plenth = strlen($path);
42 $TESTROOT = substr($path, 0, $plenth-6);
43 $_ENV[
'TESTROOT'] = $TESTROOT;
44 putenv(
"TESTROOT=$TESTROOT");
45 define(
'TESTROOT',$TESTROOT);
48 $sysconf = getenv(
'SYSCONFDIR');
49 if($sysconf === FALSE)
51 if(file_exists(
'/usr/local/etc/fossology'))
53 $sysconf =
'/usr/local/etc/fossology';
55 else if(file_exists(
'/etc/fossology'))
57 $sysconf =
'/etc/fossology';
60 if($sysconf === FALSE || $sysconf == NULL)
62 echo
"FATAL! cannot determine where the fossology sysconfigdir is located\n";
65 $RC = fopen(
"fossology.rc",
'w');
68 echo
"FATAL! could not open fossology.rc for writting\n";
71 $many = fwrite($RC, $sysconf);
75 echo
"DBCRC: sysconf is:$sysconf\n";
76 echo
"DBCRC: exporting sysconf to env and globals.\n";
77 $GLOBALS[
'SYSCONFDIR'] = $sysconf;
78 putenv(
"SYSCONFDIR={$GLOBALS['SYSCONFDIR']}");
79 $_ENV[
'SYSCONFDIR'] = $GLOBALS[
'SYSCONFDIR'];