Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add engine for the sql connection credential commands. #483

Closed
wants to merge 2 commits into from

Conversation

alexpott
Copy link
Contributor

Drupal 8 has removed the $databases global https://drupal.org/node/2176621. Drush relies on this.

@weitzman
Copy link
Member

weitzman commented Mar 4, 2014

This looks OK. I'd rather use classes now instead of engines like /lib/Role, for example. But a Drush maintainer can do that. What I'm curious about is if this patch works for sql-sync (and if not, does sql-sync work without the patch). Hopefully someone can test that soon.

function _drush_get_db_settings($database, $target) {
if (drush_bootstrap_max(DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION)) {
// We don't use DB API here `sql-sync` would have to messily addConnection.
if ($info = Database::getAllConnectionInfo()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this really work? The whole premise of DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION is that Drush has included settings.php but no other part of Drupal. Therefore, I'm surprised that an autoloader would be available to handle Database class instantiation. Has anyone tested site-install with this PR? Another good thing to test is to configure settings.php and point it at a random DB (not Drupal). sql-query should still work. I don't think it will with this patch. Aegir relies on this AFAIK. sql-sync as well.

@damiankloip
Copy link
Contributor

The autoloader has to be initialized by that point for Settings() etc.. atleast that is the case in _drupal_bootstrap_configuration(). Which I guess drush calls at come point in the form of drupal_bootsrap(DRUPAL_BOOTSTRAP_CONFIGURATION)?

@weitzman
Copy link
Member

#504 has landed so this should be simpler now.

@weitzman weitzman closed this in 57226ed Mar 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants