A small test function to show my thoughts:

function densite_test($site){
$db_spec = array();
$db_spec = drush_get_context('DRUSH_DB_CREDENTIALS');
print_r($db_spec);
$db_spec = _drush_sql_get_db_spec();
print_r($db_spec);
}

this will return:

Array
(
[driver] => mysqli
[user] => dennis
[host] => localhost
[port] =>
[pass] => password
[name] => dennisdesktop
)
Array
(
[driver] => mysql
[username] => dennis
[password] => password
[port] =>
[host] => localhost
[database] => dennisdesktop
)

1) Should these functions not at least return the same driver info. The site is using mysqli.
2) And should'nt the two functions return the same stuff, thinking of the keys in the array.
3) And should'nt these functions actually be just one function.

Or maybe I'm not enough into the drush and drupal project yet to understand this.

Note: this applies to both the 'issue' version and the 'development drush-All-Versions-HEAD' version.

- Greetings from Dennis .)

Comments

moshe weitzman’s picture

Status: Needs review » Fixed

the sql commands mostly work without a drupal site and you can two of them at one time for sql load. thats unlike drush_get_context('DRUSH_DB_CREDENTIALS');. so they are different for a reason. they probably should have same named keys but they have different callers so not a big deal. it is plausible that i have done missed a to implement this cleaner. patches welcome.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.