3

In the settings.php file of Drupal 8 installations, there are two different types of variables; $settings and $config. In Drupal 7 we used only $conf variable.

What's the difference between $config and $settigns variables in D8?

  • The $settings are a global setting config that is available only through the Settings class which acts as a wrapper whereas the $config overrides the config(ie "variables") that is accessible via \Drupal::config(). – user21641 Nov 11 '16 at 9:31
3

Settings are for early-bootstrap (you can't store the database credentials in the database) and environment specific things, like the path to the public file system. Things that are not meant to be exported/deployed.

That means in almost all cases in modules, you want to use the configuration API.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.