ServerManager project files

This commit is contained in:
2026-06-06 17:58:34 -04:00
parent ce1863d955
commit 9c0bc7f189
502 changed files with 87837 additions and 0 deletions

34
public/index.php Executable file
View File

@@ -0,0 +1,34 @@
<?php
declare(strict_types=1);
if (PHP_VERSION_ID < 80300) {
http_response_code(500);
die('ServerManager requires PHP 8.3 or higher.');
}
if (!file_exists(dirname(__DIR__) . '/vendor/autoload.php')) {
http_response_code(500);
die('Dependencies not installed. Run: composer install');
}
require_once dirname(__DIR__) . '/vendor/autoload.php';
use ServerManager\Core\App;
try {
$app = App::getInstance();
$app->boot(dirname(__DIR__));
$app->run();
} catch (\Throwable $e) {
http_response_code(500);
if (($_ENV['APP_DEBUG'] ?? false) === 'true') {
echo '<h1>Server Error</h1>';
echo '<pre>' . htmlspecialchars($e->getMessage()) . '</pre>';
echo '<pre>' . $e->getTraceAsString() . '</pre>';
} else {
echo '<h1>500 Internal Server Error</h1>';
echo '<p>An unexpected error occurred. Please check the logs.</p>';
}
}