Skip to content

Commit

Permalink
Merge pull request #120 from Liturgical-Calendar/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
JohnRDOrazio authored Jun 6, 2022
2 parents 6c1185c + b399022 commit d232b2d
Show file tree
Hide file tree
Showing 157 changed files with 13,282 additions and 2,490 deletions.
56 changes: 56 additions & 0 deletions .github/ISSUE_TEMPLATE/new_bug_report.yml
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
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Check-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Update source file translation strings
id: update_pot
Expand All @@ -34,7 +34,7 @@ jobs:
# push the output folder to your repo
- name: Push changes
if: ${{ steps.update_pot.outputs.POT_LINES_CHANGED > 0 }}
uses: actions-x/commit@v4
uses: actions-x/commit@v6
with:
# The committer's email address
email: 41898282+github-actions[bot]@users.noreply.github.com
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ LiturgicalCalendar.iml
.idea
engineCache/*
allowedOrigins.php
vendor/*

54 changes: 54 additions & 0 deletions LitCalAllFestivities.php
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();
203 changes: 0 additions & 203 deletions LitCalDiocesanData.php

This file was deleted.

3 changes: 1 addition & 2 deletions LitCalEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
* Author: John Romano D'Orazio
* Email: priest@johnromanodorazio.com
* Licensed under the Apache 2.0 License
* Version 3.0
* Version 3.4
* Date Created: 27 December 2017
* Note: it is necessary to set up the MySQL liturgy tables prior to using this script
*/


Expand Down
Loading

0 comments on commit d232b2d

Please sign in to comment.