Elgg  Version 3.0
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Elgg\Database\DbConfig Class Reference

WARNING: API IN FLUX. More...

Public Member Functions

 __construct (\stdClass $config)
 Constructor. More...
 
 getTablePrefix ()
 Get the database table prefix. More...
 
 isDatabaseSplit ()
 Are the read and write connections separate? More...
 
 getConnectionConfig ($type=self::READ_WRITE)
 Get the connection configuration. More...
 

Static Public Member Functions

static fromElggConfig (Config $config)
 Construct from an Elgg Config. More...
 

Public Attributes

const READ = 'read'
 
const WRITE = 'write'
 
const READ_WRITE = 'readwrite'
 

Protected Member Functions

 getGeneralConnectionConfig ()
 Get the read/write database connection information. More...
 
 getParticularConnectionConfig ($type)
 Get connection information for reading or writing. More...
 

Protected Attributes

 $db
 
 $dbprefix
 
 $dbhost
 
 $dbuser
 
 $dbpass
 
 $dbname
 
 $dbencoding
 

Detailed Description

WARNING: API IN FLUX.

DO NOT USE DIRECTLY.

Definition at line 13 of file DbConfig.php.

Constructor & Destructor Documentation

Elgg\Database\DbConfig::__construct ( \stdClass  $config)

Constructor.

Parameters
\stdClass$configObject with keys: db dbprefix dbhost dbuser dbpass dbname dbencoding

Definition at line 39 of file DbConfig.php.

Member Function Documentation

static Elgg\Database\DbConfig::fromElggConfig ( Config  $config)
static

Construct from an Elgg Config.

Parameters
Config$configElgg config
Returns
DbConfig

Definition at line 52 of file DbConfig.php.

Elgg\Database\DbConfig::getConnectionConfig (   $type = self::READ_WRITE)

Get the connection configuration.

Note
You must check isDatabaseSplit before using READ or WRITE for $type

The parameters are in an array like this: array( 'host' => 'xxx', 'user' => 'xxx', 'password' => 'xxx', 'database' => 'xxx', 'encoding' => 'xxx', 'prefix' => 'xxx', )

Parameters
string$typeThe connection type: READ, WRITE, READ_WRITE
Returns
array

Definition at line 105 of file DbConfig.php.

Elgg\Database\DbConfig::getGeneralConnectionConfig ( )
protected

Get the read/write database connection information.

Returns
array

Definition at line 127 of file DbConfig.php.

Elgg\Database\DbConfig::getParticularConnectionConfig (   $type)
protected

Get connection information for reading or writing.

Parameters
string$typeConnection type: 'write' or 'read'
Returns
array

Definition at line 142 of file DbConfig.php.

Elgg\Database\DbConfig::getTablePrefix ( )

Get the database table prefix.

Returns
string

Definition at line 65 of file DbConfig.php.

Elgg\Database\DbConfig::isDatabaseSplit ( )

Are the read and write connections separate?

Returns
bool

Definition at line 74 of file DbConfig.php.

Member Data Documentation

Elgg\Database\DbConfig::$db
protected

Definition at line 19 of file DbConfig.php.

Elgg\Database\DbConfig::$dbencoding
protected

Definition at line 25 of file DbConfig.php.

Elgg\Database\DbConfig::$dbhost
protected

Definition at line 21 of file DbConfig.php.

Elgg\Database\DbConfig::$dbname
protected

Definition at line 24 of file DbConfig.php.

Elgg\Database\DbConfig::$dbpass
protected

Definition at line 23 of file DbConfig.php.

Elgg\Database\DbConfig::$dbprefix
protected

Definition at line 20 of file DbConfig.php.

Elgg\Database\DbConfig::$dbuser
protected

Definition at line 22 of file DbConfig.php.

const Elgg\Database\DbConfig::READ = 'read'

Definition at line 15 of file DbConfig.php.

const Elgg\Database\DbConfig::READ_WRITE = 'readwrite'

Definition at line 17 of file DbConfig.php.

const Elgg\Database\DbConfig::WRITE = 'write'

Definition at line 16 of file DbConfig.php.


The documentation for this class was generated from the following file: