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