| @@ 217-232 (lines=16) @@ | ||
| 214 | * @param array $config |
|
| 215 | * @return array |
|
| 216 | */ |
|
| 217 | protected function configureMySQL( array $config ) { |
|
| 218 | ||
| 219 | if( !$config['port'] ) |
|
| 220 | $config['port'] = 3306; |
|
| 221 | ||
| 222 | // construct a MySQL PDO connection string |
|
| 223 | $config['pdo'] = sprintf( |
|
| 224 | "mysql:host=%s;port=%s;dbname=%s", |
|
| 225 | $config['host'], |
|
| 226 | $config['port'], |
|
| 227 | $config['db'] |
|
| 228 | ); |
|
| 229 | ||
| 230 | return $config; |
|
| 231 | ||
| 232 | } |
|
| 233 | ||
| 234 | /** |
|
| 235 | * Configure a PostgreSQL DSN. |
|
| @@ 239-254 (lines=16) @@ | ||
| 236 | * @param array $config |
|
| 237 | * @return array |
|
| 238 | */ |
|
| 239 | protected function configurePgSQL( array $config ) { |
|
| 240 | ||
| 241 | if( !$config['port'] ) |
|
| 242 | $config['port'] = 5432; |
|
| 243 | ||
| 244 | // construct a PgSQL PDO connection string |
|
| 245 | $config['pdo'] = sprintf( |
|
| 246 | "pgsql:host=%s;port=%s;dbname=%s", |
|
| 247 | $config['host'], |
|
| 248 | $config['port'], |
|
| 249 | $config['db'] |
|
| 250 | ); |
|
| 251 | ||
| 252 | return $config; |
|
| 253 | ||
| 254 | } |
|
| 255 | ||
| 256 | /** |
|
| 257 | * Configure a SQLite DSN. |
|