-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApplication.cfc
executable file
·73 lines (60 loc) · 2.33 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
component {
// Version: FW/1 4.0.0
// 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;
this.ormenabled = true;
this.datasource = "PortMan";
this.ormSettings.dbCreate = "update";
this.ormSettings.dialect = "MYSQL";
// set up per-application mappings as needed:
// this.mappings[ '/framework' ] = expandPath( '../path/to/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();
// you can specify FW/1 configuration as an argument:
// request._framework_one = new framework.one({
// base : '/app',
// trace : true
// });
request._framework_one = new MyApplication({
reloadApplicationOnEveryRequest : false
});
// 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;
}
// custom settings
this.baseDir = "PortMan";
this.mappings = structNew();
this.mappings["/assets"] = this.baseDir & "/assets";
// 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();
}
}