Initial commit

This commit is contained in:
2020-10-02 08:06:04 +02:00
parent 25708d01db
commit 1fd648bc4a
17 changed files with 567 additions and 1 deletions

29
main.inc.php Normal file
View File

@ -0,0 +1,29 @@
<?php
/**
* Main file load's all the important files and the autoloader.
* Bindet alles ein und setzt einige Variablen sowie die Datenbank.
*/
require_once __DIR__ . '/classes/Autoloader.class.inc.php';
require_once __DIR__ . '/config.inc.php';
# Registering autoloader
Autoloader::register();
try
{
$host = MYSQL_HOST;
$dbname = MYSQL_DB;
# Creates a mysql connection
$pdo = new PDO( "mysql:host={$host};dbname={$dbname}", MYSQL_USER, MYSQL_PASS, array( PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION ) );
# Set DB connection
Database::setConnection( $pdo );
}
catch ( Exception $e )
{
# Error occured, please replace it with error template
die( 'An internal error occured while proccessing your request' );
}