Igni是一款迷你php7框架用于构建PSR-7和PSR-15兼容REST服务

网友投稿 871 2022-11-05

Igni是一款迷你php7框架用于构建PSR-7和PSR-15兼容REST服务

Igni是一款迷你php7框架用于构建PSR-7和PSR-15兼容REST服务

Igni is a php7 anti-framework with built-in swoole server and modular architecture support to help you quickly write scalable PSR-7 and PSR-15 compilant REST services.

Its main objective it to be as much transparent and as less visible for your application as possible.

get('/hello/{name}', function (Request $request) : Response { return Response::asText("Hello {$request->getAttribute('name')}.");});// Middleware - no interfaces no binding with framework code is required in order things to work.$application->use(function($request, /** callable|RequestHandlerInterface */$next) { $response = $next($request); return $response->withAddedHeader('Version', $this->getConfig()->get('version'));});// Extending application is a brief just create and implement methods for your needs.$application->extend(new class implements ConfigProvider { public function provideConfig(Config $config): void { $config->set('version', '1.0'); }});$application->run();

Installation and requirements

Recommended installation way of the Igni Framework is with composer:

composer install igniphp/framework

Requirements:

php 7.1 or betterswoole extension for build-in http server support

What's new

With version 2.0 network package was extracted from the framework code, error handling was overall improved as well as Server's listeners. More details can be found in changelog file.

Quick start

Alternatively you can start using framework with quick start which contains bootstrap application.

Features

Routing

Igni router is based on very fast symfony routing library.

PSR-7, PSR-15 Support

Igni fully supports PSR message standards for both manipulating http response, request and http middlwares.

Dependency Injection and Autoresolving

Igni autoresolves dependencies for you and provides intuitive dependency container. It also allows you to use any PSR compatible container of your choice.

Modular architecture

Modular and scalable solution is one of the most important aspects why this framework was born. Simply create a module class, implement required interfaces and extend application by your module.

Performant, production ready http server

No nginx nor apache is required when swoole is installed, application can be run the same manner as in node.js world:

php examples/build_in_server_example.php

Igni's http server is as fast as express.js application with almost 0 configuration.

Detailed documentation

Detailed documentation and more examples can be found here and in examples directory.

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Entitas是针对C#和Unity专门制造的超快实体组件系统(ECS)框架
下一篇:Jenkins自动化部署集成了docker-maven插件的多模块项目
相关文章

 发表评论

暂时没有评论,来抢沙发吧~