Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I determine which files a ColdFusion application uses?

Tags:

coldfusion

I'm starting some work on an existing ColdFusion application with no version control and what look like unused cfm files (test.cfm, test2.cfm etc.). I'd like to get a picture of what files are actually part of the application so I can get it into git or subversion in a manageable state.

How would you go about this? A regex and some methods to find and map cfinclude and cfcomponent tags? Is there some existing tool that does this?

like image 878
blank Avatar asked Nov 30 '22 07:11

blank


2 Answers

Put it into git first! Then, if you screw up, you can easily roll back.
(If you're concerned about having a 'clean' repository, when you're finished and fully tested, you have the option to just remove the single .git folder and create a new one.)

Then, as Tomalak suggests, use cflog on every file. Infact I'd say maybe even log twice, at the top and bottom of each script, could potentially help you to map out how the application runs.

like image 24
Peter Boughton Avatar answered Dec 10 '22 04:12

Peter Boughton


Ben Nadel has a method to examine the live stack trace from a running template. It seems to me that you could easily plop this into your application and log the results to a database. Once you've done that, you've got a good idea of what's in use and what's not.

I think the easiest way, however, is to enable debugging (standard caveat here about development server, etc). The standard ColdFusion debugger will give you a complete list of every file used during the execution of a single page. ColdFire will do the same thing in a handy Firebug extension (click ColdFusion then click Exec Times).

It should be pointed out that the built-in debugger even shows you the files included from CFC calls, and the files included from within those calls as well. It is all inclusive.

Ben Nadel on Stack Traces

Ray Camden's ColdFire

Sample of CF Debugging from a live page:
alt text

like image 169
JWHardcastle Avatar answered Dec 10 '22 03:12

JWHardcastle