From 444189e527c08b79babb9cd7a2a0b9ac38b5cbfb Mon Sep 17 00:00:00 2001 From: Ro Date: Wed, 21 Apr 2021 22:46:56 -0700 Subject: [PATCH] created new App class to start up app and move off of index --- brain/App.inc.php | 40 ++++++++++++++++++++++++++++++++++++++++ brain/data/Book.inc.php | 2 +- public/index.php | 29 ++--------------------------- 3 files changed, 43 insertions(+), 28 deletions(-) create mode 100644 brain/App.inc.php diff --git a/brain/App.inc.php b/brain/App.inc.php new file mode 100644 index 0000000..73b4058 --- /dev/null +++ b/brain/App.inc.php @@ -0,0 +1,40 @@ +add(TwigMiddleware::create($app, $twig)); + //set up routing + $app->get( + "/[{first}[/{second}[/{third}[/{fourth}]]]]", + "\RouteControl:get" + ); + $app->post( + "/[{first}[/{second}[/{third}[/{fourth}]]]]", + "\RouteControl:post" + ); + //start the app + + $app->run(); + } +} diff --git a/brain/data/Book.inc.php b/brain/data/Book.inc.php index db08ece..7d8bc3c 100644 --- a/brain/data/Book.inc.php +++ b/brain/data/Book.inc.php @@ -150,7 +150,7 @@ class Book //once saved, update menu $body["path"] = $path; Settings::updateMenu($body); - Settings::updateTags(); + //Settings::updateTags(); } else { $response = [ "message" => "Uh oh. File save problem. Don't panic", diff --git a/public/index.php b/public/index.php index 63323b6..f72c1bd 100644 --- a/public/index.php +++ b/public/index.php @@ -1,29 +1,4 @@ add(TwigMiddleware::create($app, $twig)); -//set up routing -$app->get("/[{first}[/{second}[/{third}[/{fourth}]]]]", "\RouteControl:get"); -$app->post("/[{first}[/{second}[/{third}[/{fourth}]]]]", "\RouteControl:post"); -//start the app - -$app->run(); +include "../brain/App.inc.php"; +new App();