jbroadway / githubfetcher
Very simple Github public project fetching tool.
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/jbroadway/githubfetcher
Requires
- php: >=5.3.0
This package is auto-updated.
Last update: 2025-09-25 08:22:07 UTC
README
- Copyright: (c) 2012 Johnny Broadway
- License: http://www.opensource.org/licenses/mit-license.php
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); ?>