Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (isset($_SERVER['db_name'])) {
- /**
- * The database credentials are stored in the Apache or Nginx vhost config
- * of the associated site with SetEnv (fastcgi_param in Nginx) parameters.
- * They are called here with $_SERVER environment variables to
- * prevent sensitive data from leaking to site administrators
- * with PHP access, that potentially might be of other sites in
- * Drupal's multisite set-up.
- * This is a security measure implemented by the Aegir project.
- */
- $databases['default']['default'] = array(
- 'driver' => $_SERVER['db_type'],
- 'database' => $_SERVER['db_name'],
- 'username' => $_SERVER['db_user'],
- 'password' => $_SERVER['db_passwd'],
- 'host' => $_SERVER['db_host'],
- /* Drupal interprets $databases['db_port'] as a string, whereas Drush sees
- * it as an integer. To maintain consistency, we cast it to a string. This
- * should probably be fixed in Drush.
- */
- 'port' => (string) $_SERVER['db_port'],
- );
- $db_url['default'] = $_SERVER['db_type'] . '://' . $_SERVER['db_user'] . ':' . $_SERVER['db_passwd'] . '@' . $_SERVER['db_host'] . ':' . $_SERVER['db_port'] . '/' . $_SERVER['db_name'];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement