Change record status: 
Project: 
Introduced in branch: 
10.1.x
Introduced in version: 
10.1.0
Description: 

The drupal_rewrite_settings() function has been replaced by Drupal\Core\Site\SettingsEditor::rewrite().

Before

drupal_rewrite_settings($settings, $file_path);

After

\Drupal\Core\Site\SettingsEditor::rewrite($settings_file, $settings);

Notes

  • $settings_file argument becomes required and the first argument of the rewrite() method (so the order of the arguments has changed).
  • The SettingsEditor class cannot be instantiated. It should be used only with the static rewrite() method.
Impacts: 
Module developers
Site templates, recipes and distribution developers