Download the PHP package magdv/mt-forwarder-registry-api without Composer

On this page you can find all versions of the php package magdv/mt-forwarder-registry-api. 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 mt-forwarder-registry-api

magdv/mt-forwarder-registry-api

PHP 8.3 клиент к MT Forwarder Registry API (контракт 2.0.0).

Покрывает только публичные read-эндпоинты system + registry (/health, /ready, /v1/meta, /v1/forwarders*). QA-эндпоинты (/qa/v1/*) в пакет не входят.

Сгенерированный код в src/ закоммичен — для установки потребителю не нужны Docker/Java.

Установка

Репозиторий: github.com/magdv/mt-forwarder-registry-api-php-wrapper.

Использование

Auth не требуется (публичный read API).

Таймауты HTTP

По умолчанию (через Configuration):

Опция Guzzle Метод Default
timeout setTimeout() / getTimeout() 1.0 сек
connect_timeout setConnectTimeout() / getConnectTimeout() 0.5 сек

Значения применяются на каждый запрос (SystemApi / RegistryApi). Пример:

Ошибки registry (400 / 404 / 503) тоже приходят как ApiException; типизированное тело Error — в getResponseObject().

Не используйте *Async / *AsyncWithHttpInfo. Они приходят из шаблона OpenAPI Generator as-is: при сетевых сбоях (ConnectException) rejection-handler может упасть с PHP Error вместо ApiException, а typed getResponseObject() на ошибках может отсутствовать. Поддерживаемый контракт пакета — синхронные методы (getMeta, listForwarders, …).

Номера реестра со /

Номер вида GL-B044-00112-00/00000051 валиден. Клиент кодирует / как %2F в path — сервис это поддерживает. Альтернатива: listForwarders(registry_number: '...').

Основные классы

Класс Роль
MagDV\MtForwarderRegistry\Configuration setHost(), setTimeout() / setConnectTimeout()
MagDV\MtForwarderRegistry\Api\SystemApi getHealth, getReady
MagDV\MtForwarderRegistry\Api\RegistryApi getMeta, listForwarders, getForwarderByRegistryNumber, getForwardersByINN
MagDV\MtForwarderRegistry\Model\* Health, Meta, Forwarder, ForwarderList, Error

Синхронизация с upstream

При смене контракта API:

  1. Скопировать/diff mt-forwarder-registry/api/openapi.yaml → openapi/openapi.yaml, без QA-путей, схемы QAApplyResult и тега qa. Версия info.version должна совпадать с upstream.
  2. Запустить bin/generate (нужен Docker; CLI pinned: openapitools/openapi-generator-cli:v7.14.0).
  3. Прогнать тесты: composer update && vendor/bin/phpunit. При bump info.version обновится artifactVersion в генерации.

Генерация пишет только в build/generated/, затем копирует src/, накладывает bin/patch-timeouts (таймауты в Configuration / API) и мержит runtime-зависимости в composer.json (php: ^8.3). README, tests/, CI не затираются.

Разработка


All versions of mt-forwarder-registry-api with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-curl Version *
ext-json Version *
ext-mbstring Version *
guzzlehttp/guzzle Version ^7.3
guzzlehttp/psr7 Version ^1.7 || ^2.0
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 magdv/mt-forwarder-registry-api contains the following files

Loading the files please wait ...