1111 */
1212class Contents extends AbstractApi
1313{
14+ /**
15+ * Get content of README file in a repository
16+ * @link http://developer.github.com/v3/repos/contents/
17+ *
18+ * @param string $username the user who owns the repository
19+ * @param string $repository the name of the repository
20+ * @param string $reference reference to a branch or commit
21+ *
22+ * @return array information for README file
23+ */
1424 public function readme ($ username , $ repository , $ reference = null )
1525 {
1626 return $ this ->show ($ username , $ repository , 'readme ' , $ reference );
1727 }
1828
29+ /**
30+ * Get contents of any file or directory in a repository
31+ * @link http://developer.github.com/v3/repos/contents/
32+ *
33+ * @param string $username the user who owns the repository
34+ * @param string $repository the name of the repository
35+ * @param string $path path to file or directory
36+ * @param string $reference reference to a branch or commit
37+ *
38+ * @return array information for file | information for each item in directory
39+ */
1940 public function show ($ username , $ repository , $ path = null , $ reference = null )
2041 {
2142 $ url = 'repos/ ' .urlencode ($ username ).'/ ' .urlencode ($ repository ).'/contents ' ;
@@ -28,6 +49,17 @@ public function show($username, $repository, $path = null, $reference = null)
2849 ));
2950 }
3051
52+ /**
53+ * Get content of archives in a repository
54+ * @link http://developer.github.com/v3/repos/contents/
55+ *
56+ * @param string $username the user who owns the repository
57+ * @param string $repository the name of the repository
58+ * @param string $format format of archive: tarball or zipball
59+ * @param string $reference reference to a branch or commit
60+ *
61+ * @return array information for archives
62+ */
3163 public function archive ($ username , $ repository , $ format , $ reference = null )
3264 {
3365 if (!in_array ($ format , array ('tarball ' , 'zipball ' ))) {
0 commit comments