From 4c072951b524c417093694b896d3a416f404d7f5 Mon Sep 17 00:00:00 2001 From: Martin Ambrus Date: Sun, 22 Oct 2017 22:04:11 +0200 Subject: [PATCH] fix: database is not always needed --- GameEngine/Database.php | 13 +++++++++---- todo.txt | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/GameEngine/Database.php b/GameEngine/Database.php index d0b29c4f..7061ae46 100755 --- a/GameEngine/Database.php +++ b/GameEngine/Database.php @@ -4671,8 +4671,13 @@ References: } }; -$database = new MYSQLi_DB; -$link = $database->return_link(); -$GLOBALS['db'] = $database; -$GLOBALS['link'] = $database->return_link(); + +// database is not needed if we're displaying static pages +$req_file = basename($_SERVER['PHP_SELF']); +if (!in_array($req_file, ['tutorial.php', 'anleitung.php'])) { + $database = new MYSQLi_DB; + $link = $database->return_link(); + $GLOBALS['db'] = $database; + $GLOBALS['link'] = $database->return_link(); +} ?> \ No newline at end of file diff --git a/todo.txt b/todo.txt index bcd91b7c..c0822487 100644 --- a/todo.txt +++ b/todo.txt @@ -1,5 +1,6 @@ - add checkbox when sending units for a raid to include the attack in the raid list, if eligible - change "incoming attacker" title of the raid list icon when actually attacking a farm (it should be "Own attacking troops") +- change "select all" button to actually select all checkboxes via JS, not via page reload - normalize forum tables - varchar is used for numeric values and is joined with int field - finish parts in Admin that are unfinished (mostly delete -X- buttons and Alliance settings) - add batching logic to mehods which get called too frequently and multiple times (example - Message::sendMessage() now that is sends messages for each forum post)