| 1 | <cftry> |
|---|
| 2 | <cfsilent> |
|---|
| 3 | <!--- |
|---|
| 4 | Fusebox Software License |
|---|
| 5 | Version 1.0 |
|---|
| 6 | |
|---|
| 7 | Copyright (c) 2003, 2004, 2005, 2006 The Fusebox Corporation. All rights reserved. |
|---|
| 8 | |
|---|
| 9 | Redistribution and use in source and binary forms, with or without modification, are permitted |
|---|
| 10 | provided that the following conditions are met: |
|---|
| 11 | |
|---|
| 12 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions |
|---|
| 13 | and the following disclaimer. |
|---|
| 14 | |
|---|
| 15 | 2. Redistributions in binary form or otherwise encrypted form must reproduce the above copyright |
|---|
| 16 | notice, this list of conditions and the following disclaimer in the documentation and/or other |
|---|
| 17 | materials provided with the distribution. |
|---|
| 18 | |
|---|
| 19 | 3. The end-user documentation included with the redistribution, if any, must include the following |
|---|
| 20 | acknowledgment: |
|---|
| 21 | |
|---|
| 22 | "This product includes software developed by the Fusebox Corporation (http://www.fusebox.org/)." |
|---|
| 23 | |
|---|
| 24 | Alternately, this acknowledgment may appear in the software itself, if and wherever such |
|---|
| 25 | third-party acknowledgments normally appear. |
|---|
| 26 | |
|---|
| 27 | 4. The names "Fusebox" and "Fusebox Corporation" must not be used to endorse or promote products |
|---|
| 28 | derived from this software without prior written (non-electronic) permission. For written |
|---|
| 29 | permission, please contact fusebox@fusebox.org. |
|---|
| 30 | |
|---|
| 31 | 5. Products derived from this software may not be called "Fusebox", nor may "Fusebox" appear in |
|---|
| 32 | their name, without prior written (non-electronic) permission of the Fusebox Corporation. For |
|---|
| 33 | written permission, please contact fusebox@fusebox.org. |
|---|
| 34 | |
|---|
| 35 | If one or more of the above conditions are violated, then this license is immediately revoked and |
|---|
| 36 | can be re-instated only upon prior written authorization of the Fusebox Corporation. |
|---|
| 37 | |
|---|
| 38 | THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
|---|
| 39 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
|---|
| 40 | DISCLAIMED. IN NO EVENT SHALL THE FUSEBOX CORPORATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY |
|---|
| 41 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|---|
| 42 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
|---|
| 43 | BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
|---|
| 44 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
|---|
| 45 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|---|
| 46 | |
|---|
| 47 | ------------------------------------------------------------------------------- |
|---|
| 48 | |
|---|
| 49 | This software consists of voluntary contributions made by many individuals on behalf of the |
|---|
| 50 | Fusebox Corporation. For more information on Fusebox, please see <http://www.fusebox.org/>. |
|---|
| 51 | |
|---|
| 52 | ---> |
|---|
| 53 | |
|---|
| 54 | <!--- FB5: allow "" default - FB41 required this variable: ---> |
|---|
| 55 | <cfparam name="FUSEBOX_APPLICATION_PATH" type="string" default="" /> |
|---|
| 56 | <!--- FB5: application key - FB41 always uses 'fusebox': ---> |
|---|
| 57 | <cfparam name="FUSEBOX_APPLICATION_KEY" type="string" default="fusebox" /> |
|---|
| 58 | |
|---|
| 59 | <cfparam name="attributes" type="struct" default="#structNew()#" /> |
|---|
| 60 | <cfset structAppend(attributes,URL,true) /> |
|---|
| 61 | <cfset structAppend(attributes,form,true) /> |
|---|
| 62 | |
|---|
| 63 | <!--- FB5: myFusebox is an object but has FB41-compatible public properties ---> |
|---|
| 64 | <cfset myFusebox = createObject("component","myFusebox").init(FUSEBOX_APPLICATION_KEY,attributes) /> |
|---|
| 65 | <!--- FB5: indicates whether application was started on this request ---> |
|---|
| 66 | <cfset myFusebox.applicationStart = false /> |
|---|
| 67 | <!--- |
|---|
| 68 | complex condition allows FB5 to drop into a running FB41 site and force re-init because |
|---|
| 69 | FB41 application.fusebox will not have compileRequest() method - this should make upgrades |
|---|
| 70 | to FB5 easier! |
|---|
| 71 | ---> |
|---|
| 72 | <cfif not structKeyExists(application,FUSEBOX_APPLICATION_KEY) or myFusebox.parameters.load> |
|---|
| 73 | <cflock name="#application.ApplicationName#_fusebox_#FUSEBOX_APPLICATION_KEY#" type="exclusive" timeout="300"> |
|---|
| 74 | <cfif not structKeyExists(application,FUSEBOX_APPLICATION_KEY) or myFusebox.parameters.load |
|---|
| 75 | or not structKeyExists(application[FUSEBOX_APPLICATION_KEY],"compileRequest") |
|---|
| 76 | or not isCustomFunction(application[FUSEBOX_APPLICATION_KEY].compileRequest)> |
|---|
| 77 | <cfset application[FUSEBOX_APPLICATION_KEY] = |
|---|
| 78 | createObject("component","fuseboxApplication") |
|---|
| 79 | .init(FUSEBOX_APPLICATION_KEY,FUSEBOX_APPLICATION_PATH,myFusebox) /> |
|---|
| 80 | <cfset _fba = application[FUSEBOX_APPLICATION_KEY] /> |
|---|
| 81 | <cfif myFusebox.parameters.parseall> |
|---|
| 82 | <cfset _fba.compileAll(myFusebox) /> |
|---|
| 83 | </cfif> |
|---|
| 84 | <cfparam name="attributes.#_fba.fuseactionVariable#" default="#_fba.defaultFuseaction#" /> |
|---|
| 85 | <cfset myFusebox.applicationStart = true /> |
|---|
| 86 | <!--- force parse after reload for consistency ---> |
|---|
| 87 | <cfset myFusebox.parameters.parse = true /> |
|---|
| 88 | <!--- FB5: new appinit include file ---> |
|---|
| 89 | <cftry> |
|---|
| 90 | <cfinclude template="#_fba.getCoreToAppRootPath()#fusebox.appinit.cfm" /> |
|---|
| 91 | <cfcatch type="missinginclude" /> |
|---|
| 92 | </cftry> |
|---|
| 93 | <cfelse> |
|---|
| 94 | <cfset _fba = application[FUSEBOX_APPLICATION_KEY] /> |
|---|
| 95 | <cfparam name="attributes.#_fba.fuseactionVariable#" default="#_fba.defaultFuseaction#" /> |
|---|
| 96 | </cfif> |
|---|
| 97 | </cflock> |
|---|
| 98 | <cfelse> |
|---|
| 99 | <cfset _fba = application[FUSEBOX_APPLICATION_KEY] /> |
|---|
| 100 | <cfparam name="attributes.#_fba.fuseactionVariable#" default="#_fba.defaultFuseaction#" /> |
|---|
| 101 | </cfif> |
|---|
| 102 | <cftry> |
|---|
| 103 | <cfinclude template="#_fba.getCoreToAppRootPath()#fusebox.init.cfm" /> |
|---|
| 104 | <cfcatch type="missinginclude" /> |
|---|
| 105 | </cftry> |
|---|
| 106 | <cfset _parsedFile = _fba.compileRequest(attributes[_fba.fuseactionVariable],myFusebox) /> |
|---|
| 107 | </cfsilent><cfprocessingdirective suppresswhitespace="true"> |
|---|
| 108 | <cfinclude template="#_parsedFile#" /> |
|---|
| 109 | </cfprocessingdirective> |
|---|
| 110 | <cfcatch type="fusebox"> |
|---|
| 111 | <cfif not isDefined("_fba.errortemplatesPath") or not _fba.handleFuseboxException(cfcatch)> |
|---|
| 112 | <cfrethrow /> |
|---|
| 113 | </cfif> |
|---|
| 114 | </cfcatch> |
|---|
| 115 | </cftry> |
|---|