27 lines
542 B
PHP
27 lines
542 B
PHP
<?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();
|
|
} |