If I have an old CF11 app using a big application....
# cfml-general
j
If I have an old CF11 app using a big application.cfm file, can I still do something like onRequestStart?
d
Nope. you would need to convert it to Applicaiton.cfc
j
😭
d
We are almost done converting about 80 application.cfm to .cfc 😂
Its not that complicated really.
j
Not complicated, but very tedious. I was hoping I could avoid that
m
And please don't just cfinclude the application.cfm in your application.cfc onRequestStart or I will send cfninjas to your place of work to eat all the donuts out of the breakroom 😛
w
call his bluff. there are no donuts in the breakroom
m
You have no idea what I'd do for good donuts though 😂
j
There's not even a breakroom. I work remote
m
That's OK, I'm flexible lol.
a
Application.cfm
pretty much is an
onRequestStart
handler. It runs every request. What specifically did you need to do that can't be done already in your
Application.cfm
? (
Application.cfm
is the single worst-named concept in the history of CFML, I think).
j
@Adam Cameron I was trying to update a specific endpoint to be consistent with our Node apps and other apis, but I do not have control over the URL or IIS/web.config for rewriting. So I thought I could do something in onRequestStart
It is working now though
My new problem is that everything in application.cfm was defined in the variables scope and accessible w/in any other .cfm without a prefix. So transitioning to application.cfc would consist of going through everything and adding application.name or session.name to all of those variables...
d
Exactly our situation. Find and replace is most of the work.
a
@jumpmaster use
onRequest
instead then.