Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elusivecodes/fyrenegotiate
FyreNegotiate is a free, open-source negotiation library for PHP.
https://github.com/elusivecodes/fyrenegotiate
content-type encoding language negotiate negotiator php
Last synced: about 1 month ago
JSON representation
FyreNegotiate is a free, open-source negotiation library for PHP.
- Host: GitHub
- URL: https://github.com/elusivecodes/fyrenegotiate
- Owner: elusivecodes
- License: mit
- Created: 2021-12-02T10:27:24.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-28T08:18:02.000Z (2 months ago)
- Last Synced: 2024-10-28T09:13:40.745Z (2 months ago)
- Topics: content-type, encoding, language, negotiate, negotiator, php
- Language: PHP
- Homepage:
- Size: 48.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FyreNegotiate
**FyreNegotiate** is a free, open-source HTTP negotiation library for *PHP*.
## Table Of Contents
- [Installation](#installation)
- [Methods](#methods)## Installation
**Using Composer**
```
composer require fyre/negotiate
```In PHP:
```php
use Fyre\Http\Negotiate;
```## Methods
**Content**
Negotiate a content type.
- `$accepted` is a string representing the `Accept` header.
- `$supported` is an array containing the supported content values.
- `$strict` is a boolean indicating whether to not use a default fallback, and will default to *false*.```php
Negotiate::content($accepted, $supported, $strict);
```**Encoding**
Negotiate an encoding.
- `$accepted` is a string representing the `Accept-Encoding` header.
- `$supported` is an array containing the supported encoding values.```php
Negotiate::encoding($accepted, $supported);
```**Language**
Negotiate a language.
- `$accepted` is a string representing the `Accept-Language` header.
- `$supported` is an array containing the supported language values.```php
Negotiate::language($accepted, $supported);
```