mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 02:39:10 -04:00
ALPHA 3.0.5
This commit is contained in:
19
app/Http/helpers.php
Normal file
19
app/Http/helpers.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?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;
|
||||
}
|
||||
Reference in New Issue
Block a user