| @@ 41-56 (lines=16) @@ | ||
| 38 | return $this->database; |
|
| 39 | } |
|
| 40 | ||
| 41 | protected function buildMySQL(array $config) |
|
| 42 | { |
|
| 43 | $port = isset($config['port']) ? $config['port'] : 3306; |
|
| 44 | ||
| 45 | $socket = isset($config['unix_socket']) ? $config['unix_socket'] : ''; |
|
| 46 | ||
| 47 | $this->database = new Databases\MySQLDatabase( |
|
| 48 | $this->console, |
|
| 49 | $config['database'], |
|
| 50 | $config['username'], |
|
| 51 | $config['password'], |
|
| 52 | $this->determineHost($config), |
|
| 53 | $port, |
|
| 54 | $socket |
|
| 55 | ); |
|
| 56 | } |
|
| 57 | ||
| 58 | /** |
|
| 59 | * Build a PgSQLDatabase instance. |
|
| @@ 62-77 (lines=16) @@ | ||
| 59 | * Build a PgSQLDatabase instance. |
|
| 60 | * @param array $config |
|
| 61 | */ |
|
| 62 | protected function buildPgSql(array $config) |
|
| 63 | { |
|
| 64 | $port = isset($config['port']) ? $config['port'] : 5432; |
|
| 65 | ||
| 66 | $schema = isset($config['schema']) ? $config['schema'] : 'public'; |
|
| 67 | ||
| 68 | $this->database = new Databases\PgSQLDatabase( |
|
| 69 | $this->console, |
|
| 70 | $config['database'], |
|
| 71 | $schema, |
|
| 72 | $config['username'], |
|
| 73 | $config['password'], |
|
| 74 | $this->determineHost($config), |
|
| 75 | $port |
|
| 76 | ); |
|
| 77 | } |
|
| 78 | ||
| 79 | /** |
|
| 80 | * Determine the host from the given config. |
|