23 $DatabaseName =
"fossology";
24 $UpdateLiceneseRef =
false;
25 $sysconfdir =
'/usr/local/etc/fossology';
29 $projectGroup = $SysConf[
'DIRECTORIES'][
'PROJECTGROUP'] ?:
'fossy';
30 $gInfo = posix_getgrnam($projectGroup);
31 posix_setgid($gInfo[
'gid']);
33 if (!preg_match(
"/\s$projectGroup\s/",$groups) && (posix_getgid() != $gInfo[
'gid']))
35 print
"FATAL: You must be in group '$projectGroup' to update the FOSSology database.\n";
40 require_once(
"$MODDIR/lib/php/common.php");
45 require_once(
"./dbmigrate_2.1-2.2.php");
46 print
"Migrate data from 2.1 to 2.2 \n";
84 $rcfile =
"fossology.rc";
86 if (empty($sysconfdir))
88 $sysconfdir = getenv(
'SYSCONFDIR');
89 if ($sysconfdir ===
false)
91 if (file_exists($rcfile)) $sysconfdir = file_get_contents($rcfile);
92 if ($sysconfdir ===
false)
95 $text = _(
"FATAL! System Configuration Error, no SYSCONFDIR.");
102 $sysconfdir =
trim($sysconfdir);
103 $GLOBALS[
'SYSCONFDIR'] = $sysconfdir;
106 $ConfFile =
"{$sysconfdir}/fossology.conf";
107 if (!file_exists($ConfFile))
109 $text = _(
"FATAL! Missing configuration file: $ConfFile");
113 $SysConf = parse_ini_file($ConfFile,
true);
114 if ($SysConf ===
false)
116 $text = _(
"FATAL! Invalid configuration file: $ConfFile");
125 foreach($SysConf[
'DIRECTORIES'] as $var=>$assign)
130 $toeval =
"\$$var = \"$assign\";";
134 $SysConf[
'DIRECTORIES'][$var] = ${$var};
135 $GLOBALS[$var] = ${$var};
140 $text = _(
"FATAL! System initialization failure: MODDIR not defined in $SysConf");
146 require_once(
"$MODDIR/www/ui/template/template-plugin.php");
147 require_once(
"$MODDIR/lib/php/common.php");
ConfigInit($sysconfdir, &$SysConf, $exitOnDbFail=true)
Initialize the fossology system after bootstrap().
Migrate_21_22($Verbose)
Create new groups, group_user_member, perm_upload and perm_folder records to support 2....
char * trim(char *ptext)
Trimming whitespace.
foreach($Options as $Option=> $OptVal) if(0==$reference_flag &&0==$nomos_flag) $PG_CONN
bootstrap($sysconfdir="")
Bootstrap the fossology php library.