Make environment loading compatible with Plesk

This commit is contained in:
2026-07-22 10:11:15 +02:00
parent 9518bb8c6a
commit cadb633d51
6 changed files with 62 additions and 19 deletions
+10 -5
View File
@@ -1,8 +1,13 @@
<?php
$communityCsv = app_cached_string(
'communities',
app_env_int('REFERENCE_CACHE_SECONDS', 86400, 300, 604800),
static fn(): string => communityCSV((string)$username, (string)$password)
);
$communityCsv = '';
try {
$communityCsv = app_cached_string(
'communities',
app_env_int('REFERENCE_CACHE_SECONDS', 86400, 300, 604800),
static fn(): string => communityCSV((string)$username, (string)$password)
);
} catch (Throwable $exception) {
error_log('Community reference data could not be loaded: ' . $exception->getMessage());
}
echo 'communityCsvData = ' . json_encode($communityCsv, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT) . ';';