FOSSology  4.4.0
Open Source License Compliance by Open Source Software
fossinit-common.php File Reference

Common functions required by init scripts. More...

Go to the source code of this file.

Functions

 guessSysconfdir ()
 
 bootstrap ($sysconfdir="")
 Determine SYSCONFDIR, parse fossology.conf. More...
 
 readlineTimeout ($seconds, $default)
 Using bash's read command, read input from STDIN. More...
 

Detailed Description

Common functions required by init scripts.

Definition in file fossinit-common.php.

Function Documentation

◆ bootstrap()

bootstrap (   $sysconfdir = "")

Determine SYSCONFDIR, parse fossology.conf.

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 58 of file fossinit-common.php.

◆ readlineTimeout()

readlineTimeout (   $seconds,
  $default 
)

Using bash's read command, read input from STDIN.

This function runs a new bash shell and execute read command on it with a timeout set.

Parameters
integer$secondsTimeout in seconds
string$defaultDefault value to return (in case of timeout)
Returns
string The input read from STDIN or default value.

Definition at line 121 of file fossinit-common.php.