CMS Drupal Mastering Development

How State is specific to the specific environment, when its actually pushed to all environments with DB sync?

I am working with a Drupal 8 setup when production, test and development environments periodically sync database. In Drupal 7 it was easy to override the $conf variables in settings.php to force a site in maintenance mode. However, in Drupal 8, however, the maintenance_mode is not a configuration anymore, but a state that is not possible to override from settings.php, so we have to use additional drush command after each sync to put one of the environments to maintenance mode.

And I am confused how come State API documentation asserts it’s environment-specific, when in fact, it gets sync together with database and it is not easy to keep enforcement-specific settings using State API.

On the contrary, $config is easy to override in settings.php (which is excluded during sync), so it does provide easy way of setting environment-specific configurations.

Leave a Reply

Your email address will not be published. Required fields are marked *