From 5c4e6ee08ce332d4604c692a837c0a7feed08b94 Mon Sep 17 00:00:00 2001 From: Troels Ugilt Jensen <6103205+tuj@users.noreply.github.com> Date: Fri, 8 Nov 2024 12:37:44 +0100 Subject: [PATCH] 2321: Added infrastructure files --- .../etc/confd/templates/env.local.tmpl | 12 ++++++++++++ .../etc/confd/templates/env.local.tmpl | 12 ++++++++++++ src/Feed/CalendarApiFeedType.php | 6 ++---- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/infrastructure/itkdev/display-api-service/etc/confd/templates/env.local.tmpl b/infrastructure/itkdev/display-api-service/etc/confd/templates/env.local.tmpl index f9ce1ef7..dadab538 100644 --- a/infrastructure/itkdev/display-api-service/etc/confd/templates/env.local.tmpl +++ b/infrastructure/itkdev/display-api-service/etc/confd/templates/env.local.tmpl @@ -51,3 +51,15 @@ CLI_REDIRECT={{ getenv "APP_CLI_REDIRECT" "" }} REDIS_CACHE_PREFIX={{ getenv "APP_CLI_REDIRECT" "DisplayApiService" }} REDIS_CACHE_DSN={{ getenv "APP_CLI_REDIRECT" "redis://redis:6379/0" }} ###< redis ### + +###> Calendar Api Feed Source ### +CALENDAR_API_FEED_SOURCE_LOCATION_ENDPOINT={{ getenv "APP_CALENDAR_API_FEED_SOURCE_LOCATION_ENDPOINT" "" }} +CALENDAR_API_FEED_SOURCE_RESOURCE_ENDPOINT={{ getenv "APP_CALENDAR_API_FEED_SOURCE_RESOURCE_ENDPOINT" "" }} +CALENDAR_API_FEED_SOURCE_EVENT_ENDPOINT={{ getenv "APP_CALENDAR_API_FEED_SOURCE_EVENT_ENDPOINT" "" }} +CALENDAR_API_FEED_SOURCE_CUSTOM_MAPPINGS={{ getenv "APP_CALENDAR_API_FEED_SOURCE_CUSTOM_MAPPINGS" "'{}'" }} +CALENDAR_API_FEED_SOURCE_EVENT_MODIFIERS={{ getenv "APP_CALENDAR_API_FEED_SOURCE_EVENT_MODIFIERS" "'{}'" }} +CALENDAR_API_FEED_SOURCE_DATE_FORMAT={{ getenv "APP_CALENDAR_API_FEED_SOURCE_DATE_FORMAT" "" }} +CALENDAR_API_FEED_SOURCE_DATE_TIMEZONE={{ getenv "APP_CALENDAR_API_FEED_SOURCE_DATE_TIMEZONE" "" }} +CALENDAR_API_FEED_SOURCE_CACHE_EXPIRE_RESOURCES={{ getenv "APP_CALENDAR_API_FEED_SOURCE_CACHE_EXPIRE_RESOURCES" "3600" }} +CALENDAR_API_FEED_SOURCE_CACHE_EXPIRE_EVENTS={{ getenv "APP_CALENDAR_API_FEED_SOURCE_CACHE_EXPIRE_EVENTS" "300" }} +###< Calendar Api Feed Source ### diff --git a/infrastructure/os2display/display-api-service/etc/confd/templates/env.local.tmpl b/infrastructure/os2display/display-api-service/etc/confd/templates/env.local.tmpl index f9ce1ef7..dadab538 100644 --- a/infrastructure/os2display/display-api-service/etc/confd/templates/env.local.tmpl +++ b/infrastructure/os2display/display-api-service/etc/confd/templates/env.local.tmpl @@ -51,3 +51,15 @@ CLI_REDIRECT={{ getenv "APP_CLI_REDIRECT" "" }} REDIS_CACHE_PREFIX={{ getenv "APP_CLI_REDIRECT" "DisplayApiService" }} REDIS_CACHE_DSN={{ getenv "APP_CLI_REDIRECT" "redis://redis:6379/0" }} ###< redis ### + +###> Calendar Api Feed Source ### +CALENDAR_API_FEED_SOURCE_LOCATION_ENDPOINT={{ getenv "APP_CALENDAR_API_FEED_SOURCE_LOCATION_ENDPOINT" "" }} +CALENDAR_API_FEED_SOURCE_RESOURCE_ENDPOINT={{ getenv "APP_CALENDAR_API_FEED_SOURCE_RESOURCE_ENDPOINT" "" }} +CALENDAR_API_FEED_SOURCE_EVENT_ENDPOINT={{ getenv "APP_CALENDAR_API_FEED_SOURCE_EVENT_ENDPOINT" "" }} +CALENDAR_API_FEED_SOURCE_CUSTOM_MAPPINGS={{ getenv "APP_CALENDAR_API_FEED_SOURCE_CUSTOM_MAPPINGS" "'{}'" }} +CALENDAR_API_FEED_SOURCE_EVENT_MODIFIERS={{ getenv "APP_CALENDAR_API_FEED_SOURCE_EVENT_MODIFIERS" "'{}'" }} +CALENDAR_API_FEED_SOURCE_DATE_FORMAT={{ getenv "APP_CALENDAR_API_FEED_SOURCE_DATE_FORMAT" "" }} +CALENDAR_API_FEED_SOURCE_DATE_TIMEZONE={{ getenv "APP_CALENDAR_API_FEED_SOURCE_DATE_TIMEZONE" "" }} +CALENDAR_API_FEED_SOURCE_CACHE_EXPIRE_RESOURCES={{ getenv "APP_CALENDAR_API_FEED_SOURCE_CACHE_EXPIRE_RESOURCES" "3600" }} +CALENDAR_API_FEED_SOURCE_CACHE_EXPIRE_EVENTS={{ getenv "APP_CALENDAR_API_FEED_SOURCE_CACHE_EXPIRE_EVENTS" "300" }} +###< Calendar Api Feed Source ### diff --git a/src/Feed/CalendarApiFeedType.php b/src/Feed/CalendarApiFeedType.php index 6ccf41a7..1e085737 100644 --- a/src/Feed/CalendarApiFeedType.php +++ b/src/Feed/CalendarApiFeedType.php @@ -60,9 +60,7 @@ public function __construct( } /** - * @param Feed $feed - * - * @return array + * {@inheritDoc} */ public function getData(Feed $feed): array { @@ -372,7 +370,7 @@ private function stringToUnixTimestamp(string $dateTimeString): int $dateFormat = $this->dateFormat !== '' ? $this->dateFormat : \DateTimeInterface::ATOM; // Default is no timezone since the difference from UTC is in the dateformat (+00:00). // For timezone options see: https://www.php.net/manual/en/timezones.php - $timezone = $this->timezone !== '' ? new \DateTimeZone($this->timezone) : null; + $timezone = !empty($this->timezone) ? new \DateTimeZone($this->timezone) : null; $datetime = \DateTime::createFromFormat($dateFormat, $dateTimeString, $timezone);