Skip to content
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);
}
}