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