123456789101112131415161718192021222324 |
- <?php namespace Client;
- class GogsAPI {
- use \Lib\Curl;
- public function __construct($api_url, $api_token) {
- $this->url = $api_url;
- $this->token = $api_token;
- $this->authorized("/user");
- }
- public function user($name = "") {
- $scope = sprintf("%s/user", $this->url);
- if ($name != "") {
- $scope = sprintf("%ss/%s", $scope, $name);
- }
- return new Request\User($scope, $this->token);
- }
- public function __destruct() {}
- }
- ?>
|