Commit 4b9a5546 authored by Adrian Rossouw's avatar Adrian Rossouw

Revert "initialize mysql credentials from drush bootstrap so that we can work...

Revert "initialize mysql credentials from drush bootstrap so that we can work on non-verified sites easily"

Provision is managing the master database connection here, drush's db credentials are the details for the SITE, and will only be available at drush_bootstrap_drupal_site.

we need the master db connection from drush_bootstrap_drush already, and we will never ever ever be able to make use of drush' code in this regard because what we are doing is completely outside of the Drupal context.

This reverts commit 5439e6d01d32fd7351c404a6bf74c11a028ee8a4.
parent 4d7d5505
<?php
function drush_provision_mysql_pre_provision_backup($url = NULL) {
provision_mysql_creds_from_drush();
# set the umask to 077 so that the dump itself is generated so it's non-readable by the webserver
umask(0077);
drush_log("Generating mysql dump for $url.", 'backup');
......
......@@ -24,32 +24,6 @@ function provision_mysql_drush_init() {
drush_set_default('master_db_type', $db['scheme']);
drush_set_default('db_type', $db['scheme']);
// profit from drush credentials if we're bootstrapped far enough
provision_mysql_creds_from_drush();
}
}
/**
* Import database settings from drush bootstrapped settings
*
* This should normally not be necessary: we should not do our own parsing in the first place, see:
* http://drupal.org/node/661720
*/
function provision_mysql_creds_from_drush() {
if ($drush_creds = drush_get_context('DRUSH_DB_CREDENTIALS')) {
foreach (array('user', 'host', 'name') as $part) {
if (!drush_get_option("db_$part")) {
drush_set_default("db_$part", $drush_creds[$part]);
}
}
if (!drush_get_option('db_passwd')) {
drush_set_default('db_passwd', $drush_creds['pass']);
}
if (!drush_get_option('db_type')) {
drush_set_default('db_type', $drush_creds['driver']);
}
// XXX: port not handled
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment