-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #120 from Liturgical-Calendar/development
Development
- Loading branch information
Showing
157 changed files
with
13,282 additions
and
2,490 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Bug Report | ||
description: File a bug report | ||
title: "[Bug]: " | ||
labels: ["bug"] | ||
assignees: | ||
- JohnRDOrazio | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Thanks for taking the time to fill out this bug report! | ||
- type: input | ||
id: contact | ||
attributes: | ||
label: Contact Details | ||
description: How can we get in touch with you if we need more info? | ||
placeholder: ex. email@example.com | ||
validations: | ||
required: false | ||
- type: textarea | ||
id: what-happened | ||
attributes: | ||
label: What happened? | ||
description: Also tell us, what did you expect to happen? | ||
placeholder: Tell us what you see! | ||
value: "A bug happened!" | ||
validations: | ||
required: true | ||
- type: dropdown | ||
id: version | ||
attributes: | ||
label: Version | ||
description: What version of the API where you using when you noticed the bug? | ||
options: | ||
- v1 | ||
- v2 | ||
- v3 (Default) | ||
- dev (Edge) | ||
validations: | ||
required: true | ||
- type: dropdown | ||
id: browsers | ||
attributes: | ||
label: Which browsers are you seeing the problem on? | ||
multiple: true | ||
options: | ||
- Firefox | ||
- Chrome | ||
- Safari | ||
- Microsoft Edge | ||
- type: textarea | ||
id: error-messages | ||
attributes: | ||
label: Relevant error messages | ||
description: If there are any error messages related to the bug, please add them here. This will be automatically formatted into code, so no need for backticks. | ||
render: shell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ LiturgicalCalendar.iml | |
.idea | ||
engineCache/* | ||
allowedOrigins.php | ||
vendor/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
include_once( 'includes/enums/LitLocale.php' ); | ||
include_once( 'includes/enums/RomanMissal.php' ); | ||
|
||
$requestHeaders = getallheaders(); | ||
if( isset( $requestHeaders[ "Origin" ] ) ) { | ||
header( "Access-Control-Allow-Origin: {$requestHeaders[ "Origin" ]}" ); | ||
header( 'Access-Control-Allow-Credentials: true' ); | ||
} | ||
else { | ||
header( 'Access-Control-Allow-Origin: *' ); | ||
} | ||
header( 'Access-Control-Max-Age: 86400' ); // cache for 1 day | ||
header( 'Cache-Control: must-revalidate, max-age=259200' ); | ||
header( 'Content-Type: application/json' ); | ||
|
||
$FestivityCollection = []; | ||
|
||
$LatinMissals = array_filter( RomanMissal::$values, function($item){ | ||
return str_starts_with( $item, "VATICAN_" ); | ||
}); | ||
|
||
$LOCALE = isset( $_GET["locale"] ) && LitLocale::isValid( strtoupper( $_GET["locale"] ) ) ? strtoupper( $_GET["locale"] ) : "LA"; | ||
|
||
foreach( $LatinMissals as $LatinMissal ) { | ||
$DataFile = RomanMissal::getSanctoraleFileName( $LatinMissal ); | ||
if( $DataFile !== false ) { | ||
$I18nPath = RomanMissal::getSanctoraleI18nFilePath( $LatinMissal ); | ||
if( $I18nPath !== false && file_exists( $I18nPath . "/" . strtolower( $LOCALE ) . ".json" ) ) { | ||
$NAME = json_decode( file_get_contents( $I18nPath . "/" . strtolower( $LOCALE ) . ".json" ), true ); | ||
$DATA = json_decode( file_get_contents( $DataFile ), true ); | ||
foreach( $DATA as $idx => $festivity ) { | ||
$key = $festivity[ "TAG" ]; | ||
$FestivityCollection[ $key ] = $festivity; | ||
$FestivityCollection[ $key ][ "NAME" ] = $NAME[ $key ]; | ||
$FestivityCollection[ $key ][ "MISSAL" ] = $LatinMissal; | ||
} | ||
} | ||
} | ||
} | ||
|
||
$responseObj = [ "LitCalAllFestivities" => $FestivityCollection ]; | ||
|
||
$response = json_encode( $responseObj ); | ||
$responseHash = md5( $response ); | ||
header("Etag: \"{$responseHash}\""); | ||
if (!empty( $_SERVER['HTTP_IF_NONE_MATCH'] ) && $_SERVER['HTTP_IF_NONE_MATCH'] === $responseHash) { | ||
header( $_SERVER[ "SERVER_PROTOCOL" ] . " 304 Not Modified" ); | ||
header('Content-Length: 0'); | ||
} else { | ||
echo $response; | ||
} | ||
die(); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.