Skip to content

Added method getRepoContents for Repo API #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 12, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions lib/Github/Api/Repo.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,4 +356,19 @@ public function getRepoTeams($username, $repo)
{
return $this->get('repos/'.urlencode($username).'/'.urlencode($repo).'/teams');
}

/**
* Get contents of any file or directory in a repository
* @link http://developer.github.com/v3/repos/contents/
*
* @param string $username the user who owns the repo
* @param string $repo the name of the repo
* @param $path path to file or directory
*
* @return array information for file | information for each item in directory
*/
public function getRepoContents($username, $repo, $path)
{
return $this->get('repos/'.urlencode($username).'/'.urlencode($repo).'/contents/'.$path);
}
}