Configuration
The configuration for a module is contained within in the ModuleConfig.cfc that lives in the root folder. Here's an overview of the options for configuring your module.
1
component{
2
// Module Properties
3
this.autoMapModels = true;
4
this.modelNamespace = "test";
5
this.cfmapping = "test";
6
this.dependencies = [ "otherModule", "coolModule" ];
7
8
function configure(){
9
10
// Settings for my module
11
settings = {
12
mySetting = 'isCool',
13
settingsCanBe = [
14
'complex',
15
'values'
16
]
17
};
18
19
// Declare some interceptors to listen
20
interceptors = [
21
{
22
class='#moduleMapping#.interceptors.TestInterceptor'
23
}
24
];
25
26
// Ad-hoc interception events I will announce myself
27
interceptorSettings = {
28
customInterceptionPoints = ''
29
};
30
31
// Manually map some models
32
binder.map( 'foo' ).to( '#moduleMapping#.com.foo.bar' );
33
34
}
35
36
// Runs when module is loaded
37
function onLoad(){
38
log.info('Module loaded successfully.' );
39
}
40
41
// Runs when module is unloaded
42
function onUnLoad(){
43
log.info('Module unloaded successfully.' );
44
}
45
46
// An interceptor that listens for every command that's run.
47
function preCommand( interceptData ){
48
// I just intercepted ALL Commands in the CLI
49
log.info('The command executed is #interceptData.CommandInfo.commandString#');
50
}
51
52
}
Copied!
Copy link
Edit on GitHub