Download the PHP package oryx/adr without Composer
On this page you can find all versions of the php package oryx/adr. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package adr
Short Description Action Domain Responder (ADR) library for PHP, compatible with oryx/mvc and PWA middleware
License BSD-3-Clause
Informations about the package adr
oryx/adr
Action Domain Responder (ADR) library for PHP, compatible with oryx/mvc and PWA middleware.
Overview
This library implements the Action Domain Responder (ADR) pattern, a refinement of the MVC pattern that separates concerns into:
- Action: Receives input and delegates to Domain
- Domain: Contains business logic
- Responder: Prepares and returns HTTP responses
The library includes:
- ADR pattern interfaces and abstract base classes
- ManifestJsonMiddleware for PWA compatibility
- PSR-15 compliant middleware integration
- PSR-4 autoloading
- JSON:API and Problem Details (RFC 7807) responders
Installation
Requirements
- PHP 8.1+
- PSR interfaces (http-message, http-server-middleware)
- Laminas Diactoros (for JSON responses)
- oryx/mvc (framework integration)
Usage
Basic ADR Implementation
Using Built-in Responders
Using with oryx/mvc Middleware
The ManifestJsonMiddleware is PSR-15 compliant and can be used directly with oryx/mvc:
ManifestJsonMiddleware Features
The ManifestJsonMiddleware automatically handles requests for:
/manifest.json/manifest.webmanifest
It returns a standard PWA manifest with:
- App name and short name
- Description
- Start URL
- Display mode
- Theme and background colors
- Icon array for various sizes
The middleware delegates all other requests to the next middleware in the queue.
PWA Compatibility
This library provides PWA compatibility through the ManifestJsonMiddleware which serves the web app manifest required for:
- Installable PWAs
- Offline capabilities (when combined with service workers)
- Mobile app-like experience
For full PWA functionality, combine this middleware with:
- Service worker middleware (for offline caching)
- Secure HTTPS connection
- Proper icon assets
Testing
Run the test suite:
License
This library is licensed under the BSD 3-Clause License - see the LICENSE file for details.
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -am 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Create a new Pull Request
All versions of adr with dependencies
psr/http-message Version ^1.0|^2.0
psr/http-server-middleware Version ^1.0
laminas/laminas-diactoros Version ^2.0|^3.0
oryx/mvc Version *