You are here

public function BackupDatabaseClient::getConnectionOptions in Backup Database 8

Return formatted connection options.

1 call to BackupDatabaseClient::getConnectionOptions()
BackupDatabaseClient::dump in src/BackupDatabaseClient.php
Perform the database dump.

File

src/BackupDatabaseClient.php, line 108
Contains \Drupal\backup_db\BackupDatabaseClient

Class

BackupDatabaseClient
BackupDatabaseClient class.

Namespace

Drupal\backup_db

Code

public function getConnectionOptions() {
  $options = $this->connection
    ->getConnectionOptions();

  // Requires formatting as a string.
  $connection = $options['driver'] . ':' . 'host=';
  $connection .= $options['host'] . ';port=';
  $connection .= $options['port'] . ';dbname=';
  $connection .= $options['database'];
  return [
    'connection' => $connection,
    'username' => $options['username'],
    'password' => $options['password'],
  ];
}