From cdd879093df6c74bf2709ae257ac379d830631e9 Mon Sep 17 00:00:00 2001 From: flashwave Date: Sat, 7 Jan 2023 22:32:28 +0000 Subject: [PATCH] Updated index, 404 and 500 pages on the URL redirect service. --- public/assets/awaki-logo.png | Bin 0 -> 19126 bytes public/assets/style.css | 70 +++++++++++++++++++++++++++++++++++ public/err404.html | 26 +++++++++++++ public/err500.html | 26 +++++++++++++ public/index.html | 26 +++++++++++++ public/index.php | 41 ++------------------ src/AwakiContext.php | 40 ++++++++++++++++++++ src/RedirectorRoutes.php | 41 ++++++++++++++++++++ 8 files changed, 233 insertions(+), 37 deletions(-) create mode 100644 public/assets/awaki-logo.png create mode 100644 public/assets/style.css create mode 100644 public/err404.html create mode 100644 public/err500.html create mode 100644 public/index.html create mode 100644 src/RedirectorRoutes.php diff --git a/public/assets/awaki-logo.png b/public/assets/awaki-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..fb2c10f9de918a4d1b0c35274e3772e1f6286a06 GIT binary patch literal 19126 zcma%ibyyqBvNx1Mu~H~ntU!x96b%G-E5V9upin$OaN6STP>QuU6nCe%LyJR@qQQf^ ze4*z(=iWc=bDl3D$!3||ot>He&Ft(Z^sTDgQ*3f<6cm)F3i8q*6cjY%3#AVe1Npwf z`>PH4@xn#sor{Kpr3=*58H^%f;a~=)QLr<$0)xP&79LLhU=d`iO>50}F7H&7h0Pu8 zI7}aCINa?Vk*!fsM8w=3P0c@mU1-d}R@U~Sbcm)lIvQ&WQ92zy6)qJ=De!x1c~57s zhNr5gx#tISAqzS&AdQH-FtP(Xu!|{;yPd5)MA%)F?r*=s$nrxqCmqdS5|@g1e@(&8QAOoH9os|x5foBnobINMoZK8- zoOX5(^ZH8-aRGtsGRF#ivoqpP#+ z-+5Y?bAoNbc3^uK2$Cu8zZ@Ys7glq&Mk>(MR@%Yb_2It?(xP;(uGSX9e9}Bzfce=tEoU|7pwfU)u^xIfG4I9Go>B9Blt> zDsSIAxHv%GJ2=uvY4Fo9=~&xaI6xuH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EmdE5z<2Js$xgtLaquAz47^O`Ud!%VHyRz? zuU)>yV*ON(L@%}UlOKR_%)Li{<}nY@7(WmKEnra7ES)2IV^*z=x%`2fCreKJn)SKn zr^3b+?oY}CrEOEifn$JBl~=noQ*|eEJ*+mr?zzM4k))>HEYM;BkRc#|< + + + + + Error 404 + + + +
+
+
+ +
+

Couldn't find what you were looking for

+
+
+ +
+
+ + diff --git a/public/err500.html b/public/err500.html new file mode 100644 index 0000000..3a4cb87 --- /dev/null +++ b/public/err500.html @@ -0,0 +1,26 @@ + + + + + + Error 500 + + + +
+
+
+ +
+

Something horrendously went wrong! Please report this if the error persists.

+
+
+ +
+
+ + diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..9295f1f --- /dev/null +++ b/public/index.html @@ -0,0 +1,26 @@ + + + + + + Awaki + + + +
+
+
+ +
+

Short URL Service for Flashii

+
+
+ +
+
+ + diff --git a/public/index.php b/public/index.php index 101f5ae..2e34b8a 100644 --- a/public/index.php +++ b/public/index.php @@ -1,42 +1,9 @@ use('/', function($response) { - $response->setPoweredBy('Awaki+Index'); -}); - -$router->get('/', function() { - $body = ''; - $body .= 'Awaki'; - $body .= 'Redirect service - OK'; - return $body; -}); - -$router->get('/:id', function($response, $request, $id) use ($db) { - $getInfo = $db->prepare('SELECT `redir_url` FROM `awk_redirects` WHERE `redir_id` = ? OR `redir_vanity` = ?'); - $getInfo->addParameter(1, $id, DbType::INTEGER); - $getInfo->addParameter(2, $id, DbType::STRING); - $getInfo->execute(); - $info = $getInfo->getResult(); - - if(!$info->next()) - return 404; - - $targetUrl = $info->getString(0); - - $params = $request->getParamString(); - if(!empty($params)) - $targetUrl .= '?' . $params; - - $response->redirect($targetUrl); -}); - -$router->dispatch(); +$awk->setUpHttp(); +$awk->dispatchHttp( + \Index\Http\HttpRequest::fromRequest() +); diff --git a/src/AwakiContext.php b/src/AwakiContext.php index bcb1f1b..25e8a42 100644 --- a/src/AwakiContext.php +++ b/src/AwakiContext.php @@ -5,11 +5,18 @@ use Index\Data\IDbConnection; use Index\Data\Migration\IDbMigrationRepo; use Index\Data\Migration\DbMigrationManager; use Index\Data\Migration\FsDbMigrationRepo; +use Index\Http\HttpFx; +use Index\Http\HttpRequest; +use Index\Routing\IRouter; + +// theme colours: #99403d, #592824, #d18c83 +// totally didn't just eyedrop musujime class AwakiContext { private const DB_INIT = 'SET SESSION time_zone = \'+00:00\', sql_mode = \'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION\';'; private IDbConnection $dbConn; + private HttpFx $router; public function __construct(IDbConnection $dbConn) { $this->dbConn = $dbConn; @@ -28,4 +35,37 @@ class AwakiContext { public function createMigrationRepo(): IDbMigrationRepo { return new FsDbMigrationRepo(AWK_DIR_DBM); } + + public function getRouter(): IRouter { + return $this->router->getRouter(); + } + + public function setUpHttp(): void { + $this->router = new HttpFx; + $this->router->use('/', function($response) { + $response->setPoweredBy('Awaki'); + }); + + $this->registerErrorPages(); + $this->registerHttpRoutes(); + } + + public function dispatchHttp(?HttpRequest $request = null): void { + $this->router->dispatch($request); + } + + private function registerErrorPages(): void { + $this->router->addErrorHandler(404, function($response) { + $response->accelRedirect('/err404.html'); + $response->setTypeHTML(); + }); + $this->router->addErrorHandler(500, function($response) { + $response->accelRedirect('/err500.html'); + $response->setTypeHTML(); + }); + } + + private function registerHttpRoutes(): void { + new RedirectorRoutes($this->router, $this->dbConn); + } } diff --git a/src/RedirectorRoutes.php b/src/RedirectorRoutes.php new file mode 100644 index 0000000..4e842ce --- /dev/null +++ b/src/RedirectorRoutes.php @@ -0,0 +1,41 @@ +dbConn = $dbConn; + + $router->get('/', [$this, 'index']); + $router->get('/:id', [$this, 'redirect']); + } + + public function index($response): void { + $response->accelRedirect('/index.html'); + $response->setTypeHTML(); + } + + public function redirect($response, $request, $id) { + $getInfo = $this->dbConn->prepare('SELECT redir_url FROM awk_redirects WHERE redir_id = ? OR redir_vanity = ?'); + $getInfo->addParameter(1, $id, DbType::INTEGER); + $getInfo->addParameter(2, $id, DbType::STRING); + $getInfo->execute(); + $info = $getInfo->getResult(); + + if(!$info->next()) + return 404; + + $targetUrl = $info->getString(0); + + $params = $request->getParamString(); + if(!empty($params)) + $targetUrl .= '?' . $params; + + $response->redirect($targetUrl); + } +}