k9u / framework
Web Application Framework for PHP.
0.8.0
2020-07-21 22:37 UTC
Requires
- php: ^7.4
- ext-json: *
- k9u/request-mapper: ^0.11.0
- laminas/laminas-diactoros: ^2.3
- laminas/laminas-httphandlerrunner: ^1.2
- psr/http-factory: ^1.0
- psr/http-message: ^1.0
- psr/http-server-handler: ^1.0
- psr/http-server-middleware: ^1.0
- ray/di: ^2.10
- relay/relay: ^2.1
Requires (Dev)
- phpmd/phpmd: ^2.8
- phpstan/phpstan: ^0.12
- phpunit/phpunit: ^9.2
- squizlabs/php_codesniffer: ^3.5
- dev-master
- 0.8.0
- 0.7.0
- 0.6.0
- 0.5.0
- 0.4.0
- 0.3.0
- 0.2.0
- 0.1.0
- dev-dependabot/composer/laminas/laminas-httphandlerrunner-tw-2.0
- dev-dependabot/composer/laminas/laminas-diactoros-tw-2.6
- dev-dependabot/add-v2-config-file
- dev-dependabot/composer/phpmd/phpmd-tw-2.10
- dev-dependabot/composer/squizlabs/php_codesniffer-tw-3.6
- dev-dependabot/composer/ray/di-tw-2.12
- dev-dependabot/composer/phpunit/phpunit-tw-9.5
- dev-dependabot/composer/k9u/request-mapper-tw-0.13.0
This package is auto-updated.
Last update: 2024-10-13 04:41:46 UTC
README
Overview
use K9u\Framework\ApplicationInterface; use K9u\Framework\CachedInjectorFactory; use K9u\Framework\Demo\FakeMiddleware; use K9u\Framework\Demo\FakeRequestHandler; use K9u\Framework\FrameworkModule; use Laminas\Diactoros\ServerRequestFactory; use Ray\Di\AbstractModule; class AppModule extends AbstractModule { protected function configure() { $middlewares = [ FakeMiddleware::class, FakeRequestHandler::class ]; $this->install(new FrameworkModule($middlewares)); } } $module = new AppModule(); $injector = (new CachedInjectorFactory('/path/to/cache'))($module); $app = $injector->getInstance(ApplicationInterface::class); /* @var ApplicationInterface $app */ $request = ServerRequestFactory::fromGlobals(); $app($request); // handle request and emit response
Run demo application
See demo.
git clone https://github.com/kawanamiyuu/K9u.Framework.git cd K9u.Framework composer install composer serve:demo # access to http://localhost:8080