'
. '
Maintenance Mode
'
. '' . htmlspecialchars($title, ENT_QUOTES, 'UTF-8') . '
'
. '' . nl2br(htmlspecialchars($message, ENT_QUOTES, 'UTF-8')) . '
';
if ($buttonLabel !== '' && $buttonUrl !== '') {
$contentHtml .= ''
. htmlspecialchars($buttonLabel, ENT_QUOTES, 'UTF-8')
. '';
}
$contentHtml .= '';
}
$maintenanceHtml = ''
. ''
. '' . htmlspecialchars($siteTitle, ENT_QUOTES, 'UTF-8') . ''
. '' . $contentHtml . '';
(new Core\Http\Response($maintenanceHtml, 503, ['Content-Type' => 'text/html; charset=utf-8']))->send();
exit;
}
$router = new Core\Http\Router();
$router->get('/', function (): Core\Http\Response {
$db = Core\Services\Database::get();
if ($db instanceof PDO) {
$stmt = $db->prepare("SELECT title, content_html FROM ac_pages WHERE is_home = 1 AND is_published = 1 LIMIT 1");
$stmt->execute();
$page = $stmt->fetch(PDO::FETCH_ASSOC);
if ($page) {
$view = new Core\Views\View(__DIR__ . '/../modules/pages/views');
return new Core\Http\Response($view->render('site/show.php', [
'title' => (string)$page['title'],
'content_html' => Core\Services\Shortcodes::render((string)$page['content_html'], [
'page_slug' => 'home',
'page_title' => (string)$page['title'],
]),
]));
}
}
$view = new Core\Views\View(__DIR__ . '/../views');
return new Core\Http\Response($view->render('site/home.php', [
'title' => 'AudioCore V1.5',
]));
});
$router->registerModules(__DIR__ . '/../modules');
Core\Services\Plugins::register($router);
$response = $router->dispatch($_SERVER['REQUEST_URI'] ?? '/', $_SERVER['REQUEST_METHOD'] ?? 'GET');
$response->send();