A minimalistic php sdk for GITHUB API v3
PHP
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
README.md
base_github.php
github.php

README.md

Github-php-sdk

A minimalistic sdk for Github v3 api

Usage:

To use the github api inclue the source file

require_once ('github.php');

create an object of github class

$github = Github(array( 'APP_ID' => GITHUB_APP_ID, 
                        'APP_SECRET' => GITHUB_APP_SECRET,
                        'SCOPE' => SCOPE(comma seperated values, defaults to 'repo')[optional],
                        'REDIRECT_URI' => REDIRECT_URL[optional],
                ));             

To generate the login url for users, call the getLoginUrl method

$url = $github->getLoginUrl();

To get user info, call the getUser method

$user = $github->getUser();

Use the api method to make api calls

$data = $github->api("\path", 'GET/POST', 'get parameters as hashmap', 'post paramenters as hashmap[optional]');

###Useful Stuff### You can directly set the access token using setAccessToken method

$github->setAccessToken(<access_token>);

app secret/app id can be changed after creation using 'setAppSecret' and 'setAppId'

Get methods of the above are also available

####Contributing####

If you find a bug or interested in working on a new feature contact me or just open a pull request.