FOSSology  4.7.1
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

if(!function_exists('resolve_config_value')) 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 76 of file fossinit-common.php.

◆ guessSysconfdir()

if (!function_exists( 'resolve_config_value')) guessSysconfdir ( )

Resolve simple $VAR and ${VAR} placeholders against already-known values.

Parameters
string$valueThe raw config value.
array$scopePreviously resolved values.
Returns
string

Definition at line 33 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 141 of file fossinit-common.php.