I’m just trying to clean up some of my config after upgrading to CB4, and a while back I asked about config inheritance for a multi-tenant app.
Brad responded here: https://groups.google.com/d/msg/coldbox/hQxVASXO9q8/aJdDGmXLsf0J
I’ve tried this in a few different ways, and I’m drawing a blank on how to configure it properly.
component extends=“config.Coldbox” {
function configure() {
super.configure();
}
}
When I do that, anything I add afterward the super seems to be ignored?
Thanks,
Tom.
Can you show us a working example of what’s not working?
- You are extending config.coldbox which is the default config file. Are you sure Coldbox is even finding your sub class?
- You would need to change the application.cfc COLDBOX_CONFIG_FILE setting to load anything else
- How are you adding additional properties? Are you re-declaring the entire coldbox struct again, or just adding specific items into it.
- Are you using environment overrides? If so, they all need to call super.development(), etc as well.
Thanks!
~Brad
ColdBox Platform Evangelist
Ortus Solutions, Corp
E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com
Hi Brad,
Here’s an example - does this look correct?
Application.cfc:
COLDBOX_CONFIG_FILE = “custom.config.Coldbox”;
Directory Structure
wwwroot > custom > config > Coldbox.cfc
wwwroot > config > Coldbox.cfc // default “super” config
Coldbox.cfc: component extends=“config.Coldbox” { function configure() { super.congfigure(); coldbox.handlerCaching = “false”; settings.settingToOveride = “test”; mailSettings.username = “differentEmailUsername”; interceptors.append( { class=“interceptors.customInterceptor”, properties={} } ); } }
Ignore the typo BTW in super.configure() 
That seems like it would work. If you dump the variables scope and abort at the end of your custom.config.coldbox, does it contain what you expect?
Also, I don’t know what your exact use case is, but I’ve usually kept config.coldbox as the concrete class, and named the super class something like “BaseColdBox.cfc” which follows the ColdBox developer guidelines. Then I can store the base class outside the root and access it via a mapping by more than one application.
Thanks!
~Brad
ColdBox Platform Evangelist
Ortus Solutions, Corp
E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com
Oh crap. It does work - I was just being a total idiot!
Sorry for wasting your time - been a long day!
Thanks,
Tom.
No worries, glad you’re back in business 
Thanks!
~Brad
ColdBox Platform Evangelist
Ortus Solutions, Corp
E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com