Converting an Application from Fusebox 3 to Fusebox 5.5 (Part 2)

Converting the circuits

I can see this part of the conversion being a bit of a slog. In each fbx_switch I have to do the following steps:
  • Change the cfswitch tag to a cfcomponent tag. (Don't forget the closing tag too!)
  • Change every cfcase tag to a cffunction tag and the value= to name=.

  • Add a prefusaction to call the circuit's fbx_settings fuse and because we no longer have the automatic nesting available we have to call the parent circuit's fbx_settings fuse.
  • Add a postfusaction to call the page layouts. Again I have to remember to add the fbx_layout for any parent circuits.
  • Move the changed code (now a CFC) to the controller directory.
  • Then because the circuit CFC will now sit in the controller directory I have to put the path in front of every cfinclude template parameter. (But see insight below).

I worked my way throught two of these circuits, they were small ones but even so some of the changes are tedious and the path changes are not too easy to automate.

But at the end of that work two of the circuits from my application are working and running under Fusebox 5. No major fuses have been harmed, apart from moving some of the code from application.cfm to application.cfc, and some of the initialisation code from fbx_settings into application.cfc.

Then I had an insight! It isn't really necessary to move the fbx_switch code to the controller directory! I could avoid having to add all that path information to the includes. I can just leave my new circuit CFCs where they are with their fuses in the same directory and create a dummy CFC which just extends the new circuit CFC to put in the contoller directory. Problem solved!

Now most of the required changes are automatable and a global search and replace should do it!

I'll let you know what I find.

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.