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

Test migration function. More...

Go to the source code of this file.

Functions

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

Variables

 $PG_CONN = 0
 
 $Plugins = array()
 
 $Verbose = false
 
 $DatabaseName = "fossology"
 
 $UpdateLiceneseRef = false
 
 $sysconfdir = '/usr/local/etc/fossology'
 
 $SysConf = bootstrap($sysconfdir)
 
 $projectGroup = $SysConf['DIRECTORIES']['PROJECTGROUP'] ?: 'fossy'
 
 $gInfo = posix_getgrnam($projectGroup)
 
 $groups = `groups`
 
 if (!preg_match("/\s$projectGroup\s/", $groups) &&(posix_getgid() !=$gInfo[ 'gid']))
 get monk license list of one specified uploadtree_id More...
 
print Migrate data from to n
 

Detailed Description

Test migration function.

Returns
int 0 for success, 1 for failure.

Definition in file migratetest.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
string$sysconfdirTypically from the caller's -c command line parameter
Returns
mixed 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 82 of file migratetest.php.

Variable Documentation

◆ if

if ( file_exists"/\s$projectGroup\s/", $groups) &&(posix_getgid() !=$gInfo[ 'gid'])
Initial value:
{
require_once ("$LIBEXECDIR/dbmigrate_3.5-3.6.php")

get monk license list of one specified uploadtree_id

get nomos license list of one specified uploadtree_id

get ninka license list of one specified uploadtree_id

delete from copyright where pfile_fk not in (select pfile_pk from pfile) add foreign constraint on copyright pfile_fk if not exist comment out for 2.5.0 require_once("$LIBEXECDIR/dbmigrate_2.0-2.5-pre.php"); Migrate_20_25($Verbose);

Parameters
int$uploadtree_pk- uploadtree id
int$upload_pk- upload id
int$showContainer- include container or not, 1: yes, 0: no
string$excluding
bool$ignoreignore files without license

Definition at line 33 of file migratetest.php.