-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModuleConfig.cfc
49 lines (41 loc) · 1.41 KB
/
ModuleConfig.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
component {
this.title = "config-builder";
this.author = "Joseph Lamoree";
this.webURL = "https://github.com/ecivis/config-builder";
this.description = "A custom DSL for fetching nested configuration information.";
this.version = "1.0.1";
this.dependencies = [];
this.autoMapModels = false;
/**
* Configure
*/
public void function configure() {
// You might like to know that this will get called multiple times. For reasons, I guess.
variables.log.info("The Config Builder module was configured.");
/*
This doesn't work:
variables.binder.mapDSL("config", "#variables.moduleMapping#.ConfigBuilderDSL");
*/
/*
This also doesn't work:
if (!structKeyExists(variables.wirebox, "customDSL")) {
variables.wirebox.customDSL = {};
}
structAppend(variables.wirebox.customDSL, {"config": "#variables.moduleMapping#.ConfigBuilderDSL"});
*/
/*
This works. Perhaps dynamic DSL registration is required due to load order.
*/
variables.controller.getWireBox().registerDSL("config", "#variables.moduleMapping#.ConfigBuilderDSL");
}
/**
* Fired when the module is registered and activated.
*/
public void function onLoad() {
}
/**
* Fired when the module is unregistered and unloaded
*/
public void function onUnload() {
}
}