mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-05-23 16:32:45 +00:00
Simplify init_tables
This commit is contained in:
parent
9f54f33a91
commit
2335143b34
@ -257,7 +257,6 @@ class Settings {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private function test_strftime() {
|
private function test_strftime() {
|
||||||
// If you modify this function, you may get an "Assertion failed" error.
|
// If you modify this function, you may get an "Assertion failed" error.
|
||||||
date_default_timezone_set("UTC"); // temporarily set UTC timezone for testing purposes
|
date_default_timezone_set("UTC"); // temporarily set UTC timezone for testing purposes
|
||||||
@ -280,17 +279,11 @@ class Settings {
|
|||||||
date_default_timezone_set($this->timezone); // set configured timezone
|
date_default_timezone_set($this->timezone); // set configured timezone
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function init_tables() {
|
protected function init_tables() {
|
||||||
$table_prefix = $this->table_prefix;
|
$this->table = array();
|
||||||
// Internal table names, do not translate.
|
array_map(function ($t) {
|
||||||
$this->table = array(
|
$this->table[$t] = $this->table_prefix . $t;
|
||||||
'bans' => "${table_prefix}bans",
|
}, array('bans', 'mutes', 'warnings', 'kicks', 'history', 'servers', 'config'));
|
||||||
'mutes' => "${table_prefix}mutes",
|
|
||||||
'warnings' => "${table_prefix}warnings",
|
|
||||||
'kicks' => "${table_prefix}kicks",
|
|
||||||
'history' => "${table_prefix}history",
|
|
||||||
'servers' => "${table_prefix}servers",
|
|
||||||
'config' => "${table_prefix}config",
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user