Allow OverConf to pass module params
This commit is contained in:
parent
c54b89485e
commit
0d4bea66ed
|
@ -116,13 +116,12 @@ sub init {
|
|||
|
||||
my $moduleType = $self->conf->{sfExtra}->{$extraKey}->{type};
|
||||
next unless ($moduleType);
|
||||
my $over = $self->conf->{sfExtra}->{$extraKey}->{over};
|
||||
|
||||
my %over = %{ $self->conf->{sfExtra}->{$extraKey}->{over} or {} };
|
||||
$self->logger->debug(
|
||||
"Loading extra 2F module $extraKey of type $moduleType");
|
||||
my $m =
|
||||
$self->loadPlugin( "::2F::$moduleType",
|
||||
{ sfPrefix => $extraKey, %over } )
|
||||
$self->loadPlugin( "::2F::$moduleType", $over, prefix => $extraKey, )
|
||||
or return 0;
|
||||
|
||||
# Rule and prefix may be modified by 2F module, reread them
|
||||
|
|
|
@ -43,7 +43,6 @@ sub init {
|
|||
}
|
||||
}
|
||||
|
||||
$self->prefix( $self->conf->{sfPrefix} ) if ( $self->conf->{sfPrefix} );
|
||||
return $self->SUPER::init();
|
||||
}
|
||||
|
||||
|
|
|
@ -68,8 +68,6 @@ sub init {
|
|||
return 0;
|
||||
}
|
||||
|
||||
$self->prefix( $self->conf->{sfPrefix} )
|
||||
if ( $self->conf->{sfPrefix} );
|
||||
return $self->SUPER::init();
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,6 @@ sub init {
|
|||
$self->vrfyAttrs->{$k} = $attr;
|
||||
}
|
||||
|
||||
$self->prefix( $self->conf->{sfPrefix} ) if ( $self->conf->{sfPrefix} );
|
||||
return $self->SUPER::init();
|
||||
}
|
||||
|
||||
|
|
|
@ -46,8 +46,6 @@ sub init {
|
|||
)
|
||||
);
|
||||
|
||||
$self->prefix( $self->conf->{sfPrefix} )
|
||||
if ( $self->conf->{sfPrefix} );
|
||||
return $self->SUPER::init();
|
||||
}
|
||||
|
||||
|
|
|
@ -8,15 +8,15 @@ our @overC;
|
|||
|
||||
# Override portal loadPlugin() to use a wrapped configuration
|
||||
sub loadPlugin {
|
||||
my ( $self, $plugin, $over ) = @_;
|
||||
my $obj = $self->loadModule( $plugin, $over );
|
||||
my ( $self, $plugin, $over, %args ) = @_;
|
||||
my $obj = $self->loadModule( $plugin, $over, %args );
|
||||
return 0
|
||||
unless ( $obj and $obj = $self->p->findEP( $plugin, $obj ) );
|
||||
return $obj;
|
||||
}
|
||||
|
||||
sub loadModule {
|
||||
my ( $self, $plugin, $over ) = @_;
|
||||
my ( $self, $plugin, $over, %args ) = @_;
|
||||
my $obj;
|
||||
my $nc;
|
||||
if ($over) {
|
||||
|
@ -28,7 +28,7 @@ sub loadModule {
|
|||
$nc = $self->conf;
|
||||
}
|
||||
return 0
|
||||
unless ( $obj = $self->p->loadModule( "$plugin", $nc ) );
|
||||
unless ( $obj = $self->p->loadModule( "$plugin", $nc, %args ) );
|
||||
return $obj;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue