diff options
author | Voker57 <voker57@gmail.com> | 2010-03-15 00:13:37 +0300 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2010-03-16 14:54:17 +0100 |
commit | ca51b3d47107c385fd6f7ece8893787179ac8acb (patch) | |
tree | f75b87fdb7e90064c0e541dbe52cbc5a90ff63d6 /lib | |
parent | 6d112bb9364e9329806c90f116ac30e3f1437a0c (diff) |
DB backend option
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rbot/ircbot.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index 5aae4dbe..68dd4b34 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -153,7 +153,6 @@ require 'rbot/timer' require 'rbot/plugins' require 'rbot/message' require 'rbot/language' -require 'rbot/registry/bdb' module Irc @@ -418,6 +417,12 @@ class Bot bot.socket.penalty_pct = v }, :desc => "Percentage of IRC penalty to consider when sending messages to prevent being disconnected for excess flood. Set to 0 to disable penalty control.") + Config.register Config::StringValue.new('core.db', + :default => "bdb", + :wizard => true, :default => "bdb", + :validate => Proc.new { |v| ["bdb"].include? v }, + :requires_restart => true, + :desc => "DB adaptor to use for storing settings and plugin data. Options are: bdb (Berkeley DB, stable adaptor, but troublesome to install and unmaintained)") @argv = params[:argv] @run_dir = params[:run_dir] || Dir.pwd @@ -486,6 +491,12 @@ class Bot if @config['core.run_as_daemon'] $daemonize = true end + case @config["core.db"] + when "bdb" + require 'rbot/registry/bdb' + else + raise _("Unknown DB adaptor: %s") % @config["core.db"] + end @logfile = @config['log.file'] if @logfile.class!=String || @logfile.empty? |