mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-05-24 08:52:45 +00:00
Allow port to be changed in settings.php
This commit is contained in:
parent
01b05bc715
commit
ec16759705
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user