Defining variables in settings.php
If you’ve ever setup a drupal installation before, then you’re familiar with the settings.php file. This little file resides in the default folder on a typical drupal install. Normally, its only used to simply tell drupal about our database name and password. However, there are some other cool things you can do with it.
Because settings.php is not part of our repo, you can easily make edits on your local settings.php with the following variables overrides in it:
// Aggregate and compress CSS files in Drupal - off.
$conf['preprocess_css'] = 0;
$conf['preprocess_js'] = 0;
If you’re looking to test email notifications on your local development machine and don’t want to send notification to the person that receives e-mails on the production site, you could set the sites admin e-mail in settings.php as well.
$conf[‘site_mail’] = ‘firstname.lastname@example.org’;
You can also set custom settings that you can use in your php code, for example, a web key. You will set this variable the same way you overwrite existing ones.
$conf[‘my_custom_settings’] = ‘This is my custom string’
To get the variable in code use the handy variable_get() function
A full list of the default variables that you can overwrite can be found in the drupal documentation and adding contrib modules can add extra variables that you might want to overwrite on your next project.