]> git.donarmstrong.com Git - infobot.git/blobdiff - src/modules.pl
add initial SQLite support
[infobot.git] / src / modules.pl
index 36e3204529c8cd8d14ce3116e52ff6acbd518b06..ae2dac531699f771d1b09400cd0852303562b0a0 100644 (file)
@@ -21,6 +21,7 @@ if ($@) {
 
 ### MODULES.
 %myModules = (
+       "bzflag"        => "BZFlag.pl",
        "countdown"     => "Countdown.pl",
        "debian"        => "Debian.pl",
        "debianExtra"   => "DebianExtra.pl",
@@ -30,9 +31,9 @@ if ($@) {
        "factoids"      => "Factoids.pl",
        "freshmeat"     => "Freshmeat.pl",
        "kernel"        => "Kernel.pl",
-       "ircdcc"        => "UserDCC.pl",
        "perlMath"      => "Math.pl",
        "news"          => "News.pl",
+       "plug"          => "Plug.pl",
        "quote"         => "Quote.pl",
        "rootwarn"      => "RootWarn.pl",
        "search"        => "Search.pl",
@@ -40,13 +41,16 @@ if ($@) {
        "topic"         => "Topic.pl",
        "units"         => "Units.pl",
        "uptime"        => "Uptime.pl",
+       "ircdcc"        => "UserDCC.pl",
        "userinfo"      => "UserInfo.pl",
        "wwwsearch"     => "W3Search.pl",
        "whatis"        => "WhatIs.pl",
        "wingate"       => "Wingate.pl",
+       "babelfish"     => "babel.pl",
        "insult"        => "insult.pl",
        "nickometer"    => "nickometer.pl",
-       "babelfish"     => "babel.pl",
+       "zfi"           => "zfi.pl",
+       "zsi"           => "zsi.pl",
 );
 ### THIS IS NOT LOADED ON RELOAD :(
 my @myModulesLoadNow;
@@ -77,8 +81,6 @@ sub loadCoreModules {
 }
 
 sub loadDBModules {
-    &status("Loading DB modules...");
-
     my $f = "$bot_src_dir/modules.pl";
     $moduleAge{$f} = (stat $f)[9];
 
@@ -88,13 +90,11 @@ sub loadDBModules {
            &ERROR("libdbd-mysql-perl is not installed!");
            exit 1;
        }
-       &showProc(" (DBI // mysql)");
-
-       &status("  using MySQL support.");
+       &status("Loading MySQL support.");
        $f = "$bot_src_dir/db_mysql.pl";
        require $f;
        $moduleAge{$f} = (stat $f)[9];
-
+       &showProc(" (DBI // mysql)");
     } elsif ($param{'DBType'} =~ /^pgsql$/i) {
 #      eval "use Pg";
        eval "use DBI";
@@ -102,17 +102,16 @@ sub loadDBModules {
            &ERROR("libpgperl is not installed!");
            exit 1;
        }
-       &showProc(" (pgsql)");
-
-       &status("  using pgsql support.");
+       &status("Loading pgsql support.");
        require "$bot_src_dir/db_pgsql.pl";
-
-    } elsif ($param{'DBType'} =~ /^dbm$/i) {
-
-       &status("  using Berkeley DBM support.");
-       require "$bot_src_dir/db_dbm.pl";
+       &showProc(" (pgsql)");
+    } elsif ($param{'DBType'} =~ /^sqlite$|^dbm$/i) {
+       &status("Loading " . $param{'DBType'} . " support.");
+       $f="$bot_src_dir/db_" . $param{'DBType'} . ".pl";
+       $moduleAge{$f} = (stat $f)[9];
+       require $f;
+       &showProc(" $bot_src_dir/db_" . $param{'DBType'} . ".pl");
     } else {
-
        &status("DB support DISABLED.");
        return;
     }
@@ -161,7 +160,9 @@ sub loadIRCModules {
     foreach ( &getPerlFiles("$bot_src_dir/$interface") ) {
        my $mod = "$bot_src_dir/$interface/$_";
 
-       &status("Loading Modules \"$mod\"");
+       # hrm... use another config option besides DEBUG to display
+       # change in memory usage.
+       &status("Loading Modules \"$mod\"") if (!&IsParam("DEBUG"));
        eval "require \"$mod\"";
        if ($@) {
            &ERROR("require \"$mod\" => $@");