<?php
// Maintenance sentinel: if .maintenance* file(s) exist, serve the courtesy page.
// .maintenance or .maintenance.general → index.courtesy.general.php
// .maintenance.{suffix} → index.courtesy.{suffix}.php if present, else general
(function () {
$sentinels = glob(__DIR__ . '/../var/maintenance/.maintenance*') ?: [];
if (empty($sentinels)) {
return;
}
$courtesyPage = null;
foreach ($sentinels as $sentinel) {
$suffix = ltrim(substr(basename($sentinel), strlen('.maintenance')), '.');
if ($suffix !== '' && $suffix !== 'general') {
$candidate = __DIR__ . '/index.courtesy.' . $suffix . '.php';
if (file_exists($candidate)) {
$courtesyPage = $candidate;
break;
}
}
}
require $courtesyPage ?? __DIR__ . '/index.courtesy.general.php';
exit;
})();
use App\Kernel;
umask(0002);
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
return function (array $context) {
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};