public function SqlBase::params_to_options

8.0.x SqlBase.php public SqlBase::params_to_options($parameters)
7.x SqlBase.php public SqlBase::params_to_options($parameters)
master SqlBase.php public SqlBase::params_to_options($parameters)
2 calls to SqlBase::params_to_options()
Sqlmysql::creds in lib/Drush/Sql/Sqlmysql.php
Build a fragment connection parameters.
Sqlpgsql::creds in lib/Drush/Sql/Sqlpgsql.php
Build a fragment connection parameters.

File

lib/Drush/Sql/SqlBase.php, line 332

Namespace

Drush\Sql

Class

SqlBase

Code

public function params_to_options($parameters) {
  // Turn each parameter into a valid parameter string.
  $parameter_strings = array();
  foreach ($parameters as $key => $value) {
    // Only escape the values, not the keys or the rest of the string.
    $value = drush_escapeshellarg($value);
    $parameter_strings[] = "--$key=$value";
  }

  // Join the parameters and return.
  return implode(' ', $parameter_strings);
}