Allow port to be changed in settings.php

This commit is contained in:
Ruan 2015-06-06 09:04:24 +02:00
parent 01b05bc715
commit ec16759705

View File

@ -6,6 +6,7 @@ $serverip = 'mc.example.com';
/** MySQL settings **/ /** MySQL settings **/
// Server host // Server host
$dbhost = 'localhost'; $dbhost = 'localhost';
$dbport = 3306;
$username = 'root'; $username = 'root';
$password = 'password'; $password = 'password';
@ -27,13 +28,13 @@ $driver = 'mysql';
/*****************************************************************************/ /*****************************************************************************/
function litebans_connect() { function litebans_connect() {
// imported // imported
global $dbhost, $username, $password, $database, $table_prefix, $show_inactive_bans, $driver; global $dbhost, $dbport, $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 = $driver . ':dbname=' . $database . ';host=' . $dbhost . ';charset=utf8'; $dsn = $driver . ':dbname=' . $database . ';host=' . $dbhost . ';port=' . $dbport . ';charset=utf8';
try { try {
$conn = new PDO($dsn, $username, $password); $conn = new PDO($dsn, $username, $password);