innmind / http-framework
This package is abandoned and no longer maintained.
The author suggests using the innmind/framework package instead.
HTTP framework
2.3.0
2021-02-15 16:52 UTC
Requires
- php: ~7.4|~8.0
- innmind/http-authentication: ~2.0
- innmind/http-server: ^2.0
- innmind/operating-system: ^2.1
- innmind/rest-server: ~8.0
- innmind/router: ~2.0
- innmind/silent-cartographer: ^2.0
- innmind/stack: ^1.1
- symfony/dotenv: ~5.0
Requires (Dev)
- filp/whoops: ^2.7
- innmind/black-box: ^4.9
- innmind/coding-standard: ^1.1
- phpunit/phpunit: ~9.0
- vimeo/psalm: ~4.4
Suggests
- filp/whoops: To ease debugging
- innmind/debug: To enable a profiler
Conflicts
- filp/whoops: <2.7|~3.0
README
Library to formalize http request handling and provide generic tools such as routing.
Installation
composer require innmind/http-framework
Usage
<?php # index.php use function Innmind\HttpFramework\bootstrap; use Innmind\HttpFramework\{ Controller, Application, Main, }; use Innmind\Url\Path; use Innmind\Immutable\Map; new class extends Main { protected function configure(Application $app): Application { return $app ->configAt(Path::of('/folder/containing/dotenv_file/')) ->handler(static function($os, $env) { $framework = bootstrap(); return $framework['enforce_https']( $framework['authenticate']($authenticator, $condition)( $framework['router']( /* instance of Innmind\Router\RequestMatcher */, Map::of('string', Controller::class), ), ), ); }); } }