Files
domnitor/core/Application.php

33 lines
635 B
PHP
Raw Normal View History

2025-10-08 14:23:07 +03:00
<?php
namespace Core;
use App\Services\ErrorHandler;
2025-10-08 14:23:07 +03:00
class Application
{
public static Router $router;
public static Database $db;
private ErrorHandler $errorHandler;
2025-10-08 14:23:07 +03:00
public function __construct()
{
self::$router = new Router();
self::$db = new Database();
// Initialize error handler
$this->errorHandler = new ErrorHandler();
2025-10-08 14:23:07 +03:00
}
public function run()
{
try {
self::$router->resolve();
} catch (\Throwable $e) {
// Use centralized error handler
$this->errorHandler->handleException($e);
2025-10-08 14:23:07 +03:00
}
}
}