From: konekoneko Date: Thu, 30 May 2013 09:44:47 +0000 (+0900) Subject: DB名を設定ファイルから設定できるようにした X-Git-Url: http://git.osdn.jp/view?a=commitdiff_plain;h=91e848de59872d1810098755228b208f3677598f;p=webchat%2FWebChat.git DB名を設定ファイルから設定できるようにした --- diff --git a/chat.js b/chat.js index 0b7e68e..391eb57 100644 --- a/chat.js +++ b/chat.js @@ -134,7 +134,7 @@ function RoomInfomationCollection() user : config.db_user, password : config.db_password, port : config.db_port, - database : "webchat", + database : config.db_name, }); var collection = {}; this.Get = function(rno){ @@ -351,7 +351,7 @@ function IpBanCollecion() user : config.db_user, password : config.db_password, port : config.db_port, - database : "webchat", + database : config.db_name, }); var collection = {}; this.IsBaned = function(ip){ diff --git a/configure.js b/configure.js index 9b12cd2..5e0ed25 100644 --- a/configure.js +++ b/configure.js @@ -11,6 +11,7 @@ db_password : "user", //MySQLサーバーのパスワード db_host : "localhost", //MySQLサーバーのアドレス db_port : 3306, //MySQLサーバーのポート + db_name : "webchat", //データーベース名 db_limit : 50, //一度に表示する件数 username : "admin", //管理者用のページにアクセスできるユーザ名 diff --git a/init.js b/init.js index 0370eaa..2fffa8f 100644 --- a/init.js +++ b/init.js @@ -8,7 +8,7 @@ var pool = new MySQLPool({ user : config.db_user, password : config.db_password, port : config.db_port, - database : "webchat", + database : config.db_name, }); if("name_hash" in config.alias) diff --git a/profile.js b/profile.js index dc140f9..5957f71 100644 --- a/profile.js +++ b/profile.js @@ -271,7 +271,7 @@ function ProfileCollection() user : config.db_user, password : config.db_password, port : config.db_port, - database : "webchat", + database : config.db_name, }); this.AuthAsync = function(name,password,cb){ async.waterfall([