36 $AllPossibleOpts =
"abc:defghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
40 $DatabaseName =
"fossology";
41 $UpdateLiceneseRef =
false;
45 $Options = getopt($AllPossibleOpts);
46 foreach($Options as $Option => $OptVal)
51 $sysconfdir = $OptVal;
54 echo
"Invalid Option \"$Option\".\n";
67 if ($rv ===
false) exit(1);
79 $usage =
"Usage: " . basename($argv[0]) .
" [options] 80 Update FOSSology database. Options are: 81 -c fossology system configuration directory 120 $rcfile =
"fossology.rc";
122 if (empty($sysconfdir))
124 $sysconfdir = getenv(
'SYSCONFDIR');
125 if ($sysconfdir ===
false)
127 if (file_exists($rcfile)) $sysconfdir = file_get_contents($rcfile);
128 if ($sysconfdir ===
false)
131 $text = _(
"FATAL! System Configuration Error, no SYSCONFDIR.");
138 $sysconfdir =
trim($sysconfdir);
139 $GLOBALS[
'SYSCONFDIR'] = $sysconfdir;
142 $ConfFile =
"{$sysconfdir}/fossology.conf";
143 if (!file_exists($ConfFile))
145 $text = _(
"FATAL! Missing configuration file: $ConfFile");
149 $SysConf = parse_ini_file($ConfFile,
true);
150 if ($SysConf ===
false)
152 $text = _(
"FATAL! Invalid configuration file: $ConfFile");
161 foreach($SysConf[
'DIRECTORIES'] as $var=>$assign)
166 $toeval =
"\$$var = \"$assign\";";
170 $SysConf[
'DIRECTORIES'][$var] = ${$var};
171 $GLOBALS[$var] = ${$var};
176 $text = _(
"FATAL! System initialization failure: MODDIR not defined in $SysConf");
183 require_once(
"$MODDIR/lib/php/common.php");
DBconnect($sysconfdir, $options="", $exitOnFail=true)
Connect to database engine. This is a no-op if $PG_CONN already has a value.
bootstrap($sysconfdir="")
Bootstrap the fossology php library.
Usage()
Print Usage statement.
foreach($Options as $Option=> $OptVal) if(0==$reference_flag &&0==$nomos_flag) $PG_CONN
ConfigInit($sysconfdir, &$SysConf)
Initialize the fossology system after bootstrap().
char * trim(char *ptext)
Trimming whitespace.