Skip to content

Instantly share code, notes, and snippets.

@MissAllSunday
Created May 10, 2013 14:44
Show Gist options
  • Save MissAllSunday/5554848 to your computer and use it in GitHub Desktop.
Save MissAllSunday/5554848 to your computer and use it in GitHub Desktop.
check API status
protected function getAPIStatus()
{
$apiUrl = 'https://status.github.com/api/status.json';
$check = json_decode($this->fetch_web_data($apiUrl));
if (empty($check))
return false;
if (!empty($check) && is_object($check))
return $check->status == 'good' ? true : false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment