engelsystem/includes/engelsystem.php

32 lines
738 B
PHP
Raw Normal View History

2017-11-01 12:35:45 +01:00
<?php
/**
* Bootstrap application
2017-11-01 12:35:45 +01:00
*/
2024-03-25 00:03:39 +01:00
use Engelsystem\Application;
use Engelsystem\Http\UrlGeneratorInterface;
require __DIR__ . '/application.php';
2017-11-01 12:35:45 +01:00
/**
* Include legacy code
*/
require __DIR__ . '/includes.php';
2017-11-01 12:35:45 +01:00
/**
* Check for maintenance
*/
2024-03-25 00:03:39 +01:00
/** @var Application $app */
2017-11-01 12:35:45 +01:00
if ($app->get('config')->get('maintenance')) {
http_response_code(503);
$url = $app->get(UrlGeneratorInterface::class);
$maintenance = file_get_contents(__DIR__ . '/../resources/views/layouts/maintenance.html');
2023-12-04 23:33:07 +01:00
$maintenance = str_replace('%APP_NAME%', htmlspecialchars($app->get('config')->get('app_name')), $maintenance);
$maintenance = str_replace('%ASSETS_PATH%', $url->to(''), $maintenance);
echo $maintenance;
2017-11-01 12:35:45 +01:00
die();
}