Download the PHP package kleijnweb/php-api-middleware without Composer

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

This project is no longer maintained

KleijnWeb\PhpApi\Middleware

Build Status Coverage Status Scrutinizer Code Quality Latest Stable Version

Middleware for kleijnweb/php-api-descriptions.

Components

DefaultPipe

A complete chain of middleware that can process OpenAPI requests from begin to end, once you add some command handlers. The middleware in this section is executed in order listed.

You can append and prepend 3rd party middleware, ResultSerializer is appended just before dispatching.

OperationMatcher

Determines which Operation object a request maps to (routing), or returning 404/405 responses respectively. Returns an request object some API description objects as well as the path parameters added as attributes.

BodyParsing

Parses the request body. In DefaultPipe uses JsonBodyParser but the parser is injectable.

ParameterAssembler

Coerces all the request data that qualify as OpenAPI parameters (bar the body) and sets them as request attributes.

MessageValidator

Validates the incoming request using the OpenAPI document and returns a 400 response with failure messages when invalid.

ParameterHydrator

Uses kleijnweb/php-api-hydrator to hydrate custom typed objects and \DateTime.

CommandDispatcher

Dead simple command dispatcher that invokes callables with the arguments in order as found in the request.

ResponseBodyDehydrator

Picks up the result of CommandDispatcher and produces a response object.

Example

Verify that it works properly by starting a dev server and issuing some cURL requests:

Contributing

Pull requests are very welcome, but the code has to be PSR2 compliant, follow used conventions concerning parameter and return type declarations, and the coverage can not go down.

License

KleijnWeb\PhpApi\Middleware is made available under the terms of the LGPL, version 3.0.


All versions of php-api-middleware with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0.0
kleijnweb/php-api-descriptions Version ^v1.0.0-alpha4
kleijnweb/php-api-hydrator Version ^v1.0.0-alpha2
http-interop/http-middleware Version ^0.4.1
middlewares/utils Version ^0.11.0
psr/http-message Version 1.0
equip/dispatch Version ^0.3.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 kleijnweb/php-api-middleware contains the following files

Loading the files please wait ....