plug-ins are now dynamically loaded

This commit is contained in:
JT Smith 2004-05-28 16:00:28 +00:00
parent f83b2c6086
commit 8266dfd69a
11 changed files with 47 additions and 36 deletions

View file

@ -41,6 +41,9 @@ sub getInstance {
my $userId = $_[1];
#Create Auth Object
my $cmd = "WebGUI::Auth::".$authMethod;
my $load = "use ".$cmd;
WebGUI::ErrorHandler::fatalError("Authentication module failed to compile: $cmd.".$@) if($@);
eval($load);
my $auth = eval{$cmd->new($authMethod,$userId)};
WebGUI::ErrorHandler::fatalError("Couldn't instanciate authentication module: $authMethod. Root cause: ".$@) if($@);
return $auth;
@ -100,4 +103,4 @@ sub www_recoverPassword {
return www_auth("recoverPassword");
}
1;
1;

View file

@ -29,6 +29,9 @@ sub _duplicateWobjects {
my $sth = WebGUI::SQL->read("select * from wobject where pageId=$_[0] order by sequenceNumber");
while (my $wobject = $sth->hashRef) {
my $cmd = "WebGUI::Wobject::".${$wobject}{namespace};
my $load = "use ".$cmd;
eval($load);
WebGUI::ErrorHandler::warn("Wobject failed to compile: $cmd.".$@) if($@);
my $w = $cmd->new($wobject);
$w->duplicate($_[1]);
}

View file

@ -42,6 +42,9 @@ sub _purgeUserTrash {
where wobjectId=".$base->{wobjectId});
%properties = (%{$base}, %{$extended});
$cmd = "WebGUI::Wobject::".$properties{namespace};
my $load = "use ".$cmd;
eval($load);
WebGUI::ErrorHandler::warn("Wobject failed to compile: $cmd.".$@) if($@);
$w = $cmd->new(\%properties);
$w->purge;
}
@ -70,6 +73,9 @@ sub _purgeWobject {
where wobjectId=".$base->{wobjectId});
%properties = (%{$base}, %{$extended});
$cmd = "WebGUI::Wobject::".$properties{namespace};
my $load = "use ".$cmd;
eval($load);
WebGUI::ErrorHandler::warn("Wobject failed to compile: $cmd.".$@) if($@);
$w = $cmd->new(\%properties);
$w->purge;
}
@ -86,6 +92,9 @@ sub _purgeWobjects {
where wobjectId=".$base->{wobjectId});
%properties = (%{$base}, %{$extended});
$cmd = "WebGUI::Wobject::".$properties{namespace};
my $load = "use ".$cmd;
eval($load);
WebGUI::ErrorHandler::warn("Wobject failed to compile: $cmd.".$@) if($@);
$w = $cmd->new(\%properties);
$w->purge;
}