Was doing some testing on my dev box today.
When I remove items from the config_override.php file and rebuild the config. The changes don’t seem to reflect in the rebuild config.php file.
Are the contents of the config_override.php file supposed to be a part of the config.php file?
Hi,
SuiteCRM reads config.php first and then reads config_override.php.
So anything which you wrote in config_override.php will be applied to CRM ignoring what is configured in config.php file.
You should always define any stand alone configurations, i mean any new configuration options to config_override.php.
What I am not understanding is why when I remove and/or comment some lines in the config_override.php file why it does not remove and/or comment out the lines in the config.php after a rebuild?
The time stamp at the top of the config.php changes when I run rebuild config but I am not seeing the changes in the config.php file that I would expect to see if I changed something in the config_overrride.php file.
@tkoehn you misunderstand how SuiteCRM handles those files.
SuiteCRM only writes to config.php when creating the original version, during installation *.
On the other hand, config_override.php is handled in other moments, typically when changing system settings. You can also have your manual entries there, and they will be preserved if they don’t conflict with what you’re trying to do from the UI.
When reading the settings, SuiteCRM reads config.php, then applies any changes or additions from config_override.php on top of that, so that your effective settings are a merge from both files (with config_override.php taking priority).
(*) I guess that Admin / Repairs / Rebuild Config File repeats this process. I’ve never used it.
Hi @tkoehn,
The file doing the config Rebuild process is modules\Administration\RebuildConfig.php
So if i explain in depth, this file is utilizing loadCleanConfig() method of CRM utils file at the path include\utils.php to load only config.php and then doing the rebuild process by skipping the config_override.php file. And then calling rebuildConfigFile() method to merge the pre-defined config array (by loading default config options defined in get_sugar_config_defaults() method) and merging it with the current config.php values and then applying ksort() operations.
This is all what the rebuild config action is doing.