smichaelsen/caldera-php
最新稳定版本:0.5.1
Composer 安装命令:
composer require smichaelsen/caldera-php
包简介
Caldera Records Parser
README 文档
README
Caldera helps you to import data from sources like XML or CSV, to map, transform and validate them according to your needs and provides them with small memory footprint.
$csvInputGenerator = new \Smichaelsen\Caldera\InputGenerator\CsvInputGenerator();
$csvInputGenerator->setCsvHandle(fopen(__DIR__ . '/test-equestrian.csv', 'r'));
foreach (\Smichaelsen\Caldera\RecordMapper::mapRecords(
$csvInputGenerator,
new MyMappingClass()
) as $record) {
// $record is mapped, validated and processed according to rules in your MyMappingClass()
}
Caldera works line by line (record by record) when possible (not possible with XML) and this way saves memory. This enables you to import data from a huge CSV file for example.
Run tests:
composer update --prefer-lowest --prefer-stable
./vendor/bin/phpunit --bootstrap vendor/autoload.php tests
composer update
./vendor/bin/phpunit --bootstrap vendor/autoload.php tests
统计信息
- 总下载量: 47.39k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2018-08-03