[announcement] more BE features to test

Hey everyone, I’ve got some exciting new stuff on the bleeding edge of CommandBox. Now we have global config settings. They are stored in ~/.CommandBox/CommandBox.json
These can be used by CommandBox to store system-wide settings or user preferences that controls how CommandBox runs. The other use is that now you can directly override module settings via namespaced config settings that follow a convention.

https://ortussolutions.atlassian.net/browse/COMMANDBOX-291
https://ortussolutions.atlassian.net/browse/COMMANDBOX-313

There are three new commands for interacting with config settings:

  • config show
  • config set
  • config clear
    These work in almost every way like the package show/set/clear commands. (I refactored the logic for re-use).

config set mySetting foo=bar
config show mySetting
config clear mySetting

For module developers (custom commands, interceptors, etc), the config is programmatically available via the new ConfigService. See the CFC source for the simple getSetting() setSetting() API.

The coolest part is if you have a module called “foo” with a setting in its ModuleConfig settings struct called bar, you can override that setting (without touching the 3rd party module code) like so:

config set modules.foo.bar = value

I put together a sample module last night that shows this in action:
https://github.com/bdw429s/commandbox-banner-customizer

The entire module is just a single file-- ModuleConfig which has 3 default settings and an OnCLIStart() interceptor listener. It lets you control the ASCII art banner that shows when CommandBox opens via your config settings. It’s just an example, but should show what’s possible. Read the readme (and the one file of code) to see how it works.

I’ll be documenting all the new CommandBox interception points, but they’re also here on this ticket:

https://ortussolutions.atlassian.net/browse/COMMANDBOX-252

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Just realized I typo’s one of the examples.

config set mySetting foo=bar

should have been

config set mySetting=myValue

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Just added these nice WireBox DSLs to CommandBox that module authors can use in their code to help get programmatic access to module settings and config settings.

property name='shell' inject='commandbox';
property name='allModuleConfigs' inject='commandbox:moduleConfig';
property name='moduleConfig' inject='commandbox:moduleConfig:moduleName';
property name='moduleSettings' inject='commandbox:moduleSettings:moduleName';
property name='mySetting' inject='commandbox:moduleSettings:moduleName:mySetting';
property name='myConfigSettings' inject='commandbox:ConfigSettings';
property name='myConfigSetting' inject='commandbox:ConfigSettings:myConfigSetting';

These injections can go into Command CFCs or any module that ships with your CommandBox module.

https://ortussolutions.atlassian.net/browse/COMMANDBOX-314

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com