Installation
Click the download button above or git clone git://github.com/YaWK/gitCurl
Usage
Initialize gitCurl
Simply require and init the class like:
require_once ( 'curl-git.class.php' ); // include class
$gitCurl = new gitCurl(); // create new gitCurl object
Request
Make a simple request
To get commits, use this method: $gitCurl->getData('your api url')$data = $gitCurl->getData('https://api.github.com/repos/USERNAME/REPOSITORY/commits');
// your GitHub API URL
Draw Data
(Examples)
Basic Data Output
$gitCurl->printData($data);
// print Issues (data only)
Draw Issues with Bootstrap 4 Cards
$gitCurl->drawIssues($data); // draw Issues (card view)
Full-featured code example
take a look at this basic code example and see how it works
Embed Commits
Issues and Milestones
<?PHP
// include class
require_once ('gitCurl.class.php');
// create new gitCurl object
$gitCurl = new gitCurl();
// grab data from GitHub with any API URL
$commits = $gitCurl->getData('https://api.github.com/repos/USER/REPO/commits');
$issues = $gitCurl->getData('https://api.github.com/repos/USER/REPO/issues?state=closed');
$milestones = $gitCurl->getData('https://api.github.com/repos/USER/REPO/milestones?state=open');
// finished for now - data array is filled.
// now it's time to take care about the layout.
?>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.slim.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css" rel="stylesheet">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css" rel="stylesheet">
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-md-2">
<?PHP $gitCurl->drawCommits($commits); ?>
</div>
<div class="col-md-4">
<?PHP $gitCurl->drawIssues($issues); ?>
</div>
<div class="col-md-4">
<?PHP $gitCurl->drawMilestones($milestones); ?>
</div>
</div>
</div>
</body>
</html>
GitCurl Help
Class Documentation
If you want to modify or extend the class, you should start with the GitCurl Docs:
GitCurl Class Documentation
GitHub API Help
get more information
You can learn everything about the GitHub API here:
https://developer.github.com/v3/
For more information on cURL & PHP visit:
http://php.net/manual/book.curl.php
Donate to this project
Send $10 with PayPal
This project is free, licensed under the MIT license.If you like it, support it! Download it, use it, spread the word!
You help me developing more tools if you spend a few bucks.
If you can - thank you!
Supporters
Become a believer and get linked
- $ 10 Daniel Retzl | http://yawk.io
- $ 10 Claudia Pölzi
- $ 10 Bella GFX
Get in contact
with the developer
Daniel Retzl
on GitHubon Twitter
on Facebook
other projects:
Yet another WebKit