bear / package
BEAR.Sunday application framework package
Installs: 517 104
Dependents: 26
Suggesters: 0
Security: 0
Stars: 30
Watchers: 14
Forks: 25
Open Issues: 5
pkg:composer/bear/package
Requires
- php: ^8.2
- ext-hash: *
- aura/cli: ^2.2
- bear/app-meta: ^1.9
- bear/query-repository: ^1.13
- bear/resource: ^1.27
- bear/streamer: ^1.4
- bear/sunday: ^1.8
- koriym/http-constants: ^1.2
- koriym/psr4list: ^1.3
- monolog/monolog: ^1.25 || ^2.0 || ^3.0
- psr/cache: ^1.0 || ^2.0 || ^3.0
- psr/log: ^1.1 || ^2.0 || ^3.0
- ray/aop: ^2.19
- ray/compiler: ^1.13
- ray/di: ^2.19.3
- ray/object-visual-grapher: ^1.0
- ray/psr-cache-module: ^1.5.1
- symfony/cache: ^v6.4 || ^v7.2
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.8
- phpunit/phpunit: ^11.0
- 1.x-dev
- 1.20.1
- 1.20.0
- 1.19.0
- 1.18.0
- 1.17.0
- 1.16.0
- 1.15.5
- 1.15.4
- 1.15.3
- 1.15.2
- 1.15.1
- 1.15.0
- 1.14.6
- 1.14.5
- 1.14.4
- 1.14.3
- 1.14.2
- 1.14.1
- 1.14.0
- 1.13.0
- 1.12.4
- 1.12.3
- 1.12.2
- 1.12.1
- 1.12.0
- 1.11.0
- 1.10.13
- 1.10.12
- 1.10.11
- 1.10.10
- 1.10.9
- 1.10.8
- 1.10.7
- 1.10.6
- 1.10.5
- 1.10.4
- 1.10.3
- 1.10.2
- 1.10.1
- 1.10.0
- 1.9.7
- 1.9.6
- 1.9.5
- 1.9.4
- 1.9.3
- 1.9.2
- 1.9.1
- 1.9.0
- 1.8.2
- 1.8.1
- 1.8.0
- 1.7.16
- 1.7.15
- 1.7.14
- 1.7.13
- 1.7.12
- 1.7.11
- 1.7.10
- 1.7.9
- 1.7.8
- 1.7.7
- 1.7.6
- 1.7.5
- 1.7.4
- 1.7.3
- 1.7.2
- 1.7.1
- 1.7.0
- 1.6.0
- 1.5.0
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.1
- 1.3.0
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.1
- 1.1.0
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 1.0.0-rc.4
- 1.0.0-rc.3
- 1.0.0-rc.2
- 1.0.0-rc
- 1.0.0-beta.4
- 1.0.0-beta.3
- 1.0.0-beta.2
- 1.0.0-beta
- 1.0.0-alpha.4
- 1.0.0-alpha.3
- 1.0.0-alpha.2
- 1.0.0-alpha
- 0.x-dev
- 0.13.2
- 0.13.1
- 0.13.0
- 0.12.0
- 0.11.3
- 0.11.2
- 0.11.1
- 0.11.0
- 0.10.2
- 0.10.1
- 0.10.0
- 0.9.2
- 0.9.1
- 0.9.0
- 0.8.6
- 0.8.5
- 0.8.4
- 0.8.3
- 0.8.2
- 0.8.1
- 0.8.0
- 0.6.2
- 0.6.0
- 0.5.6
- 0.5.5
- 0.5.4
- 0.5.3
- dev-modernize-demo-v2
- dev-compiler-return-report
- dev-ignore-fake-app-minor-updates
- dev-add-changelog
- dev-claude/add-taint-annotations-v47rU
This package is auto-updated.
Last update: 2026-02-08 15:24:55 UTC
README
Overview
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
| Concern | Implementation |
|---|---|
| Routing | WebRouter (HTTP), CliRouter (CLI) |
| Error Handling | DevVndErrorPage / ProdVndErrorPage (application/vnd.error+json) |
| Caching | QueryRepository integration, PSR-6 cache |
| Compilation | DI container compiled to PHP scripts, preload file, autoload optimization |
| Logging | PsrLoggerModule (Monolog, PSR-3) |
| Context Modules | ProdModule, ApiModule, CliModule, HalModule |
Architecture
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:
app—AppModule(loaded first; base bindings +PackageModule)api—ApiModule(overrides default scheme binding toapp://self)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:
- App namespace first:
{AppName}\Module\{Context}Module - Framework fallback:
BEAR\Package\Context\{Context}Module
This allows applications to override any context module while falling back to the framework defaults.
Documentation
Documentation is available at https://bearsunday.github.io/.