Download the PHP package gosuccess/php-enhance-api-wrapper without Composer

On this page you can find all versions of the php package gosuccess/php-enhance-api-wrapper. 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 php-enhance-api-wrapper

Enhance API

A modern, dependency-free PHP client for the Enhance control panel API.

Requirements

Installation

Quick start

Every API section is exposed as a resource on the Enhance object, e.g. $enhance->websites, $enhance->servers, $enhance->orgs, $enhance->plans, $enhance->subscriptions, $enhance->domains, $enhance->dns, $enhance->emails, $enhance->backups, $enhance->ssl, and so on.

Documentation & examples

Working with DTOs

Request bodies are typed DTOs; only the properties you set are sent. Responses are hydrated into DTOs automatically.

By default, properties left as null are omitted from the request body. To clear a field via an update endpoint, mark it with setNull() so it is sent as an explicit null:

The organization id

Most endpoints are scoped to an organization. The orgId you pass to Enhance::create() is used by default, so you can omit it. Pass it explicitly to target a different organization (e.g. as an MO managing customers):

Pagination

Listing endpoints accept offset/limit. Paginator::items() transparently walks every page for you:

Configuration

Enhance::create() covers the common case. For finer control, build a Configuration and pass it to the constructor:

A 429 is retried after Retry-After (capped at a minute) unless retryOnRateLimit is off; then it throws the RateLimitException right away, while transport errors and 5xx responses of GET, PUT and DELETE are still retried. That suits callers with a deadline of their own.

Error handling

Non-2xx responses throw a typed exception. All of them extend GoSuccess\Enhance\Exception\ApiException, which carries the status code and response body as context.

Status Exception
400 BadRequestException
401 UnauthorizedException
403 ForbiddenException
404 NotFoundException
409 ConflictException
429 RateLimitException
5xx ServerException
transport error RequestException

Redirects are never followed and are not treated as errors: the SSO endpoints document a 3xx as their success case, so the response is returned and its target can be read from Response::$location.

Custom transport

ApiClient builds the request (URL, query, headers, JSON body), retries transient failures and maps the response to typed exceptions. The bytes go over the wire through a GoSuccess\Enhance\Http\Transport; the default is CurlTransport. Pass your own to route the requests through your application's HTTP stack, fake them in tests or limit the response size, while keeping the retry policy and the error mapping:

Custom HTTP client

To replace the whole client instead (no retries, no error mapping), implement GoSuccess\Enhance\Contract\HttpClientInterface:

Architecture

Development

The Resource, DTO, and Enum classes were originally derived from the Enhance OpenAPI specification (v12.25.4) and are now maintained by hand.

License

MIT


All versions of php-enhance-api-wrapper with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
ext-curl Version *
ext-json Version *
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 gosuccess/php-enhance-api-wrapper contains the following files

Loading the files please wait ...