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

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

This library class provides functions to work with the GitHub API v3.

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

Picture of Mat Jung
  Performance   Level  
Name: Mat Jung <contact>
Classes: 2 packages by
Country: Switzerland Switzerland
Innovation award
Innovation award
Nominee: 1x

Details
The class has a dependency with PHP cURL
https://www.php.net/manual/en/book.curl.php

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

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

Sample client

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

Sample output
140.82.112.6 https://api.github.com/ 200

In tab Example you find a more comprehensive sample github api client
  GitHub Repository Directory TreeExternal page   Invite yourself to GitHub RepoExternal page  
  Files folder image Files  
File Role Description
Files folder imageconsumer (1 directory)
Accessible without login Plain text file ghacadduser2repo.php Example Sample invite friends to GitHub Repository
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 https://api.github.com/user
Accessible without login Plain text file githubclient_repository_content_tree.php Example GitHub Content Tree Walker
Accessible without login Plain text file githubclient_userprofile.php Example Example for phpGithubUser
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 phpGithubUser.php Class class phpGithubUser Model for Github user
Plain text file phpHubResult.php Class class phpHubResult
Accessible without login Plain text file Readme Doc. Readme

  Files folder image Files  /  consumer  
File Role Description
Files folder imagejhu (1 file)

  Files folder image Files  /  consumer  /  jhu  
File Role Description
  Accessible without login Plain text file web.php Example Returns todays covid file from JHU repository

 Version Control Unique User Downloads Download Rankings  
 0%
Total:55
This week:0
All time:9,908
This week:261Up

For more information send a message to info at phpclasses dot org.