This commit is contained in:
William 2022-01-30 22:11:38 +01:00
parent 2f2e097db3
commit 542e9bf5f2
2 changed files with 25 additions and 2 deletions

View File

@ -0,0 +1,21 @@
<?php
class AccessControl
{
public User $user;
private array $routes;
public function __construct(User $user)
{
$this->user = $user;
$this->routes = [
"index.php" => $this->catcher()
];
}
private function catcher(): void
{
// ...
}
}

View File

@ -20,10 +20,10 @@ spl_autoload_register(function ($class_name) {
require __DIR__ . '/core/' . $class_name . '.php'; require __DIR__ . '/core/' . $class_name . '.php';
}); });
// Error and exception handling /* === App Setup === */
new ErrorHandler; new ErrorHandler;
// Setup
$config = ( $config = (
new Config(__DIR__ . '/config.php') new Config(__DIR__ . '/config.php')
)->config; )->config;
@ -32,6 +32,8 @@ $database = new Database($config['database']);
$session = new Session; $session = new Session;
$user = new User($session); $user = new User($session);
new AccessControl($user);
$app = new App( $app = new App(
$config, $config,
$database, $database,