pavlyuts/php-csv-objects
最新稳定版本:0.1.2
Composer 安装命令:
composer require pavlyuts/php-csv-objects
包简介
Handle CSV complex multi-string objects
README 文档
README
Purpose
There a lot of scenarions for CSV format used to export/import structured documents with more complex structure: some of fields are document-level and repeated each row and other fields are row-level. The most common example is an invoice: Customer ID and name, billing address and other header-level fields are repeating each row while other columns contains invoice rows data like sell item, quantity and price.
The idea behing the library is to provide easy and configurable gear to handle this kind of "structured CSV", based on "profile", describig CSV file structures and handling rules.
So, with this lib you need at least:
- Create CSV "profile" data structure to define processing rules
- Create collecton from file and got an array of class instances, representing the CSV encoded entities
In a simple case you need no extra code. For more complex scenarios you may extent Entity class with your features or add field processing functions
- Create a subclass of
Entityto do extra handling on your 'documents' - Create custome field classes for sophisticated validation and processing on export and import
Installation
In the Composer storage. Just add proper require section:
"require": {
"pavlyuts/csv-objects": "^0.1"
}
It is a good idea to fix at least major version you use. Don't use next version without review, I can't promose backward compatibility even will try to keep it. Please, review the changelog before to change used version.
Dependencies
- psr/log: ^1.1
- rmccue/requests: ^1.7
统计信息
- 总下载量: 24
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2023-02-01