ColdFusion (2018 release) imports environment vars into the server scope

Adobe Employee ,
Mar 04, 2020 Mar 04, 2020

Copy link to clipboard

Copied

Thanks to Charlie's blog and Pete's tweet, we have another hidden gem in ColdFusion (2018 release). 

ColdFusion (2018 release) imports environment variables into the server scope.

For instance,

<cfscript>
    writeDump(server.system.environment)
</cfscript>

The snippet above returns a struct that contains environment variables.

ColdFusion (2018 release) also imports Java system properties.

For instance,

<cfscript>
    writeDump(server.system.properties)
</cfscript>

The snippet above returns a struct that contains Java system properties.

Pete has also documented these scopes in the cfdocs site.

TOPICS
Advanced techniques

Views

404

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation