Ben, One of the reasons I was considering the approach of a variable map was to get into understand the scheme. My thought process seems to grasp the overall picture better when I can see how variables are used. Plus makes debugging strategy more meaning.
Your suggestions using regex and Paul's suggestion of searching all files with CFFile makes a lot of sense. My regex is limited. Finding the scope part of session.XXX or server.mydomain.XXX is within my capabilities. It is extracting the entire variable that I am struggling. If we could take that one step further and also extract how the variable was used, e.g., cfset or ?, then we would have created a great post documenting tool ;-) Any hints on how to create a regex to extract the complete session.XXX or server.mydomain.XXX would be appreciated? Nick At 01:01 PM 1/27/2005, you wrote: >So, if I'm reading this right, what you're looking for is a way to >compare variable use across templates, particularly where they might be >conflicting in/with background processing, right? Assuming so, here's >where I'd start.... > >Since the background processes are most likely to be having issues with >shared scopes, I'd start by adding a separate template that just dumps >the application and server scopes, then doing a find across the >application for all instances of each of the variables in those scopes. > >If that didn't lead me to the problems, I'd look for unscoped variables. > This is going to be a PITA, but the basic idea (at least what I've >thought of) is to first look for all hashed values in the code, then >look in all the <cf...> tags. Yeah, annoying. Personally, I'd create a >copy of the code and do some serious reductions on it using regex, but >I'm a regex junkie. :-) Any way you slice it, this is going to be a >royal pain. > >HTH. If there's more I can help with, feel free to let me know. > >--Ben > >Nick Baker wrote: > > Ben, > > > > The reason is to get a good pic of the variable usage strategy. I > inherited > > some fairly large CF code that is a little buggy. There is some background > > event processing going on and appears a few variables are possibly being > > stepped on. The variable naming conventions makes me suspect there may be > > duplicate uses of variable names. > > > > CFDump maybe my best option, but calling templates could affect ongoing > > background events. > > > > Nick > > > > At 11:06 AM 1/27/2005, you wrote: > > > >>You could always cfdump the various scopes at the bottom of the page... > >> > >>I'm not sure what your intent is, though. What are you trying to do > >>with this information? > >> > >>--Ben > >> > >>Nick Baker wrote: > >> > >>>How can you strip variables such as session and server variables from > >>>existing code? Leaving a map of variables used by template. > >>> > >>>Unfortunately, all of the variables were not initialized in > CFAPPLICATIONS. > >>> > >>>Any tools or snippets that can do that? > >>> > >>>Thanks, > >>> > >>>Nick > >>> > >>> > >>> > >> > >> > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192000 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

