The Cheeky Monkey Media Blog
A few words from the apes, monkeys, and various primates that make up the Cheeky Monkey Super Squad.
If you’ve ever set up 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, it’s 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:
If you’re looking to test email notifications on your local development machine and don’t want to send notifications to the person that receives e-mails on the production site, you could set the site’s admin e-mail in settings.php as well.
$conf[‘site_mail’] = ‘[email protected]’;
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.