[coldbox-3.5.3] application.cbBootstrap

After upgrading the coldbox platform tools, the application.cfc scaffold’d contains this code:

onApplicationStart:

application.cbBootstrap = CreateObject(“component”,“coldbox_3_5_3.system.Coldbox”).init(COLDBOX_CONFIG_FILE,COLDBOX_APP_ROOT_PATH,COLDBOX_APP_KEY,COLDBOX_APP_MAPPING);
application.cbBootstrap.loadColdbox();
return true;

onRequestStart:

<cfif not structKeyExists(application,“cbBootstrap”) or application.cbBootStrap.isfwReinit()>

<cfset structDelete(application,“cbBootStrap”)>
<cfset application.cbBootstrap = CreateObject(“component”,“coldbox_3_5_3.system.Coldbox”).init(COLDBOX_CONFIG_FILE,COLDBOX_APP_ROOT_PATH,COLDBOX_APP_KEY,COLDBOX_APP_MAPPING)>

<cfset application.cbBootstrap.onRequestStart(arguments.targetPage)>

my current application doesnt use that. Should I switch to that? What is that?

Are you using the inheritance or non-inheritance approach?

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

How do I find that out?

It extends a class.

extends=“coldbox_3_5_3.system.Coldbox”

It does.

Description :
This is the bootstrapper Application.cfc for ColdBox Applications.
It uses inheritance on the CFC, so if you do not want inheritance
then use the Application_noinheritance.cfc instead.

Then you don’t need to be creating ColdBox manually. The inheritance approach has a lot less code because all the createObject stuff is wrapped up for you in the class that you’re extending.

Also, I see that you’ve renamed your “coldbox” folder to “coldbox_3_5_3”. Have you also performed a find/replace on coldbox.system and coldbox/system in the ColdBox source code? if not, you are probably going to get errors or accidentally be creating files from some other mapping without realizing it.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

ok. that makes sense. ill keep my code as is.

and i have renamed all the references in the source code. i hope ive gotten all of them. although, i dont get any errors so most likely.

thanks brad.