Skip to content

Commit

Permalink
Hash missing endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
meezaan committed Sep 7, 2022
1 parent 917a86e commit b815acc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions api/Controllers/v1/Edition.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion api/Utils/Ayah.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b815acc

Please sign in to comment.