PHP Classes

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 (12)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2020-05-30 (3 days ago) RSS 2.0 feedNot yet rated by the usersTotal: 51 This week: 13All time: 9,776 This week: 22Up
Version License PHP version Categories
phpgithub 1.2.0Free for non-comm...7PHP 5, Files and Folders, Web services, P...
Description Author

This class can get responses to requests to 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

Name: Mat Jung <contact>
Classes: 2 packages by
Country: Switzerland Switzerland
Age: 44
All time rank: 415933 in Switzerland Switzerland
Week rank: 19 Up1 in Switzerland Switzerland Up
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  
  Files folder image Files  
File Role Description
Files folder imageconsumer (1 directory)
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:51
This week:13
All time:9,776
This week:22Up

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