TerrenceRyan.com

I'm a 35 year old redhead geek from Philly.
I'm currently a Developer Evangelist for Adobe.
Also the author of Driving Technical Change

Introspecting Application.cfc

7 Comments

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









Categories

Monthly Archives

Tag Cloud

coldfusion web development flex coldfusion builder appearances squidhead coldfusion builder extensions higher ed flash builder air mobile android adobe apptacular html5 driving technical change running a coldfusion shop adobemax06 movable type flash catalyst flash blackberry adobemax07 adobemax08 hero finicky css adobemax09 holy crap i’m a mobile developer centaur basecamp cfc unfuddle motorola metablog irrational characters ios git evangelism devices code reviews ant wharton subversion security phonegap philly philadelphia multidevice knowledge@wharton jobs browserlab adobemax10 adobe tv unfuddlecfc svnauth.cfc semantic html semantic html responsive web design qnx nlb linux jquery mobile java it github flexorg fireworks edge eclipse dreamweaver apps apple adobemax11