Download the PHP package tourze/gitee-api-bundle without Composer

On this page you can find all versions of the php package tourze/gitee-api-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package gitee-api-bundle

GiteeApiBundle

δΈ­ζ–‡

[Latest Version] (https://packagist.org/packages/tourze/gitee-api-bundle) [PHP Version] (https://packagist.org/packages/tourze/gitee-api-bundle) [License] (https://packagist.org/packages/tourze/gitee-api-bundle) Build Status [Code Coverage] (https://codecov.io/gh/tourze/php-monorepo)

A comprehensive Gitee API integration bundle for Symfony applications, providing OAuth authentication, API client, repository synchronization, and data management features.

Table of Contents

Features

Installation

  1. Add the bundle to your project:

Requirements

Configuration

  1. Create and configure your Gitee OAuth application in the database:

By default, applications are configured with the following scopes:

Additional available scopes:

  1. Configure the callback URL in your Gitee application settings:

Usage

OAuth Authentication

The bundle provides built-in controllers for handling the OAuth flow. To start the authentication process, redirect users to:

The callbackUrl parameter supports the following template variables:

Example usage in your templates:

The bundle will:

  1. Redirect users to Gitee's authorization page with configured scopes
  2. Handle the OAuth callback
  3. Store the access token
  4. Redirect to the specified callback URL with template variables replaced, or to the homepage route if no callback URL is provided

Multiple Tokens

The bundle now supports multiple tokens per user per application. Each time a user authorizes the application, a new token is created instead of updating the existing one. When using the API, the most recently created valid token will be used.

API Calls

Console Commands

The bundle provides console commands to manage Gitee data:

gitee:sync:repositories

Synchronizes a user's Gitee repositories with the local database.

Arguments:

Options:

The command will:

  1. Fetch all repositories for the specified user using the application's OAuth token
  2. Compare with existing local repository data
  3. Create new repository records or update existing ones if changes are detected
  4. Skip repositories that haven't been updated since the last sync (unless --force is used)
  5. Display progress and summary statistics

Customizing the OAuth Flow

The default controllers provide a basic OAuth flow. You can customize the flow by:

  1. Creating your own controller that extends the default one:

  2. Or implementing the flow entirely in your own controller using the services:

Advanced Usage

Token Management

For applications requiring multiple authentication workflows or token management:

Custom API Endpoints

Extend the API client for custom endpoints:

Repository Filtering

Filter synchronized repositories based on criteria:

Data Model

The bundle provides three main entities:

GiteeApplication

Stores Gitee OAuth application configuration:

GiteeAccessToken

Manages user OAuth tokens:

GiteeRepository

Caches repository information:

Service Architecture

The bundle provides several services:

Security

Token Security

Input Validation

Scope Management

Rate Limiting

Error Handling

The bundle throws GiteeApiException for API-related errors. Always wrap API calls in try-catch blocks:

Testing

Run the test suite:

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests and ensure they pass
  5. Submit a pull request

Please follow PSR-12 coding standards and write tests for new features.

License

This bundle is open-sourced software licensed under the MIT license.


All versions of gitee-api-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
doctrine/dbal Version ^4.0
doctrine/doctrine-bundle Version ^2.13
doctrine/orm Version ^3.0
doctrine/persistence Version ^3.1 || ^4
psr/simple-cache Version ^1.0|^2.0|^3.0
symfony/config Version ^6.4
symfony/console Version ^6.4
symfony/dependency-injection Version ^6.4
symfony/doctrine-bridge Version ^6.4
symfony/framework-bundle Version ^6.4
symfony/http-client Version ^6.4
symfony/http-client-contracts Version ^2.5 | ^3.0
symfony/http-foundation Version ^6.4
symfony/http-kernel Version ^6.4
symfony/routing Version ^6.4
symfony/yaml Version ^6.4 || ^7.1
tourze/doctrine-indexed-bundle Version 0.0.*
tourze/doctrine-timestamp-bundle Version 0.0.*
tourze/easy-admin-attribute Version 0.1.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tourze/gitee-api-bundle contains the following files

Loading the files please wait ...