-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Database Implementation #23
Comments
Issue #22 Includes some of our discussion about logged features. Right now the current goal is to get raw text file logging first, and then add database logging later. When we do go about implementing database logging, is there any particular one you would be interested in? |
For me, this wouldn't be for logging purposes. I tend to manage channels in an access-list sort of way. So just a wrapper for accessing in commands to check say, if they have access to even use the command, or are allowed into a channel. Also good for giving auto-operator, voice etc if someone doesn't know how to do so via XOP |
What both of you are suggesting falls more under the feature sets rather than, pure database. You want the ability to add custom permission and settings for a bot. We could use something like a flatfile database to be able to store this information without adding the additional dependence of a real database(ie we want you to be able just to run the script). I had made some progress on rough drafting a web admin panel in the web-exp branch. This would allow you to do the features you listed above. Any ideas on how to specifically implement this, and what we should focus on first would be appreciated. |
I originally made this on the wrong account. No clue why I have that other one. Use a config option as to whether or not use the database. If the config option is not true, or yes, then use flatfile. |
This is how I added DB-support to the PHP IRC-Bot (it's a dirty hack, but works):
return array(
//[...]
'db_server' => 'localhost',
'db_name' => 'mydatabase',
'db_user' => 'root',
'db_pass' => 'root',
//[...]
public function command() {
if(!$db = mysqli_connect(
$this->bot->db_server,
$this->bot->db_user,
$this->bot->db_pass,
$this->bot->db_name)
){
die('Unable to connect to database');
} else {
// do all the DB-queries and stuff here
mysqli_close($db);
}
}
require_once('../includes/mysql.inc.php'); There are far better ways, I am sure. I.e. copying a MySQL-Handler Class to the root of the "Classes/" directory? |
Just some food for thought, if we are going to be logging everything to a database server, we should probably buffer the incoming entries in some way because in a busy channel this could otherwise lead to high I/O and possibly massive lag on the bots side. For settings and such it shouldn't be a problem. I could work on a simple abstraction layer and a layer for MySQLi, if needed. |
A database implementation would be nice to have for if the bot sits in multiple channelse and other various things.
The text was updated successfully, but these errors were encountered: