I’m trying to follow this Legacy->Coldbox migra...
# box-products
p
I’m trying to follow this Legacy->Coldbox migration video from @bdw429s from 2020. I have a massive legacy app and getting CB in place will allow me to move to it. However, I’m confused a bit about code that’s already in my Application.cfc. If I have onApplicationStart code there already, do I need to move that to somewhere else (where?), since my Application.cfc is now extending the ColdBox Bootstrap CFC? I previously had an reinit URL setup, but now that I have ColdBox in place I assume I would be using
fwreinit
which is fine, but then I’m not sure where my existing code would need to be order to get reexecuted with the restart. (Brad - the demo video is aimed at CB5. Wondering if it’s different with CB6 as well). Any pointers would be greatly appreciated.
b
If you have existing stuff, I would recommend using the non-inheritance approach
You can leave all your logic in onappstart for example (at least, for now), just run it before/after the coldbox bootstrap runs
You can also continue to use both init URLs, or make one trigger the other, etc. That's up to you.
If you want to be able to trigger a ColdBox reinit on a non-coldbox page, just make sure you're calling
reloadChecks()
on the bootstrap
@Peter Hoopes
p
I’ll take a look. Thanks!
Sorry - the last note has me confused. If I have a URL
reinit
key that triggers onApplicationStart, wouldn’t that reload CB since the Bootstrap code is at the start of that function? It would seem to me (CB newbie) that any time onApplicationStart runs, it’ll fully recreate CB in
application.cbBootstrap
. I’m not sure where
reloadChecks()
should go in all of this…