Download the PHP package rummykhan/github-reader without Composer

On this page you can find all versions of the php package rummykhan/github-reader. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package github-reader

Github Repository Reader

This package helps reading a complete github repository & retrieve any file you want to. This package is a wrapper around GrahamCampbell/Laravel-GitHub, But this package is specifically for reading a Repository in its proper format using Github Official API

Github Official Format

Only the type is changed for directory / symlink.

Installation

Install using composer

Add Service Provider

Add ServiceProvider to config/app.php providers array.

Add Facade

To use with Facade add

Publish the configuration (github.php)

Publish Config

This will publish github.php in config/ directory.

Update Config

Since Github has changed the api Rate Limit you may get exception for hourly rate limit reached. Then you need to Register Github App and add credentials in config/github.php.

Reading Repository

Reading a repository is as straight forward as it could be.

Getting content of a file

Query Files

Since files and directories are instances of Illuminate\Support\Collection, You can query both files or dictionaries just like you query a Illuminate\Support\Collection

There are two ways you can query files.

OR

To query in Files just add InFiles to all the collection methods.

Query Directories

OR

To query in Dictionaries just add InDictionaries to all the Collection methods.

Find a file in repository

Since the structure of each item either File/Directory in the repository is like below.

We can find any all matching directory/files recursively.

Third parameter in the find is to find recursively

This find method will return a collection.

Available Methods

1. GithubReader\RepositoryReader

Name Purpose
init($organization, $repositoryName, $connection = null) Initialize the repository with organization/user and repository name.
getConnection() Getter for connection.
setConnection(string $connection) Set the connection.
getOrganization() Getter for Organization.
setOrganization(string $organization) Setter for organization.
getRepositoryName() Getter for repository name.
setRepositoryName($repositoryName) Setter for repository name.
read($organization = null, $repositoryName = null, $connection = null) read a repository completely.
readPath($path = null) Read only certain path of the repository.

To only use read path.

2. GithubReader\Github\Directory Or Repository

Name Purpose
getFiles() Get all files in that directory.
getDirectories() Get all directories in that directory.
listAll() Get all files and directories in that directory.
retrieve() Alias of listAll().
find($key, $name, $all = true) Find in all files and directories if $all=true it will find recursively.
findDirectory($key, $name, $all = false) Find in directoris and if $all=true it will find recursively.
findFile($key, $name, $all = false) Find in files and if $all=true it will find recursively.
toArray() Convert the object to array representation.
toJson($options = 0) Convert the object to JSON representation.

3. GithubReader\Github\File

Name Purpose
retrieve() It will give you instance of Github\Github\FileContent.

4. GithubReader\Github\FileContent

Name Purpose
getContent() It will give content of file in plain text.

Contact

[email protected]


All versions of github-reader with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
laravel/framework Version 5.2.*
graham-campbell/github Version ^6.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rummykhan/github-reader contains the following files

Loading the files please wait ....