In my custom module I want to define a constant which takes its value from a function provided by another module. When I call this function in my module I get a 'call to undefined function' error. Curiously, if I call the function from inside another function, I don't get an error and it works fine. It's as if all module functions get loaded at the same time and then executed, but anything that is not a function gets executed first before the functions become available.
// MY_MODULE.module $var = FUNCTION_FROM_OTHER_MODULE(); define('MY_CONSTANT', $var); // use MY_CONSTANT in the other hooks and functions of MY_MODULE
Why am I getting this error and how can I set my constant with this function? Hope this makes sense. thanks.