PHPackages                             pagemill/accept - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. pagemill/accept

ActiveLibrary[HTTP &amp; Networking](/categories/http)

pagemill/accept
===============

Parses the HTTP Accept header and determes the preferred content type

v3.0.0(8mo ago)116.0k↓23.1%3BSD-3-ClausePHPPHP ^8.2

Since Jul 26Pushed 8mo ago5 watchersCompare

[ Source](https://github.com/dealnews/pagemill-accept)[ Packagist](https://packagist.org/packages/pagemill/accept)[ RSS](/packages/pagemill-accept/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (7)Used By (3)

HTTP Accept Header Parser
=========================

[](#http-accept-header-parser)

Parses an Accept header and determines which content type is preferred by the client according to [RFC 2616](https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).

```
// content types with which the web service can respond
$valid_content_types = [
    "application/json",
    "text/xml"
];

$accept = new \PageMill\Accept\Accept();
$content_type = $accept->determine($valid_content_types);

// If Accept did not find an acceptable content type, the determine method
// will return null. The server should respond to the client with a 406.
if ($content_type === null) {
    // Respond with 406 Not Acceptable
    http_response_code(406);
    exit();
}
```

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance60

Regular maintenance activity

Popularity27

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~745 days

Total

4

Last Release

251d ago

Major Versions

v1.0 → v2.0.02020-03-22

v2.0.1 → v3.0.02025-09-09

PHP version history (3 changes)v2.0.0PHP ~7.3

v2.0.1PHP ^7.4 || ^8.0

v3.0.0PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/49531?v=4)[Brian Moon](/maintainers/brianlmoon)[@brianlmoon](https://github.com/brianlmoon)

![](https://www.gravatar.com/avatar/dbf067b8b1b679cc96fb0e13483a6be5b90cb35dfbb85d471cee151b9fa87417?d=identicon)[dealnews](/maintainers/dealnews)

---

Top Contributors

[![brianlmoon](https://avatars.githubusercontent.com/u/49531?v=4)](https://github.com/brianlmoon "brianlmoon (10 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pagemill-accept/health.svg)

```
[![Health](https://phpackages.com/badges/pagemill-accept/health.svg)](https://phpackages.com/packages/pagemill-accept)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78026.4M414](/packages/react-http)[php-http/curl-client

PSR-18 and HTTPlug Async client with cURL

48347.0M384](/packages/php-http-curl-client)[smi2/phpclickhouse

PHP ClickHouse Client

84310.1M71](/packages/smi2-phpclickhouse)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
