idk anymore! please put the dog down (me)!
This commit is contained in:
27
public/index.php
Normal file
27
public/index.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Controllers\HomeController;
|
||||
use src\Database;
|
||||
|
||||
session_start();
|
||||
|
||||
spl_autoload_register(function ($class) {
|
||||
$file = __DIR__ . '/../' . str_replace('\\', '/', $class) . '.php';
|
||||
|
||||
if (file_exists($file)) {
|
||||
require_once $file;
|
||||
}
|
||||
});
|
||||
|
||||
require_once __DIR__ . '/../src/Controllers/HomeController.php';
|
||||
require_once __DIR__ . '/../src/Database.php';
|
||||
|
||||
$path = $_SERVER['REQUEST_URI'] ?? '/';
|
||||
|
||||
if ($path === '/') {
|
||||
$db = Database::getInstance();
|
||||
|
||||
$controller = new HomeController($db);
|
||||
|
||||
$controller->index();
|
||||
}
|
||||
Reference in New Issue
Block a user