Commit
This commit is contained in:
parent
2f2e097db3
commit
542e9bf5f2
21
app/core/AccessControl.php
Normal file
21
app/core/AccessControl.php
Normal 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
|
||||
{
|
||||
// ...
|
||||
}
|
||||
}
|
@ -20,10 +20,10 @@ spl_autoload_register(function ($class_name) {
|
||||
require __DIR__ . '/core/' . $class_name . '.php';
|
||||
});
|
||||
|
||||
// Error and exception handling
|
||||
/* === App Setup === */
|
||||
|
||||
new ErrorHandler;
|
||||
|
||||
// Setup
|
||||
$config = (
|
||||
new Config(__DIR__ . '/config.php')
|
||||
)->config;
|
||||
@ -32,6 +32,8 @@ $database = new Database($config['database']);
|
||||
$session = new Session;
|
||||
$user = new User($session);
|
||||
|
||||
new AccessControl($user);
|
||||
|
||||
$app = new App(
|
||||
$config,
|
||||
$database,
|
||||
|
Reference in New Issue
Block a user