ColdFusion Dump All Scopes Utility

Word Count: 94
I am sorry If I am telling folks stuff they already know but I am having tons of fun digging around. So have you ever needed a quick way to see whats going on in every scope? I think I have written debug functions before that dump out a bunch of scopes like application, session and CGI. Well if you want a quick way to see what is living in every scope there is actually a very easy solution. I am on ColdFusion 8.0.1 by the way.

Comments

#1 Posted By: dfguy Posted On: 6/24/08 7:50 AM
now that is nice!
#2 Posted By: Phil Duba Posted On: 6/24/08 9:09 AM
Wow, that's nice. Might be good to put that in an error page as part of logging.
#3 Posted By: Ian Posted On: 6/24/08 10:39 AM
"With great power comes great responsibility."

One thing to keep in mind if you are displaying this on screen or emailing this as part of an error report is that things like credit card numbers and passwords might be getting sent clear text.

For debugging on dev servers this is great! Thanks.
#4 Posted By: Andrew Maurer Posted On: 10/19/08 1:09 PM
Great stuff! Thanks Dan!
#5 Posted By: Gert Posted On: 2/19/10 12:40 PM
Very nice!
#6 Posted By: Jay Greer Posted On: 7/14/10 11:24 AM
In CF9 I'm geeting the error below when I try to run that code. Any idea how to do this in CF9 ..?

--------------------------------------------------

CFCATCH MESSAGE: The getBuiltInScopes method was not found.

CFCATCH DETAIL: Either there are no methods with the specified method name and argument types or the getBuiltInScopes method is overloaded with argument types that ColdFusion cannot decipher reliably. ColdFusion found 0 methods that match the provided arguments. If this is a Java object and you verified that the method exists, use the javacast function to reduce ambiguity.
#7 Posted By: Dan Vega Posted On: 7/16/10 7:54 AM |
Author Comment
Looks like that method has been removed. I did a quick dump of the page context and found this one though. It returns a nice array of all the CF scopes.

<cfdump var="#getPageContext().getCFScopes()#">


Post Your Comment

Leave this field empty







Show Captcha

If you subscribe, any new posts to this thread will be sent to your email address.

Copyright © 2007 Dan Vega | BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.