Skip to content

JMedoy/php-github-api

 
 

Repository files navigation

PHP GitHub API

Build Status StyleCI

A simple Object Oriented wrapper for GitHub API, written with PHP5.

Uses GitHub API v3. The object API is very similar to the RESTful API.

Features

  • Follows PSR-0 conventions and coding standard: autoload friendly
  • Light and fast thanks to lazy loading of API classes
  • Extensively tested and documented

Requirements

Autoload

The first step to use php-github-api is to download composer:

$ curl -s http://getcomposer.org/installer | php

Then run the following command to require the library:

$ php composer.phar require knplabs/github-api

php-github-api follows the PSR-4 convention names for its classes, which means you can easily integrate php-github-api classes loading in your own autoloader.

Using Laravel?

Laravel GitHub by Graham Campbell might interest you.

Basic usage of php-github-api client

<?php

// This file is generated by Composer
require_once 'vendor/autoload.php';

$client = new \Github\Client(
    new \Github\HttpClient\HttplugClient(
        new \Http\Adapter\Guzzle6\Client( // Only available when you require the php-httplug/guzzle6-adapter lib
            new \GuzzleHttp\Client()
        ),
        new \Github\Factory\RequestFactory()
    )
);

$users = $client->api('user')->all();

From $client object, you can access to all GitHub.

Cache usage

TBD

Documentation

See the doc directory for more detailed documentation.

License

php-github-api is licensed under the MIT License - see the LICENSE file for details

Credits

Sponsored by

KnpLabs Team

Contributors

Thanks to GitHub for the high quality API and documentation.

About

A simple PHP GitHub API client, Object Oriented, tested and documented. For 5.3+.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%