FOSSology  4.4.0
Open Source License Compliance by Open Source Software
fo_dbcheck.php File Reference

Check that you can connect to the db. More...

Go to the source code of this file.

Functions

 Usage ()
 Print Usage statement. More...
 
 bootstrap ($sysconfdir="")
 Bootstrap the fossology php library. More...
 

Variables

 $SysConf = array()
 
 $PG_CONN = 0
 
 $Plugins = array()
 
 $AllPossibleOpts = "abc:defghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
 
 $Verbose = false
 
 $DatabaseName = "fossology"
 
 $UpdateLiceneseRef = false
 
 $sysconfdir = ''
 
 $Options = getopt($AllPossibleOpts)
 
 $rv = DBconnect($sysconfdir, "", false)
 

Detailed Description

Check that you can connect to the db.

@exit 0 for success, 1 for failure.

Definition in file fo_dbcheck.php.

Function Documentation

◆ bootstrap()

bootstrap (   $sysconfdir = "")

Bootstrap the fossology php library.

Included here so that fossinit can run from any directory

  • Determine SYSCONFDIR
  • parse fossology.conf
  • source template (require_once template-plugin.php)
  • source common files (require_once common.php)

The following precedence is used to resolve SYSCONFDIR:

  • $SYSCONFDIR path passed in ($sysconfdir)
  • environment variable SYSCONFDIR
  • ./fossology.rc

Any errors are fatal. A text message will be printed followed by an exit(1)

Parameters
$sysconfdirTypically from the caller's -c command line parameter
Returns
the $SysConf array of values. The first array dimension is the group, the second is the variable name. For example:
  • $SysConf[DIRECTORIES][MODDIR] => "/mymoduledir/

The global $SYSCONFDIR is also set for backward compatibility.

\Note Since so many files expect directory paths that used to be in pathinclude.php to be global, this function will define the same globals (everything in the DIRECTORIES section of fossology.conf).

Definition at line 106 of file fo_dbcheck.php.

◆ Usage()

Usage ( )

Print Usage statement.

Returns
No return, this calls exit.

Definition at line 63 of file fo_dbcheck.php.