delboy1978uk / bone-http
HTTP package for Bone Framework
Installs: 1 534
Dependents: 6
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 1
Language:HTML
Requires
- php: ^8.2
- ext-fileinfo: *
- delboy1978uk/barnacle: ^2.3
- delboy1978uk/bone-server: ^1.2.0
- delboy1978uk/router: ^4.4
- laminas/laminas-diactoros: ^3.3
- psr/http-message: ^2.0
- psr/http-server-middleware: ^1.0
Requires (Dev)
- codeception/codeception: ^5.1
- codeception/module-asserts: ^3.0
- roave/security-advisories: dev-latest
README
Http Middleware stack and HAL middleware for Bone Framework.
installation
This is a core package of Bone Framework. It is installed by default.
usage
middleware stack
To add application wide middleware that will run pre-routing, just add your middleware class into your
config/middleware.php
file. For instance, to use the delboy1978uk/bone-firewall
middleware:
<?php use Bone\Firewall\RouteFirewall; return [ 'stack' => [ RouteFirewall::class, ], ];
You can add middleware of course to the router's stack, either on a group of routes or an individual route.
bundled middleware
This package comes with two middleware classes for representing HAL links for an API.
For a single entity, you can use the Bone\Http\Middleware\HalEntity
, and for an array you can use the
Bone\Http\Middleware\HalCollection
.
adding your own middlware to a package
If your package class implements Bone\Http\MiddlewareRegistrationInterface
you can return an array of middlewares
and it will be added by the Bone Application to the container