Skip to content

Commit

Permalink
Fix #363 by supporting binder-based config
Browse files Browse the repository at this point in the history
If `diConfig` is a string, it is assumed to be the dotted path to a
binder CFC and is passed directly to the `Injector`. The `framework`
configuration struct is passed at the `properties` argument (which is
comparable with how ColdBox uses WireBox).
  • Loading branch information
seancorfield committed Sep 5, 2015
1 parent 317caa4 commit e57b234
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions framework/one.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -2182,12 +2182,23 @@ component {
setBeanFactory( ioc );
break;
case "wirebox":
var wb = new "#variables.framework.diComponent#"(
properties = variables.framework.diConfig
);
wb.getBinder().scanLocations( variables.framework.diLocations );
// we do not provide fw alias for controller constructor here!
setBeanFactory( wb );
if ( isSimpleValue( variables.framework.diConfig ) ) {
// per #363 assume name of binder CFC
var wb1 = new "#variables.framework.diComponent#"(
variables.framework.diConfig, // binder path
variables.framework // properties struct
);
// we do not provide fw alias for controller constructor here!
setBeanFactory( wb1 );
} else {
// legacy configuration
var wb2 = new "#variables.framework.diComponent#"(
properties = variables.framework.diConfig
);
wb2.getBinder().scanLocations( variables.framework.diLocations );
// we do not provide fw alias for controller constructor here!
setBeanFactory( wb2 );
}
break;
case "custom":
var ioc = new "#variables.framework.diComponent#"(
Expand Down

0 comments on commit e57b234

Please sign in to comment.