Skip to content
PHP Other
  1. PHP 98.0%
  2. Other 2.0%
Branch: 2.x
Clone or download

Latest commit

Latest commit 815b4ad May 31, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github DevKit updates (#340) May 31, 2020
.travis DevKit updates Mar 16, 2020
docs DevKit updates (#328) Mar 10, 2020
src Applied fixes from FlintCI Feb 12, 2020
tests Applied fixes from FlintCI Apr 20, 2020
.editorconfig DevKit updates Jan 23, 2019
.flintci.yml DevKit updates (#259) Dec 6, 2018
.gitattributes
.gitignore DevKit updates (#337) May 10, 2020
.php_cs.dist DevKit updates (#339) May 28, 2020
.travis.yml DevKit updates Mar 16, 2020
.yamllint
CHANGELOG.md 2.2.0 Mar 17, 2020
CONTRIBUTING.md DevKit updates (#338) May 27, 2020
LICENSE DevKit updates (#223) May 6, 2018
Makefile DevKit updates Mar 16, 2020
README.md
UPGRADE-1.x.md 1.6.0 Aug 1, 2016
UPGRADE-2.0.md Spell exporter properly Dec 15, 2018
UPGRADE-2.x.md 2.x-dev Dec 15, 2018
composer.json Bump Symfony 4 minimum version to 4.3 Mar 17, 2020
phpunit.xml.dist

README.md

Data Exporter

Build Status

Data Exporter is a lightweight library to export data into different formats.

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.

Note for Symfony2 users

  • For Symfony >=2.3, use tag ^1.4
  • For Symfony 2.2, use tag 1.3.1
  • For Symfony 2.1, use tag 1.2.3
  • For Symfony 2.0, use tag 1.1.0
You can’t perform that action at this time.