Introspecting Application.cfc
I've gotten this question a bunch of times. How do you get information about what's enabled in your application scope? How do I know if ORM is enabled, or what the datasource is?
Pretty easy - Instantiate the Application scope, and then get that information from the This scope.
<cfset test= new Application() />
<cfdump var="#test.ormenabled#">
7 responses so far ↓
1 Ryan Vikander
Maybe I am wrong, but can't you just <cfdump var="#Application#">?2 Ryan Vikander
Nevermind, after testing that doesn't work.3 Billy Cravens
Since you have to create an object, I'd think you could<cfset test = new Application()>
<cfdump var="#test#">
4 Ben Nadel
Nice! I never thought of actually creating a new instance of the CFC. Very cool idea! I always used some hacky approach like dumping out the secret properties of the application scope. Your way is much better!5 Ben Nadel
Thanks Terry - I was enjoying this post again at lunch :)6 Terrence Ryan
Thanks, Ben. I'm glad you liked it. It was one of those "It's so simple it can't work" moments.7 joe banken
Thats pretty cool man, I also did not know you could do new Application(). Nice find.Leave a Comment