ETL Adapter: JSON
Description
ETL Adapter that provides memory safe JSON support for ETL.
Following implementation are available:
Extractor - JSONMachine - JsonExtractor
<?php
use Flow\ETL\Adapter\JSON\JSONMachine\JsonExtractor;
use Flow\ETL\Row;
use Flow\ETL\Rows;
use JsonMachine\JsonMachine;
$extractor = new JsonExtractor(
__DIR__ . '/../Fixtures/timezones.json',
5
);
/** @var Rows $rows */
foreach ($extractor->extract() as $rows) {
// Do something with Row
}
Loader - JsonLoader
<?php
$loader = new JsonLoader(\sys_get_temp_dir() . '/file.json');
$loader->load(new Rows(...));
Development
In order to install dependencies please, launch following commands:
composer install
Run Tests
In order to execute full test suite, please launch following command:
composer build
It's recommended to use pcov for code coverage however you can also use
xdebug by setting XDEBUG_MODE=coverage
env variable.