public/index.php line 30

Open in your IDE?
  1. <?php
  2. // Maintenance sentinel: if .maintenance* file(s) exist, serve the courtesy page.
  3. // .maintenance or .maintenance.general → index.courtesy.general.php
  4. // .maintenance.{suffix}               → index.courtesy.{suffix}.php if present, else general
  5. (function () {
  6.     $sentinels glob(__DIR__ '/../var/maintenance/.maintenance*') ?: [];
  7.     if (empty($sentinels)) {
  8.         return;
  9.     }
  10.     $courtesyPage null;
  11.     foreach ($sentinels as $sentinel) {
  12.         $suffix ltrim(substr(basename($sentinel), strlen('.maintenance')), '.');
  13.         if ($suffix !== '' && $suffix !== 'general') {
  14.             $candidate __DIR__ '/index.courtesy.' $suffix '.php';
  15.             if (file_exists($candidate)) {
  16.                 $courtesyPage $candidate;
  17.                 break;
  18.             }
  19.         }
  20.     }
  21.     require $courtesyPage ?? __DIR__ '/index.courtesy.general.php';
  22.     exit;
  23. })();
  24. use App\Kernel;
  25. umask(0002);
  26. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  27. return function (array $context) {
  28.     return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
  29. };