Allow driver to be changed in settings.php

This commit is contained in:
Ruan 2015-06-06 08:59:22 +02:00
parent c18750007d
commit 01b05bc715

View File

@ -22,17 +22,18 @@ $limit_per_page = 20;
// If you set a table prefix in config.yml, put it here too // If you set a table prefix in config.yml, put it here too
$table_prefix = ""; $table_prefix = "";
$driver = 'mysql';
/*****************************************************************************/ /*****************************************************************************/
function litebans_connect() { function litebans_connect() {
// imported // imported
global $dbhost, $username, $password, $database, $table_prefix, $show_inactive_bans; global $dbhost, $username, $password, $database, $table_prefix, $show_inactive_bans, $driver;
// exported // exported
global $conn, $active_query; global $conn, $active_query;
global $table_bans, $table_mutes, $table_warnings, $table_history; global $table_bans, $table_mutes, $table_warnings, $table_history;
$dsn = 'mysql:dbname=' . $database . ';host=' . $dbhost . ';charset=utf8'; $dsn = $driver . ':dbname=' . $database . ';host=' . $dbhost . ';charset=utf8';
try { try {
$conn = new PDO($dsn, $username, $password); $conn = new PDO($dsn, $username, $password);