@@ -88,17 +88,17 @@ private function alter(&$data, $type): void
8888 $ $ type = &$ data ;
8989
9090 // Allow alteration via the `default` directory.
91- $ file = DRUPAL_ROOT . '/sites/default/ ' .
92- $ type . '. ' . $ this ->getEnvironmentName () . '.php ' ;
93- if (file_exists ($ file )) {
94- include $ file ;
95- }
91+ $ files [] = DRUPAL_ROOT . '/sites/default/ ' . $ type . '. ' . $ this ->getEnvironmentName () . '.php ' ;
92+ $ files [] = DRUPAL_ROOT . '/sites/default/ ' . $ type . '.local.php ' ;
9693
9794 // Allow alteration via non-`default` directories.
9895 $ siteName = $ this ->getSiteName ();
9996 if ($ siteName !== 'default ' ) {
100- $ file = DRUPAL_ROOT . '/sites/ ' . $ siteName . '/ ' .
101- $ type . '. ' . $ this ->getEnvironmentName () . '.php ' ;
97+ $ files [] = DRUPAL_ROOT . '/sites/ ' . $ siteName . '/ ' . $ type . '. ' . $ this ->getEnvironmentName () . '.php ' ;
98+ $ files [] = DRUPAL_ROOT . '/sites/ ' . $ siteName . '/ ' . $ type . '.local.php ' ;
99+ }
100+
101+ foreach ($ files as $ file ) {
102102 if (file_exists ($ file )) {
103103 include $ file ;
104104 }
@@ -159,6 +159,16 @@ public function getConfig(): array
159159 break ;
160160 }
161161
162+ // Configure Mailgun.
163+ if (isset ($ _SERVER ['MAILGUN_URL ' ])) {
164+ $ parts = parse_url ($ _SERVER ['MAILGUN_URL ' ]);
165+ $ config ['mailgun.settings ' ]['api_endpoint ' ] = vsprintf ('%s://%s ' , [
166+ 'scheme ' => $ parts ['scheme ' ] ?? 'https ' ,
167+ 'host ' => $ parts ['host ' ] ?? 'api.mailgun.net ' ,
168+ ]);
169+ $ config ['mailgun.settings ' ]['api_key ' ] = $ parts ['name ' ] ?? 'key-1234567890abcdefghijklmnopqrstu ' ;
170+ }
171+
162172 // Configure Shield if enabled.
163173 if ($ config ['shield.settings ' ]['shield_enable ' ]) {
164174 if (isset ($ _SERVER ['SHIELD_USERNAME ' ])) {
0 commit comments