-
Notifications
You must be signed in to change notification settings - Fork 0
/
Application.cfc
48 lines (38 loc) · 1.18 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
component output="false"{
// application variables
this.name = "#hash( getCurrentTemplatePath() )#v0008";
this.sessionmanagement = true;
this.clientmanagement = true;
this.scriptProtect = false;
this.welcomefilelist = "views/index.cfm";
this.isDevelopment = true;
// orm settings
this.datasource = "ormTest";
this.ormEnabled = true;
this.ormsettings.dbcreate = "dropcreate";
this.ormsettings.logSQL = true;
this.ormsettings.cflocation = "models";
/**
* @hint The application first starts
*/
public boolean function onApplicationStart(){
application.departmentObj = createObject('services.department').init( this.datasource );
application.managerObj = createObject('services.manager').init( this.datasource );
return true;
}
/**
* @hint A request starts
*/
public boolean function onRequestStart(String targetPage){
// Remove when finished initial development
onApplicationStart();
if( structKeyExists(url, "rebuild") ){
onApplicationStart();
this.ormsettings.dbcreate = "dropcreate";
ormflush();
//application.departmentObj.create("Human resources");
}
//writeDump(var=application.departmentObj, abort=1);
return true;
}
}