Read/write generators in PHP.
PSR-4 compliant library to simplify reading and writing from/to files or any other endpoint within loops.
The benefits of using this library are:
- Read and write from/to many different sources using a common syntax
- Use it easily in foreach loops (readers) or any other kind of loop (writers)
- Unclutter your code by delegating the preparation and cleanup steps
Via Composer
$ composer require jotaelesalinas/php-rwgen
$input = new JLSalinas\RWGen\Readers\Csv($filename_customers);
$output_csv = new JLSalinas\RWGen\Writers\Csv($filename_output . '.csv');
$output_kml = new JLSalinas\RWGen\Writers\Kml($filename_output . '.kml');
foreach ( $input as $customer ) {
// ...some filtering and transforming...
$output_csv->send($customer_data);
$output_kml->send($customer_geolocation_data);
}
Please see extending.md for more information.
Please see the CHANGELOG for more information what has changed recently.
$ composer test
Please see CONTRIBUTING and CONDUCT for details.
If you discover any security related issues, please email DM @jotaelesalinas instead of using the issue tracker.
- Improve tests code coverage
- Add docblocks
- Fill changelog
- Travis-CI
- Use league/csv?
The MIT License (MIT). Please see License File for more information.