Description of the need
While working with a new Backdrop project, I really needed to be able to quickly set/change the maintenance_mode using override method from command line or the settings.php file. And since the maintenance_mode variable moved to State database table, I could not use the configuration overrides.
Therefore, knowing that implementation of new features to core would take some time, as a quick temporary solution I've pushed very simple State Override module, which literally consists of 13 lines:
<?php
/**
* Implements hook_boot.
*/
function state_override_boot() {
global $config;
if (!empty($config)) {
foreach ($config['state'] as $key => $value) {
state_set($key, $value);
}
}
}
so now I can simply put lines like:
$config['state']['maintenance_mode'] = TRUE;
$config['state']['cron_key'] = 'w5AXKo9UdkoVRp9rT_0gqtdG2h322LGJ_sYuJN6aWpk1';
to settings.php file and it will work just as desired.
However, I believe it would be really useful for automation purposes and convenience of all future Backdrop developers if core supported overriding State variables.
Proposed solution
Let's get this into core if the consensus says so.
Recent comments
https://backdropcms.org/project/metatag https://backdropcms.org/project/xmlsitemap https://backdropcms.org/project/imagefield_tokens These are more powerful modules, in my opinion...
How to Improve SEO Performance in Backdrop CMS
I recently did this for my website and it increased my PageSpeed score significantly. I just installed and configured the following modules: Alt/Title Default (to set default...
How to Improve SEO Performance in Backdrop CMS
Welcome to Backdrop CMS! To start, I recommend two basic modules: https://backdropcms.org/project/seo_meta and https://backdropcms.org/project/easy_xmlsitemap. I hope they are...
How to Improve SEO Performance in Backdrop CMS