http://coldfusion.com logo
#cfml-general
Title
# cfml-general
b

Benjy

01/30/2022, 11:16 PM
I inherited this monolithic legacy app that is still using app.cfm. It has lots of "global" variables, client variables, functions etc. I am bringing it up to at least app.cfc before going to coldbox. I put all the old vars into application.settings, but they also need to remain as "global" because there is too much to update. I put them in an include inside onRequestStart, but the app does not acknowledge them unless they are physically in onRequestStart. Been a while since I have had to deal with anything like this, so just curious if anyone may know what's up? I also tried an include in onRequest.
d

deactivateduser

01/31/2022, 12:38 AM
You can't just move variable storage and not change the code that references it. It would be better to start small and iterate by changing variables to be less global. Do it with 1 variable first, and make sure it works, then as you get use to making those changes you can run more automated versions like regex replacements to make the changes more broad and faster
b

Benjy

01/31/2022, 3:22 AM
You can't just move variable storage and not change the code that references it.
Obviously, but I guess I didn't explain it right.
Anyway, got it figured out, I was putting targetpage before the includes in onrequest, should be after.
2 Views