Detailed Description

DBUtil provides database helper functions.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 27 of file DBUtil.php.

Static Public Member Functions

static executeScript ($file, $initSection)
 
static copyDatabase ($srcName, $destName, $server, $user, $password)
 
static createDatabase ($name, $server, $user, $password)
 

Member Function Documentation

◆ executeScript()

static executeScript (   $file,
  $initSection 
)
static

Execute a sql script.

Execution is done inside a transaction, which is rolled back in case of failure.

Parameters
$fileThe filename of the sql script
$initSectionThe name of the configuration section that defines the database connection
Returns
Boolean whether execution succeeded or not.

Definition at line 88 of file DBUtil.php.

◆ copyDatabase()

static copyDatabase (   $srcName,
  $destName,
  $server,
  $user,
  $password 
)
static

Duplicate a database on the same server (same user).

This works only for MySQL databases.

Parameters
$srcNameThe name of the source database
$destNameThe name of the source database
$serverThe name of the database server
$userThe user name
$passwordThe password

Definition at line 146 of file DBUtil.php.

◆ createDatabase()

static createDatabase (   $name,
  $server,
  $user,
  $password 
)
static

Crate a database on the server.

This works only for MySQL databases.

Parameters
$nameThe name of the source database
$serverThe name of the database server
$userThe user name
$passwordThe password

Definition at line 194 of file DBUtil.php.