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

Functions to bring database schema to a known state. More...

Go to the source code of this file.

Classes

class  fo_libschema
 Class to handle database schema. More...
 

Functions

 ApplySchema ($Filename=NULL, $Debug=false, $Catalog='fossology')
 Make schema match $Filename. This is a single transaction. More...
 
 GetSchema ()
 Load the schema from the db into an array.
 
 ExportSchema ($filename=NULL)
 Export the schema of the connected ($PG_CONN) database to a file in the format readable by GetSchema(). More...
 
 MakeFunctions ($Debug)
 Create any required DB functions.
 

Variables

if(empty($dbManager)||!($dbManager instanceof DbManager)) $libschema = new fo_libschema($dbManager)
 

Detailed Description

Functions to bring database schema to a known state.

Definition in file libschema.php.

Function Documentation

◆ ApplySchema()

ApplySchema (   $Filename = NULL,
  $Debug = false,
  $Catalog = 'fossology' 
)

Make schema match $Filename. This is a single transaction.

Parameters
string$FilenameSchema file written by schema-export.php
bool$DebugTurn on debugging (echo sql as it is being executed)
string$CatalogOptional database name
Returns
false=success, on error return string with error message.

Definition at line 1101 of file libschema.php.

◆ ExportSchema()

ExportSchema (   $filename = NULL)

Export the schema of the connected ($PG_CONN) database to a file in the format readable by GetSchema().

Parameters
string$filenamepath to the file to store the schema in.
Returns
false=success, on error return string with error message.

Definition at line 1122 of file libschema.php.