-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathApplication.cfc
More file actions
43 lines (30 loc) · 1.2 KB
/
Application.cfc
File metadata and controls
43 lines (30 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<cfcomponent output="false">
<!--- Application name, should be unique --->
<cfset this.name = Hash( GetCurrentTemplatePath() ) />
<!--- How long application vars persist --->
<cfset this.applicationTimeout = createTimeSpan(0,8,0,0) />
<cfset this.sessionManagement = true />
<cfset this.sessionTimeout = createTimeSpan(0,0,20,0) />
<!--- Dev or Prod? --->
<cfset this.isDev = false />
<!--- Run when application starts up --->
<cffunction name="onApplicationStart" returnType="boolean" output="false">
<cfif (NOT IsDefined('application.cache')) OR (IsDefined('url.reinit'))>
<cflock name="cacheInit" type="exclusive" timeout="15">
<cfset application.cache = CreateObject('component','com.hanzo.util.cache.SimpleCache').init() />
</cflock>
<cfif isdefined('url.reinit')>
<cfobjectcache action="clear" />
</cfif>
</cfif>
<cfreturn true />
</cffunction>
<!--- Run before the request is processed --->
<cffunction name="onRequestStart" returnType="boolean" output="false">
<cfargument name="thePage" type="string" required="true" />
<cfif isdefined('url.reinit')>
<cfset onApplicationStart() />
</cfif>
<cfreturn true />
</cffunction>
</cfcomponent>