Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/divineomega/php-github-status-api
Programmatically determine if GitHub is working well, or experiencing issues
https://github.com/divineomega/php-github-status-api
github github-api github-status
Last synced: 2 months ago
JSON representation
Programmatically determine if GitHub is working well, or experiencing issues
- Host: GitHub
- URL: https://github.com/divineomega/php-github-status-api
- Owner: DivineOmega
- Created: 2018-12-07T22:49:18.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-16T22:16:20.000Z (over 5 years ago)
- Last Synced: 2024-10-15T02:38:20.366Z (2 months ago)
- Topics: github, github-api, github-status
- Language: PHP
- Size: 13.7 KB
- Stars: 7
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PHP GitHub Status API
[![Build Status](https://travis-ci.com/DivineOmega/php-github-status-api.svg?branch=master)](https://travis-ci.com/DivineOmega/php-github-status-api)
---
⚠️ **Warning:** As of 11th December 2018, GitHub have deprecated the status page that this package parses, so current status information may not be up-to-date. More information: https://blog.github.com/2018-12-11-introducing-the-new-github-status-site/
---
This package provides a way to programmatically determine if GitHub is working
well, or experiencing issues.
Both the current status and historical statuses can be looked up by date.
## Installation
To install PHP GitHub Status API, just run the following composer command.
```bash
composer require divineomega/github-status-api
```Remember to include the `vendor/autoload.php` file if your framework does not
do this for you.## Usage
To check the state of GitHub currently, simply create a new `Client` object,
and call its `status` method. You can optionally pass a `Carbon` date object
to the `status` method to retrieve a historical status.```php
use Carbon\Carbon;
use DivineOmega\GitHubStatusApi\Client;
use DivineOmega\GitHubStatusApi\Enums\GitHubStatus;require_once 'vendor/autoload.php';
$status = (new Client())->status();
// $status = (new Client())->status(Carbon::parse('2018-12-06 17:00'));switch ($status) {
case GitHubStatus::GOOD:
echo 'GitHub is up! No issues reported.';
break;case GitHubStatus::MINOR:
echo 'GitHub is experiencing minor issues.';
break;case GitHubStatus::MAJOR:
echo 'GitHub is experiencing major issues.';
break;case GitHubStatus::UNKNOWN:
echo 'Unable to determine GitHub\'s status.';
break;
}echo PHP_EOL;
```