PHP code example of cyve / etl

1. Go to this page and download the library: Download cyve/etl library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cyve / etl example snippets


$etl = new ETL(
    new CsvFileExtractor('users.csv'),
    new NullTransformer(),
    new JsonFileLoader('users.json')
);
$etl->start();

$eventDispatcher = new Symfony\Component\EventDispatcher\EventDispatcher();

$etl = new ETL(
    $extractor,
    $transformer,
    $loader,
    $eventDispatcher,
);
$etl->start();

$eventDispatcher = new Symfony\Component\EventDispatcher\EventDispatcher();
$eventDispatcher->addListener(LoadSuccessEvent::class, function (LoadSuccessEvent $event): void {
    echo '#';
});
$eventDispatcher->addListener(LoadFailureEvent::class, function (LoadFailureEvent $event): void {
    echo 'E';
});