middlewares/csv-payload 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

middlewares/csv-payload

Composer 安装命令:

composer require middlewares/csv-payload

包简介

Middleware to parse the CSV body of the request

README 文档

README

Latest Version on Packagist Software License Testing Total Downloads

Extends middlewares/payload to add support for parsing the CSV body of the request.

Requirements

Installation

This package is installable and autoloadable via Composer as middlewares/csv-payload.

composer require middlewares/csv-payload

CsvPayload

Parses the CSV payload of the request. Uses league/csv to read the CSV values. Contains the following options to configure the CSV Reader object:

delimiter($delimiter)

To configure the CSV delimiter control character (one character only). If the submitted character is invalid an InvalidArgumentException exception is thrown.

enclosure($enclosure)

To configure the CSV enclosure control character (one character only). If the submitted character is invalid an InvalidArgumentException exception is thrown.

escape($escape)

To configure the CSV escape control character (one character only). If the submitted character is invalid an InvalidArgumentException exception is thrown.

header($header)

To configure the CSV header line. If the submitted header value is less than 0 an InvalidArgumentException exception is thrown.

methods(array $methods)

To configure the allowed methods. By default only the requests with the method POST, PUT, PATCH, DELETE, COPY, LOCK, UNLOCK are handled.

contentType(array $contentType)

To configure all Content-Type headers used in the request. By default is text/csv

override($override = true)

To override the previous parsed body if exists (false by default)

$dispatcher = new Dispatcher([
    (new \Middlewares\CsvPayload())
        ->delimiter(";")
        ->enclosure("'")
        ->escape("\\")
]);

$response = $dispatcher->dispatch(new ServerRequest());

Please see CHANGELOG for more information about recent changes and CONTRIBUTING for contributing details.

The MIT License (MIT). Please see LICENSE for more information.

统计信息

  • 总下载量: 6
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 1

GitHub 信息

  • Stars: 5
  • Watchers: 6
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-06-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固