coldfusionenvironment-variablesopenbdcloud-foundry

CFML system environment variable (OpenBD)


How do I access the system environment variables in CFML? It is required to read out the CloudFoundry database connectivity settings.

The variable required is "VCAP_SERVICES".

Is there a function for that?

Thanks,

Yvan


Solution

  • Following solution seems to work very-very partially on my Ubuntu (it gets far from all variables listed by env -- bit this may be fine because JVM just does not get most of these), but it may somehow work for you:

    <cfset properties = createObject("java", "java.lang.System").properties />
    <cfdump var="#properties#">
    

    Variable you are looking for can be prefixed with user.