igniphp/framework
Composer 安装命令:
composer require igniphp/framework
包简介
Swoole, PSR-7, PSR-15 modular micro anti-framework.
README 文档
README
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 requirements
Recommended installation way of the Igni Framework is with composer:
composer install igniphp/framework
Requirements:
- php 7.1 or better
- swoole 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.
igniphp/framework 适用场景与选型建议
igniphp/framework 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.01k 次下载、GitHub Stars 达 265, 最近一次更新时间为 2018 年 03 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「framework」 「http」 「micro」 「middleware」 「psr-7」 「swoole」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 igniphp/framework 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 igniphp/framework 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 igniphp/framework 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Framework HLEB2 is the foundation of the web application. Provides ease of development and application performance.
repository php library
Anax htmlform module.
Micro Active Record library in PHP, support chain calls, events, and relations.
Onix Micro Framework
PHP classes for database handling upon PDO
统计信息
- 总下载量: 1.01k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 265
- 点击次数: 17
- 依赖项目数: 2
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2018-03-13