From b815acc374bc1527b81faa873ac40ec0b4562d20 Mon Sep 17 00:00:00 2001 From: Meezaan-ud-Din Abdu Dhil-Jalali Wal-Ikram Date: Wed, 7 Sep 2022 16:42:11 +0400 Subject: [PATCH] Hash missing endpoint --- api/Controllers/v1/Edition.php | 8 ++++---- api/Utils/Ayah.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/Controllers/v1/Edition.php b/api/Controllers/v1/Edition.php index f7c463e..575413c 100644 --- a/api/Controllers/v1/Edition.php +++ b/api/Controllers/v1/Edition.php @@ -25,7 +25,7 @@ public function get(ServerRequestInterface $request, ResponseInterface $response $format = Http\Request::getQueryParam($request,'format'); $language = Http\Request::getQueryParam($request,'language'); - $result = $this->mc->get('edition_' . $type . '_'. $format . '_' . $language, + $result = $this->mc->get(md5('edition_' . $type . '_'. $format . '_' . $language), function (ItemInterface $item) use ($type, $format, $language) { $item->expiresAfter(604800); $e = new EditionResponse($this->em, null, $type, $language, $format); @@ -63,7 +63,7 @@ public function getByType(ServerRequestInterface $request, ResponseInterface $re { $type = Http\Request::getAttribute($request, 'type'); - $result = $this->mc->get('edition_' . $type, function (ItemInterface $item) use ($type) { + $result = $this->mc->get(md5('edition_' . $type), function (ItemInterface $item) use ($type) { $item->expiresAfter(604800); $e = new EditionResponse($this->em,null, $type); @@ -100,7 +100,7 @@ public function getByFormat(ServerRequestInterface $request, ResponseInterface $ $format = Http\Request::getAttribute($request, 'format'); - $result = $this->mc->get('edition_' . $format, function (ItemInterface $item) use ($format) { + $result = $this->mc->get(md5('edition_' . $format), function (ItemInterface $item) use ($format) { $item->expiresAfter(604800); $e = new EditionResponse($this->em,null, null, null, $format); @@ -135,7 +135,7 @@ public function getByLanguage(ServerRequestInterface $request, ResponseInterface { $lang = $request->getAttribute('lang'); - $result = $this->mc->get('edition_' . $lang, function (ItemInterface $item) use ($lang) { + $result = $this->mc->get(md5('edition_' . $lang), function (ItemInterface $item) use ($lang) { $item->expiresAfter(604800); $e = new EditionResponse($this->em,null, null, null, $lang); diff --git a/api/Utils/Ayah.php b/api/Utils/Ayah.php index 631f1d9..ce00ed5 100644 --- a/api/Utils/Ayah.php +++ b/api/Utils/Ayah.php @@ -24,7 +24,7 @@ public static function getMultipleEditions(ServerRequestInterface $request, mixe $editions = Request::editions(Http\Request::getAttribute($request, 'editions')); if (!empty($editions)) { - $result = $mc->get('ayah_' . $number . '_' . md5(json_encode($editions)), function (ItemInterface $item) use ($number, $editions, $em) { + $result = $mc->get(md5('ayah_' . $number . '_' . json_encode($editions)), function (ItemInterface $item) use ($number, $editions, $em) { $item->expiresAfter(604800); $ayats = []; foreach ($editions as $edition) {