Download the PHP package ptlis/conneg without Composer

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

ConNeg

Content Negotiation for PHP.

This framework-independent library provides tooling to allow you to support content negotiation in your applications.

Supports negotiation on the Accept, Accept-Charset, Accept-Encoding and Accept-Language fields in a HTTP header.

Build Status Code Coverage Scrutinizer Quality Score License Latest Stable Version

Install

With composer:

Usage

In a PSR-7 Project

If your application supports PSR-7 then the simplest way to get content negotiation is via the middlewares provided by ptlis/psr7-conneg.

In non PSR-7 Projects

First create a Negotiation instance. This provides methods to perform negotiation on client and server preferences.

In most cases your application will only care about the best match, to get these we can use the methods.

For example, negotiation to decide whether to serve JSON or XML (preferring JSON) would look like:

This will return a string representation of the best matching mime-type specified by the server's preferences, for example 'application/json'.

Negotiation of Language, Encoding & Charset can be done by using the appropriate method (languageBest, encodingBest & charsetBest respectively).

Note: server preferences a string-encoded as described in the documentation.

See the detailed usage docs for further (more complex) examples.

Documentation

Full Documentation

Integration

Contributing

You can contribute by submitting an Issue to the issue tracker, improving the documentation, integrating the library into your framework of choice or submitting a pull request. For pull requests i'd prefer that the code style and test coverage is maintained, but I am happy to work through any minor issues that may arise so that the request can be merged.

TODO


All versions of conneg with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.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/conneg contains the following files

Loading the files please wait ....