private static function init()
 {
     if (!self::$initDone) {
         global $mysqlConfig;
         self::$mysqlConfigMaxPacketSize = $mysqlConfig['max_allowed_packet'];
         self::$mysqli = new mysqli($mysqlConfig['host'], $mysqlConfig['username'], $mysqlConfig['password'], $mysqlConfig['schema']);
         self::$mysqli->set_charset('utf8');
         self::$initDone = true;
         userManager::task_checkForExistingSession();
     }
 }
<?php

/*
 * JavaScript Redstone Simulator
 * Copyright (C) 2012  Jonathan Lydall (Email: jonathan.lydall@gmail.com)
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA. 
 * 
 */
header('Content-type: application/json; charset=UTF-8');
//include_once 'includes/error_handling.php';
include 'includes/class_saveOnServer.php';
echo json_encode(saveOnServer::save());