gogsapi.php 465 B

1234567891011121314151617181920212223
  1. <?php namespace Client;
  2. class GogsAPI {
  3. use \Lib\Curl;
  4. public function __construct($api_url, $api_token) {
  5. $this->url = $api_url;
  6. $this->token = $api_token;
  7. }
  8. public function user($name = "") {
  9. return new Request\User($this->url, $this->token, $name);
  10. }
  11. public function repos($user = "") {
  12. if ($user == "")
  13. return $this->user()->get("/repos");
  14. }
  15. public function __destruct() {}
  16. }
  17. ?>