/github-api-wrapper

Github API Wrapper for PHP7

Primary LanguagePHP

Github API Wrapper

Connect to github and fetch user / repository data. It's easy and fast!

Requirements

  • PHP 7
  • GuzzleHTTP
  • Composer

Install

Install with composer, run:

composer require saiik/github-api-wrapper

Github Token

Visit Github settings to get a github access token.

Quickstart

Connect to github

require_once 'vendor/autoload.php';

$token = 'YOUR_GITHUB_TOKEN';

$github = new \saiik\Github($token);

Get all user repositories

$repos = $github->getRepos();

Get a specify repository

// you need to have access to the repository
$repo = $github->getRepo('REPO_OWNER', 'REPO_NAME');

Get all commits from a repository

$repo = $github->getRepo('saiik', 'dodu');
$commits = $github->getCommits($repo);

See? It's pretty easy and not overloaded.

View the full documentation in the wiki.

Changelog

License

GNU GPLv3