Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
PHP 5.3+ GitHub project fetching class
PHP
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
tests
README.md
composer.json
phpunit.xml.dist

README.md

GithubFetcher - PHP 5.3+ GitHub project fetching class

A very basic Github public project fetching tool. Uses v3 of the Github API through CURL. Useful for quickly fetching a project from Github, and much smaller than the full Github PHP client library.

Usage:

<?php

require 'GithubFetcher.php';

$github = new GithubFetcher ('git://github.com/codeguy/Slim.git');

// get all files/folders from the repository
$tree = $github->tree ();

$first_file = false

foreach ($tree as $item) {
    printf ("%s: %s\n", $item->type, $item->path);
    if (! $first_file && $item->type === 'blob') {
        $first_file = $item;
    }
}

// print the contents of the file
echo $github->get ($first_file);

?>
Something went wrong with that request. Please try again.