FOSSology  4.4.0
Open Source License Compliance by Open Source Software
dbmigrate_3.7-3.8.php File Reference

Migrate DB from release 3.7.0 to 3.8.0. More...

Go to the source code of this file.

Functions

 calculateNumberOfRecordsToRecode ($dbManager)
 
 updateRecodedValues ($dbManager, $table, $rows)
 
 recodeContents (&$rows, $MODDIR)
 
 startRecodingTables ($dbManager, $MODDIR)
 
 getDbEncoding ($dbManager)
 
 updateDbEncoding ($dbManager)
 
 checkMigrate3738Required ($dbManager)
 
 recodeTables ($dbManager, $MODDIR, $force=false)
 
 Migrate_37_38 ($dbManager, $MODDIR)
 

Variables

const MAX_ROW_SIZE = 100
 
const ENCODE_TABLES
 

Detailed Description

Migrate DB from release 3.7.0 to 3.8.0.

Definition in file dbmigrate_3.7-3.8.php.

Function Documentation

◆ calculateNumberOfRecordsToRecode()

calculateNumberOfRecordsToRecode (   $dbManager)

Calculate the total number of records in concerned tables

Parameters
DbManager$dbManager

Definition at line 37 of file dbmigrate_3.7-3.8.php.

◆ checkMigrate3738Required()

checkMigrate3738Required (   $dbManager)

Check if migration is required.

Parameters
DbManager$dbManager
Returns
boolean True if migration is required, false otherwise

Definition at line 237 of file dbmigrate_3.7-3.8.php.

◆ getDbEncoding()

getDbEncoding (   $dbManager)

Get fossology DB's encoding

Parameters
DbManager$dbManager
Returns
string Encoding of current DB

Definition at line 207 of file dbmigrate_3.7-3.8.php.

◆ Migrate_37_38()

Migrate_37_38 (   $dbManager,
  $MODDIR 
)

Migration from FOSSology 3.7.0 to 3.8.0

Parameters
DbManager$dbManager

Definition at line 322 of file dbmigrate_3.7-3.8.php.

◆ recodeContents()

recodeContents ( $rows,
  $MODDIR 
)

Use the recoder tool to remove non UTF-8 characters from text

Parameters
[in,out]array$rowsRows with ID and content. Function will replace the content with recoded values and remove the rows which are unchanged.
string$MODDIRLocation of fossology mods
Exceptions

Definition at line 90 of file dbmigrate_3.7-3.8.php.

◆ recodeTables()

recodeTables (   $dbManager,
  $MODDIR,
  $force = false 
)

Start the recoding process

Parameters
DbManager$dbManager
string$MODDIRLocation of LIB
boolean$forceTrue to force the process
Returns
number Return code

Definition at line 268 of file dbmigrate_3.7-3.8.php.

◆ startRecodingTables()

startRecodingTables (   $dbManager,
  $MODDIR 
)

Fetch the data from tables and update the recoded values

Parameters
DbManager$dbManager

Definition at line 148 of file dbmigrate_3.7-3.8.php.

◆ updateDbEncoding()

updateDbEncoding (   $dbManager)

Check if the DB encoding is SQL_ASCII, change it to UTF-8

Parameters
DbManager$dbManager

Definition at line 220 of file dbmigrate_3.7-3.8.php.

◆ updateRecodedValues()

updateRecodedValues (   $dbManager,
  $table,
  $rows 
)

Update the recoded values back into DB

Parameters
DbManager$dbManager
string$tableTable to be updated
array$rowsRows with ID and recoded values
Returns
int Count of updated rows

Definition at line 58 of file dbmigrate_3.7-3.8.php.

Variable Documentation

◆ ENCODE_TABLES

array ENCODE_TABLES
Initial value:
= array(
"copyright",
"author",
"ecc",
"keyword"
)

Tables which needs to be recoded

Definition at line 26 of file dbmigrate_3.7-3.8.php.

◆ MAX_ROW_SIZE

integer MAX_ROW_SIZE = 100

Maximum rows to process at once

Definition at line 20 of file dbmigrate_3.7-3.8.php.