Developed with love by KnpLabs Hire us for your project!
378

exporter

by sonata-project

Lightweight Exporter library

Data Exporter

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

Latest Stable Version
Latest Unstable Version
License

Total Downloads
Monthly Downloads
Daily Downloads

Branch Github Actions Coverage
2.x Test Coverage Status
master Test Coverage Status

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.

The MIT License (MIT)

Copyright (c) 2010 Thomas Rabaix

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
  • Refactor PropelCollectionSourceIterator::rewind()
    By franmomu, 1 month ago
  • Allow consecutive rewind calls
    By franmomu, 1 month ago
  • Document property as nullable
    By franmomu, 1 month ago
  • Fix
    By OskarStark, 1 month ago
  • Add keywords
    By OskarStark, 1 month ago
  • Sort keywords
    By web-flow, 1 month ago
  • DevKit updates
    By OskarStark, 1 month ago
  • DevKit updates (#369)
    By web-flow, 1 month ago
  • DevKit updates (#368)
    By web-flow, 1 month ago
  • Remove Symfony2 note
    By phansys, 1 month ago
  • Manually sync README.md
    By OskarStark, 1 month ago
  • Add links for tags
    By web-flow, 1 month ago
  • DevKit updates (#363)
    By web-flow, 1 month ago
  • DevKit updates (#362)
    By web-flow, 1 month ago
  • DevKit updates (#361)
    By web-flow, 1 month ago
  • DevKit updates (#360)
    By web-flow, 1 month ago
  • DevKit updates (#359)
    By web-flow, 1 month ago
  • DevKit updates (#358)
    By web-flow, 1 month ago
  • DevKit updates (#357)
    By web-flow, 1 month ago
  • DevKit updates (#356)
    By web-flow, 1 month ago
  • DevKit updates (#355)
    By web-flow, 1 month ago
  • DevKit updates (#354)
    By web-flow, 1 month ago
  • DevKit updates (#353)
    By web-flow, 1 month ago
  • DevKit updates (#352)
    By web-flow, 1 month ago
  • DevKit updates (#351)
    By web-flow, 2 months ago
  • DevKit updates (#348)
    By web-flow, 2 months ago
  • Drop support for "symfony/*:<4.4"
    By jordisala1991, 3 months ago
  • Add `SonataExporterSymfonyBundle` in order to be compatible with Symfony Flex
    By jordisala1991, 3 months ago
  • Release 2.3.0 (#344)
    By web-flow, 3 months ago
  • Add support for array and traversable (#343)
    By web-flow, 3 months ago