/conneg

Content Negotiation Library for PHP 5

Primary LanguagePHPMIT LicenseMIT

ConNeg

A Content Negotiation library for PHP >= 5.3. The API provides support for negotiation on the Accept, Accept-Charset, Accept-Encoding and Accept-Language fields in a HTTP header.

Build Status Code Coverage Scrutinizer Quality Score Latest Stable Version

Install

Either from the console::

    $ composer require ptlis/conneg:"~3.0.0"

Or by Editing composer.json:

    {
        "require": {
            ...
            "ptlis/conneg": "~3.0.0",
            ...
        }
    }

Followed by a composer update:

    $ composer update

Use negotiator:

    use ptlis\ConNeg\Negotiate;

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

  • Handle accept-extens
  • Time based negotiation? See RFC 7089