} elsif ($param{'DBType'} =~ /^dbm$/i) {
&status(" using Berkeley DBM 1.85/2.0 support.");
- require "$bot_src_dir/db_dbm.pl";
+ &ERROR("dbm support is broken... you want it, you fix it!");
+ &shutdown();
+ exit 1;
+
+# require "$bot_src_dir/db_dbm.pl";
} else {
&status("DB support DISABLED.");
}
if (!&IsParam($_) and !&IsChanConf($_) and !&getChanConfList($_)) {
- &DEBUG("_ => $_");
if (exists $myModules{$_}) {
- &status("myModule: $myModules{$_} (1) not loaded.");
+ &status("myModule: $myModules{$_} or $_ (1) not loaded.");
} else {
&DEBUG("myModule: $_ (2) not loaded.");
}
return;
}
- my $age = (stat $file)[9];
- return if ($age == $moduleAge{$file});
-
- if ($age < $moduleAge{$file}) {
- &WARN("rM: we're not gonna downgrade the file. use 'touch'.");
- return;
- }
-
if (grep /$mod/, @myModulesReloadNot) {
&DEBUG("rM: SHOULD NOT RELOAD $mod!!!");
return;
}
- my $dc = &Time2String($age - $moduleAge{$file});
- my $ago = &Time2String(time() - $moduleAge{$file});
+ my $age = (stat $file)[9];
+
+ if (!exists $moduleAge{$file}) {
+ &DEBUG("Looks like $file was not loaded; fixing.");
+ } else {
+ return if ($age == $moduleAge{$file});
+
+ if ($age < $moduleAge{$file}) {
+ &WARN("rM: we're not gonna downgrade the file. use 'touch'.");
+ return;
+ }
+
+ my $dc = &Time2String($age - $moduleAge{$file});
+ my $ago = &Time2String(time() - $moduleAge{$file});
+
+ &VERB("Module: delta change: $dc",2);
+ &VERB("Module: ago: $ago",2);
+ }
&status("Module: Loading $mod...");
- &VERB("Module: delta change: $dc",2);
- &VERB("Module: ago: $ago",2);
delete $INC{$file};
eval "require \"$file\""; # require or use?
sub AUTOLOAD {
return if ($AUTOLOAD =~ /__/); # internal.
- &ERROR("UNKNOWN FUNCTION CALLED: $AUTOLOAD");
- foreach (@_) {
- next unless (defined $_);
- &status(" => $_");
+ my $str = join(', ', @_);
+ &ERROR("UNKNOWN FUNCTION CALLED: $AUTOLOAD ($str)");
+
+ $AUTOLOAD =~ s/^(\S+):://g;
+
+ if (exists $myModules{lc $AUTOLOAD}) {
+ # hopefully this will work.
+ &DEBUG("Trying to load module $AUTOLOAD...");
+ &loadMyModule(lc $AUTOLOAD);
}
}