Public feed #600721

application.cfc

public html v1 · immutable
Raw Edit
·published 2007-07-03 01:40 UTC
rendered paste body
<cfcomponent output="false">	<cfset this.name 				= "CD" />	<cfset this.applicationTimeout 	= createTimeSpan(0,0,1,0) />	<cfset this.clientManagement 	= true />	<cfset this.clientStorage 		= "cookie" />	<cfset this.loginStorage 		= "session" />	<cfset this.sessionManagement 	= true />	<cfset this.sessionTimeout 		= createTimeSpan(1,0,0,0) />	<cfset this.setClientCookies 	= true />	<cfset this.setDomainCookies 	= false />	<cfset this.scriptProtect 		= false />	<cffunction name="onApplicationStart" returnType="boolean" output="false">	<cfset var xmlFile = "">	<cfset var xmlData = "">	<cfset var rootDir = getDirectoryFromPath(getCurrentTemplatePath())>	<cfset var key = "">	<cfset var groups = "">	<cfset var datasource = "">   	<!--- load settings --->	<cffile action="read" file="#rootdir#/config/config.cfm" variable="xmlFile">	<!--- Remove comments --->	<cfset xmlFile = replace(xmlFile, "<!---","")>	<cfset xmlFile = trim(replace(xmlFile, "--->",""))>		<cfset xmlData = xmlParse(xmlFile)>	<cfloop item="key" collection="#xmlData.initvals.defaults#">		<cfset application[key] = xmlData.initvals.defaults[key].xmlText>	</cfloop>		<!--- coldspring needs this --->	<cfset application.defaultProperties = structnew()/>	<cfset application.defaultProperties.dsn = application.dsn >		<cfset application.attachmentPath = rootDir & "attachments">		<cfset application.securityManager = createObject("component","model.security").init(application.dsn)>	<cfset application.pageRender = createObject("component","model.PageRender").init()>	<cfset application.pageGateway = createObject("component","model.PageGateway").init(application.dsn)>	<cfset application.pageDAO = createObject("component","model.PageDAO").init(application.dsn)>		<cfreturn true></cffunction><cffunction name="onApplicationEnd" returnType="void" output="false">	<cfargument name="applicationScope" required="true"></cffunction><cffunction name="onRequestStart" returnType="boolean" output="false">	<cfargument name="thePage" type="string" required="true">	<cfparam name="attributes.isLoginForm" default="false">	<cfparam name="session.isAuthenticated" default="false">	<cfif isDefined("url.reinit")>		<cfset onApplicationStart()>	</cfif>	<cfsilent>		<!--- <cfif right(cgi.script_name, len("index.cfm")) neq "index.cfm" and right(cgi.script_name, 3) neq "cfc">			<cflocation url="index.cfm" addtoken="no" />		</cfif> --->		<cfif structKeyExists(url, "reinit")>			<cfset onApplicationStart()>		</cfif>	</cfsilent><cfreturn true></cffunction><cffunction name="onRequest" returnType="void">	<cfargument name="thePage" type="string" required="true">	<cfinclude template="#arguments.thePage#"></cffunction><cffunction name="onRequestEnd" returnType="void" output="false">	<cfargument name="thePage" type="string" required="true"></cffunction><cffunction name="onError" returnType="void" output="true">	<cfargument name="exception" required="true">	<cfargument name="eventname" type="string" required="true">	<cfdump var="#arguments.exception#"></cffunction><cffunction name="onSessionStart" returnType="void" output="false"></cffunction><cffunction name="onSessionEnd" returnType="void" output="false">	<cfargument name="sessionScope" type="struct" required="true">	<cfargument name="appScope" type="struct" required="false"></cffunction></cfcomponent>