Release 2.13 (#4659)

This commit is contained in:
Kevin Papst
2024-03-10 15:35:59 +01:00
committed by GitHub
parent a78e8ed8c4
commit dee90bb15e
79 changed files with 1019 additions and 932 deletions

View File

@@ -45,21 +45,28 @@ final class PluginController extends AbstractController
private function getPluginInformation(HttpClientInterface $client, CacheInterface $cache): array
{
return $cache->get('kimai.marketplace_extensions', function (ItemInterface $item) use ($client) {
$response = $client->request('GET', 'https://www.kimai.org/plugins.json');
try {
$response = $client->request('GET', 'https://www.kimai.org/plugins.json');
if ($response->getStatusCode() !== 200) {
return [];
if ($response->getStatusCode() !== 200) {
return [];
}
$json = json_decode($response->getContent(), true);
if ($json === null) {
return [];
}
$item->expiresAfter(86400); // one day
return $response->toArray();
} catch (\Exception $exception) {
$this->logException($exception);
$this->flashError('Could not download plugin information');
}
$json = json_decode($response->getContent(), true);
if ($json === null) {
return [];
}
$item->expiresAfter(86400); // one day
return $response->toArray();
return [];
});
}
}