Fixed docker errors and improved error logging..

This commit is contained in:
Hosteroid
2025-10-29 12:45:01 +02:00
parent 0e08e807d3
commit a0ada0b2c2
4 changed files with 23 additions and 2 deletions

View File

@@ -12,12 +12,30 @@ class Application
public function __construct()
{
// Configure error reporting based on environment
$this->configureErrorReporting();
self::$router = new Router();
self::$db = new Database();
// Initialize error handler
$this->errorHandler = new ErrorHandler();
}
private function configureErrorReporting()
{
$env = $_ENV['APP_ENV'] ?? 'development';
if ($env === 'production') {
// In production, suppress deprecation warnings to prevent header issues
error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);
ini_set('display_errors', '0');
} else {
// In development, show all errors including deprecations
error_reporting(E_ALL);
ini_set('display_errors', '1');
}
}
public function run()
{