diff --git a/.env.dist b/.env.dist index 33584f1..a01b516 100644 --- a/.env.dist +++ b/.env.dist @@ -22,8 +22,8 @@ APP_NODES_FILE="config/appnodes.php" #APP_NODE2='{"key":"/","router":"config/routes/main/collection.php"}' # Default page -PAGE404="public/web/404.html" -PAGE501="public/web/501.html" +PAGE404="templates/error/404.tpl" +PAGE501="templates/error/501.tpl" # Users environment diff --git a/config/factories/templateFactory.php b/config/factories/templateFactory.php index 41d5b93..79be0ff 100644 --- a/config/factories/templateFactory.php +++ b/config/factories/templateFactory.php @@ -1,2 +1,2 @@ setSubtemplePath('templates'); \ No newline at end of file +return (new \Rmphp\Content\Content('templates/base.tpl'))->setSubtemplePath('templates'); \ No newline at end of file diff --git a/public/web/main/css/style.css b/public/assets/css/style.css similarity index 100% rename from public/web/main/css/style.css rename to public/assets/css/style.css diff --git a/public/web/main/images/.gitkeep b/public/assets/images/.gitkeep similarity index 100% rename from public/web/main/images/.gitkeep rename to public/assets/images/.gitkeep diff --git a/public/web/main/js/script.js b/public/assets/js/script.js similarity index 100% rename from public/web/main/js/script.js rename to public/assets/js/script.js diff --git a/public/index.php b/public/index.php index 7ce9c5b..342eb89 100644 --- a/public/index.php +++ b/public/index.php @@ -23,17 +23,7 @@ $response = $app->handler($request, (new Response())->withHeader("Content-Type", (new ResponseEmitter())->emit($response); -if(getenv("APP_MODE") == 'DEV' && in_array("Dev", $response->getHeader("App-Mode"))){ - $app->syslogger()->dump("request", $request); - $app->syslogger()->dump("response", $response); - $app->syslogger()->dump("globals", [ - "ENV"=>$_ENV, - "GET"=>$request->getQueryParams(), - "POST"=>$request->getParsedBody(), - "COOKIE"=>$request->getCookieParams(), - "SESSION"=>$_SESSION ?? [], - "SERVER"=>$request->getServerParams() - ]); - $app->syslogger()->dump("kernel", $app); +if(getenv("APP_MODE") == 'DEV' || in_array("Dev", $response->getHeader("App-Mode"))){ + $app->syslogger()->dump("Response", $response); addShutdownInfo($app->syslogger()->getLogs()); } \ No newline at end of file diff --git a/public/web/source/.gitkeep b/public/web/source/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/public/web/main/sheet.html b/templates/base.tpl similarity index 51% rename from public/web/main/sheet.html rename to templates/base.tpl index ed412e8..b1eac62 100644 --- a/public/web/main/sheet.html +++ b/templates/base.tpl @@ -5,15 +5,11 @@ Rmphp - <?=$this->getPoint('title')?> - - + getPoint('main')?> - + getPoint('jsscript')?> \ No newline at end of file diff --git a/public/web/404.html b/templates/error/404.tpl similarity index 100% rename from public/web/404.html rename to templates/error/404.tpl diff --git a/public/web/500.html b/templates/error/501.tpl similarity index 100% rename from public/web/500.html rename to templates/error/501.tpl