[coldbox 3.6] Inherit Coldbox.cfc

I have about 20 sites all running the same app. Currently, I have a custom folder “/www/custom/” where I have all my over-rides for each site (Routes, views, layouts etc), and I also have customised Application.cfc to load a Coldbox.cfc from this location for each site like so:

customCBPath = getDirectoryFromPath(getCurrentTemplatePath()) & “custom/#appName#/config/Coldbox.cfc”;

if (fileExists(customCBPath)) {

COLDBOX_CONFIG_FILE = “custom.#appName#.config.Coldbox”;

} else {

COLDBOX_CONFIG_FILE = “”;

}

However, when I over-ride the Coldbox.cfc like this, in reality, only a few settings are different in each Coldbox.cfc – so I really have a lot of duplication. If I change a setting in the default Coldbox.cfc, I have to do the same thing in each “custom” Coldbox.cfc too…

I was wondering, is there a better way? For example, maybe inheriting the default Coldbox.cfc and then calling a super.configure() or something similar?

Anyone done anything like this, or have any ideas?

Thanks,

Tom.

I have about 20 sites all running the same app. Currently, I have a custom folder “/www/custom/” where I have all my over-rides for each site (Routes, views, layouts etc), and I also have customised Application.cfc to load a Coldbox.cfc from this location for each site like so:

customCBPath = getDirectoryFromPath(getCurrentTemplatePath()) & “custom/#appName#/config/Coldbox.cfc”;

if (fileExists(customCBPath)) {

COLDBOX_CONFIG_FILE = “custom.#appName#.config.Coldbox”;

} else {

COLDBOX_CONFIG_FILE = “”;

}

However, when I over-ride the Coldbox.cfc like this, in reality, only a few settings are different in each Coldbox.cfc – so I really have a lot of duplication. If I change a setting in the default Coldbox.cfc, I have to do the same thing in each “custom” Coldbox.cfc too…

I was wondering, is there a better way? For example, maybe inheriting the default Coldbox.cfc and then calling a super.configure() or something similar?

Anyone done anything like this, or have any ideas?

Thanks,

Tom.

Ok I’ll give it a go - Thanks Brad!