url = $api_url; $this->token = $api_token; } /** * Returns a Request\Users object to fetch users from the * Gogs installation. * * @see Request\Users class to understand usage (e.g ->load() to fetch all, * ->search(array params) to search for one or several * users etc). * * @return Request\Users */ public function users() { return new Request\Users($this->url, $this->token); } /** * Get a single user from Gogs. * * Returns either * * the authorized user ($name = "" or "me") * * the specified user ($name = anything else) * * @return Request\User */ public function user(string $name = "me") { return new Request\User($this->url, $this->token, $name); } /** * Returns an \Request\Repos to fetch repositories * on the Gogs installation. * * @see \Request\Repos to understand usage. Inherits * the same class as \R\Users, but the usage may differ! * * Note! To fetch a particular repo under a user, you * should go through the user (see method below). * * @return Request\Repos */ public function repos() { return new Request\Repos($this->url, $this->token); } /** * @return null */ public function __destruct() {} } } ?>