2017-11-01 12:35:45 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
2018-01-16 19:56:05 +01:00
|
|
|
* Bootstrap application
|
2017-11-01 12:35:45 +01:00
|
|
|
*/
|
2021-12-03 23:27:11 +01:00
|
|
|
|
|
|
|
use Engelsystem\Http\UrlGeneratorInterface;
|
|
|
|
|
2018-01-16 19:56:05 +01:00
|
|
|
require __DIR__ . '/application.php';
|
2017-11-01 12:35:45 +01:00
|
|
|
|
|
|
|
|
2017-11-01 14:47:09 +01:00
|
|
|
/**
|
|
|
|
* Include legacy code
|
|
|
|
*/
|
|
|
|
require __DIR__ . '/includes.php';
|
|
|
|
|
|
|
|
|
2017-11-01 12:35:45 +01:00
|
|
|
/**
|
|
|
|
* Check for maintenance
|
|
|
|
*/
|
2022-06-16 23:00:56 +02:00
|
|
|
/** @var \Engelsystem\Application $app */
|
2017-11-01 12:35:45 +01:00
|
|
|
if ($app->get('config')->get('maintenance')) {
|
2021-12-03 23:27:11 +01:00
|
|
|
http_response_code(503);
|
|
|
|
$url = $app->get(UrlGeneratorInterface::class);
|
2018-10-05 15:35:14 +02:00
|
|
|
$maintenance = file_get_contents(__DIR__ . '/../resources/views/layouts/maintenance.html');
|
|
|
|
$maintenance = str_replace('%APP_NAME%', $app->get('config')->get('app_name'), $maintenance);
|
2021-12-03 23:27:11 +01:00
|
|
|
$maintenance = str_replace('%ASSETS_PATH%', $url->to(''), $maintenance);
|
2018-10-05 15:35:14 +02:00
|
|
|
echo $maintenance;
|
2017-11-01 12:35:45 +01:00
|
|
|
die();
|
|
|
|
}
|