I’m wondering if someone can give me an example of this or point me to some specific documentation. I want to be able to change certain (read ANY) coldbox and custom settings based on the environment. Since I can easily detect which environment I’m in (read development, production), how can I, for example, add an interceptor into the mix based on that environment, or change from one data source to another (say I have one called master but on dev it points to one db and in production it points to a differently named db).
I’ve been playing around with this for a little bit and what I cannot seem to get my head around is (a) how to change framework settings like these on the fly and (b) how they would be registered since the environment functions kick off after configuration completes. I THINK it does not entirely matter typically, at least for db, because the structure is exposed through wirebox which provides dynamic getter functions for name, etc…so I should be able to do
datasources.customdatasource = {}
or
datasources.master = {}
to replace the existing one based on environment…but I’m not sure that will work, or whether or not things like interceptors being added on the fly in this way will either.
Examples / Advice ?
MIke