|
34 | 34 | <cfinclude template="#this.projectConstructorLocation#" /> |
35 | 35 |
|
36 | 36 |
|
| 37 | + <!--- set up the farcry dsn from the environment ---> |
| 38 | + <cfif structKeyExists(THIS, "bUseEnv") AND THIS.bUseEnv eq "true"> |
| 39 | + <cfset system = createObject("java", "java.lang.System")> |
| 40 | + <cfset FARCRY_DSN = "" & system.getEnv("FARCRY_DSN")> |
| 41 | + |
| 42 | + <cfif len(FARCRY_DSN)> |
| 43 | + |
| 44 | + <!--- set the farcry dsn, dbtype and dbowner ---> |
| 45 | + <cfset THIS.dsn = FARCRY_DSN /> |
| 46 | + <cfset FARCRY_DBTYPE = system.getEnv("FARCRY_DBTYPE")> |
| 47 | + <cfif NOT isNull(FARCRY_DBTYPE)> |
| 48 | + <cfset THIS.dbType = FARCRY_DBTYPE> |
| 49 | + </cfif> |
| 50 | + <cfset FARCRY_DBOWNER = system.getEnv("FARCRY_DBOWNER")> |
| 51 | + <cfif NOT isNull(FARCRY_DBOWNER)> |
| 52 | + <cfset THIS.dbOwner = FARCRY_DBOWNER> |
| 53 | + </cfif> |
| 54 | + |
| 55 | + <!--- set up the datasource settings ---> |
| 56 | + <cfset this.datasources[FARCRY_DSN] = { |
| 57 | + "class" = system.getEnv("FARCRY_DSN_CLASS"), |
| 58 | + "connectionString" = system.getEnv("FARCRY_DSN_CONNECTIONSTRING"), |
| 59 | + "database" = system.getEnv("FARCRY_DSN_DATABASE"), |
| 60 | + "driver" = system.getEnv("FARCRY_DSN_DRIVER"), |
| 61 | + "host" = system.getEnv("FARCRY_DSN_HOST"), |
| 62 | + "port" = system.getEnv("FARCRY_DSN_PORT"), |
| 63 | + "type" = system.getEnv("FARCRY_DSN_TYPE"), |
| 64 | + "url" = system.getEnv("FARCRY_DSN_URL"), |
| 65 | + "username" = system.getEnv("FARCRY_DSN_USERNAME"), |
| 66 | + "password" = system.getEnv("FARCRY_DSN_PASSWORD") |
| 67 | + }> |
| 68 | + |
| 69 | + <!--- set custom options when not using a connection string ---> |
| 70 | + <cfset FARCRY_DSN_CUSTOM = system.getEnv("FARCRY_DSN_CUSTOM")> |
| 71 | + <cfif NOT isNull(FARCRY_DSN_CUSTOM) AND len(FARCRY_DSN_CUSTOM)> |
| 72 | + <cfif isJSON(FARCRY_DSN_CUSTOM)> |
| 73 | + <cfset this.datasources[FARCRY_DSN].custom = deserializeJSON(FARCRY_DSN_CUSTOM)> |
| 74 | + <cfelse> |
| 75 | + <cfset stCustom = {}> |
| 76 | + <cfloop list="#FARCRY_DSN_CUSTOM#" index="item" delimiters="&"> |
| 77 | + <cfset stCustom[listFirst(item, "=")] = listRest(item, "=")> |
| 78 | + </cfloop> |
| 79 | + <cfset this.datasources[FARCRY_DSN].custom = stCustom> |
| 80 | + </cfif> |
| 81 | + </cfif> |
| 82 | + |
| 83 | + <!--- set linked db hostname/port using the provided alias ---> |
| 84 | + <cfset FARCRY_DB_LINK_ALIAS = system.getEnv("FARCRY_DB_LINK_ALIAS")> |
| 85 | + <cfif NOT isNull(FARCRY_DB_LINK_ALIAS) AND len(FARCRY_DB_LINK_ALIAS)> |
| 86 | + <cfset DB_PORT = system.getEnv(ucase(FARCRY_DB_LINK_ALIAS) & "_PORT")> |
| 87 | + <cfif NOT isNull(DB_PORT) AND len(DB_PORT)> |
| 88 | + <cfset this.datasources[FARCRY_DSN].host = listFirst(listLast(DB_PORT, "/"), ":")> |
| 89 | + <cfset this.datasources[FARCRY_DSN].port = listLast(listLast(DB_PORT, "/"), ":")> |
| 90 | + </cfif> |
| 91 | + </cfif> |
| 92 | + |
| 93 | + </cfif> |
| 94 | + </cfif> |
| 95 | + |
| 96 | + |
37 | 97 | <cfparam name="this.botDetection" default="true" /> |
38 | 98 | <cfif this.botDetection> |
39 | 99 | <!--- Bot detection values ---> |
|
745 | 805 | <cfparam name="this.bUseMobileWebskins" default="false" /><!--- Mobile webskins are enabled when this flag is set to true ---> |
746 | 806 | <cfparam name="this.bUseTabletWebskins" default="false" /><!--- Tablet webskins are enabled when this flag is set to true ---> |
747 | 807 |
|
| 808 | + <!--- environment configuration ---> |
| 809 | + <cfparam name="this.bUseEnv" default="false" /> |
| 810 | + |
748 | 811 | <!--- Option to archive ---> |
749 | 812 | <cfparam name="this.bUseMediaArchive" default="false" /> |
750 | 813 |
|
|
0 commit comments