Added option to skip hourly modules on a per site basis.
This commit is contained in:
parent
f445a03a23
commit
9bc401a619
3 changed files with 15 additions and 9 deletions
|
|
@ -5,4 +5,5 @@ logfile = /data/webgui.log
|
|||
extras = /extras
|
||||
uploadsURL = /uploads
|
||||
uploadsPath = /data/WebGUI/www/uploads
|
||||
#skipHourly =
|
||||
#scripturl = /
|
||||
|
|
|
|||
|
|
@ -486,8 +486,8 @@ sub param {
|
|||
|
||||
## get the value of the desired parameters
|
||||
for my $arg (@{$args->{'get'}}) {
|
||||
carp("[$CLASS] Parameter '$arg' does not exist ") and next
|
||||
if not exists $self->{'param'}{_case_($self, $arg)};
|
||||
#carp("[$CLASS] Parameter '$arg' does not exist ") and
|
||||
next if not exists $self->{'param'}{_case_($self, $arg)};
|
||||
|
||||
push @retlist, $self->{'param'}{_case_($self, $arg)}
|
||||
}
|
||||
|
|
@ -582,8 +582,8 @@ sub delete {
|
|||
my $self = shift;
|
||||
|
||||
for my $param (@_) {
|
||||
carp("[$CLASS] Parameter '$param' does not exist ") and next
|
||||
if not exists $self->{'param'}{_case_($self, $param)};
|
||||
#carp("[$CLASS] Parameter '$param' does not exist ") and
|
||||
next if not exists $self->{'param'}{_case_($self, $param)};
|
||||
delete $self->{'param'}{_case_($self, $param)}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,9 +19,10 @@ BEGIN {
|
|||
use DBI;
|
||||
use strict qw(subs vars);
|
||||
use Data::Config;
|
||||
use WebGUI::Utility;
|
||||
|
||||
|
||||
my (@files, $cmd, $namespace, $i, $file, $slash, $confdir, @plugins, $plugin, $plugdir);
|
||||
my (@files, $cmd, $namespace, $file, $slash, $confdir, %plugins, $plugdir, $skip);
|
||||
$slash = ($^O =~ /Win/i) ? "\\" : "/";
|
||||
$confdir = $webguiRoot.$slash."etc".$slash;
|
||||
$plugdir = $webguiRoot.$slash."sbin".$slash."Hourly".$slash;
|
||||
|
|
@ -33,8 +34,7 @@ if (opendir (PLUGDIR,$plugdir)) {
|
|||
$namespace = $1;
|
||||
$cmd = "use Hourly::".$namespace;
|
||||
eval($cmd);
|
||||
$plugins[$i] = "Hourly::".$namespace."::process";
|
||||
$i++;
|
||||
$plugins{$namespace} = "Hourly::".$namespace."::process";
|
||||
}
|
||||
}
|
||||
closedir(PLUGDIR);
|
||||
|
|
@ -54,8 +54,13 @@ if (opendir (CONFDIR,$confdir)) {
|
|||
unless (eval {$dbh = DBI->connect($config->param('dsn'),$config->param('dbuser'),$config->param('dbpass'))}) {
|
||||
print "Can't connect to ".$config->param('dsn')." with info provided. Skipping.\n";
|
||||
} else {
|
||||
foreach $plugin (@plugins) {
|
||||
&$plugin($dbh);
|
||||
foreach $namespace (keys %plugins) {
|
||||
$skip = $config->param('skipHourly');
|
||||
$skip =~ s/ //g;
|
||||
unless (isIn($namespace, split(/,/,$skip))) {
|
||||
$cmd = $plugins{$namespace};
|
||||
&$cmd($dbh);
|
||||
}
|
||||
}
|
||||
$dbh->disconnect();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue