Skip to content

Commit 194a626

Browse files
authored
Merge pull request #295 from Liturgical-Calendar/development
Prepare v4.4 release
2 parents f6c8554 + 112f515 commit 194a626

File tree

30 files changed

+2281
-601
lines changed

30 files changed

+2281
-601
lines changed

Dockerfile

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
# Use the official PHP 8.3 CLI image as the base image
1+
# Use the official PHP 8.4 CLI image as the base image
22
FROM php:8.4-cli AS build
33

44
# Install necessary PHP extensions and Composer in one step to minimize layers
55
RUN apt-get update -y && \
6-
apt-get upgrade -y && \
7-
apt-get install -y --no-install-suggests --no-install-recommends libicu-dev libonig-dev libzip-dev gettext libyaml-dev && \
6+
apt-get install -y --no-install-suggests --no-install-recommends \
7+
libicu-dev libonig-dev libzip-dev gettext libyaml-dev && \
88
docker-php-ext-install intl zip gettext calendar && \
99
pecl install yaml && \
1010
docker-php-ext-enable intl zip gettext calendar yaml && \
1111
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
12-
apt-get clean && \
1312
rm -rf /var/lib/apt/lists/*
1413

1514
# Set the working directory
1615
WORKDIR /var/www/html
1716

17+
# Copy composer files first for caching purposes
1818
COPY composer.json composer.lock ./
1919

2020
# Run composer install to install dependencies
@@ -32,25 +32,23 @@ FROM php:8.4-cli AS main
3232
# Set the working directory
3333
WORKDIR /var/www/html
3434

35+
# Install runtime dependencies (not the -dev packages)
36+
RUN apt-get update -y && \
37+
apt-get install -y --no-install-suggests --no-install-recommends \
38+
libyaml-0-2 libzip4 locales-all && \
39+
rm -rf /var/lib/apt/lists/*
40+
3541
# Copy the compiled PHP extensions from the build stage
36-
COPY --from=build /usr/lib/x86_64-linux-gnu/libyaml* /usr/lib/x86_64-linux-gnu
37-
COPY --from=build /usr/lib/x86_64-linux-gnu/libzip* /usr/lib/x86_64-linux-gnu
3842
COPY --from=build /usr/local/lib/php/extensions /usr/local/lib/php/extensions
3943
COPY --from=build /usr/local/etc/php/conf.d /usr/local/etc/php/conf.d
4044
COPY --from=build /usr/local/bin/composer /usr/local/bin/composer
4145
COPY --from=build /var/www/html /var/www/html
4246

43-
RUN apt-get update -y && \
44-
apt-get upgrade -y && \
45-
apt-get install -y --no-install-suggests --no-install-recommends locales-all && \
46-
apt-get clean && \
47-
rm -rf /var/lib/apt/lists/*
47+
# Set the environment variable
48+
ENV PHP_CLI_SERVER_WORKERS=6
4849

4950
# Expose port 8000 to the host
5051
EXPOSE 8000
5152

52-
# Set the environment variable
53-
ENV PHP_CLI_SERVER_WORKERS=6
54-
5553
# Command to run PHP's built-in server
5654
CMD ["php", "-S", "0.0.0.0:8000", "-t", "/var/www/html"]

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ Some characteristics of this API:
4141
# Example applications
4242
There are a few proof of concept example applications for usage of the API at https://litcal.johnromanodorazio.com/usage.php, which demonstrate generating an HTML representation of the Liturgical Calendar.
4343

44-
* The [first example](https://litcal.johnromanodorazio.com/examples/php/) uses cURL in PHP to make a request to the endpoint and handle the results.
45-
* The [second example](https://litcal.johnromanodorazio.com/examples/javascript/) uses `fetch` in Javascript to make the request to the endpoint and handle the results.
46-
* The [third example](https://litcal.johnromanodorazio.com/examples/fullcalendar/examples/month-view.html) makes use of the [FullCalendar javascript framework](https://github.com/fullcalendar/fullcalendar) to display the results from the `fetch` request in a nicely formatted calendar view.
47-
* The [fourth example](https://litcal.johnromanodorazio.com/examples/fullcalendar/examples/messages.html) is the same as the third except that it outputs the Messages first and the [FullCalendar](https://github.com/fullcalendar/fullcalendar) calendar view after.
44+
* The [first example](https://litcal.johnromanodorazio.com/examples.php?example=PHP) uses cURL in PHP to make a request to the endpoint and handle the results.
45+
* The [second example](https://litcal.johnromanodorazio.com/examples.php?example=JavaScript) uses `fetch` in Javascript to make the request to the endpoint and handle the results.
46+
* The [third example](https://litcal.johnromanodorazio.com/examples.php?example=FullCalendar) makes use of the [FullCalendar javascript framework](https://github.com/fullcalendar/fullcalendar) to display the results from the `fetch` request in a nicely formatted calendar view.
47+
* The [fourth example](https://litcal.johnromanodorazio.com/examples.php?example=FullCalendarMessages) is the same as the third except that it outputs the Messages first and the [FullCalendar](https://github.com/fullcalendar/fullcalendar) calendar view after.
4848

4949
All of these examples request `JSON` as the data exchange format generated by the endpoint. Any application could use the endpoint in a similar manner: an Android App, a plugin for a Desktop Publishing App...
5050

@@ -60,23 +60,23 @@ _(See [usage.php#calSubscription](https://litcal.johnromanodorazio.com/usage.php
6060
# Testing locally
6161

6262
System requirements:
63-
* PHP >= 8.1
63+
* PHP >= 8.4 (we make use of more modern PHP functions such as `array_find`)
6464
* PHP modules installed and enabled: `intl` * `zip` * `gettext` * `calendar` * `yaml`
6565
* System language packs for all the supported languages
6666

6767
## Using PHP's builtin server
6868

69-
To test the API locally, you can use PHP's builtin server. However, you will need to spawn at least a couple of workers, since some routes will make a request internally to another route. For example, a request to the `/calendar` route will make a request internally to the `/calendars` route.
69+
To test the API locally, you can use PHP's builtin server. However, you will need to spawn at least a couple of workers, since some routes will make a request internally to another route. For example, a request to the `/calendar` route will make a request internally to the `/calendars` route. To be really safe, you could spawn up to 6 workers.
7070

7171
Spawn at least two workers:
7272
```bash
7373
PHP_CLI_SERVER_WORKERS=2 php -S localhost:8000
7474
```
7575

76-
## Using a docker container
77-
7876
For convenience when using VSCode, a `tasks.json` has been defined so that you can simply type <kbd>CTRL</kbd>+<kbd>SHIFT</kbd>+<kbd>B</kbd> (<kbd>CMD</kbd>+<kbd>SHIFT</kbd>+<kbd>B</kbd> on MacOS) to start the PHP builtin server and open the browser.
7977

78+
## Using a docker container
79+
8080
To further simplify your setup, without having to worry about getting all the system requirements in place, you can also launch the API in a docker container using the repo `Dockerfile`:
8181

8282
```bash
@@ -87,6 +87,9 @@ docker build -t liturgy-api:{branch} .
8787
docker run -p 8000:8000 -d liturgy-api:{branch}
8888
```
8989

90+
This will result in a docker image of about 1.09GB. Unfortunately this cannot be reduced by means of an alpine image,
91+
if we want to install system locales in order for `gettext` to work properly with all supported languages.
92+
9093
# Translations
9194

9295
<a href="https://translate.johnromanodorazio.com/engage/liturgical-calendar/">
@@ -95,6 +98,9 @@ docker run -p 8000:8000 -d liturgy-api:{branch}
9598

9699
# CHANGELOG
97100

101+
## [v4.4](https://github.com/JohnRDOrazio/LiturgicalCalendar/releases/tag/v4.4) (March 22nd 2025)
102+
* restore national calendar `PUT`, `PATCH` and `DELETE` requests with full support for all i18n languages (issues #284, #265, and #220)
103+
98104
## [v4.3](https://github.com/JohnRDOrazio/LiturgicalCalendar/releases/tag/v4.3) (January 26th 2025)
99105
* realign XML output with latest developments (issue #290)
100106

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"keywords": ["api","rest","restful","liturgy","calendar","liturgical","universal","roman","catholic"],
66
"homepage": "https://litcal.johnromanodorazio.com",
77
"require": {
8-
"php": ">=8.1",
8+
"php": ">=8.4",
99
"swaggest/json-schema": "~0.12",
1010
"cboden/ratchet": "~0.4",
1111
"sabre/vobject": "^4.5.1",

composer.lock

Lines changed: 12 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

i18n/hr/LC_MESSAGES/litcal.mo

2.26 KB
Binary file not shown.

0 commit comments

Comments
 (0)