-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathApplication.cfc
63 lines (61 loc) · 2.15 KB
/
Application.cfc
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<cfcomponent>
<!--- configure this Application.cfm options --->
<cfscript>
THIS.name = "IUSDemo_v1";
THIS.clientmanagement="True";
THIS.loginstorage="session";
THIS.sessionmanagement="True";
THIS.sessiontimeout="#createtimespan(0,15,0,0)#";
THIS.applicationtimeout="#createtimespan(0,0,0,0)#";
THIS.scriptprotect="all";
</cfscript>
<!--- --->
<!--- onApplicationStart --->
<!--- --->
<cffunction name="onApplicationStart">
<!--- set application variables --->
<cfscript>
APPLICATION.ds = "[your datasource]";
APPLICATION.iusTable = 'iusDemo';
APPLICATION.iusColumn = 'demoId';
</cfscript>
<!--- INITIALIZE OBJECTS --->
<cfset datasourceObject = createObject('component','Datasource').init(DSN = APPLICATION.ds) />
<cfset APPLICATION.iusObject = createObject('component','IrreversibleURLShortener').init(datasource = datasourceObject) />
<!--- log the application start --->
<cflog text="#THIS.name# Application Started" type="Information" file="#THIS.name#" thread="yes" date="yes" time="yes" application="yes">
<cfreturn True>
</cffunction>
<!--- --->
<!--- onSessiontStart --->
<!--- --->
<cffunction name="onSessionStart">
</cffunction>
<!--- --->
<!--- onRequestStart --->
<!--- --->
<cffunction name="onRequestStart">
<!--- set up a tick counter --->
<cfset tickBegin = GetTickCount()>
</cffunction>
<cffunction name="onRequestEnd">
<!--- set up another tick counter --->
<cfset tickEnd = GetTickCount()>
<!--- calculate ticks it took to process this page --->
<cfset totalTicks = tickEnd - tickBegin>
</cffunction>
<!--- --->
<!--- onSessionEnd --->
<!--- --->
<cffunction name="onSessionEnd" returnType="void">
<cfargument name="SessionScope" required=True/>
<cfargument name="ApplicationScope" required=False/>
</cffunction>
<!--- --->
<!--- onApplicationEnd --->
<!--- --->
<cffunction name="onApplicationEnd">
<cfargument name="ApplicationScope" required=true/>
<cflog file="#This.Name#" type="Information" text="Application #ApplicationScope.applicationname# Ended">
</cffunction>
</cfcomponent>