Setup/DBconfig

* test for known world db formats and throw appropriate errors
 * test for imported aowow db and throw error if missing
 * make DB connection reloadable
This commit is contained in:
Sarjuuk
2024-06-09 00:54:53 +02:00
parent 82c04c9ed5
commit 33ee358e0c
5 changed files with 107 additions and 27 deletions

View File

@@ -24,7 +24,10 @@ class DB
public static function connect($idx)
{
if (self::isConnected($idx))
return;
{
self::$interfaceCache[$idx]->link->close();
self::$interfaceCache[$idx] = null;
}
$options = &self::$optionsCache[$idx];
$interface = DbSimple_Generic::connect(self::createConnectSyntax($options));

View File

@@ -11,6 +11,9 @@ define('E_AOWOW', E_ALL & ~(E_DEPRECATED | E_USER_DEPRECATED | E
define('JSON_AOWOW_POWER', JSON_PRETTY_PRINT | JSON_NUMERIC_CHECK | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
define('FILTER_FLAG_STRIP_AOWOW', FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_STRIP_BACKTICK);
define('TDB_WORLD_MINIMUM_VER', 21101);
define('TDB_WORLD_EXPECTED_VER', 24041);
// as of 01.01.2024 https://www.wowhead.com/wotlk/de/spell=40120/{seo}
// https://www.wowhead.com/wotlk/es/search=vuelo
define('WOWHEAD_LINK', 'https://www.wowhead.com/wotlk/%s/%s=%s');