Detailed Description

DBUtil provides database helper functions.

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

Definition at line 26 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

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 71 of file DBUtil.php.

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 129 of file DBUtil.php.

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 177 of file DBUtil.php.