Download the PHP package ptlis/psr7-conneg without Composer

On this page you can find all versions of the php package ptlis/psr7-conneg. 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 psr7-conneg

PSR-7 ConNeg

A content negotiation middleware that uses the PSR-7 interfaces.

Configurable component that decorate processed requests with preferred type information.

Built upon ptlis/ConNeg.

Build Status Code Coverage Scrutinizer Code Quality License Latest Stable Version

Install

Either from the console:

Or by Editing composer.json:

Followed by a composer update:

Usage

The package ships with a single class to provide negotiation.

To opt-in to negotiation on a field use the appropriate method (note these methods return a new instance in the manner of the PSR-7 interfaces).

To negotiate the preferred mime-type use the method, providing it with a list of your application's type preference:

With your negotiator configured you can now perform negotiation:

This adds attributes to the request containing the preferred type. These can be accessed with the appropriate getters, in the above example of negotiation on the Accept field this looks like:

If the Accept field of the request contained then the value returned from this lookup would be .

With Zend-Stratigility

To use the zend-stratigility component, configure your negotiator instance as described above and pass it to the Stratigility negotiator.

To perform negotiation on all routes, add it with an empty route:

For further information please refer to the Stratigility documentation.

With Relay

To use the relay component, configure your negotiator instance as described above and pass it to the Relay negotiator.

Note: The negotiator must be earlier in the queue than middleware components that depend upon negotiation data.

Integration

Middlewares integration is shipped for the following packages:

Contributing

You can contribute by submitting an Issue to the issue tracker or submitting a pull request.


All versions of psr7-conneg with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
ptlis/conneg Version ~3.0
psr/http-message Version ~1.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 ptlis/psr7-conneg contains the following files

Loading the files please wait ....