PHPackages                             bear/package - 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. [Framework](/categories/framework)
4. /
5. bear/package

ActiveLibrary[Framework](/categories/framework)

bear/package
============

BEAR.Sunday application framework package

1.21.0(1mo ago)30578.6k↓34.4%25[4 issues](https://github.com/bearsunday/BEAR.Package/issues)[5 PRs](https://github.com/bearsunday/BEAR.Package/pulls)20MITPHPPHP ^8.2

Since Oct 26Pushed 1w ago13 watchersCompare

[ Source](https://github.com/bearsunday/BEAR.Package)[ Packagist](https://packagist.org/packages/bear/package)[ RSS](/packages/bear-package/feed)WikiDiscussions 1.x Synced 2w ago

READMEChangelog (10)Dependencies (76)Versions (153)Used By (20)

BEAR.Package
============

[](#bearpackage)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/0c1cfa0ae9b3bcbac3bc6724226f6606e06f5699ee40485d6c604dfed19d4fdc/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6265617273756e6461792f424541522e5061636b6167652f6261646765732f7175616c6974792d73636f72652e706e673f623d312e78)](https://scrutinizer-ci.com/g/bearsunday/BEAR.Package/?branch=1.x)[![codecov](https://camo.githubusercontent.com/9eab89bac6f82f13d316a9a4fc1490c1bf9eccbe0a24fecf782ec0de6c2410e6/68747470733a2f2f636f6465636f762e696f2f67682f6265617273756e6461792f424541522e5061636b6167652f6272616e63682f312e782f67726170682f62616467652e7376673f746f6b656e3d65683363394146344d72)](https://codecov.io/gh/koriym/BEAR.Package)[![Type Coverage](https://camo.githubusercontent.com/7333fa5d3d66c4491293a5691cb3c247dd16985e55532ae04690b07b60a777b8/68747470733a2f2f73686570686572642e6465762f6769746875622f6265617273756e6461792f424541522e5061636b6167652f636f7665726167652e737667)](https://shepherd.dev/github/bearsunday/BEAR.Package)[![Continuous Integration](https://github.com/bearsunday/BEAR.Package/workflows/Continuous%20Integration/badge.svg)](https://github.com/bearsunday/BEAR.Package/workflows/Continuous%20Integration/badge.svg)

Overview
--------

[](#overview)

[BEAR.Sunday](https://github.com/bearsunday/BEAR.Sunday) is a resource-oriented framework that defines the interfaces and abstractions for the application lifecycle — resource handling, dependency injection, and AOP interception. It does not include concrete implementations for routing, caching, error handling, or compilation.

BEAR.Package is the implementation package for BEAR.Sunday. It provides the production-ready bindings that turn those interfaces into a working application: HTTP routing, DI container compilation, query repository caching, `application/vnd.error+json` error pages, PSR-3 logging, and context-based module loading.

What This Package Provides
--------------------------

[](#what-this-package-provides)

ConcernImplementationRouting`WebRouter` (HTTP), `CliRouter` (CLI)Error Handling`DevVndErrorPage` / `ProdVndErrorPage` (`application/vnd.error+json`)CachingQueryRepository integration, PSR-6 cacheCompilationDI container compiled to PHP scripts, preload file, autoload optimizationLogging`PsrLoggerModule` (Monolog, PSR-3)Context Modules`ProdModule`, `ApiModule`, `CliModule`, `HalModule`Architecture
------------

[](#architecture)

### Context-Based DI Binding Override

[](#context-based-di-binding-override)

Instead of switching behavior with a global `MODE` constant and conditionals, BEAR.Package uses a multi-dimensional **context** string to compose DI modules. Each segment of the context corresponds to a module, and later modules override the bindings of earlier ones.

For example, the context `"prod-api-app"` is split by `-`, reversed, and each segment resolves to a Module class:

1. `app` — `AppModule` (loaded first; base bindings + `PackageModule`)
2. `api` — `ApiModule` (overrides default scheme binding to `app://self`)
3. `prod` — `ProdModule` (overrides cache, error handler, and compilation bindings)

The framework's behavior changes entirely through binding overrides — no `if` branches on environment values. Each segment is resolved in order:

1. App namespace first: `{AppName}\Module\{Context}Module`
2. Framework fallback: `BEAR\Package\Context\{Context}Module`

This allows applications to override any context module while falling back to the framework defaults.

Documentation
-------------

[](#documentation)

Documentation is available at .

###  Health Score

72

—

ExcellentBetter than 100% of packages

Maintenance93

Actively maintained with recent releases

Popularity50

Moderate usage in the ecosystem

Community40

Growing community involvement

Maturity94

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 95.8% 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 ~36 days

Recently: every ~26 days

Total

140

Last Release

38d ago

Major Versions

0.13.1 → 1.0.0-alpha2015-02-19

0.13.2 → 1.2.32017-04-29

0.x-dev → 1.15.12023-01-06

PHP version history (12 changes)0.5.3PHP &gt;=5.4.0

1.0.0-alphaPHP &gt;=5.5.0

1.1.0PHP &gt;=5.6.0

1.5.0PHP &gt;=7.0.0

1.9.3PHP &gt;=7.1.0

1.9.7PHP &gt;=7.2.0

1.10.2PHP ^7.2 || ^8.0

1.10.4PHP ^7.3 || ^8.0

1.13.0PHP ^7.4 || ^8.0

1.15.0PHP ^8.0

1.17.0PHP ^8.1

1.20.0PHP ^8.2

### Community

Maintainers

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

---

Top Contributors

[![koriym](https://avatars.githubusercontent.com/u/529021?v=4)](https://github.com/koriym "koriym (2864 commits)")[![mackstar](https://avatars.githubusercontent.com/u/197328?v=4)](https://github.com/mackstar "mackstar (22 commits)")[![kenjis](https://avatars.githubusercontent.com/u/87955?v=4)](https://github.com/kenjis "kenjis (19 commits)")[![NaokiTsuchiya](https://avatars.githubusercontent.com/u/17171732?v=4)](https://github.com/NaokiTsuchiya "NaokiTsuchiya (14 commits)")[![MugeSo](https://avatars.githubusercontent.com/u/250446?v=4)](https://github.com/MugeSo "MugeSo (10 commits)")[![kumamidori](https://avatars.githubusercontent.com/u/384567?v=4)](https://github.com/kumamidori "kumamidori (8 commits)")[![iteman](https://avatars.githubusercontent.com/u/52985?v=4)](https://github.com/iteman "iteman (7 commits)")[![tanakahisateru](https://avatars.githubusercontent.com/u/403893?v=4)](https://github.com/tanakahisateru "tanakahisateru (6 commits)")[![claude](https://avatars.githubusercontent.com/u/81847?v=4)](https://github.com/claude "claude (6 commits)")[![madapaja](https://avatars.githubusercontent.com/u/491357?v=4)](https://github.com/madapaja "madapaja (4 commits)")[![kawanamiyuu](https://avatars.githubusercontent.com/u/1461463?v=4)](https://github.com/kawanamiyuu "kawanamiyuu (4 commits)")[![kenchingh](https://avatars.githubusercontent.com/u/5219653?v=4)](https://github.com/kenchingh "kenchingh (4 commits)")[![zukimochi](https://avatars.githubusercontent.com/u/529051?v=4)](https://github.com/zukimochi "zukimochi (3 commits)")[![jingu](https://avatars.githubusercontent.com/u/892913?v=4)](https://github.com/jingu "jingu (3 commits)")[![apple-x-co](https://avatars.githubusercontent.com/u/8497012?v=4)](https://github.com/apple-x-co "apple-x-co (2 commits)")[![fiahfy](https://avatars.githubusercontent.com/u/7123916?v=4)](https://github.com/fiahfy "fiahfy (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![sasezaki](https://avatars.githubusercontent.com/u/42755?v=4)](https://github.com/sasezaki "sasezaki (2 commits)")[![atakig](https://avatars.githubusercontent.com/u/552033?v=4)](https://github.com/atakig "atakig (2 commits)")[![ktutumi](https://avatars.githubusercontent.com/u/3712782?v=4)](https://github.com/ktutumi "ktutumi (2 commits)")

---

Tags

bearsunday-modulebeasundayphpframeworkaoprestdi

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bear-package/health.svg)

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

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k21](/packages/tempest-framework)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.8M672](/packages/shopware-core)[symfony/symfony

The Symfony PHP framework

31.4k87.4M2.2k](/packages/symfony-symfony)[laravel/framework

The Laravel Framework.

34.9k556.2M21.4k](/packages/laravel-framework)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k39.6k](/packages/matomo-matomo)

PHPackages © 2026

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