-
Notifications
You must be signed in to change notification settings - Fork 141
/
Application.cfc
62 lines (53 loc) · 2.14 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
component {
// copy this to your application root to use as your Application.cfc
// or incorporate the logic below into your existing Application.cfc
// you can provide a specific application name if you want:
this.name = hash( getBaseTemplatePath() );
// any other application settings:
this.sessionManagement = true;
// set up per-application mappings as needed:
this.mappings[ '/framework' ] = getDirectoryFromPath( getBaseTemplatePath() ) & 'framework';
// this.mappings[ '/app' ] expandPath( '../path/to/app' );
function _get_framework_one() {
if ( !structKeyExists( request, '_framework_one' ) ) {
// create your FW/1 application:
request._framework_one = new framework.one( {
trace = true,
missingview = 'main.missingview',
base = getDirectoryFromPath( CGI.SCRIPT_NAME )
.replaceFirst( getContextRoot(), '' ) & 'introduction'
} );
// you can specify FW/1 configuration as an argument:
// request._framework_one = new framework.one({
// base : '/app',
// trace : true
// });
// if you need to override extension points, use
// MyApplication.cfc for those and then do:
// request._framework_one = new MyApplication({
// base : '/app',
// trace : true
// });
}
return request._framework_one;
}
// delegation of lifecycle methods to FW/1:
function onApplicationStart() {
return _get_framework_one().onApplicationStart();
}
function onError( exception, event ) {
return _get_framework_one().onError( exception, event );
}
function onRequest( targetPath ) {
return _get_framework_one().onRequest( targetPath );
}
function onRequestEnd() {
return _get_framework_one().onRequestEnd();
}
function onRequestStart( targetPath ) {
return _get_framework_one().onRequestStart( targetPath );
}
function onSessionStart() {
return _get_framework_one().onSessionStart();
}
}