在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:igniphp/framework开源软件地址:https://github.com/igniphp/framework开源编程语言:PHP 100.0%开源软件介绍: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. <?php
require 'vendor/autoload.php';
use Igni\Application\Config;
use Igni\Application\HttpApplication;
use Igni\Application\Providers\ConfigProvider;
use Igni\Network\Http\Response;
use Igni\Network\Http\Request;
$application = new HttpApplication();
// Routing
$application->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 requirementsRecommended installation way of the Igni Framework is with composer:
Requirements:
What's newWith 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 startAlternatively you can start using framework with quick start which contains bootstrap application. FeaturesRoutingIgni router is based on very fast symfony routing library. PSR-7, PSR-15 SupportIgni fully supports PSR message standards for both manipulating http response, request and http middlwares. Dependency Injection and AutoresolvingIgni autoresolves dependencies for you and provides intuitive dependency container. It also allows you to use any PSR compatible container of your choice. Modular architectureModular 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 serverNo nginx nor apache is required when
Igni's http server is as fast as express.js application with almost 0 configuration. Detailed documentationDetailed documentation and more examples can be found here and in examples directory. |
2022-08-15
2022-08-17
2022-09-23
2023-10-27
2022-08-18
请发表评论