Michael Gerdemann 5aaff48c99 feat: Add basic client and first basic endpoint
Adds the client with first basic authentication and
the first endpoint `repositories` with first method.
2020-01-17 08:38:49 +01:00
2020-01-17 08:16:47 +01:00
2020-01-17 08:23:08 +01:00

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

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

Description
API client for Gitea API Version 1
Readme 127 KiB
Languages
PHP 100%