mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 10:49:10 -04:00
19 lines
405 B
PHP
19 lines
405 B
PHP
<?php
|
|
|
|
function getStatus()
|
|
{
|
|
$client = new GuzzleHttp\Client();
|
|
$incidents = $client->get('https://status.c-cms.cf/api/v1/incidents');
|
|
|
|
$isBroken = false;
|
|
|
|
$incidents_decode = json_decode($incidents->getBody(),true);
|
|
|
|
foreach ($incidents_decode['data'] as $incident) {
|
|
if (!$incident['is_resolved']) {
|
|
$isBroken = true;
|
|
}
|
|
}
|
|
|
|
return $isBroken;
|
|
} |