Skip to content

Commit

Permalink
use the baselocale for reading and writing cache
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRDOrazio committed Jun 9, 2024
1 parent cf42d24 commit 4ef110d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions includes/Easter.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ private static function handleRequestParams(): void

private static function serveCachedFileIfExists(): void
{
if (file_exists('engineCache/easter/' . self::$Locale . '.json')) {
if (file_exists('engineCache/easter/' . self::$baseLocale . '.json')) {
header('Content-Type: application/json');
echo file_get_contents('engineCache/easter/' . self::$Locale . '.json');
echo file_get_contents('engineCache/easter/' . self::$baseLocale . '.json');
die();
}
}
Expand Down Expand Up @@ -142,7 +142,7 @@ private static function produceResponse(): void
if (!is_dir('engineCache/easter/')) {
mkdir('engineCache/easter/', 0774, true);
}
file_put_contents('engineCache/easter/' . self::$Locale . '.json', json_encode(self::$EasterDates));
file_put_contents('engineCache/easter/' . self::$baseLocale . '.json', json_encode(self::$EasterDates));

header('Content-Type: application/json');
echo json_encode(self::$EasterDates);
Expand Down

0 comments on commit 4ef110d

Please sign in to comment.