Skip to content
Snippets Groups Projects

Add ENV for settings_verified to pass

1 unresolved thread

Closes #3445816

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
174 'prefix' => '',
175 ];
176 }
177 else {
178 $databases['default']['default'] = [
179 'driver' => $_ENV['DRUPAL_DB_DRIVER'],
180 'database' => $_ENV['DRUPAL_DB_NAME'],
181 'username' => $_ENV['DRUPAL_DB_USERNAME'],
182 'password' => $_ENV['DRUPAL_DB_PASSWORD'],
183 'host' => $_ENV['DRUPAL_DB_HOST'] ?? '',
184 'port' => $_ENV['DRUPAL_DB_PORT'] ?? '',
185 'prefix' => $_ENV['DRUPAL_DB_PREFIX'] ?? '',
186 ];
187 }
188 }
189 }
  • Comment on lines +151 to +189

    This seems questionable to me (forgive me if it was previously discussed, I haven't read through the whole issue)...but doing this in Settings::initialize() is going to potentially override the database at runtime (although I see it's guarded against by checking for existing database connections). Surely we'd want to have this set once, at install time, and then not change it at runtime at all?

  • It's always at runtime. It's just some folks have it hardcoded in settings.php, but most hosting providers do runtime environment variable injection in settings.php

    Unfortunately this is the only logical place to do it, I left a paper trail in tbe issue.

  • Please register or sign in to reply
Please register or sign in to reply
Loading