34 $DatabaseName =
"fossology";
35 $UpdateLiceneseRef =
false;
36 $sysconfdir =
'/usr/local/etc/fossology';
40 $projectGroup = $SysConf[
'DIRECTORIES'][
'PROJECTGROUP'] ?:
'fossy';
41 $gInfo = posix_getgrnam($projectGroup);
42 posix_setgid($gInfo[
'gid']);
44 if (!preg_match(
"/\s$projectGroup\s/",$groups) && (posix_getgid() != $gInfo[
'gid']))
46 print
"FATAL: You must be in group '$projectGroup' to update the FOSSology database.\n";
51 require_once(
"$MODDIR/lib/php/common.php");
56 require_once(
"./dbmigrate_2.1-2.2.php");
57 print
"Migrate data from 2.1 to 2.2 \n";
95 $rcfile =
"fossology.rc";
97 if (empty($sysconfdir))
99 $sysconfdir = getenv(
'SYSCONFDIR');
100 if ($sysconfdir ===
false)
102 if (file_exists($rcfile)) $sysconfdir = file_get_contents($rcfile);
103 if ($sysconfdir ===
false)
106 $text = _(
"FATAL! System Configuration Error, no SYSCONFDIR.");
113 $sysconfdir =
trim($sysconfdir);
114 $GLOBALS[
'SYSCONFDIR'] = $sysconfdir;
117 $ConfFile =
"{$sysconfdir}/fossology.conf";
118 if (!file_exists($ConfFile))
120 $text = _(
"FATAL! Missing configuration file: $ConfFile");
124 $SysConf = parse_ini_file($ConfFile,
true);
125 if ($SysConf ===
false)
127 $text = _(
"FATAL! Invalid configuration file: $ConfFile");
136 foreach($SysConf[
'DIRECTORIES'] as $var=>$assign)
141 $toeval =
"\$$var = \"$assign\";";
145 $SysConf[
'DIRECTORIES'][$var] = ${$var};
146 $GLOBALS[$var] = ${$var};
151 $text = _(
"FATAL! System initialization failure: MODDIR not defined in $SysConf");
157 require_once(
"$MODDIR/www/ui/template/template-plugin.php");
158 require_once(
"$MODDIR/lib/php/common.php");
Migrate_21_22($Verbose)
Create new groups, group_user_member, perm_upload and perm_folder records to support 2...
foreach($Options as $Option=> $OptVal) if(0==$reference_flag &&0==$nomos_flag) $PG_CONN
bootstrap($sysconfdir="")
Bootstrap the fossology php library.
ConfigInit($sysconfdir, &$SysConf)
Initialize the fossology system after bootstrap().
char * trim(char *ptext)
Trimming whitespace.