sbsedv/input-converter-bundle
最新稳定版本:v3.1.0
Composer 安装命令:
composer require sbsedv/input-converter-bundle
包简介
A Symfony ^6.1 bundle that adds the raw request body input to the http-foundation InputBag.
README 文档
README
sbsedv/input-converter-bundle
A Symfony ^6.1 bundle that adds the raw request body input to the http-foundation InputBag.
composer require sbsedv/input-converter-bundle
This bundle integrates sbsedv/input-converter into the Symfony Framework.
This bundle registers an event listener that runs as early as possible in the applications lifecycle and tries to parse the incoming request body and to add it to the main http-foundation request object.
By default this bundle comes with the following converters which are all enabled by default:
# config/packages/sbsedv_input_converter.yaml # Default configuration values are shown sbsedv_input_converter: # {NAME}_converter: false # disables the {NAME} converter json_converter: content_types: [application/json] # Http Content-Type headers on which this converter will work methods: [POST, PUT, PATCH, DELETE] # Http Methods on which this convert will work formdata_converter: methods: [PUT, PATCH, DELETE] file_support: false # Whether file uploads are added to the FileBag urlencoded_converter: enabled: false # disabled by default, see below methods: [PUT, PATCH, DELETE]
WARNING: You should not enable file_support for the formdata_converter.
The entire uploaded file would be copied into memory at least two times which will potentially use a lot of system memory (depending on the file size).
PHPs upload_max_filesize INI setting has no effect, only post_max_size.
You should only rely on PHPs integrated file upload support.
Custom Converters
If you want to register a custom converter (e.g. for YAML support), you only have to register a service in your application that implements the SBSEDV\InputConverter\Converter\ConverterInterface.
The bundle has autoconfiguration setup and each service that implements that interface will automatically be picked up.
URLEncodedConverter Information
By default, the urlencoded_converter is disabled because Symfony\Component\HttpFoundation\Request::createFromGlobals() has the same functionality.
The vast majority of symfony applications boot up the framework in a way that creates the Request object with this static method. Because of this, the bundle disables its functionality by default to avoid unneccessary work.
In case you boot symfony without calling this method (e.g. in a runtime like Swoole), you can enable the functionality manually in the bundles config file.
sbsedv/input-converter-bundle 适用场景与选型建议
sbsedv/input-converter-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 115 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 05 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 sbsedv/input-converter-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sbsedv/input-converter-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 115
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-05-14