gogsapi.php 511 B

123456789101112131415161718192021222324
  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. $this->authorized("/user");
  8. }
  9. public function user($name = "") {
  10. $scope = sprintf("%s/user", $this->url);
  11. if ($name != "") {
  12. $scope = sprintf("%ss/%s", $scope, $name);
  13. }
  14. return new Request\User($scope, $this->token);
  15. }
  16. public function __destruct() {}
  17. }
  18. ?>