Download the PHP package eonx-com/apiformats without Composer

On this page you can find all versions of the php package eonx-com/apiformats. 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 apiformats

API Formats

Installation

Use Composer to install the package in your project:

Formats

By default the package handle JSON (application/json) and XML (application/xml, text/xml) formats. If you want to handle different formats or want to implement your own JSON/XML encoding logic, the only thing you need to do is creating your encoder implementing \EoneoPay\ApiFormats\Interfaces\RequestEncoderInterface and tell the package to use it, with which Mime types as explained in the Configuration section.

Integration

Laravel

To integrate the package into your Laravel or Lumen you need to register the following service provider and middleware:

That's it! Your application is now able to easily receive requests and generate responses in several formats.

Formatted Api Response

If you want to customise the generated response as its status code or headers without handling body encoding yourself, the package provides the \EoneoPay\ApiFormats\Bridge\Laravel\Responses\FormattedApiResponse object you can return from your controllers/middlewares. The FormattedApiResponse accept three parameters through its constructor as following:

Configuration

The philosophy of the package is to map encoders to a list of MIME types that they can handle through an array as following:

Each MIME type can be the exact name as application/json or a Regex used to match multiple MIME types as application/vnd.eoneopay.v[0-9]+\+json.

Laravel

To configure supported formats in your application, create a api-formats.php config file with a formats array using the encoders class as key and array of associated Mime types as value:


All versions of apiformats with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
doctrine/inflector Version ^1.3
eonx-com/utils Version ^1.0 || ^2.0
ext-json Version *
laminas/laminas-diactoros Version ^2.1
league/fractal Version ^0.17.0 || ^0.19
symfony/psr-http-message-bridge Version ^1.0
woohoolabs/yang Version ^1.4
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 eonx-com/apiformats contains the following files

Loading the files please wait ....