How to add a global variable to suiteCRM

Hello

Just an observation I made which may help someone save a bunch of time. In my case I was trying to pull in a variable into the class scope and it wouldn’t work.

Solution was to add the global variable to config_override.php file

For example
$sugar_config["str1"] = "this is a string";

Then after repair and rebuild it can be accessed via:
echo $GLOBALS['sugar_config']['str1'];

Video overview:

3 Likes

Is this approach upgrade/update safe?

Yes, it is upgrade-safe.

@pgr , this is noted, thank you sir.