-
Notifications
You must be signed in to change notification settings - Fork 0
/
Application.cfc
80 lines (70 loc) · 2.74 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
component output="false" {
// Application name, should be unique
this.name = "cfwheels_www";
// How long application vars persist
this.applicationTimeout = createTimeSpan(0,2,0,0);
// Should client vars be enabled?
this.clientManagement = false;
// Where should we store them, if enable?
this.clientStorage = "registry";
// Where should cflogin stuff persist
this.loginStorage = "session";
// Should we even use sessions?
this.sessionManagement = false;
// How long do session vars persist?
this.sessionTimeout = createTimeSpan(0,0,20,0);
// Should we set cookies on the browser?
this.setClientCookies = false;
// should cookies be domain specific, ie, *.foo.com or www.foo.com
this.setDomainCookies = false;
// should we try to block 'bad' input from users
this.scriptProtect = "none";
// should we secure our JSON calls?
this.secureJSON = false;
// Should we use a prefix in front of JSON strings?
this.secureJSONPrefix = "";
// Used to help CF work with missing files and dir indexes
this.welcomeFileList = "";
// define custom coldfusion mappings. Keys are mapping names, values are full paths
this.mappings = structNew();
// define a list of custom tag paths.
this.customtagpaths = "_customtags";
// Run when application starts up
public boolean function onApplicationStart() output=false {
return true;
}
// Run when application stops
public void function onApplicationEnd(required applicationScope) output=false {
}
// Fired when user requests a CFM that doesn't exist.
public boolean function onMissingTemplate(required string targetpage) output=false {
return true;
}
// Run before the request is processed
public boolean function onRequestStart(required string thePage) output=false {
return true;
}
// Runs before request as well, after onRequestStart
/*
WARNING!!!!! THE USE OF THIS METHOD WILL BREAK FLASH REMOTING, WEB SERVICES, AND AJAX CALLS.
DO NOT USE THIS METHOD UNLESS YOU KNOW THIS AND KNOW HOW TO WORK AROUND IT!
EXAMPLE: http://www.coldfusionjedi.com/index.cfm?mode=entry&entry=ED9D4058-E661-02E9-E70A41706CD89724
*/
public void function onRequest(required string thePage) {
include arguments.thePage;
}
// Runs at end of request
public void function onRequestEnd(required string thePage) output=false {
}
// Runs on error
public void function onError(required exception, required string eventname) output=false {
writeDump( var=arguments );
abort;
}
// Runs when your session starts
public void function onSessionStart() output=false {
}
// Runs when session ends
public void function onSessionEnd(required struct sessionScope, struct appScope) output=false {
}
}