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.
Maybe I am wrong, but can’t you just <cfdump var="#Application#">?
LikeLike
Nevermind, after testing that doesn’t work.
LikeLike
Since you have to create an object, I’d think you could
<cfset test = new Application()>
<cfdump var="#test#">
LikeLike
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!
LikeLike
Thanks Terry – I was enjoying this post again at lunch 🙂
LikeLike
Thanks, Ben. I’m glad you liked it. It was one of those "It’s so simple it can’t work" moments.
LikeLike
Thats pretty cool man, I also did not know you could do new Application(). Nice find.
LikeLike
This looks promising but in Ben’s post where he actually tries to use this technique http://www.bennadel.com/blog/1686-accessing-coldfusion-application-settings.htm the output of his last cfdump shown at the bottom of the post seems to be nonsense i.e. a tiny fraction where we should be seeing 300 as the sessionTimeout. Is this usable?
LikeLike