24 if (!empty($MODDIR)) {
30 print
"ERROR: Unable to determine working directory and \$MODDIR is not set.\n";
36 require_once(
"$dir/lib/php/libschema.php");
38 $AllPossibleOpts =
"abc:d:ef:ghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
42 $DatabaseName =
"fossology";
43 $UpdateLiceneseRef =
false;
47 $SchemaFilePath =
"$dir/www/ui/core-schema.dat";
50 $Options = getopt($AllPossibleOpts);
51 foreach ($Options as $Option => $OptVal) {
56 $DatabaseName = $OptVal;
59 $SchemaFilePath = $OptVal;
65 echo
"Invalid Option \"$Option\".\n";
73 $usage =
"Usage: " . basename($argv[0]) .
" [options]
74 Update FOSSology database. Options are:
75 -d {database name} default is 'fossology'
80 if (file_exists($SchemaFilePath) && !@unlink($SchemaFilePath)) {
81 $FailMsg =
"Existing schema data file ($SchemaFilePath) could not be removed.";
86 if ($FailMsg !==
false) {
87 print
"ERROR: $FailMsg \n";
ExportSchema($filename=NULL)
Export the schema of the connected database to a file in the format readable by GetSchema().