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

prepare a system for install testing. More...

Go to the source code of this file.

Classes

class  ConfigSys
 

Functions

 insertDeb ($objRef)
 insert the fossology debian line in /etc/apt/sources.list More...
 
 installFossology ($objRef)
 Install fossology using either apt or yum. More...
 
 ckInstallLog ($log)
 Check the fossology install output for errors in the install. More...
 
 copyFiles ($files, $dest)
 copyFiles, copy one or more files to the destination, throws exception if file is not copied. More...
 
 findVerPsql ()
 find the version of postgres and return major release and sub release. For example, if postgres is at 8.4.8, this function will return 8.4. More...
 
 tuneKernel ()
 tune the kernel for this boot and successive boots More...
 
 configApache2 ($osType)
 check to see if fossology is configured into apache. If not copy the config file and configure it. Restart apache if configured. More...
 
 configDebian ($osType, $osVersion)
 config a debian based system to install fossology. More...
 
 configRhel ($osType, $osVersion)
 copy configuration files and restart apache and postgres More...
 
 configYum ($objRef)
 config yum on a redhat based system to install fossology. More...
 
 restart ($application)
 restart the application passed in, so any config changes will take affect. Assumes application is restartable via /etc/init.d/<script>. The application passed in should match the script name in /etc/init.d More...
 
 start ($application)
 start the application Assumes application is restartable via /etc/init.d/<script>. The application passed in should match the script name in /etc/init.d More...
 
 stop ($application)
 stop the application Assumes application is restartable via /etc/init.d/<script>. The application passed in should match the script name in /etc/init.d More...
 
 getPGhba ($destPath)
 wget the pg_hba.conf file and place it in $destPath More...
 

Variables

global $Debian
 
global $RedHat
 
 $debian = NULL
 
 $redHat = NULL
 
 $fedora = NULL
 
 $ubuntu = NULL
 
 $euid = posix_getuid()
 
if($euid !=0) $distros = array()
 
 $f = exec('cat /etc/issue', $dist, $dRtn)
 
 $testUtils = new TestRun()
 

Detailed Description

prepare a system for install testing.

pkgConfig prepares a system for the installation of fossology packages and installs the fossology packages.

Parameters
string$fossVersionthe version of fossology to install?
Todo:
what should the api for this really be?
Version
"$Id $" Created on Jul 19, 2011 by Mark Donohoe Updated on Nov 15, 2012 by Vincent Ma

pkgConfig prepares a system for the installation of fossology packages and installs the fossology packages.

Parameters
string$fossVersionthe version of fossology to install?
Todo:
what should the api for this really be?
Version
"$Id $" Created on Jul 19, 2011 by Mark Donohoe Updated on Nov 15, 2012 by Vincent Ma

pkgConfig prepares a system for the installation of fossology packages and installs the fossology packages.

Parameters
string$fossVersionthe version of fossology to install?
Todo:
what should the api for this really be?
Version
"$Id $" Created on Jul 19, 2011 by Mark Donohoe Updated on Nov 15, 2012 by Vincent Ma

Definition in file pkgConfig.php.

Function Documentation

◆ ckInstallLog()

ckInstallLog (   $log)

Check the fossology install output for errors in the install.

These errors do not cause apt to think that the install failed, so the output should be checked for typical failures during an install of packages. See the code for the specific checks.

Parameters
string$logthe output from a fossology install with packages

Definition at line 630 of file pkgConfig.php.

◆ configApache2()

configApache2 (   $osType)

check to see if fossology is configured into apache. If not copy the config file and configure it. Restart apache if configured.

Parameters
string$osTypetype of the os, e.g. Debian, Ubuntu, Red, Fedora
Returns
boolean

Definition at line 802 of file pkgConfig.php.

◆ configDebian()

configDebian (   $osType,
  $osVersion 
)

config a debian based system to install fossology.

copy postgres, php config files so that fossology can run.

Parameters
string$osTypeeither Debian or Ubuntu
string$osVersionthe particular version to install
Returns
boolean

Definition at line 867 of file pkgConfig.php.

◆ configRhel()

configRhel (   $osType,
  $osVersion 
)

copy configuration files and restart apache and postgres

Parameters
string$osType
string$osVersion
Returns
boolean

Definition at line 1041 of file pkgConfig.php.

◆ configYum()

configYum (   $objRef)

config yum on a redhat based system to install fossology.

Copies the Yum configuration file for fossology to

Parameters
object$objRef,areference to the ConfigSys object
Returns
boolean

Definition at line 1097 of file pkgConfig.php.

◆ copyFiles()

copyFiles (   $files,
  $dest 
)

copyFiles, copy one or more files to the destination, throws exception if file is not copied.

The method can be used to rename a single file, but not a directory. It cannot rename multiple files.

Parameters
mixed$filesthe files to copy (string), use an array for multiple files.
string$destthe destination path (must exist, must be writable).

@retrun boolean

Definition at line 673 of file pkgConfig.php.

◆ findVerPsql()

findVerPsql ( )

find the version of postgres and return major release and sub release. For example, if postgres is at 8.4.8, this function will return 8.4.

Returns
boolean

Definition at line 742 of file pkgConfig.php.

◆ getPGhba()

getPGhba (   $destPath)

wget the pg_hba.conf file and place it in $destPath

Parameters
string$destPaththe full path to the destination
Returns
boolean, TRUE on success, FALSE otherwise.

Definition at line 1272 of file pkgConfig.php.

◆ insertDeb()

insertDeb (   $objRef)

insert the fossology debian line in /etc/apt/sources.list

Parameters
object$objRefthe object with the deb attribute
Returns
boolean

Definition at line 487 of file pkgConfig.php.

◆ installFossology()

installFossology (   $objRef)

Install fossology using either apt or yum.

installFossology assumes that the correct configuration for yum and the correct fossology version has been configured into the system.

Parameters
object$objRefan object reference (should be to ConfigSys)
Returns
boolean

Definition at line 529 of file pkgConfig.php.

◆ restart()

restart (   $application)

restart the application passed in, so any config changes will take affect. Assumes application is restartable via /etc/init.d/<script>. The application passed in should match the script name in /etc/init.d

Parameters
string$applicationthe application to restart. The application passed in should match the script name in /etc/init.d
Returns
boolen

Definition at line 1187 of file pkgConfig.php.

◆ start()

start (   $application)

start the application Assumes application is restartable via /etc/init.d/<script>. The application passed in should match the script name in /etc/init.d

Parameters
string$applicationthe application to start. The application passed in should match the script name in /etc/init.d
Returns
boolen

Definition at line 1214 of file pkgConfig.php.

◆ stop()

stop (   $application)

stop the application Assumes application is restartable via /etc/init.d/<script>. The application passed in should match the script name in /etc/init.d

Parameters
string$applicationthe application to stop. The application passed in should match the script name in /etc/init.d
Returns
boolen

Definition at line 1248 of file pkgConfig.php.

◆ tuneKernel()

tuneKernel ( )

tune the kernel for this boot and successive boots

returns void

Definition at line 765 of file pkgConfig.php.