Download the PHP package krak/api-platform-extra without Composer

On this page you can find all versions of the php package krak/api-platform-extra. 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 api-platform-extra

API Platform Extra

API Platform Extra includes additional features or bug fixes into API Platform that haven't been released or won't be released.

Installation

Install with composer at krak/api-platform-extra.

Usage

By default all functionality provided by this library is opt-in, so you'll need to explicitly enable each feature in the config to make use of the features.

MessageBusDataPersister

The message bus data persister is enabled by default and controlled via the following config:

The MessageBusDataPersister will push any messages that aren't handled by the standard data persisters into the message bus.

So the only thing you need to do is simply just register message handlers for the ApiPlatform resources you want to handle via the message bus.

Additional Swagger Documentation

This allows you to merge and override in any additional swagger documentation to the generated swagger documentation from API Platform. This is useful if you need to provide any custom endpoints outside of your defined API Platform resources.

The configuration for defining the swagger file is here:

If that file exists, the additional swagger documentation will be merged. Else, nothing will happen.

Plural Data Path Segment Name Generator

By default, API Platform's inflector will transport any resource ending with Data as Datas. This fixes this specific use case, and could possibly extended to adjust multiple inflection fixes.

Constructor Denormalizer

This issue has actually been fixed but is pending release https://github.com/api-platform/core/pull/2178. This library will include that patch until api platform 2.4.0 is released.

This basically allows you to use constructor arguments with nested entities like so:

The actual POST API request for this would look like:

Operation Resource Classes

This feature is controlled via the following configuration:

When enabled, this will allow with very simple configuration, the ability to define a specific resource class per operation. This is especially useful on POST collection operations where you want to use a special DTO resource instead of the actual Entity resource.

Here's how you'd set it up:

Then, you can configure the resources with the following yaml. You could use annotations or xml, but I find it more manageable to use yaml than either:

This will make sure the documentation and the API use the schema of the CreateBookRequest instead of the normal Book entity schema. Using the schema_only attribute for the DTO ensures that no paths will be generated for that resource.

You'll need to make sure the Message Bus Data Persister is enabled so that the wiring of the Request to the CreateBook Service is done properly.

Definition Only Resources

There may be certain Resources that you want to only use for definitions, but use custom endpoints/swagger docs around them, to do that, you can just use the schema_only: true attribute.

ApiProperty Override

Any definitions in the ApiProperty annotation do not override changes made from the Serializer Property Metadata Factory. You can control the ability for ApiProperty to override with the following option:


All versions of api-platform-extra with dependencies

PHP Build Version
Package Version
Requires api-platform/core Version ^2.3
symfony/config Version ^4.4|^5.0
symfony/dependency-injection Version ^4.4|^5.0
symfony/http-kernel Version ^4.4|^5.0
symfony/yaml Version ^4.4|^5.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 krak/api-platform-extra contains the following files

Loading the files please wait ....