Editor’s Note: This articles details another new developer features that is coming coming in SugarCRM 6.2, now in beta. In this article, senior software engineer Collin Lee illustrates how to set config.php variables during the silent upgrade process.
Starting with version 6.2, we have added support in the silent upgrade scripts to automatically update or set configuration variables in the config.php file via the presence of a config_si.php file. This feature is useful for administrators managing the upgrading of multiple SugarCRM installations who also need to add or change configuration values in the config.php file(s) of the existing installations.
Depending on where you run the silent upgrade scripts (say /home/upgrades) the silent upgrade scripts will check for the presence of a config_si.php file (i.e. file /home/upgrades/config_si.php) file and merge these settings to the config.php file directory of the upgrade instance.
Imagine the contents of /home/upgrades as:
And the contents of the config_si.php as:
$sugar_config_si = array(
‘disable_count_query’ => true,
‘external_cache_disabled_apc’ => true,
‘external_cache_disabled_zend’ => true,
‘external_cache_disabled_memcache’ => true,
‘external_cache_disabled’ => true,
‘system_skypeout_on’ => 1,
So for example when running silent upgrade on command line:
/home/upgrades>php silentUpgrade.php “/home/upgrades/zip/SugarEnt-Upgrade-6.0.x-to-6.2.x.zip” “/home/upgrades/silent_upgrade.log” “/Applications/MAMP/htdocs/SugarEnt-Full-6.0.3” “admin”
The config.php file in the third argument (/Applications/MAMP/htdocs/SugarEnt-Full-6.0.3) will be the file that will be merged with config_si.php. If the config.php file contains the existing key, then the value of this key will be altered to the value specified in config_si.php. If the config.php file does not contain the declared key/value entry in config_si.php, then the config.php file will be updated to include the key/value combination.