mpie22/core
Composer 安装命令:
composer require mpie22/core
包简介
A componentized lightweight PHP framework that supports frameworks for openswoole, workerman, and FPM environments.
README 文档
README
Mpie Framework Starter
Lightweight • Simple • Fast
A componentized lightweight PHP framework that supports swoole, workerman, and FPM environments. It can be used for API development, which is convenient and fast. The framework has the session and view extensions installed by default, and can be removed directly if not needed.
Environmental requirements
- PHP >= 8.0
- ext-ctype
- ext-dom
- ext-filter
- ext-json
- ext-libxml
- ext-mbstring
- ext-openssl
- ext-openswoole
- ext-pcntl
- ext-pdo
- ext-phar
- ext-redis
- ext-tokenizer
- ext-xml
- ext-xmlwriter
If you use openswoole, be sure to install version 4.8 or above, if you use workerman, be sure to use version 4.0 or above
use
Install
composer create-project mpie22/framework:dev-main
Start the service
swoole service
php bin/openswoole.php // asynchronous mode php bin/openswoole-co.php // coroutine mode
workerman service
php bin/workerman.php start
Built-in services
php bin/cli-server.php
FPM mode, direct the request to public/index.php
the difference
Using swoole/workerman to support annotations, AOP and other features, FPM mode can directly uninstall AOP packages.
Getting started
route definition
Annotation definitions can be used under swoole/swooleco/workerman
<?php namespace App\Controllers; use App\Http\Response; use Mpie\Routing\Annotation\Controller; use Mpie\Routing\Annotation\GetMapping; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; #[Controller(prefix: '/')] class IndexController { #[GetMapping(path: '/')] public function index(ServerRequestInterface $request): ResponseInterface { return Response::HTML('Hello, ' . $request->query('name', 'MpiePHP!')); } }
The above request 0.0.0.0:8080 will point to the index method, the controller method supports dependency injection, if you need an example of the current request, the request parameter name must be request, other routing parameters will be injected, the controller method An instance of ResponseInterface needs to be returned.
Annotations cannot be used under FPM or built-in services
Route definitions are defined in the map method of the App\Http\Kernel class
$router->middleware(TestMiddleware::class)->group(function(Router $router) { $router->get('/', [IndexController::class, 'index']); $router->get('/test', function(\Psr\Http\Message\ServerRequestInterface $request) { return \App\Http\Response::HTML('new'); }); });
More
Thanks
mpie22/core 适用场景与选型建议
mpie22/core 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 10 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Flexible」 「php framework」 「mpie-framework」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mpie22/core 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mpie22/core 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mpie22/core 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Framework HLEB2 is the foundation of the web application. Provides ease of development and application performance.
Edit your .env file in Laravel directly from the command line.
Field for repeating groups of fields for MoonShine
A robust Laravel package for handling metadata with JSON casting, custom relation names, and advanced querying capabilities.
Flexible Content & Repeater Fields for Laravel Nova.
Flexible Content & Repeater Fields for Laravel Nova.
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 20
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-10-05