RE: [coldbox:15982] Coldbox and Fusebox in the same CF App context

Yes, a feature of ColdBox is to be able to integrate it slowly into an existing app. They key is the if statement in the onRequestStart() method of Application.cfc.

<cfif findNoCase(‘index.cfm’, listLast(arguments.targetPage, ‘/’))>
<cfset reloadChecks()>
<cfset processColdBoxRequest()>

You can make that statement whatever you want, really. When it’s true, the framework will run. If your legacy code doesn’t use the index.cfm front controller than that’s easy. If your legacy code also hits index.cfm, then you’ll need to find a way to differentiate.

Another method is to build your new code in a sub folder and when it’s all converted over, move it down to the root. Just know that your URLs will change. If you need legacy and new to share the same actual application scope, then matching application names and application.cfc inheritance magic can come in very handy.



ColdBox Platform Evangelist
Ortus Solutions, Corp

ColdBox Platform:

Except that Fusebox uses the index.cfm as its controller, so although Brad has given you a guide to go by, just remember that you can achieve the desired results.

Another solution would be to use rewrite rules, or apply an Application.cfc to Fusebox that uses the same application name, but just without the ColdBox stuff in the root of the fusebox code.

As always there will be many ways to skin the cat.