Skip to content

Commit

Permalink
Fix framework-one#258 by adding framework.diConfig option (defaults t…
Browse files Browse the repository at this point in the history
…o empty struct). This is passed to DI/1, AOP/1 as second constructor argument, and to WireBox as properties. Only affects top-level bean factory.
  • Loading branch information
seancorfield committed May 31, 2014
1 parent 96e80d2 commit 4288184
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions framework/one.cfc
Expand Up @@ -1955,13 +1955,15 @@ component {
case "aop1":
case "di1":
var ioc = variables.framework.diEngine == "di1" ?
new framework.ioc( variables.framework.diLocations ) :
new framework.aop( variables.framework.diLocations );
new framework.ioc( variables.framework.diLocations,
variables.framework.diConfig ) :
new framework.aop( variables.framework.diLocations,
variables.framework.diConfig );
ioc.addBean( "fw", this ); // alias for controller constructor compatibility
setBeanFactory( ioc );
break;
case "wirebox":
var wb = new framework.WireBoxAdapter();
var wb = new framework.WireBoxAdapter( properties = variables.framework.diConfig );
wb.getBinder().scanLocations( variables.framework.diLocations );
setBeanFactory( wb );
break;
Expand Down Expand Up @@ -2123,6 +2125,9 @@ component {
if ( !structKeyExists( variables.framework, 'diLocations' ) ) {
variables.framework.diLocations = 'model,controller';
}
if ( !structKeyExists( variables.framework, 'diConfig' ) ) {
variables.framework.diConfig = { };
}
setupEnvironment( env );
request._fw1.doTrace = variables.framework.trace;
}
Expand Down

0 comments on commit 4288184

Please sign in to comment.