config; } public function getDbHostname() { $matches = []; $matched = preg_match('~host=([^;]+)~s', $this->config['dsn'], $matches); if (!$matched) { return false; } return $matches[1]; } public function getDbName() { $matches = []; $matched = preg_match('~dbname=([^;]+)~s', $this->config['dsn'], $matches); if (!$matched) { return false; } return $matches[1]; } public function getDbUsername() { return $this->config['user']; } public function getDbPassword() { return $this->config['password']; } }