artfulrobot/csv
Composer 安装命令:
composer require artfulrobot/csv
包简介
CSV parser and generator libraries
README 文档
README
Class ArtfulRobot\CSV
This contains various static methods for:
- creating a CSV-safe values: single values, rows, or arrays of rows.
- outputting CSV in a string as a file download HTTP response.
- converting a PDO result to CSV data, and to a direct download.
Class ArtfulRobot\CSVParser
Loads CSV data from a file (uses fgetcsv()) or string (uses str_getcsv())
and provides an iterator giving access to the rows referenced by column name,
column/row indexes.
See the Synopsis section in the docblock of ArtfulRobot/CSVParser.php
If your CSV has some header rows that need to be ignored, pass a different header row parameter to the parse method (default is 1).
Change log
v1.3.1 Support php7.4. Throw exception if file not found.
v1.3.0 Support dodgy headers (duplicate and missing) via
$csv->supportDodgyHeaders(). A duplicate header 'name' will be renamed 'name_2', another would be 'name_3'. An empty header would get renamed 'missing_header_1', etc. AlsoremapHeaders(), helpful if your input gives you awkward header names. AlsorequireHeaders(), helpful to assert certain headers must be there.v1.2.2 Work around bug in php's str_getcsv that fails to parse values with new lines
v1.2.1 New feature: Added TSV file parsing capabilities. Also see tsv2csv command line utility.
v1.2 Added ability to parse without any header row, and to define this later either by passing in an array of headers, or by extracting headers from the parsed data. Also fixed bug in getRowNumber() which was returning 1 too high. Tests updated/added. More type hints added.
v1.1 Added two new features: (1) Ability to specify the header row from the source data (rows before this are skipped), and (2) Ability to parse from a string source. Tests have been written to cover the new features, and have been updated for compatibility with PHPUnit 9.
v1.0 This began life bundled with the artfulrobot/artfulrobot PHP libraries, but was separated out as a lot of the other code in that library is deprecated. So it's been in production use for years. If you previously depended on artfulrobot/artfulrobot for the CSV libraries you should update to artfulrobot/csv which is where future maintenance will happen. In this case you should note that the class names have been standardised, so it's now
CSVParsernotCsvParser.
artfulrobot/csv 适用场景与选型建议
artfulrobot/csv 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 582 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 07 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「csv」 「parser」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 artfulrobot/csv 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 artfulrobot/csv 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 artfulrobot/csv 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Easy to use SDK with grabber for multiple platforms at once like YouTube, Dailymotion, Facebook and more.
An MT940 bank statement parser for PHP
Laravel integration for the jsonapi.org parser
laravel facade to read/write csv file
Collection of tools to use the full power of the Enyalius framework
A modern HTML DOM parser for PHP using DOMDocument and Symfony CssSelector.
统计信息
- 总下载量: 582
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2021-07-14