2017 © Pedro Peláez
 

library php-github

A PHP client library for the GitHub API.

image

guillermoandrae/php-github

A PHP client library for the GitHub API.

  • Wednesday, March 11, 2015
  • by guillermoandrae
  • Repository
  • 0 Watchers
  • 1 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 9 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

php-github

Travis branch Coverage Status Code Quality HHVM, (*1)

A PHP client library for the GitHub API., (*2)

Installation

The recommended way to install this library is via Composer:, (*3)

{
    "require": {
        "guillermoandrae/php-github": "*"
    }
}

Basic Usage

The basic client uses Guzzle to communicate with the GitHub API. Instantiation of the client is straight-forward:, (*4)

// create the client
$client = new GitHub\Client\Client();

Resources are represented as objects, and resource data is fetched through the use of object mappers:, (*5)

// pick a resource and get some useful data, like so...
$users = $client->resource('user')->findAll();
foreach ($users as $user) {
    printf('%s has %d followers.', $user->getLogin(), $user->getNumFollowers());
    echo PHP_EOL;
}

// or like so...
$org = $client->resource('organization')->find('github');
echo $org->getLocation();

// .. and rejoice!
echo 'YEESSSSSSSSSSSS!';

The Versions