private function __construct()
 {
     $db_host = ConfigHelper::read('db.host');
     $db_name = ConfigHelper::read('db.basename');
     $db_user = ConfigHelper::read('db.user');
     $db_pass = ConfigHelper::read('db.password');
     $this->dbh = new mysqli($db_host, $db_user, $db_pass, $db_name);
     //set UTF8 as global encoding
     $this->dbh->set_charset("utf8");
 }
<?php

require '../vendor/autoload.php';
require '../config.php';
//read version number from composer file
$composer = json_decode(file_get_contents(__DIR__ . '/../composer.json'));
// check if logging is enabled, if yes, activate the logwriter
$logEnabled = \lib\ConfigHelper::read('log');
if ($logEnabled) {
    $filename = '../log/log.log';
    $log = new \Slim\LogWriter(fopen($filename, 'a+'));
    // how long the file should be kept, deletes log file content if last access more than config.php::log.hours
    $hours = \lib\ConfigHelper::read('log.hours');
    if (time() - filectime($filename) > $hours * 3600) {
        unlink($filename);
    }
}
$debugEnabled = \lib\ConfigHelper::read('debug');
//instanciate new Slim App instance
$app = new \Slim\Slim(array('version' => $composer->version, 'debug' => $debugEnabled, 'log.enabled' => $logEnabled, 'log.level' => \Slim\Log::INFO, 'log.writer' => $log, 'templates.path' => '../templates/'));
//first authenticate any request with a Slim middleware
$app->add(new \app\AuthMiddleware());
require_once __DIR__ . '/../app/app.php';
$app->run();
 /**
  * Read relevant tables' meta information
  *
  * @param String $db_name DefaultDB of request's user
  * @return mixed Returns database content array or false on bad query
  */
 function readRelevantTablesMetaInformation($db_name)
 {
     $tables = ConfigHelper::read('db.mysql_tables');
     $finalArray = array();
     foreach ($tables as $table) {
         $query = 'SHOW COLUMNS FROM `' . $table . '` FROM `' . $db_name . '`';
         if ($result = $this->core->dbh->query($query)) {
             $rows = array();
             while ($row = $result->fetch_assoc()) {
                 $rows[] = $row;
             }
             $finalArray[$table] = $rows;
         }
     }
     if (!empty($finalArray)) {
         return $finalArray;
     } else {
         return false;
     }
 }