Skip to main content
Participating Frequently
August 12, 2011
Question

cfc vs cfm files

  • August 12, 2011
  • 2 replies
  • 2054 views

Hi,
I am new to coldfusion, never saw it before this month.  The  person that developed our application has moved on and I am now supporting it.  So far it seems fairly straight forward programming wise.  We  have no test environment so when I need to update the application, it is  fairly complicated with copying files to a test directory, renaming  them Test_, using sed to change the paths in my cfm files.....  So I  have done that, and started making updates to my application.   Things seem to be working as far as my changes go but then when I move  along through this app (to things I have not changed), I get errors,  always that it cannot find the coldfusion component ReportShared.  Now  it just so happens that ReportShared is the one file that is a .cfc  (besides application.cfc) file as opposed to a .cfm file.  The exact  error is


10:55:16.016 - Application Exception - in /usr/local/apache/htdocs/Testing/Test_ReportShared.cfc : line 148

Line 148 is pointing to a cfinvokeargument tag.  I did not modify .cfc files  except to rename.  Is there something special about the .cfc file?  This  file is certainly a lot different from the Application.cfc defining many functions and used in many of the files.  Do I  need some sort of directory path in the Test_ReportShard.cfc maybe?  LIne 147 is <cfinvoke component="ReportShared"....>  Maybe that should be component="Test_ReportShared"???

Thanks!

    This topic has been closed for replies.

    2 replies

    Inspiring
    August 12, 2011

    I just saw Dan's post in rely to you which encouraged me re-read your own post, given how many alarm bells started going off:

    We  have no test environment so when I need to update the application, it is  fairly complicated with copying files to a test directory, renaming  them Test_, using sed to change the paths in my cfm files..... 

    You're doing what?

    No.  Stop that.  That's just stupid.

    It completely defeats the purpose of testing if you need to change the code to be able to test it.

    How is it you cannot create a proper test environment?

    --

    Adam

    Participating Frequently
    August 13, 2011

    The person that I took over from gave me "instructions" on how to test this app.  Everything was done by hand, copy to here, edit this file to say...  So at least I did create scripts to automate that somewhat.  We have no money to buy a server to use strictly for testing.  So if there is a way to setup so that I can change the application and test it without affecting the production app that others are using, I would be thrilled.  Can I copy all the files to a new directory and leave them as is, no name change, no directory path changes in the .cfm itself?  Will the simple fact that I put an Application.cfc in my testing directory that sets up paths in the new directory sufficient?

    I am

    Apache 1.3.37 (Unix)
    server RedHat 3ES 13.9.5
    ColdFusion 7.0.0.91690

    Inspiring
    August 15, 2011

    You can set up a CF instance on any old machine, it doesn't have to be a server, per se.  You should be able to do unit testing and scaled-down load testing on that.

    Or CF hosting can be incredibly cheap, so you could just rent some space for testing.

    What type of CF install is it?  IE: Standard or multi-server?  If it's multi-server, you can just install a second instance on the prod box for UAT.  Depending on the memory available to the server, that might even be OK for load testing.  You just don't want to be loading the server up so much it interferes with live traffic.

    --

    Adam

    Inspiring
    August 12, 2011

    If you renamed the file, that's exactly what you have to do.

    Having said that, renaming all your files for your test environment is creating opportunities for things to go wrong.  Ideally, they should be on a different server, but if you are simply using a different directory, I see no reason to change file names.

    Participating Frequently
    August 13, 2011

    So let's say under root I have my Application.cfc and the cfm's that it use are subdirectories under that Reports/File.cfm, Templates/XFile.cfm...  If I want to create a more managable test environment, can I create Testing under root, then Report/File.cfm, Templates/XFile.cfm under there?  And then a new Application.cfm in Testing?  That Application.cfm would have paths with Testing?  Still I think the ReportsShared.cfc will have path relative root problems?  Any advice about setting up a test environment without using a seperate server would be great!

    I am

    Apache 1.3.37 (Unix)
    server RedHat 3ES 13.9.5
    ColdFusion 7.0.0.91690