AnewtDatabase class

Static database connectivity support.

Class Overview

Static database connectivity support.

Use this class to setup database connections and to obtain AnewtDatabaseConnection instances.

Public Static Methods

static setup_connection($settings, $id='default') [static]

Setup a new database connection.

This stores the connection configuration in the database pool. See the AnewtDatabaseConnection (and subclasses) documentation for the description of the settings array.

Parameters

$settings

An associative array with connection settings. At least the type key must be provided to specify the database connection type. See AnewtDatabaseConnection for the possible values.

$id

The connection id to use for this connection (optional, defaults to default)

See also

static get_connection($id='default') [static]

Get an already existing AnewtDatabaseConnection.

Parameters

$id

The connection id (optional, defaults to default)

Return value

An AnewtDatabaseConnection instance.