In ColdBox.cfc is it possible to use a ColdBox setting in another directive? My reason to do this is to disable the SSL interceptor when the code is running locally on my machine. I keep run into looping issues. I am trying to set a variable to true or false and use it in an interceptor…
coldbox = {…
checkSSLsetting = true,…
interceptors = [
…{class=“interceptors.ssl”,
properties= {
checkSSL = checkSSLsetting ,
pattern = “.*”
}…
}
];
You should be able to re-use a setting, since they’re just variables after all.
coldbox = {
mySetting = true
};
interceptors = [
{class=“interceptors.ssl”,
properties= {
checkSSL = coldbox.mySetting
}
}
];
Now, the issue you’ll probably run into is that if you’re using environment overrides, your development() method (or whatever it is) will run after and may overwrite the main setting, but not anywhere you’ve copied it to.
If at all possible, get settings at run time with getSetting( ‘mySetting’ ) or write an afterConfigurationLoad() interceptor to finish configuring your application. My preference being the first.
Thanks!
~Brad
ColdBox Platform Evangelist
Ortus Solutions, Corp
E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com