/
Application.cfc
34 lines (27 loc) · 940 Bytes
/
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
component {
this.name = "bear";
request.dgmrRunningDirectory = getDirectoryFromPath( getCurrentTemplatePath() );
//The following code and its placement is a little odd. Its here to give developers the ability to download then run code to do the setup.
if ( fileExists( request.dgmrRunningDirectory & "settings.cfm" ) ) {
include "settings.cfm";
} else if ( structKeyExists( form, "makeSettings" ) ) {
include "saveSettings.cfm";
location( url="index.cfm?ormReload", addtoken=false );
} else {
include "setup.cfm";
abort;
}
this.ormEnabled = true;
this.ormSettings.useDBForMapping = false;
this.mappings[ "/ui" ] = request.dgmrRunningDirectory & "ui";
this.mappings[ "/services" ] = request.dgmrRunningDirectory & "services";
function onRequestStart() {
if ( structKeyExists( url, "ormReload" ) ) {
ormReload();
}
}
function onError( Exception, EventName ) {
writeOutput("<h2>bear error</h2>");
writeDump(arguments);
}
}