PHP Classes

Github PHP API Library: Get responses to requests to the Github API

Recommend this page to a friend!
  Info   View files Example   View files View files (8)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2020-03-31 (2 days ago) RSS 2.0 feedNot yet rated by the usersTotal: 35 This week: 12All time: 9,809 This week: 38Up
Version License PHP version Categories
phpgithub 1.1.6Free for non-comm...7PHP 5, Files and Folders, Web services, P...
Description Author

This class can get responses to requests to the Github API.

It can send a HTTP request to the GitHub API Web server to perform queries using a given API URL.

The class returns an object with several details of the API response like an:

- The API call success status
- An error that may have occurred in case it failed
- The API response data, content type and content length
- The HTTP response code
- The API server IP address

Name: Mat Jung <contact>
Classes: 2 packages by
Country: Switzerland Switzerland
Age: 43
All time rank: 416933 in Switzerland Switzerland
Week rank: 29 Up1 in Switzerland Switzerland Up
Innovation award
Innovation award
Nominee: 1x


The class has a dependency with PHP cURL

If that is not working for you, the class won't work for you.

Class namespace: namespace php\github;
$hub = new php\github\phpGithub();
$hub->AddCurlConfig(CURLOPT_CAINFO, "/path/to/php/curl/cacert.pem");

Sample client

if($response->success) { 
	echo $response->urlip ." " . $response->url ." " . $response->http_code . "<br>";

Sample output 200

In tab Example you find a more comprehensive sample github api client
  Files folder image Files  
File Role Description
Accessible without login Plain text file githubclient.php Example Sample php client that works with phpGitHub
Accessible without login Plain text file githubclient_current_user.php Example Sample client for calling current_user_url
Plain text file hubHelper.php Class class helper
Plain text file phpGithub.php Class class phpGithub
Plain text file phpGithubContent.php Class class phpGithubContent
Accessible without login Plain text file phpGithubServiceArray.php Appl. AssociativeArray gh mapping between service name and api url
Plain text file phpHubResult.php Class class phpHubResult
Accessible without login Plain text file Readme Doc. Readme

 Version Control Unique User Downloads Download Rankings  
This week:12
All time:9,809
This week:38Up