Download the PHP package er1z/multi-api-platform-bundle without Composer

On this page you can find all versions of the php package er1z/multi-api-platform-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 multi-api-platform-bundle

Multi-API-Platform

This Symfony's bundle is a solution to problem for having more than one API in single API Platform instance. For example, you have an application's back-end that exposes resources for end-clients and you want to create an entrypoint for internal microservices.

Installation

Issue

Configuration

First, separate your structures. They have to be distinguished via namespace or implemented interface. Suppose we create two APIs: internal and external.

Usually I rely on DTOs (but it should work also for entities). Create two classes:

Then create config/packages/multi_api_platform.yml with following contents:

Either namespace or implements should be configured.

You must configure conditions for each API manually. This is an expression that restricts API access via HTTP using dynamic route conditions.

Conditions are not pre-defined in order to obligate you exposing particular API carefully. If you want to expose an API as is, put "true" as a value.

debug_conditions are evaluated in dev environment whereas conditions only in production.

Usage

Conditions are simple but powerful tool to restrict particular API, for example by origin IP, header, environment variable and so on. Check the route conditions documentation how to construct this stuff.

To extend this for your needs you can always create kernel.request event listener/subscriber and append some attributes to check against with expression. Be aware to configure your listener with priority higher than 32 because Symfony's router lives there. Executing your listener after would produce useless results.

Swagger dump

bin/console swagger:api:export is overrided — requires a single argument with desired API name to produce correct dump.

Debug mode

If you are in development environment, it's useful to specify some conditions or use special request attribute to specify an API you want work with. It's enabled by default provided you're on development environment.

Just add x-api-select variable to one of request parameters (except files) with specified API name and you're done. It will produce a cookie named with the same name that will allow to work with Swagger debugger.

Of course, it may be easily tweaked or disabled:


All versions of multi-api-platform-bundle with dependencies

PHP Build Version
Package Version
Requires api-platform/api-pack Version ^1.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 er1z/multi-api-platform-bundle contains the following files

Loading the files please wait ....