@Luis and company, here is what my full config looks like, I had to
use the URL section above to get this to work as intended:
<!---
structures/arrays to create for configuration
- coldbox (struct)
- settings (struct)
- conventions (struct)
- environments (struct)
- ioc (struct)
- models (struct)
- debugger (struct)
- mailSettings (struct)
- i18n (struct)
- bugTracers (struct)
- webservices (struct)
- datasources (struct)
- layoutSettings (struct)
- layouts (array of structs)
- cacheBox (struct)
- interceptorSettings (struct)
- interceptors (array of structs)
- modules (struct)
- logBox (struct)
Available objects in variable scope
- controller
- logBoxConfig
- appMapping (auto calculated by ColdBox)
Required Methods
- configure() : The method ColdBox calls to configure the
application.
Optional Methods
- detectEnvironment() : If declared the framework will call it and it
must return the name of the environment you are on.
- {environment}() : The name of the environment found and called by
the framework.
--->
<cfcomponent output="false" hint="My App Configuration" >
<cffunction name="GetAppShared" access="private" output="false"
returntype="struct">
<cfscript>
var sSetting=StructNew(); //ast = application shared struct
// Application INI Data
sSetting.AppIniData=StructNew();
sSetting.AppIniData= GetApplicationConfig(
ConfigFilename="ApplicationConfig.cfm",
ConfigFileLine="32",
ConfigNames="ApplicationMode,AppDomain,UrlAddress,SecondaryUrlAddress,BugTracers,BugTracerTo,BugTracerFrom"
);
//************CORE Application
Settings*************************************
sSetting.AppCore=StructNew();
sSetting.AppCore.AppName="AppName";
sSetting.AppCore.AppDomain=sSetting.AppIniData.AppIniData.AppDomain;
sSetting.AppCore.AppFullDomain=sSetting.AppIniData.AppIniData.UrlAddress;
sSetting.AppCore.AppCfcPathName="AppCfcPathName";
sSetting.AppCore.AppKey=DateFormat(now(),"yyyymmdd");
sSetting.AppCore.DebugPassword=sSetting.AppCore.AppKey;
sSetting.AppCore.ReInitPassword=sSetting.AppCore.AppKey;
sSetting.AppCore.BackwardsCompatible=false;
sSetting.AppCore.Database=StructNew();
sSetting.AppCore.Database.name="pcmenu";
sSetting.AppCore.Database.datasource="pcmenusqldev";
sSetting.AppCore.Database.dbType="";
sSetting.AppCore.Database.username="";
sSetting.AppCore.Database.password="";
//application encryption settings use for encrypting any data
sSetting.AppCore.AppEncrypt.Encryption=true;
sSetting.AppCore.AppEncrypt.Seed=hash("MallfinderRetailHub" &
sSetting.AppCore.AppKey);
sSetting.AppCore.AppEncrypt.Algorithm="CFMX_COMPAT";
sSetting.AppCore.AppEncrypt.Encoding="Base64";
//cookie settings, as cookies are added to the system, this list
is used for debugging and clearing cookies on log out, do not remove
the base cbstorage
sSetting.AppCore.CookieList="cbStorage" & "," &
sSetting.AppCore.AppName;
sSetting.AppCore.CookieSetting.CookieEncryption=sSetting.AppCore.AppEncrypt.Encryption;
sSetting.AppCore.CookieSetting.CookieSeed=sSetting.AppCore.AppEncrypt.Seed;
sSetting.AppCore.CookieSetting.CookieAlgorithm=sSetting.AppCore.AppEncrypt.Algorithm;
sSetting.AppCore.CookieSetting.CookieEncoding=sSetting.AppCore.AppEncrypt.Encoding;
//what version of coldbox are we running, all coldbox specific
framework data
sSetting.AppCore.ColdBox=StructNew();
sSetting.AppCore.ColdBox.Version="Coldbox 3.10";
sSetting.AppCore.ColdBox.Website="http://coldbox.org/";
sSetting.AppCore.ColdBox.Documentation="http://wiki.coldbox.org/
wiki/Dashboard.cfm";
// get all of the server operating system information
sSetting.AppServerInfo=GetServerInfo();
sSetting.AppServerInfo.ApplicationPath=sSetting.AppServerInfo.AppBasePath
& sSetting.AppCore.AppName &
sSetting.AppServerInfo.AppFilePathSeparator;
// get base application data, hard coded xml data files, may
change to queries later
sSetting.AppData=StructNew();
sSetting.AppData.AppDataFilePath=ExpandPath("../") &
sSetting.AppCore.AppName & sSetting.AppServerInfo.AppFilePathSeparator
& "data" & sSetting.AppServerInfo.AppFilePathSeparator;
// setup the log files
sSetting.AppLogs=StructNew();
sSetting.AppLogs.AppLogFileName="RetailHub";
sSetting.AppLogs.AppLogFilePath=ExpandPath("../") &
sSetting.AppCore.AppName & "logs";
// which environment are we working in
sSetting.AppDevMode=StructNew();
switch (sSetting.AppIniData.AppIniData.ApplicationMode){
case "Production": {
//----------------------------------------------------------------------------------------------------------------------------------------
// PRODUCTION
//----------------------------------------------------------------------------------------------------------------------------------------
sSetting.AppCore.AppMode="Production";
sSetting.AppDevMode.AppDebugMode=false;
//Application Aspects : Production false,true,true,true ::
Development true,false,false,false
sSetting.AppDevMode.configAutoReload=false;
sSetting.AppDevMode.handlerCaching=true;
sSetting.AppDevMode.handlersIndexAutoReload=false;
sSetting.AppDevMode.eventCaching=true;
sSetting.AppDevMode.methodOutput=false;
sSetting.AppDevMode.proxyReturnCollection=true;
sSetting.AppDevMode.flashURLPersistScope="session";
//modules
sSetting.AppDevMode.modulesAutoReload=false;
//Error/Exception Handling
sSetting.AppDevMode.defaultLogLevel=0;
sSetting.AppDevMode.enableDumpVar=true;
sSetting.AppDevMode.exceptionHandler="";
sSetting.AppDevMode.onInvalidEvent="";
sSetting.AppDevMode.customErrorTemplate="";
break;}
case "Testing": {
//----------------------------------------------------------------------------------------------------------------------------------------
// TESTING
//----------------------------------------------------------------------------------------------------------------------------------------
sSetting.AppCore.AppMode="Testing";
sSetting.AppDevMode.AppDebugMode=true;
//Application Aspects
sSetting.AppDevMode.configAutoReload=true;
sSetting.AppDevMode.handlerCaching=false;
sSetting.AppDevMode.handlersIndexAutoReload=true;
sSetting.AppDevMode.eventCaching=false;
sSetting.AppDevMode.methodOutput=false;
sSetting.AppDevMode.proxyReturnCollection=true;
sSetting.AppDevMode.flashURLPersistScope="session";
//modules
sSetting.AppDevMode.modulesAutoReload=true;
//Error/Exception Handling
sSetting.AppDevMode.defaultLogLevel=1;
sSetting.AppDevMode.enableDumpVar=true;
sSetting.AppDevMode.exceptionHandler="";
sSetting.AppDevMode.onInvalidEvent="";
sSetting.AppDevMode.customErrorTemplate="";
break;}
case "Development": {
//----------------------------------------------------------------------------------------------------------------------------------------
// DEVELOPMENT
//----------------------------------------------------------------------------------------------------------------------------------------
sSetting.AppCore.AppMode="Development";
sSetting.AppDevMode.AppDebugMode=true;
//Application Aspects
sSetting.AppDevMode.configAutoReload=false;
sSetting.AppDevMode.handlerCaching=false;
sSetting.AppDevMode.handlersIndexAutoReload=true;
sSetting.AppDevMode.eventCaching=false;
sSetting.AppDevMode.methodOutput=true;
sSetting.AppDevMode.proxyReturnCollection=true;
sSetting.AppDevMode.flashURLPersistScope="session";
//modules
sSetting.AppDevMode.modulesAutoReload=true;
//Error/Exception Handling
sSetting.AppDevMode.defaultLogLevel=1;
sSetting.AppDevMode.enableDumpVar=true;
sSetting.AppDevMode.exceptionHandler="";
sSetting.AppDevMode.onInvalidEvent="";
sSetting.AppDevMode.customErrorTemplate="";
break;}
}
if(
isDefined("url.fwreinit") AND
url.fwreinit Eq sSetting.AppCore.AppKey AND
isDefined("url.debugmode") AND
isBoolean(url.debugmode) AND
isDefined("url.debugpassword") AND
url.debugpassword Eq sSetting.AppCore.AppKey
){
sSetting.AppDevMode.AppDebugMode=url.debugmode;
}
return sSetting;
</cfscript>
</cffunction>
<!---