24 $AllPossibleOpts =
"abc:defghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
28 $DatabaseName =
"fossology";
29 $UpdateLiceneseRef =
false;
33 $Options = getopt($AllPossibleOpts);
34 foreach($Options as $Option => $OptVal)
39 $sysconfdir = $OptVal;
42 echo
"Invalid Option \"$Option\".\n";
55 if ($rv ===
false) exit(1);
67 $usage =
"Usage: " . basename($argv[0]) .
" [options]
68 Update FOSSology database. Options are:
69 -c fossology system configuration directory
108 $rcfile =
"fossology.rc";
110 if (empty($sysconfdir))
112 $sysconfdir = getenv(
'SYSCONFDIR');
113 if ($sysconfdir ===
false)
115 if (file_exists($rcfile)) $sysconfdir = file_get_contents($rcfile);
116 if ($sysconfdir ===
false)
119 $text = _(
"FATAL! System Configuration Error, no SYSCONFDIR.");
126 $sysconfdir =
trim($sysconfdir);
127 $GLOBALS[
'SYSCONFDIR'] = $sysconfdir;
130 $ConfFile =
"{$sysconfdir}/fossology.conf";
131 if (!file_exists($ConfFile))
133 $text = _(
"FATAL! Missing configuration file: $ConfFile");
137 $SysConf = parse_ini_file($ConfFile,
true);
138 if ($SysConf ===
false)
140 $text = _(
"FATAL! Invalid configuration file: $ConfFile");
149 foreach($SysConf[
'DIRECTORIES'] as $var=>$assign)
154 $toeval =
"\$$var = \"$assign\";";
158 $SysConf[
'DIRECTORIES'][$var] = ${$var};
159 $GLOBALS[$var] = ${$var};
164 $text = _(
"FATAL! System initialization failure: MODDIR not defined in $SysConf");
171 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.
ConfigInit($sysconfdir, &$SysConf, $exitOnDbFail=true)
Initialize the fossology system after bootstrap().
bootstrap($sysconfdir="")
Bootstrap the fossology php library.
Usage()
Print Usage statement.
char * trim(char *ptext)
Trimming whitespace.
foreach($Options as $Option=> $OptVal) if(0==$reference_flag &&0==$nomos_flag) $PG_CONN