20240413#8

This commit is contained in:
User
2024-04-13 12:16:12 +03:00
parent cb5408be4a
commit 8346234859
7 changed files with 70 additions and 13 deletions

View File

@@ -9,7 +9,7 @@
# Real environment variables win over .env files.
# PROD / DEV
APP_MODE=PROD
APP_MODE=DEV
APP_COMPONENTS_FILE=application/config/app.php
APP_NODES_FILE=application/config/nodes.php

View File

@@ -1,2 +1,2 @@
<?php
return (new \Rmphp\Content\Content('/templates/base.tpl'))->setSubtemplatePath('/templates');
return (new \Rmphp\Content\Content('/templates/base.tpl0'))->setSubtemplatePath('/templates');

View File

@@ -16,3 +16,4 @@ body{font-family: Arimo, sans-serif; font-size: 15px; margin: 0; padding: 0;}
}
h1{padding: 0 30px}

View File

@@ -19,7 +19,7 @@ $app = new App();
$response = $app->handler($request, (new Response())->withHeader("Content-Type", "text/html; charset=utf-8"));
(new ResponseEmitter())->emit($response);
if(($response->getStatusCode() !== 200 && getenv("APP_MODE") != 'PROD') || in_array("Dev", $response->getHeader("App-Mode"))){
if(($response->getStatusCode() !== 200 && getenv("APP_MODE") == 'DEV') || in_array("Dev", $response->getHeader("App-Mode"))){
$app->syslogger()->dump("Response", $response);
addShutdownInfo($app->syslogger()->getLogs());
}

View File

@@ -1,10 +1,38 @@
<!DOCTYPE html>
<html lang="en">
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>404</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>404 Page Not Found</title>
<style>
body{
font-family: Arimo, sans-serif;
font-size: 15px;
margin: 0;
padding: 0;
background: #c9d1e1;
}
.err-page{
display: flex;
align-items: center;
height: 50vh;
flex-direction: column;
justify-content: center;
color:#888;
}
.err-page__header{
font-size: 70px;
}
.err-page__text{
font-size: 30px;
}
</style>
</head>
<body>
<h1>Error 404</h1>
<div class="err-page">
<div class="err-page__header">404</div>
<div class="err-page__text">Page Not Found</div>
</div>
</body>
</html>

View File

@@ -1,10 +1,38 @@
<!DOCTYPE html>
<html lang="en">
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>501</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>501 Not Implemented</title>
<style>
body{
font-family: Arimo, sans-serif;
font-size: 15px;
margin: 0;
padding: 0;
background: #e1c9d1;
}
.err-page{
display: flex;
align-items: center;
height: 50vh;
flex-direction: column;
justify-content: center;
color:#888;
}
.err-page__header{
font-size: 70px;
}
.err-page__text{
font-size: 30px;
}
</style>
</head>
<body>
<h1>Error 501</h1>
<div class="err-page">
<div class="err-page__header">501</div>
<div class="err-page__text">Not Implemented</div>
</div>
</body>
</html>

View File

@@ -1,5 +1,5 @@
<article>
<main>
<h1>Hello. Now is <?=$this->date?></h1>
<h1 style="text-align: center">Hello. Now is <?=$this->date?></h1>
</main>
</article>