Skip to content

Commit 725bf7c

Browse files
committed
Merge pull request #3 from tyomo4ka/repo-contents
Added method getRepoContents for Repo API
2 parents f72a4a2 + 1639bee commit 725bf7c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/Github/Api/Repo.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,4 +356,19 @@ public function getRepoTeams($username, $repo)
356356
{
357357
return $this->get('repos/'.urlencode($username).'/'.urlencode($repo).'/teams');
358358
}
359+
360+
/**
361+
* Get contents of any file or directory in a repository
362+
* @link http://developer.github.com/v3/repos/contents/
363+
*
364+
* @param string $username the user who owns the repo
365+
* @param string $repo the name of the repo
366+
* @param $path path to file or directory
367+
*
368+
* @return array information for file | information for each item in directory
369+
*/
370+
public function getRepoContents($username, $repo, $path)
371+
{
372+
return $this->get('repos/'.urlencode($username).'/'.urlencode($repo).'/contents/'.$path);
373+
}
359374
}

0 commit comments

Comments
 (0)