Database configuration service.
More...
Database configuration service.
Definition at line 13 of file DbConfig.php.
Elgg\Database\DbConfig::__construct |
( |
\stdClass |
$config | ) |
|
Constructor.
- Parameters
-
\stdClass | $config | Object with keys:
- db
- dbprefix
- dbhost
- dbport
- dbuser
- dbpass
- dbname
- dbencoding
|
Definition at line 72 of file DbConfig.php.
static Elgg\Database\DbConfig::fromElggConfig |
( |
Config |
$config | ) |
|
|
static |
Elgg\Database\DbConfig::getConnectionConfig |
( |
string |
$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 | $type | The connection type: READ, WRITE, READ_WRITE |
- Returns
- array
Definition at line 131 of file DbConfig.php.
Elgg\Database\DbConfig::getGeneralConnectionConfig |
( |
| ) |
|
|
protected |
Get the read/write database connection information.
- Returns
- array
Definition at line 153 of file DbConfig.php.
Elgg\Database\DbConfig::getParticularConnectionConfig |
( |
string |
$type | ) |
|
|
protected |
Get connection information for reading or writing.
- Parameters
-
string | $type | Connection type: 'write' or 'read' |
- Returns
- array
Definition at line 170 of file DbConfig.php.
Elgg\Database\DbConfig::getTablePrefix |
( |
| ) |
|
Get the database table prefix.
- Returns
- string
Definition at line 99 of file DbConfig.php.
Elgg\Database\DbConfig::isDatabaseSplit |
( |
| ) |
|
Are the read and write connections separate?
- Returns
- bool
Definition at line 108 of file DbConfig.php.
array Elgg\Database\DbConfig::$db |
|
protected |
string Elgg\Database\DbConfig::$dbencoding |
|
protected |
string Elgg\Database\DbConfig::$dbhost |
|
protected |
string Elgg\Database\DbConfig::$dbname |
|
protected |
string Elgg\Database\DbConfig::$dbpass |
|
protected |
int Elgg\Database\DbConfig::$dbport |
|
protected |
string Elgg\Database\DbConfig::$dbprefix |
|
protected |
string Elgg\Database\DbConfig::$dbuser |
|
protected |
const Elgg\Database\DbConfig::READ = 'read' |
const Elgg\Database\DbConfig::READ_WRITE = 'readwrite' |
const Elgg\Database\DbConfig::WRITE = 'write' |
The documentation for this class was generated from the following file: