sonata-project / exporter
Lightweight Exporter library
Fund package maintenance!
OskarStark
core23
VincentLanglet
wbloszyk
Installs: 9 293 455
Dependents: 43
Suggesters: 2
Security: 0
Stars: 378
Watchers: 23
Forks: 82
Open Issues: 5
Requires
- php: >=7.3
Requires (Dev)
- doctrine/dbal: ^2.5
- doctrine/mongodb-odm: ^2.0
- doctrine/orm: ^2.4.5
- matthiasnoback/symfony-config-test: ^4.2
- matthiasnoback/symfony-dependency-injection-test: ^4.0
- propel/propel1: ^1.6
- symfony/config: ^4.4 || ^5.1
- symfony/dependency-injection: ^4.4 || ^5.1
- symfony/http-foundation: ^4.4 || ^5.1
- symfony/http-kernel: ^4.4 || ^5.1
- symfony/phpunit-bridge: ^5.1.8
- symfony/property-access: ^4.4 || ^5.1
- symfony/routing: ^4.4 || ^5.1
Suggests
- propel/propel1: To export propel collections
- symfony/property-access: To be able to export from database entities
- symfony/routing: To be able to export the routes of a Symfony app
Conflicts
- doctrine/mongodb-odm: <2.0
This package is auto-updated.
Last update: 2021-01-23 02:03:09 UTC
README
Data Exporter is a lightweight library to export data into different formats.
Branch | Github Actions | Coverage |
---|---|---|
2.x | ||
master |
Installation using Composer
composer require sonata-project/exporter
Usage
<?php use Exporter\Handler; use Exporter\Source\PDOStatementSourceIterator; use Exporter\Writer\CsvWriter; // Prepare the data source $dbh = new \PDO('sqlite:foo.db'); $stm = $dbh->prepare('SELECT id, username, email FROM user'); $stm->execute(); $source = new PDOStatementSourceIterator($stm); // Prepare the writer $writer = new CsvWriter('data.csv'); // Export the data Handler::create($source, $writer)->export();
Documentation
Support
For general support and questions, please use StackOverflow.
If you think you found a bug or you have a feature idea to propose, feel free to open an issue after looking at the contributing guide.
License
This package is available under the MIT license.