Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Update Method of Passing DB Credentials #56

Open
populist opened this issue Aug 17, 2015 · 4 comments
Open

Update Method of Passing DB Credentials #56

populist opened this issue Aug 17, 2015 · 4 comments

Comments

@populist
Copy link

-- Define $databases in a cleaner way with checking to see if it is already set
-- Do not use the $$ global variable override. Iterate through known global variables.

@populist populist added the minor label Aug 17, 2015
@populist
Copy link
Author

We pass this information using $_ENV as follows:

array (
  'DB_HOST' => '10.223.176.79',
  'DB_PORT' => '16333',
  'DB_USER' => 'pantheon',
  'DB_PASSWORD' => 'lolpasswordasdsadsa',
  'DB_NAME' => 'pantheon',
)

@joshkoenig
Copy link
Member

All the variables we need should be there already, but agreed we want to get away from $$ candy-flipping.

I thought the idea was to do this in a pantheon.settings.php in a nice clean way?

@greg-1-anderson
Copy link
Member

Currently this is done in pantheon.settings.php.

Drupal 8 currently loads the settings.php file from Drupal\Core\Site\Settings:: initialize().

We might be able to populate $databases by calling Database::setMultipleConnectionInfo() directly. However, the problem with doing this is that we would then have to special-case the target platform in the prepend file. If Drupal changed the name of this method at some point, then the prepend file would need to know exactly which version of Drupal was installed in order to do the right thing. While this is unlikely, I think that the existing technique is more stable. I suggest we keep this as-is.

@greg-1-anderson
Copy link
Member

So, we need to do some things via settings.php modifications, but we could certainly clean up the way in which we do this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants