From 003293c52777e64f38753faf18cdf88fccd19676 Mon Sep 17 00:00:00 2001 From: Ruan Date: Thu, 6 Aug 2015 08:35:41 +0200 Subject: [PATCH] Refactor settings + documentation --- includes/settings.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/includes/settings.php b/includes/settings.php index 5ae78a6..ea35f68 100644 --- a/includes/settings.php +++ b/includes/settings.php @@ -2,19 +2,18 @@ final class Settings { public function __construct($connect = true) { - // Server name + // Server name, shown on the main page and on the header $this->name = 'LiteBans'; - // Server host - $dbhost = 'localhost'; - $dbport = 3306; + // Database information + $host = 'localhost'; + $port = 3306; + + $database = 'litebans'; $username = 'root'; $password = 'password'; - // Database name - $database = 'litebans'; - // Show inactive bans? Removed bans will show (Unbanned), mutes will show (Unmuted), warnings will show (Expired). $this->show_inactive_bans = true; @@ -47,7 +46,7 @@ final class Settings { } if ($connect) { - $dsn = "$driver:dbname=$database;host=$dbhost;port=$dbport;charset=utf8"; + $dsn = "$driver:dbname=$database;host=$host;port=$port;charset=utf8"; try { $this->conn = new PDO($dsn, $username, $password);