Example #1
0
}
if (!$db->select_db($dbname)) {
    die('Database connection problem.');
}
date_default_timezone_set(Config::GetSetting("defaultTimezone"));
// Error Handling (our error handler requires a DB connection
set_error_handler(array(new Debug(), "ErrorHandler"));
// Define an auto-load function
spl_autoload_register(function ($class) {
    Kit::ClassLoader($class);
});
// Define the VERSION
Config::Version();
// Deal with HTTPS/STS config
if (Kit::isSSL()) {
    Kit::IssueStsHeaderIfNecessary();
} else {
    if (Config::GetSetting('FORCE_HTTPS', 0) == 1) {
        $redirect = "https://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
        header("Location: {$redirect}");
        exit;
    }
}
// What is the production mode of the server?
if (Config::GetSetting('SERVER_MODE') == 'Test') {
    ini_set('display_errors', 1);
}
// Debugging?
if (Debug::getLevel(Config::GetSetting('audit')) == 10) {
    error_reporting(E_ALL);
}