mirror of
https://github.com/avency/Gitea.git
synced 2025-10-29 02:34:59 +01:00
Adds the client with first basic authentication and the first endpoint `repositories` with first method.
1.7 KiB
1.7 KiB
Gitea API Client
This package provides an API client for Gitea API Version 1.
Caution! This package is still under development
Getting Started
Prerequisites
This package has the following requirements:
- PHP 7.2
Installing
Install latest version via composer:
composer require avency/gitea
Basic usage
// This file is generated by Composer
require_once __DIR__ . '/vendor/autoload.php';
// - - - - -
// Create client and authenticate
$giteaClient = new Avency\Gitea\Client(
'https://gitea.yourdomain.com',
[
'type' => Avency\Gitea::AUTH_TOKEN,
'auth' => 'your-auth-token'
]
);
or
$giteaClient = new Avency\Gitea\Client(
'https://gitea.yourdomain.com',
[
'type' => Avency\Gitea::AUTH_BASIC_AUTH,
'auth' => [
'username' => 'your-username',
'password' => 'your-password',
]
]
);
// - - - - -
// Get a single repository
$repository = $giteaClient->api('repositories')->get('owner', 'repoName');
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
Authors
- Michael Gerdemann - avency GmbH
See also the list of contributors who participated in this project.
License
This project is licensed under the MIT License - see the LICENSE.md file for details