SugarCRM SupportProduct GuidesSugar DeveloperSugar Developer Guide 10.3ArchitectureConfigurator
This release is only available for SugarCloud customers.

Configurator

Overview

The Configurator class, located in ./modules/Configurator/Configurator.php, handles the config settings found in ./config.php and ./config_override.php.

Retrieving Settings

You can access the Sugar config settings by using the global variable $GLOBALS['sugar_config'] as shown below:

global $sugar_config;

//Use a specific setting
$MySetting = $sugar_config['MySetting'];

If you should need to reload the config settings, this is an example of how to retrieve a specific setting using the configurator:

require_once 'modules/Configurator/Configurator.php';

$configuratorObj = new Configurator();

//Load config
$configuratorObj->loadConfig();

//Use a specific setting
$MySetting = $configuratorObj->config['MySetting'];

Creating / Updating Settings

To create or update a specific setting, you can specify the new value using the configurator as shown below:

require_once 'modules/Configurator/Configurator.php';

$configuratorObj = new Configurator();

//Load config
$configuratorObj->loadConfig();

//Update a specific setting
$configuratorObj->config['MySetting'] = "MySettingsValue";

//Save the new setting
$configuratorObj->saveConfig();

Considerations

When looking to store custom settings, the Configurator class will store the settings in the ./config_override.php file. This class should only be used for long-term configuration options as Configurator->saveConfig() will trigger a metadata refresh that may log users out of the system.

Alternatively, you can use the Administration class, located in ./modules/Administration/Administration.php, to store settings in the config table in the database. This Administration class should be used for storing dynamic settings such as a last run date or an expiring token.

Topics

    Sugar configuration settings.
    The Sugar silent installer facilitates and automates the installation of the Sugar application after the files have been copied onto the server. This is done by populating correct parameters in a configuration file and then making a web request to kick off the installation.

Last modified: 2021-01-06 23:28:41