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']; } }